Refactor code

pull/131/head
wenxu12345 3 years ago
parent 6d0f454e6a
commit bd14e5019f

@ -38,7 +38,7 @@ func main() {
friendRouterGroup.POST("/add_blacklist", friend.AddBlacklist) //1
friendRouterGroup.POST("/get_blacklist", friend.GetBlacklist) //1
friendRouterGroup.POST("/remove_blacklist", friend.RemoveBlacklist) //1
friendRouterGroup.POST("/delete_friend", friend.DeleteFriend)
friendRouterGroup.POST("/delete_friend", friend.DeleteFriend) //1
friendRouterGroup.POST("/add_friend_response", friend.AddFriendResponse) //1
friendRouterGroup.POST("/set_friend_remark", friend.SetFriendRemark) //1
friendRouterGroup.POST("/is_friend", friend.IsFriend) //1

@ -197,7 +197,7 @@ func InviteUserToGroup(c *gin.Context) {
return
}
req := &rpc.InviteUserToGroupReq{}
utils.CopyStructFields(req, params)
utils.CopyStructFields(req, &params)
var ok bool
ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"))
if !ok {
@ -216,12 +216,12 @@ func InviteUserToGroup(c *gin.Context) {
return
}
Resp := api.InviteUserToGroupResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}}
resp := api.InviteUserToGroupResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}}
for _, v := range RpcResp.Id2ResultList {
Resp.UserIDResultList = append(Resp.UserIDResultList, api.UserIDResult{UserID: v.UserID, Result: v.Result})
resp.UserIDResultList = append(resp.UserIDResultList, api.UserIDResult{UserID: v.UserID, Result: v.Result})
}
c.JSON(http.StatusOK, Resp)
log.NewInfo(req.OperationID, "InviteUserToGroup api return ", Resp)
c.JSON(http.StatusOK, resp)
log.NewInfo(req.OperationID, "InviteUserToGroup api return ", resp)
}
func CreateGroup(c *gin.Context) {

@ -33,7 +33,7 @@ type GetGroupMembersInfoResp struct {
type InviteUserToGroupReq struct {
GroupID string `json:"groupID" binding:"required"`
InvitedUserIDList []string `json:"uidList" binding:"required"`
InvitedUserIDList []string `json:"invitedUserIDList" binding:"required"`
Reason string `json:"reason"`
OperationID string `json:"operationID" binding:"required"`
}

Loading…
Cancel
Save