diff --git a/cv/invite_cv/invite_apply.go b/cv/invite_cv/invite_apply.go index 4e37bd13db3258f7d4d6ab983234ad9c3ac417d3..f658e1ef145265426bdf573212f182fee9ffa749 100644 --- a/cv/invite_cv/invite_apply.go +++ b/cv/invite_cv/invite_apply.go @@ -13,6 +13,7 @@ type CvUserLevel struct { type InviteApplyRes struct { List []*InviteApply `json:"list"` NumList []*InviteApplyNumRes `json:"numList"` + MyCode string `json:"myCode"` } type InviteApply struct { diff --git a/myerr/bizerr/bizCode.go b/myerr/bizerr/bizCode.go index b4180770829457d9df3de3913f53bf37c9c97a4c..d5a056d35f100b1c6e94e6dee10cb21f8c302461 100755 --- a/myerr/bizerr/bizCode.go +++ b/myerr/bizerr/bizCode.go @@ -31,4 +31,6 @@ var ( CpHaveCancelNoDeal = myerr.NewBusinessCode(50121, "You have a cancel apply", myerr.BusinessData{}) // 有接触申请需要处理 InviteApplyNoPermission = myerr.NewBusinessCode(50122, "This user does not have invitation permission", myerr.BusinessData{}) // 该用户没有邀请权限 InviteApplyAlreadyInvited = myerr.NewBusinessCode(50123, "Already invited by someone else", myerr.BusinessData{}) // 已经被别人邀请了 + InviteApplyCodeInvalid = myerr.NewBusinessCode(50124, "user id invalid", myerr.BusinessData{}) // 邀请人用户id错误 + InviteApplyNewCodeInvalid = myerr.NewBusinessCode(50125, "user id invalid", myerr.BusinessData{}) // 被邀请人用户id错误 ) diff --git a/route/invite_r/party_invite.go b/route/invite_r/party_invite.go index b52ef7a139f6f7940e2f0d187b975828d685dc6f..24757892b72533492ef79524aa99fc7d8ed5324c 100644 --- a/route/invite_r/party_invite.go +++ b/route/invite_r/party_invite.go @@ -65,12 +65,12 @@ func InviteApply(c *gin.Context) (*mycontext.MyContext, error) { newUser, err := user_m.GetUserByCode(model, param.NewUserCode) if err != nil { model.Log.Errorf("InviteApply param:%v", param) - return myCtx, err + return myCtx, bizerr.InviteApplyNewCodeInvalid } user, err := user_m.GetUserByCode(model, param.UserCode) if err != nil { model.Log.Errorf("InviteApply param:%v", param) - return myCtx, err + return myCtx, bizerr.InviteApplyCodeInvalid } if newUser.ID == 0 || user.ID == 0 { model.Log.Errorf("InviteApply param:%v", param) @@ -169,6 +169,11 @@ func InviteApplyList(c *gin.Context) (*mycontext.MyContext, error) { } if param.Type == 0 { // 返回所有Type类型有多少条数 + user, err := user_c.GetUserTinyById(model, userId) + if err != nil { + model.Log.Errorf("GetApplyList param:%v, err:%v", param, err) + return myCtx, bizerr.InvalidParameter + } numList := make([]*invite_cv.InviteApplyNumRes, 0, 4) for _, gType := range []int{1, 2, 3, 4} { // 1.已申请2.待审核3.已通过4.已拒绝 num, err := invite_m.GetInviteApplyNumByType(model, gType, param.BeginTime, param.EndTime, agentIds) @@ -177,7 +182,7 @@ func InviteApplyList(c *gin.Context) (*mycontext.MyContext, error) { } numList = append(numList, &invite_cv.InviteApplyNumRes{Type: gType, Num: num}) } - resp.ResponsePageOk(c, &invite_cv.InviteApplyRes{NumList: numList}, 0, 0, 0) + resp.ResponsePageOk(c, &invite_cv.InviteApplyRes{NumList: numList, MyCode: user.Code}, 0, 0, 0) return myCtx, nil }