32 lines
826 B
Go
32 lines
826 B
Go
package usercenterapi
|
|
|
|
import (
|
|
"videoweb/app/api/proto"
|
|
"videoweb/app/service/usercenterser"
|
|
"videoweb/pub/common"
|
|
"videoweb/pub/common/srvdef"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
// Data app个人中心数据
|
|
// @Tags app个人中心相关接口
|
|
// @Summary app个人中心数据 --by 王鸣
|
|
// @Description 返回当前用户观看、收藏、追剧中、已购剧集统计
|
|
// @Accept json
|
|
// @Produce json
|
|
// @Success 200 {object} proto.UserCenterDataResp "成功"
|
|
// @Failure 400 {string} string "失败"
|
|
// @Security ApiKeyAuth
|
|
// @Router /api/app/user/center/data [get]
|
|
func Data(ctx *gin.Context) {
|
|
resp, err := usercenterser.Data(ctx, common.GetUserId(ctx))
|
|
if err != nil {
|
|
common.ServerJSON(ctx, err.Code, err.Tips)
|
|
return
|
|
}
|
|
common.ServerJSON(ctx, srvdef.Success, resp)
|
|
}
|
|
|
|
var _ = proto.UserCenterDataResp{}
|