蛋蛋星球-客户端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

39 rivejä
943 B

  1. package hdl
  2. import (
  3. "applet/app/e"
  4. "applet/app/md"
  5. "applet/app/svc"
  6. "applet/app/utils"
  7. "github.com/gin-gonic/gin"
  8. )
  9. // UserInfo
  10. // @Summary 用户信息
  11. // @Tags 用户信息
  12. // @Description 用户信息
  13. // @Accept json
  14. // @Produce json
  15. // @param Authorization header string true "验证参数Bearer和token空格拼接"
  16. // @Success 200 {object} md.UserInfoResp "具体数据"
  17. // @Failure 400 {object} md.Response "具体错误"
  18. // @Router /api/v1/userInfo [get]
  19. func UserInfo(c *gin.Context) {
  20. user := svc.GetUser(c)
  21. res := md.UserInfoResp{
  22. Id: utils.Int64ToStr(user.Id),
  23. Phone: user.Phone,
  24. Nickname: user.Phone,
  25. InviteCode: user.SystemInviteCode,
  26. IsBindExtend: "0",
  27. }
  28. if user.CustomInviteCode != "" {
  29. res.InviteCode = user.CustomInviteCode
  30. }
  31. if user.ParentUid > 0 {
  32. res.IsBindExtend = "1"
  33. }
  34. e.OutSuc(c, res, nil)
  35. return
  36. }