From b93434ea3f675b564a131122dbde3e6b6888c161 Mon Sep 17 00:00:00 2001 From: hujiebin Date: Wed, 14 Jun 2023 17:13:18 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=8E=BB=E6=8E=89=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- route/router.go | 1 - route/user_r/inner.go | 34 ---------------------------------- 2 files changed, 35 deletions(-) diff --git a/route/router.go b/route/router.go index 1c7b3ec..c8aa9d3 100755 --- a/route/router.go +++ b/route/router.go @@ -57,7 +57,6 @@ func InitRouter() *gin.Engine { innerUser.GET("/levels", wrapper(user_r.MGetUserLevels)) innerUser.GET("/bag/id", wrapper(user_r.GetUserBagId)) innerUser.GET("/cp", wrapper(user_r.GetUserCp)) - innerUser.GET("/cpRelation", wrapper(user_r.GetUserCpRelation)) innerUser.GET("/cpRelations", wrapper(user_r.MGetUserCpRelation)) innerUser.GET("/cp/pair", wrapper(user_r.GetUserCpPair)) } diff --git a/route/user_r/inner.go b/route/user_r/inner.go index b603d7b..1cd7127 100644 --- a/route/user_r/inner.go +++ b/route/user_r/inner.go @@ -172,40 +172,6 @@ func GetUserCp(c *gin.Context) (*mycontext.MyContext, error) { 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 { Ids []mysql.ID `form:"ids" binding:"required"` } -- 2.22.0