Prechádzať zdrojové kódy

Revert "update 添加接口参数、返回值"

This reverts commit 5e6dd83c66ea8a5f2c89894a54abd84dcbe3eb64.
Alvin 8 mesiacov pred
rodič
commit
2b819dc5f5

+ 3 - 39
game/game_cluster/nodes/webadmin/controller/synthesis.go

@@ -171,53 +171,17 @@ func (s *Synthesis) Activity(ctx *gin.Context) {
 
 // 转盘统计
 func (s *Synthesis) Turntable(ctx *gin.Context) {
-	var req entity.TurntableReq
-	if err := ctx.ShouldBindJSON(&req); err != nil {
-		common.PackOkResult(ctx, code.ParamError)
-		return
-	}
-
-	resp, err := s.sev.Turntable(req)
-	if err != nil {
-		common.PackOkResult(ctx, err.Code)
-		return
-	}
-
-	common.PackOkResult(ctx, code.OK, resp)
+	// TODO Turntable
 }
 
 // 资产统计
 func (s *Synthesis) Assets(ctx *gin.Context) {
-	var req entity.AssetsReq
-	if err := ctx.ShouldBindJSON(&req); err != nil {
-		common.PackOkResult(ctx, code.ParamError)
-		return
-	}
-
-	resp, err := s.sev.Assets(req)
-	if err != nil {
-		common.PackOkResult(ctx, err.Code)
-		return
-	}
-
-	common.PackOkResult(ctx, code.OK, resp)
+	// TODO Assets
 }
 
 // 邀请统计
 func (s *Synthesis) Invite(ctx *gin.Context) {
-	var req entity.InviteReq
-	if err := ctx.ShouldBindJSON(&req); err != nil {
-		common.PackOkResult(ctx, code.ParamError)
-		return
-	}
-
-	resp, err := s.sev.Invite(req)
-	if err != nil {
-		common.PackOkResult(ctx, err.Code)
-		return
-	}
-
-	common.PackOkResult(ctx, code.OK, resp)
+	// TODO Invite
 }
 
 // 后台操作记录

+ 0 - 65
game/game_cluster/nodes/webadmin/entity/synthesis.go

@@ -1,65 +0,0 @@
-package entity
-
-type UserListReq struct {
-	Page     int    `json:"page"`
-	Size     int    `json:"size"`
-	UserName string `json:"user_name"` // 用户名
-	NickName string `json:"nick_name"` // 昵称
-}
-
-type UserListResp struct {
-	Details []*UserListDetail `json:"details"`
-	Total   int64             `json:"total"`
-}
-
-type UserListDetail struct {
-	// TODO UserListDetail 用户统计数据详情
-}
-
-type TurntableReq struct {
-	Page     int    `json:"page"`
-	Size     int    `json:"size"`
-	UserName string `json:"user_name"` // 用户名
-	NickName string `json:"nick_name"` // 昵称
-}
-
-type TurntableResp struct {
-	Details []*TurntableDetail `json:"details"`
-	Total   int64              `json:"total"`
-}
-
-type TurntableDetail struct {
-	// TODO TurntableDetail 转盘统计数据详情
-}
-
-type AssetsReq struct {
-	Page     int    `json:"page"`
-	Size     int    `json:"size"`
-	UserName string `json:"user_name"` // 用户名
-	NickName string `json:"nick_name"` // 昵称
-}
-
-type AssetsResp struct {
-	Details []*AssetsDetail `json:"details"`
-	Total   int64           `json:"total"`
-}
-
-type AssetsDetail struct {
-	// TODO AssetsDetail 资产统计数据详情
-}
-
-type InviteReq struct {
-	Page     int    `json:"page"`
-	Size     int    `json:"size"`
-	UserName string `json:"user_name"` // 用户名
-	NickName string `json:"nick_name"` // 昵称
-}
-
-type InviteResp struct {
-	Details []*InviteDetail `json:"details"`
-	Total   int64           `json:"total"`
-}
-
-type InviteDetail struct {
-	// TODO InviteDetail 邀请统计数据详情
-}

+ 16 - 0
game/game_cluster/nodes/webadmin/entity/user_log_daily.go

@@ -30,3 +30,19 @@ type UserLogDailyReq struct {
 	Page      int    `json:"page"`
 	Size      int    `json:"size"`
 }
+
+type UserListReq struct {
+	Page     int    `json:"page"`
+	Size     int    `json:"size"`
+	UserName string `json:"user_name"` // 用户名
+	NickName string `json:"nick_name"` // 昵称
+}
+
+type UserListResp struct {
+	Details []*UserListDetail `json:"details"`
+	Total   int64             `json:"total"`
+}
+
+type UserListDetail struct {
+	// TODO UserListDetail 用户统计数据详情
+}

+ 1 - 81
game/game_cluster/nodes/webadmin/service/synthesis.go

@@ -33,70 +33,8 @@ func NewSynthesis() *Synthesis {
 
 // 统计用户相关信息
 func (s *Synthesis) UserList(req entity.UserListReq) (*entity.UserListResp, *code.Result) {
-	// 验证参数
-	page := req.Page
-	if req.Page <= 0 {
-		page = 1
-	}
-	pageSize := req.Size
-	if req.Size <= 0 {
-		pageSize = 10
-	}
-
-	// 构建查询条件
-	filter := bson.M{}
-	if req.UserName != "" {
-		filter["userName"] = req.UserName
-	}
-	if req.NickName != "" {
-		filter["nickName"] = req.NickName
-	}
-
-	// 设置分页选项
-	findOptions := options.Find()
-	findOptions.SetSkip(int64((page - 1) * pageSize))
-	findOptions.SetLimit(int64(pageSize))
-	findOptions.SetSort(bson.D{{"createTime", -1}})
-
-	collection := mdb.MDB.Collection(constant.CNamePlayer)
-	// 获取总数total
-	count, err := collection.CountDocuments(ctx, filter)
-	if err != nil {
-		mhayaLogger.Warnf("UserList CountDocuments error:%v", err)
-		return nil, common.NewResult(code.InternalError)
-	}
-
 	// TODO UserList 统计用户相关信息
-	// 查询数据
-	var results []*entity.UserListDetail
-	ctx, cancel := context.WithTimeout(context.Background(), 100*time.Second)
-	defer cancel()
-	cursor, err := collection.Find(ctx, filter, findOptions)
-	if err != nil {
-		mhayaLogger.Warnf("UserList Find error:%v", err)
-		return nil, common.NewResult(code.InternalError)
-	}
-
-	defer cursor.Close(ctx)
-	// 解析结果
-	for cursor.Next(ctx) {
-		var result entity.UserListDetail
-		if err := cursor.Decode(&result); err != nil {
-			mhayaLogger.Warnf("UserList Decode error:%v", err)
-			return nil, common.NewResult(code.InternalError)
-		}
-		results = append(results, &result)
-	}
-
-	if err := cursor.Err(); err != nil {
-		mhayaLogger.Warnf("UserList cursor error:%v", err)
-		return nil, common.NewResult(code.InternalError)
-	}
-
-	return &entity.UserListResp{
-		Details: results,
-		Total:   count,
-	}, nil
+	return nil, nil
 }
 
 func (s *Synthesis) FindMDBUserLogDaily(req entity.UserLogDailyReq) (*entity.UserLogDailyResp, *code.Result) {
@@ -731,21 +669,3 @@ func (s *Synthesis) RecordList(req entity.RecordListReq) (*entity.RecordListResp
 		Total:   count,
 	}, nil
 }
-
-// 转盘统计
-func (s *Synthesis) Turntable(req entity.TurntableReq) (*entity.TurntableResp, *code.Result) {
-	// TODO Turntable 转盘统计
-	return nil, nil
-}
-
-// 资产统计
-func (s *Synthesis) Assets(req entity.AssetsReq) (*entity.AssetsResp, *code.Result) {
-	// TODO Assets 资产统计
-	return nil, nil
-}
-
-// 邀请统计
-func (s *Synthesis) Invite(req entity.InviteReq) (*entity.InviteResp, *code.Result) {
-	// TODO Invite 邀请统计
-	return nil, nil
-}