Browse Source

update 新增活跃统计接口

Alvin 8 tháng trước cách đây
mục cha
commit
b82c4bec1c

+ 17 - 0
game/game_cluster/nodes/webadmin/controller/synthesis.go

@@ -220,6 +220,23 @@ func (s *Synthesis) Invite(ctx *gin.Context) {
 	common.PackOkResult(ctx, code.OK, resp)
 }
 
+// 活跃统计
+func (s *Synthesis) Active(ctx *gin.Context) {
+	var req entity.ActiveReq
+	if err := ctx.ShouldBindJSON(&req); err != nil {
+		common.PackOkResult(ctx, code.ParamError)
+		return
+	}
+
+	resp, err := s.sev.Active(req)
+	if err != nil {
+		common.PackOkResult(ctx, err.Code)
+		return
+	}
+
+	common.PackOkResult(ctx, code.OK, resp)
+}
+
 // 后台操作记录
 func (s *Synthesis) Records(ctx *gin.Context) {
 	var req entity.RecordListReq

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

@@ -63,3 +63,19 @@ type InviteResp struct {
 type InviteDetail struct {
 	// TODO InviteDetail 邀请统计数据详情
 }
+
+type ActiveReq struct {
+	Page     int    `json:"page"`
+	Size     int    `json:"size"`
+	UserName string `json:"user_name"` // 用户名
+	NickName string `json:"nick_name"` // 昵称
+}
+
+type ActiveResp struct {
+	Details []*ActiveDetail `json:"details"`
+	Total   int64           `json:"total"`
+}
+
+type ActiveDetail struct {
+	// TODO ActiveDetail 活跃统计数据详情
+}

+ 1 - 0
game/game_cluster/nodes/webadmin/router/router.go

@@ -62,6 +62,7 @@ func (c *Controller) InitApiRouter(u *gin.RouterGroup) {
 	u.POST("/user/log", controller.NewSynthesis().Records)
 
 	// 活跃统计
+	u.POST("/statistics/active", controller.NewSynthesis().Active)
 	u.POST("/user/retention", controller.NewSynthesis().FindUserRetention)
 	u.POST("/user/country", controller.NewSynthesis().FindUserCountryCount)
 	u.POST("/user/level", controller.NewSynthesis().FindUserLevel)

+ 6 - 0
game/game_cluster/nodes/webadmin/service/synthesis.go

@@ -747,3 +747,9 @@ func (s *Synthesis) Invite(req entity.InviteReq) (*entity.InviteResp, *code.Resu
 	// TODO Invite 邀请统计
 	return nil, nil
 }
+
+// 活跃统计
+func (s *Synthesis) Active(req entity.ActiveReq) (*entity.ActiveResp, *code.Result) {
+	// TODO Active 活跃统计
+	return nil, nil
+}