|
|
@@ -722,9 +722,9 @@ func GetTodayAccountConfigInfo(c *gin.Context) {
|
|
|
|
|
|
// UpdateUserInfoWechatAndEmailReq 更新用户微信和邮箱入参
|
|
|
type UpdateUserInfoWechatAndEmailReq struct {
|
|
|
- UserID int `json:"userID" binding:"required"` // 用户ID
|
|
|
- Wechat *string `json:"wechat"` // 微信号,如不必修改则不传,传空为清除微信号
|
|
|
- Email *string `json:"email"` // 邮箱地址,如不必修改则不传,传空为清除邮箱地址
|
|
|
+ UserID int `json:"userID" binding:"required "` // 用户ID
|
|
|
+ Wechat *string `json:"wechat"` // 微信号,如不必修改则不传,传空为清除微信号
|
|
|
+ Email *string `json:"email"` // 邮箱地址,如不必修改则不传,传空为清除邮箱地址
|
|
|
}
|
|
|
|
|
|
// UpdateUserInfoWechatAndEmail 更新用户微信和邮箱
|
|
|
@@ -760,7 +760,7 @@ func UpdateUserInfoWechatAndEmail(c *gin.Context) {
|
|
|
}
|
|
|
|
|
|
// GetUserScoreReq 用户积分信息查询请求参数
|
|
|
-type GetUserScoreReq struct {
|
|
|
+type QueryUserScoreReq struct {
|
|
|
UserID int `form:"userID" binding:"required"` // 用户ID
|
|
|
}
|
|
|
|
|
|
@@ -769,7 +769,7 @@ type GetUserScoreReq struct {
|
|
|
// @Produce json
|
|
|
// @Security ApiKeyAuth
|
|
|
// @Param userID query int true "用户ID"
|
|
|
-// @Success 200 {object} models.UserScore
|
|
|
+// @Success 200 {object} models.QuerUserScoreRsp
|
|
|
// @Failure 500 {object} app.Response
|
|
|
// @Router /User/QueryUserScore [get]
|
|
|
// @Tags 用户信息
|
|
|
@@ -777,14 +777,14 @@ func QueryUserScore(c *gin.Context) {
|
|
|
appG := app.Gin{C: c}
|
|
|
|
|
|
// 获取请求参数
|
|
|
- var req GetUserScoreReq
|
|
|
- if err := appG.C.ShouldBindJSON(&req); err != nil {
|
|
|
+ var req QueryUserScoreReq
|
|
|
+ if err := appG.C.ShouldBindQuery(&req); err != nil {
|
|
|
logger.GetLogger().Errorf("QueryUserScore failed: %s", err.Error())
|
|
|
appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- userScores, err := models.GetUserScore(req.UserID)
|
|
|
+ datas, err := models.GetUserScore(req.UserID)
|
|
|
if err != nil {
|
|
|
// 查询失败
|
|
|
logger.GetLogger().Errorf("QueryUserScore failed: %s", err.Error())
|
|
|
@@ -793,5 +793,5 @@ func QueryUserScore(c *gin.Context) {
|
|
|
}
|
|
|
|
|
|
// 查询成功
|
|
|
- appG.Response(http.StatusOK, e.SUCCESS, userScores)
|
|
|
+ appG.Response(http.StatusOK, e.SUCCESS, datas)
|
|
|
}
|