Commit a829b62a authored by chenweijian's avatar chenweijian

接口优化

parent 3b73212b
......@@ -32,7 +32,7 @@ func InitRouter() *gin.Engine {
user.GET("/bag/:resType", wrapper(user_r.UserBag))
user.GET("/detail", EncryptHandle, wrapper(user_r.UserDetail))
user.GET("/detail/:userExternalId", EncryptHandle, wrapper(user_r.UserDetailByExternalId))
user.GET("/detail/room/:userExternalId", EncryptHandle, wrapper(user_r.GetUserDetailInRoom))
user.GET("/detail/room", EncryptHandle, wrapper(user_r.GetUserDetailInRoom))
}
cp := v2.Group("/cp")
{
......
......@@ -110,17 +110,17 @@ func UserDetailByExternalId(c *gin.Context) (*mycontext.MyContext, error) {
// @Tags 用户
// @Summary 房间内获取用户信息
// @Param userExternalId path string true "userExternalId"
// @Param userExternalId query string true "userExternalId"
// @Param groupId query string false "群组id,当传了该id,则返回该用户在该群组的身份"
// @Success 200 {object} user_cv.CvUserDetail
// @Router /v1/user/detail/room/{userExternalId} [get]
// @Router /v1/user/detail/room [get]
func GetUserDetailInRoom(c *gin.Context) (*mycontext.MyContext, error) {
myContext := mycontext.CreateMyContext(c.Keys)
userId, lang, err := req.GetUserIdLang(c, myContext)
if err != nil {
return myContext, err
}
otherUserId, err := req.ToUserId(myContext, mysql.Str(c.Param("userExternalId")))
otherUserId, err := req.ToUserId(myContext, c.Query("userExternalId"))
if err != nil {
return nil, err
}
......
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