package user import ( "yunyan/comm" "yunyan/pb" ) // @Summary 获取统计数据 // @Description 获取用户统计数据 // @Tags User // @Accept json // @Produce json // @Param user body pb.UserGetStatisticsReq true "获取统计数据请求" // @Success 200 {object} comm.HttpResult{data=pb.UserGetStatisticsResp} "成功返回" // @Router /api/home/user_getstatistics [post] func (this *apiComp) GetStatistics(session comm.IUserSession, req *pb.UserGetStatisticsReq) (resp *pb.UserGetStatisticsResp, errdata *pb.ErrorData) { var ( statistics *pb.DBUserStatistics err error ) statistics, err = this.module.model.getStatistics(session.GetUserId()) if err != nil { errdata = &pb.ErrorData{ Code: pb.ErrorCode_DBError, Message: err.Error(), } return } resp = &pb.UserGetStatisticsResp{ Statistics: statistics, } return }