Commit b93434ea authored by hujiebin's avatar hujiebin

feat:去掉无用接口

parent 33487c6e
...@@ -57,7 +57,6 @@ func InitRouter() *gin.Engine { ...@@ -57,7 +57,6 @@ func InitRouter() *gin.Engine {
innerUser.GET("/levels", wrapper(user_r.MGetUserLevels)) innerUser.GET("/levels", wrapper(user_r.MGetUserLevels))
innerUser.GET("/bag/id", wrapper(user_r.GetUserBagId)) innerUser.GET("/bag/id", wrapper(user_r.GetUserBagId))
innerUser.GET("/cp", wrapper(user_r.GetUserCp)) innerUser.GET("/cp", wrapper(user_r.GetUserCp))
innerUser.GET("/cpRelation", wrapper(user_r.GetUserCpRelation))
innerUser.GET("/cpRelations", wrapper(user_r.MGetUserCpRelation)) innerUser.GET("/cpRelations", wrapper(user_r.MGetUserCpRelation))
innerUser.GET("/cp/pair", wrapper(user_r.GetUserCpPair)) innerUser.GET("/cp/pair", wrapper(user_r.GetUserCpPair))
} }
......
...@@ -172,40 +172,6 @@ func GetUserCp(c *gin.Context) (*mycontext.MyContext, error) { ...@@ -172,40 +172,6 @@ func GetUserCp(c *gin.Context) (*mycontext.MyContext, error) {
return myContext, nil return myContext, nil
} }
// @Tags 用户-内部
// @Summary 获取用户cp关系
// @Param id query int true "用户id"
// @Success 200 {object} cp_cv.CvCpRelation
// @Router /inner/user/cpRelation [get]
func GetUserCpRelation(c *gin.Context) (*mycontext.MyContext, error) {
myContext := mycontext.CreateMyContext(c.Keys)
var model = domain.CreateModelContext(myContext)
var req GetUserCpReq
if err := c.ShouldBindQuery(&req); err != nil {
return myContext, err
}
userId := req.Id
var response cp_cv.CvCpRelation
cpRelation, exists := cp_m.GetCpRelation(model, userId)
if !exists {
resp.ResponseOk(c, response)
return myContext, nil
}
cpUserId := cpRelation.UserId2
if cpUserId == userId {
cpUserId = cpRelation.UserId1
}
cpUser, _ := user_m.GetUser(model, cpUserId)
response = cp_cv.CvCpRelation{
CpId: cpRelation.Id,
UserId: userId,
CpUserId: cpUserId,
CpUserAvatar: cpUser.Avatar,
}
resp.ResponseOk(c, response)
return myContext, nil
}
type MGetUserCpRelationReq struct { type MGetUserCpRelationReq struct {
Ids []mysql.ID `form:"ids" binding:"required"` Ids []mysql.ID `form:"ids" binding:"required"`
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment