pull/265/head
wangchuxiao 2 years ago
parent a48b2e9edb
commit 9b130ae56c

@ -64,7 +64,7 @@ func AdminLogin(c *gin.Context) {
reqPb pbAdmin.AdminLoginReq reqPb pbAdmin.AdminLoginReq
) )
if err := c.BindJSON(&req); err != nil { if err := c.BindJSON(&req); err != nil {
log.NewInfo("0", utils.GetSelfFuncName(), err.Error()) log.NewError("0", utils.GetSelfFuncName(), err.Error())
openIMHttp.RespHttp200(c, constant.ErrArgs, nil) openIMHttp.RespHttp200(c, constant.ErrArgs, nil)
return return
} }
@ -95,7 +95,7 @@ func AddUserRegisterAddFriendIDList(c *gin.Context) {
resp apiStruct.AddUserRegisterAddFriendIDListResponse resp apiStruct.AddUserRegisterAddFriendIDListResponse
) )
if err := c.BindJSON(&req); err != nil { if err := c.BindJSON(&req); err != nil {
log.NewInfo("0", utils.GetSelfFuncName(), err.Error()) log.NewError("0", utils.GetSelfFuncName(), err.Error())
openIMHttp.RespHttp200(c, constant.ErrArgs, nil) openIMHttp.RespHttp200(c, constant.ErrArgs, nil)
return return
} }
@ -123,7 +123,7 @@ func ReduceUserRegisterAddFriendIDList(c *gin.Context) {
resp apiStruct.ReduceUserRegisterAddFriendIDListResponse resp apiStruct.ReduceUserRegisterAddFriendIDListResponse
) )
if err := c.BindJSON(&req); err != nil { if err := c.BindJSON(&req); err != nil {
log.NewInfo("0", utils.GetSelfFuncName(), err.Error()) log.NewError("0", utils.GetSelfFuncName(), err.Error())
openIMHttp.RespHttp200(c, constant.ErrArgs, nil) openIMHttp.RespHttp200(c, constant.ErrArgs, nil)
return return
} }
@ -151,7 +151,7 @@ func GetUserRegisterAddFriendIDList(c *gin.Context) {
resp apiStruct.GetUserRegisterAddFriendIDListResponse resp apiStruct.GetUserRegisterAddFriendIDListResponse
) )
if err := c.BindJSON(&req); err != nil { if err := c.BindJSON(&req); err != nil {
log.NewInfo("0", utils.GetSelfFuncName(), err.Error()) log.NewError("0", utils.GetSelfFuncName(), err.Error())
openIMHttp.RespHttp200(c, constant.ErrArgs, nil) openIMHttp.RespHttp200(c, constant.ErrArgs, nil)
return return
} }

@ -21,9 +21,9 @@ func NewGinRouter() *gin.Engine {
{ {
adminRouterGroup.POST("/login", admin.AdminLogin) adminRouterGroup.POST("/login", admin.AdminLogin)
adminRouterGroup.Use(middleware.JWTAuth()) adminRouterGroup.Use(middleware.JWTAuth())
adminRouterGroup.POST("/add_user_register_add_friend_ID", admin.AddUserRegisterAddFriendIDList) adminRouterGroup.POST("/add_user_register_add_friend_id", admin.AddUserRegisterAddFriendIDList)
adminRouterGroup.POST("/reduce_user_register_reduce_friend_ID", admin.ReduceUserRegisterAddFriendIDList) adminRouterGroup.POST("/reduce_user_register_reduce_friend_id", admin.ReduceUserRegisterAddFriendIDList)
adminRouterGroup.POST("/get_user_register_reduce_friend_ID_list", admin.GetUserRegisterAddFriendIDList) adminRouterGroup.POST("/get_user_register_reduce_friend_id_list", admin.GetUserRegisterAddFriendIDList)
} }
r2 := router.Group("") r2 := router.Group("")
r2.Use(middleware.JWTAuth()) r2.Use(middleware.JWTAuth())

@ -22,7 +22,7 @@ type AddUserRegisterAddFriendIDListResponse struct {
type ReduceUserRegisterAddFriendIDListRequest struct { type ReduceUserRegisterAddFriendIDListRequest struct {
OperationID string `json:"operationID" binding:"required"` OperationID string `json:"operationID" binding:"required"`
UserIDList []string `json:"userIDList" binding:"required"` UserIDList []string `json:"userIDList" binding:"required"`
Operation int32 `json:"operation" binding:"required"` Operation int32 `json:"operation"`
} }
type ReduceUserRegisterAddFriendIDListResponse struct { type ReduceUserRegisterAddFriendIDListResponse struct {
@ -30,10 +30,10 @@ type ReduceUserRegisterAddFriendIDListResponse struct {
type GetUserRegisterAddFriendIDListRequest struct { type GetUserRegisterAddFriendIDListRequest struct {
OperationID string `json:"operationID" binding:"required"` OperationID string `json:"operationID" binding:"required"`
RequestPagination RequestPaginationBody
} }
type GetUserRegisterAddFriendIDListResponse struct { type GetUserRegisterAddFriendIDListResponse struct {
Users []*server_api_params.UserInfo `json:"Users"` Users []*server_api_params.UserInfo `json:"users"`
ResponsePagination ResponsePagination
} }

@ -5,7 +5,12 @@ type RequestPagination struct {
ShowNumber int `form:"show_number" binding:"required"` ShowNumber int `form:"show_number" binding:"required"`
} }
type RequestPaginationBody struct {
PageNumber int `json:"pageNumber" binding:"required"`
ShowNumber int `json:"showNumber" binding:"required"`
}
type ResponsePagination struct { type ResponsePagination struct {
CurrentPage int `json:"current_number" binding:"required"` CurrentPage int `json:"current_number" binding:"required"`
ShowNumber int `json:"show_number" binding:"required"` ShowNumber int `json:"show_number" binding:"required"`
} }

@ -327,7 +327,7 @@ func (AppVersion) TableName() string {
} }
type RegisterAddFriend struct { type RegisterAddFriend struct {
UserID string `gorm:"column:user_id;size:64"` UserID string `gorm:"column:user_id;primary_key;size:64"`
} }
func (RegisterAddFriend) TableName() string { func (RegisterAddFriend) TableName() string {

Loading…
Cancel
Save