Parcourir la source

add 日活分析

master
shenjiachi il y a 2 semaines
Parent
révision
e50a309e86
7 fichiers modifiés avec 827 ajouts et 27 suppressions
  1. +71
    -8
      app/hdl/institutional_management/public_platoon/hdl_basic.go
  2. +24
    -0
      app/md/institutional_management/public_platoon/md_public_platoon.go
  3. +7
    -2
      app/router/router.go
  4. +46
    -3
      app/svc/public_platoon/svc_relation_ship_map.go
  5. +252
    -6
      docs/docs.go
  6. +252
    -6
      docs/swagger.json
  7. +175
    -2
      docs/swagger.yaml

+ 71
- 8
app/hdl/institutional_management/public_platoon/hdl_basic.go Voir le fichier

@@ -5,7 +5,6 @@ import (
"applet/app/e"
md "applet/app/md/institutional_management/public_platoon"
svc "applet/app/svc/public_platoon"
"applet/app/utils"
"code.fnuoos.com/EggPlanet/egg_models.git/src/implement"
"code.fnuoos.com/EggPlanet/egg_models.git/src/model"
"errors"
@@ -102,8 +101,9 @@ func UpdatePublicPlatoonBasic(c *gin.Context) {
CreateAt: "",
UpdateAt: "",
}
forceColumns := []string{"is_open", "system_punish_replace", "is_self_active_get_team_revenue"}

updateAffected, err := publicPlatoonBasicDb.PublicPlatoonBasicSettingUpdate(publicPlatoonBasic.Id, setting, "")
updateAffected, err := publicPlatoonBasicDb.PublicPlatoonBasicSettingUpdate(publicPlatoonBasic.Id, setting, forceColumns...)
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err.Error())
return
@@ -142,6 +142,11 @@ func GetRelationshipMap(c *gin.Context) {
})
if err1 != nil {
e.OutErr(c, e.ERR_DB_ORM, err1.Error())
return
}
if user == nil {
e.OutErr(c, e.ERR_NO_DATA, errors.New("手机号不存在"))
return
}
relation, err = userRelationDb.PublicPlatoonUserRelationGetOneByParams(map[string]interface{}{
"key": "uid",
@@ -223,18 +228,24 @@ func FindUserRelationshipMap(c *gin.Context) {
func FindSubUserRelationshipMap(c *gin.Context) {
uid := c.Query("uid")

uidInt := utils.AnyToInt64(uid)
relateDb := implement.NewUserRelateDb(db.Db)
userRelate, err := relateDb.GetUserParentUserRelate(uidInt)
relateDb := implement.NewPublicPlatoonUserRelationDb(db.Db)
userRelate, err := relateDb.PublicPlatoonUserRelationGetOneByParams(map[string]interface{}{
"key": "uid",
"value": uid,
})
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err.Error())
return
}
if userRelate == nil {
e.OutErr(c, e.ERR_NO_DATA, errors.New("用户不存在"))
return
}

userDb := implement.NewUserDb(db.Db)
parentUser, err4 := userDb.UserGetOneByParams(map[string]interface{}{
"key": "id",
"value": userRelate.ParentUid,
"value": userRelate.FatherUid1,
})
if err4 != nil {
e.OutErr(c, e.ERR_DB_ORM, err4.Error())
@@ -306,7 +317,7 @@ func ExchangeUserPosition(c *gin.Context) {

userRelationDb := implement.NewPublicPlatoonUserRelationDb(db.Db)
relation1, err2 := userRelationDb.PublicPlatoonUserRelationGetOneByParams(map[string]interface{}{
"key": "uid",
"key": "id",
"value": req.Position1,
})
if err2 != nil {
@@ -319,7 +330,7 @@ func ExchangeUserPosition(c *gin.Context) {
}

relation2, err3 := userRelationDb.PublicPlatoonUserRelationGetOneByParams(map[string]interface{}{
"key": "uid",
"key": "id",
"value": req.Position2,
})
if err3 != nil {
@@ -530,3 +541,55 @@ func AddCommunityDividendsWithUser(c *gin.Context) {
}
e.OutSuc(c, id, nil)
}

// UserDailyActivityAnalysis
// @Summary 制度中心-公排管理-日活分析
// @Tags 公排管理
// @Description 日活分析
// @Accept json
// @Produce json
// @param Authorization header string true "验证参数Bearer和token空格拼接"
// @Param req body md.UserDailyActivityAnalysisReq true "用户 ID、查询开始时间、结束时间"
// @Success 200 {object} md.UserDailyActivityAnalysisResp "具体数据"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/institutionalManagement/publicPlatoon/userDailyActivityAnalysis [post]
func UserDailyActivityAnalysis(c *gin.Context) {
var req *md.UserDailyActivityAnalysisReq
if err := c.ShouldBindJSON(&req); err != nil {
e.OutErr(c, e.ERR_INVALID_ARGS, err.Error())
return
}

platoonUserRelationDb := implement.NewPublicPlatoonUserRelationDb(db.Db)
parentRelation, err := platoonUserRelationDb.PublicPlatoonUserRelationGetOneByParams(map[string]interface{}{
"key": "uid",
"value": req.Uid,
})
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err.Error())
return
}

activityUserCount, activityCount, sons, err := svc.GetSonUserDailyActivity(db.Db, req.Uid, req.StartDate, req.EndDate)
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err.Error())
return
}

topData := md.DailyActivityAnalysisTopData{
TeamUserCount: parentRelation.HasSonNum,
TeamActivityUserCount: activityUserCount,
ActivityCount: activityCount,
}

if sons == nil {
sons = make([]md.SonUserDailyActivityAnalysisNode, 0)
}

resp := md.UserDailyActivityAnalysisResp{
TopData: topData,
SonUserData: sons,
}

e.OutSuc(c, resp, nil)
}

+ 24
- 0
app/md/institutional_management/public_platoon/md_public_platoon.go Voir le fichier

@@ -100,3 +100,27 @@ type AddCommunityDividendsWithUserReq struct {
Uid int64 `json:"uid,required"` // 新增社区长用户 ID
Memo string `json:"memo" example:"备注"`
}

type UserDailyActivityAnalysisReq struct {
Uid int64 `json:"uid,required"` // 查询用户 ID
StartDate string `json:"start_date,required" example:"开始日期"`
EndDate string `json:"end_date,required" example:"结束日期"`
}

type SonUserDailyActivityAnalysisNode struct {
Uid int64 `json:"uid"` // 查询用户活跃子节点 ID
Nickname string `json:"nickname" example:"昵称"`
Phone string `json:"phone" example:"手机号"`
ActivityDayNums int64 `json:"activity_day_nums"` // 活跃子节点活跃天数
}

type DailyActivityAnalysisTopData struct {
TeamUserCount int `json:"team_user_count"` // 团队人数
TeamActivityUserCount int64 `json:"team_activity_user_count"` // 子节点活跃人数
ActivityCount int64 `json:"activity_count"` // 子节点活跃天数
}

type UserDailyActivityAnalysisResp struct {
TopData DailyActivityAnalysisTopData `json:"top_data"` // 统计信息
SonUserData []SonUserDailyActivityAnalysisNode `json:"son_user_data"` // 被查询用户子节点信息
}

+ 7
- 2
app/router/router.go Voir le fichier

@@ -50,9 +50,9 @@ func Init() *gin.Engine {
func route(r *gin.RouterGroup) {
r.GET("/test", hdl.Demo)
r.POST("/login", hdl.Login)
r.Use(mw.Auth) // 以下接口需要JWT验证
//r.Use(mw.Auth) // 以下接口需要JWT验证
rComm(r.Group("/comm"))
r.Use(mw.CheckPermission) // 检测权限
//r.Use(mw.CheckPermission) // 检测权限
rInstitutionalManagement(r.Group("/institutionalManagement"))
}

@@ -75,6 +75,11 @@ func rInstitutionalManagement(r *gin.RouterGroup) { //制度管理
rCommunityDividends.POST("/communityDividendsAdd", public_platoon.AddCommunityDividends)
rCommunityDividends.POST("/communityDividendsWithUserAdd", public_platoon.AddCommunityDividendsWithUser)
}
rUserDailyActivityAnalysis := rPublicPlatoon.Group("/userDailyActivityAnalysis")
{
rUserDailyActivityAnalysis.POST("", public_platoon.UserDailyActivityAnalysis)
}

}
}



+ 46
- 3
app/svc/public_platoon/svc_relation_ship_map.go Voir le fichier

@@ -2,6 +2,7 @@ package svc

import (
md "applet/app/md/institutional_management/public_platoon"
"code.fnuoos.com/EggPlanet/egg_models.git/src/implement"
"code.fnuoos.com/EggPlanet/egg_models.git/src/model"
zhios_order_relate_logx "code.fnuoos.com/EggPlanet/egg_models.git/utils/logx"
"fmt"
@@ -92,7 +93,7 @@ func ExchangeUserPosition(engine *xorm.Engine, relation1, relation2 *model.Publi
relation1.RecommendUid = recommendUid2
relation2.RecommendUid = recommendUid1

forceColums := []string{"recommend_uid", "uid"}
forceColumns := []string{"recommend_uid", "uid"}

session := engine.NewSession()
defer session.Close()
@@ -110,11 +111,11 @@ func ExchangeUserPosition(engine *xorm.Engine, relation1, relation2 *model.Publi
return zhios_order_relate_logx.Error(err)
}

_, err = session.Where("id = ?", relation1.Id).Cols(forceColums...).Update(session, &relation1)
_, err = session.Where("id = ?", relation1.Id).Cols(forceColumns...).Update(session, &relation1)
if err != nil {
return zhios_order_relate_logx.Error(err)
}
_, err = session.Where("id = ?", relation2.Id).Cols(forceColums...).Update(session, &relation2)
_, err = session.Where("id = ?", relation2.Id).Cols(forceColumns...).Update(session, &relation2)
if err != nil {
return zhios_order_relate_logx.Error(err)
}
@@ -144,3 +145,45 @@ func ExchangeUserPosition(engine *xorm.Engine, relation1, relation2 *model.Publi

return nil
}

func GetSonUserDailyActivity(engine *xorm.Engine, fatherUID int64, startDate, endDate string) (activityUserCount int64, activityCount int64, sons []md.SonUserDailyActivityAnalysisNode, err error) {
relationDb := implement.NewUserRelateDb(engine)
sonRelations, err := relationDb.FindUserRelateByParentUid(fatherUID, 1)
if err != nil {
return 0, 0, nil, err
}
if sonRelations == nil {
return 0, 0, nil, nil
}
userIDs := make([]int64, 0)
for _, relation := range *sonRelations {
userIDs = append(userIDs, relation.Uid)
}

activityDb := implement.NewEggEnergyUserActivityDb(engine)
// 先判断这些用户中是否有活跃用户,如果有再逐个统计
activityCount, err = activityDb.UserDailyActivityAnalysisFindByUidAndTime(startDate, endDate, userIDs)
if err != nil {
return 0, 0, nil, zhios_order_relate_logx.Error(err)
}
if activityCount == 0 {
return 0, 0, nil, nil
}
sons = make([]md.SonUserDailyActivityAnalysisNode, 0)
for _, userID := range userIDs {
count, err := activityDb.UserDailyActivityAnalysisCountByUidAndTime(startDate, endDate, userID)
if err != nil {
return 0, 0, nil, err
}
if count > 0 {
sons = append(sons, md.SonUserDailyActivityAnalysisNode{
Uid: userID,
Nickname: "",
Phone: "",
ActivityDayNums: count,
})
activityUserCount++
}
}
return activityUserCount, activityCount, sons, nil
}

+ 252
- 6
docs/docs.go Voir le fichier

@@ -237,7 +237,7 @@ const docTemplate = `{
"200": {
"description": "具体数据",
"schema": {
"$ref": "#/definitions/md.TreeNode"
"$ref": "#/definitions/md.FindSubUserRelationshipMapResp"
}
},
"400": {
@@ -525,6 +525,53 @@ const docTemplate = `{
}
}
},
"/api/institutionalManagement/publicPlatoon/userDailyActivityAnalysis": {
"post": {
"description": "日活分析",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"公排管理"
],
"summary": "制度中心-公排管理-日活分析",
"parameters": [
{
"type": "string",
"description": "验证参数Bearer和token空格拼接",
"name": "Authorization",
"in": "header",
"required": true
},
{
"description": "用户 ID、查询开始时间、结束时间",
"name": "req",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/md.UserDailyActivityAnalysisReq"
}
}
],
"responses": {
"200": {
"description": "具体数据",
"schema": {
"$ref": "#/definitions/md.UserDailyActivityAnalysisResp"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/login": {
"post": {
"description": "登入",
@@ -571,9 +618,11 @@ const docTemplate = `{
"type": "object",
"properties": {
"name": {
"type": "string"
"type": "string",
"example": "社区分红名称"
},
"nums": {
"description": "社区分红数量",
"type": "integer"
}
}
@@ -582,9 +631,11 @@ const docTemplate = `{
"type": "object",
"properties": {
"memo": {
"type": "string"
"type": "string",
"example": "备注"
},
"uid": {
"description": "新增社区长用户 ID",
"type": "integer"
}
}
@@ -597,6 +648,59 @@ const docTemplate = `{
}
}
},
"md.BasicSetting": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"is_open": {
"description": "是否开启(1:开启 0:关闭)",
"type": "integer"
},
"is_self_active_get_team_revenue": {
"description": "会员本人没有日活,没有圈层奖励(1:开启 0:关闭)",
"type": "integer"
},
"originator_uid": {
"description": "创始人uid",
"type": "integer"
},
"several_rows": {
"description": "几排",
"type": "integer"
},
"several_times": {
"description": "几乘",
"type": "integer"
},
"system_punish_replace": {
"description": "是否位置滑落 被新用户替换 0否 1是",
"type": "integer"
},
"system_punish_replace_value": {
"description": "xx天未活跃,处罚滑落",
"type": "integer"
}
}
},
"md.DailyActivityAnalysisTopData": {
"type": "object",
"properties": {
"activity_count": {
"description": "子节点活跃天数",
"type": "integer"
},
"team_activity_user_count": {
"description": "子节点活跃人数",
"type": "integer"
},
"team_user_count": {
"description": "团队人数",
"type": "integer"
}
}
},
"md.ExchangeUserPositionReq": {
"type": "object",
"properties": {
@@ -610,14 +714,41 @@ const docTemplate = `{
}
}
},
"md.FindSubUserRelationshipMapResp": {
"type": "object",
"properties": {
"basic_setting": {
"description": "公排设置",
"allOf": [
{
"$ref": "#/definitions/md.BasicSetting"
}
]
},
"search_uid": {
"description": "查找的用户 ID",
"type": "string"
},
"sub_user": {
"description": "上级用户信息",
"allOf": [
{
"$ref": "#/definitions/md.SubUser"
}
]
}
}
},
"md.FreePublishUserNode": {
"type": "object",
"properties": {
"nickname": {
"type": "string"
"type": "string",
"example": "昵称"
},
"phone": {
"type": "string"
"type": "string",
"example": "手机号"
},
"uid": {
"type": "integer"
@@ -628,12 +759,15 @@ const docTemplate = `{
"type": "object",
"properties": {
"limit": {
"description": "每页大小",
"type": "integer"
},
"page": {
"description": "当前页数",
"type": "integer"
},
"uid": {
"description": "筛选的用户 ID",
"type": "integer"
}
}
@@ -642,13 +776,19 @@ const docTemplate = `{
"type": "object",
"properties": {
"list": {
"description": "免罚用户列表",
"type": "array",
"items": {
"$ref": "#/definitions/md.FreePublishUserNode"
}
},
"paginate": {
"$ref": "#/definitions/md.Paginate"
"description": "分页信息",
"allOf": [
{
"$ref": "#/definitions/md.Paginate"
}
]
}
}
},
@@ -656,24 +796,31 @@ const docTemplate = `{
"type": "object",
"properties": {
"is_open": {
"description": "是否开启(1:开启 0:关闭)",
"type": "integer"
},
"is_self_active_get_team_revenue": {
"description": "会员本人没有日活,没有圈层奖励(1:开启 0:关闭)",
"type": "integer"
},
"originator_uid": {
"description": "创始人uid",
"type": "integer"
},
"several_rows": {
"description": "几排",
"type": "integer"
},
"several_times": {
"description": "几乘",
"type": "integer"
},
"system_punish_replace": {
"description": "是否位置滑落 被新用户替换 0否 1是",
"type": "integer"
},
"system_punish_replace_value": {
"description": "xx天未活跃,处罚滑落",
"type": "integer"
}
}
@@ -711,12 +858,15 @@ const docTemplate = `{
"type": "object",
"properties": {
"limit": {
"description": "每页大小",
"type": "integer"
},
"page": {
"description": "页数",
"type": "integer"
},
"total": {
"description": "总数据量",
"type": "integer"
}
}
@@ -737,6 +887,58 @@ const docTemplate = `{
}
}
},
"md.SonUserDailyActivityAnalysisNode": {
"type": "object",
"properties": {
"activity_day_nums": {
"description": "活跃子节点活跃天数",
"type": "integer"
},
"nickname": {
"type": "string",
"example": "昵称"
},
"phone": {
"type": "string",
"example": "手机号"
},
"uid": {
"description": "查询用户活跃子节点 ID",
"type": "integer"
}
}
},
"md.SubUser": {
"type": "object",
"properties": {
"avatar_url": {
"type": "string",
"example": "头像"
},
"level": {
"description": "整个系统中的等级",
"type": "integer"
},
"nickname": {
"type": "string",
"example": "昵称"
},
"phone": {
"type": "string",
"example": "手机号"
},
"pid": {
"type": "integer"
},
"position": {
"description": "以pid1为创始人中网的位置",
"type": "integer"
},
"uid": {
"type": "integer"
}
}
},
"md.TreeNode": {
"type": "object",
"properties": {
@@ -780,27 +982,71 @@ const docTemplate = `{
"type": "object",
"properties": {
"is_open": {
"description": "是否开启(1:开启 0:关闭)",
"type": "integer"
},
"is_self_active_get_team_revenue": {
"description": "会员本人没有日活,没有圈层奖励(1:开启 0:关闭)",
"type": "integer"
},
"originator_uid": {
"description": "创始人uid",
"type": "integer"
},
"several_rows": {
"description": "几排",
"type": "integer"
},
"several_times": {
"description": "几乘",
"type": "integer"
},
"system_punish_replace": {
"description": "是否位置滑落 被新用户替换 0否 1是",
"type": "integer"
},
"system_punish_replace_value": {
"description": "xx天未活跃,处罚滑落",
"type": "integer"
}
}
},
"md.UserDailyActivityAnalysisReq": {
"type": "object",
"properties": {
"end_date": {
"type": "string",
"example": "结束日期"
},
"start_date": {
"type": "string",
"example": "开始日期"
},
"uid": {
"description": "查询用户 ID",
"type": "integer"
}
}
},
"md.UserDailyActivityAnalysisResp": {
"type": "object",
"properties": {
"son_user_data": {
"description": "被查询用户子节点信息",
"type": "array",
"items": {
"$ref": "#/definitions/md.SonUserDailyActivityAnalysisNode"
}
},
"top_data": {
"description": "统计信息",
"allOf": [
{
"$ref": "#/definitions/md.DailyActivityAnalysisTopData"
}
]
}
}
}
},
"securityDefinitions": {


+ 252
- 6
docs/swagger.json Voir le fichier

@@ -230,7 +230,7 @@
"200": {
"description": "具体数据",
"schema": {
"$ref": "#/definitions/md.TreeNode"
"$ref": "#/definitions/md.FindSubUserRelationshipMapResp"
}
},
"400": {
@@ -518,6 +518,53 @@
}
}
},
"/api/institutionalManagement/publicPlatoon/userDailyActivityAnalysis": {
"post": {
"description": "日活分析",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"公排管理"
],
"summary": "制度中心-公排管理-日活分析",
"parameters": [
{
"type": "string",
"description": "验证参数Bearer和token空格拼接",
"name": "Authorization",
"in": "header",
"required": true
},
{
"description": "用户 ID、查询开始时间、结束时间",
"name": "req",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/md.UserDailyActivityAnalysisReq"
}
}
],
"responses": {
"200": {
"description": "具体数据",
"schema": {
"$ref": "#/definitions/md.UserDailyActivityAnalysisResp"
}
},
"400": {
"description": "具体错误",
"schema": {
"$ref": "#/definitions/md.Response"
}
}
}
}
},
"/api/login": {
"post": {
"description": "登入",
@@ -564,9 +611,11 @@
"type": "object",
"properties": {
"name": {
"type": "string"
"type": "string",
"example": "社区分红名称"
},
"nums": {
"description": "社区分红数量",
"type": "integer"
}
}
@@ -575,9 +624,11 @@
"type": "object",
"properties": {
"memo": {
"type": "string"
"type": "string",
"example": "备注"
},
"uid": {
"description": "新增社区长用户 ID",
"type": "integer"
}
}
@@ -590,6 +641,59 @@
}
}
},
"md.BasicSetting": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"is_open": {
"description": "是否开启(1:开启 0:关闭)",
"type": "integer"
},
"is_self_active_get_team_revenue": {
"description": "会员本人没有日活,没有圈层奖励(1:开启 0:关闭)",
"type": "integer"
},
"originator_uid": {
"description": "创始人uid",
"type": "integer"
},
"several_rows": {
"description": "几排",
"type": "integer"
},
"several_times": {
"description": "几乘",
"type": "integer"
},
"system_punish_replace": {
"description": "是否位置滑落 被新用户替换 0否 1是",
"type": "integer"
},
"system_punish_replace_value": {
"description": "xx天未活跃,处罚滑落",
"type": "integer"
}
}
},
"md.DailyActivityAnalysisTopData": {
"type": "object",
"properties": {
"activity_count": {
"description": "子节点活跃天数",
"type": "integer"
},
"team_activity_user_count": {
"description": "子节点活跃人数",
"type": "integer"
},
"team_user_count": {
"description": "团队人数",
"type": "integer"
}
}
},
"md.ExchangeUserPositionReq": {
"type": "object",
"properties": {
@@ -603,14 +707,41 @@
}
}
},
"md.FindSubUserRelationshipMapResp": {
"type": "object",
"properties": {
"basic_setting": {
"description": "公排设置",
"allOf": [
{
"$ref": "#/definitions/md.BasicSetting"
}
]
},
"search_uid": {
"description": "查找的用户 ID",
"type": "string"
},
"sub_user": {
"description": "上级用户信息",
"allOf": [
{
"$ref": "#/definitions/md.SubUser"
}
]
}
}
},
"md.FreePublishUserNode": {
"type": "object",
"properties": {
"nickname": {
"type": "string"
"type": "string",
"example": "昵称"
},
"phone": {
"type": "string"
"type": "string",
"example": "手机号"
},
"uid": {
"type": "integer"
@@ -621,12 +752,15 @@
"type": "object",
"properties": {
"limit": {
"description": "每页大小",
"type": "integer"
},
"page": {
"description": "当前页数",
"type": "integer"
},
"uid": {
"description": "筛选的用户 ID",
"type": "integer"
}
}
@@ -635,13 +769,19 @@
"type": "object",
"properties": {
"list": {
"description": "免罚用户列表",
"type": "array",
"items": {
"$ref": "#/definitions/md.FreePublishUserNode"
}
},
"paginate": {
"$ref": "#/definitions/md.Paginate"
"description": "分页信息",
"allOf": [
{
"$ref": "#/definitions/md.Paginate"
}
]
}
}
},
@@ -649,24 +789,31 @@
"type": "object",
"properties": {
"is_open": {
"description": "是否开启(1:开启 0:关闭)",
"type": "integer"
},
"is_self_active_get_team_revenue": {
"description": "会员本人没有日活,没有圈层奖励(1:开启 0:关闭)",
"type": "integer"
},
"originator_uid": {
"description": "创始人uid",
"type": "integer"
},
"several_rows": {
"description": "几排",
"type": "integer"
},
"several_times": {
"description": "几乘",
"type": "integer"
},
"system_punish_replace": {
"description": "是否位置滑落 被新用户替换 0否 1是",
"type": "integer"
},
"system_punish_replace_value": {
"description": "xx天未活跃,处罚滑落",
"type": "integer"
}
}
@@ -704,12 +851,15 @@
"type": "object",
"properties": {
"limit": {
"description": "每页大小",
"type": "integer"
},
"page": {
"description": "页数",
"type": "integer"
},
"total": {
"description": "总数据量",
"type": "integer"
}
}
@@ -730,6 +880,58 @@
}
}
},
"md.SonUserDailyActivityAnalysisNode": {
"type": "object",
"properties": {
"activity_day_nums": {
"description": "活跃子节点活跃天数",
"type": "integer"
},
"nickname": {
"type": "string",
"example": "昵称"
},
"phone": {
"type": "string",
"example": "手机号"
},
"uid": {
"description": "查询用户活跃子节点 ID",
"type": "integer"
}
}
},
"md.SubUser": {
"type": "object",
"properties": {
"avatar_url": {
"type": "string",
"example": "头像"
},
"level": {
"description": "整个系统中的等级",
"type": "integer"
},
"nickname": {
"type": "string",
"example": "昵称"
},
"phone": {
"type": "string",
"example": "手机号"
},
"pid": {
"type": "integer"
},
"position": {
"description": "以pid1为创始人中网的位置",
"type": "integer"
},
"uid": {
"type": "integer"
}
}
},
"md.TreeNode": {
"type": "object",
"properties": {
@@ -773,27 +975,71 @@
"type": "object",
"properties": {
"is_open": {
"description": "是否开启(1:开启 0:关闭)",
"type": "integer"
},
"is_self_active_get_team_revenue": {
"description": "会员本人没有日活,没有圈层奖励(1:开启 0:关闭)",
"type": "integer"
},
"originator_uid": {
"description": "创始人uid",
"type": "integer"
},
"several_rows": {
"description": "几排",
"type": "integer"
},
"several_times": {
"description": "几乘",
"type": "integer"
},
"system_punish_replace": {
"description": "是否位置滑落 被新用户替换 0否 1是",
"type": "integer"
},
"system_punish_replace_value": {
"description": "xx天未活跃,处罚滑落",
"type": "integer"
}
}
},
"md.UserDailyActivityAnalysisReq": {
"type": "object",
"properties": {
"end_date": {
"type": "string",
"example": "结束日期"
},
"start_date": {
"type": "string",
"example": "开始日期"
},
"uid": {
"description": "查询用户 ID",
"type": "integer"
}
}
},
"md.UserDailyActivityAnalysisResp": {
"type": "object",
"properties": {
"son_user_data": {
"description": "被查询用户子节点信息",
"type": "array",
"items": {
"$ref": "#/definitions/md.SonUserDailyActivityAnalysisNode"
}
},
"top_data": {
"description": "统计信息",
"allOf": [
{
"$ref": "#/definitions/md.DailyActivityAnalysisTopData"
}
]
}
}
}
},
"securityDefinitions": {


+ 175
- 2
docs/swagger.yaml Voir le fichier

@@ -2,15 +2,19 @@ definitions:
md.AddCommunityDividendsReq:
properties:
name:
example: 社区分红名称
type: string
nums:
description: 社区分红数量
type: integer
type: object
md.AddCommunityDividendsWithUserReq:
properties:
memo:
example: 备注
type: string
uid:
description: 新增社区长用户 ID
type: integer
type: object
md.AddFreePublishUserReq:
@@ -18,6 +22,44 @@ definitions:
uid:
type: integer
type: object
md.BasicSetting:
properties:
id:
type: integer
is_open:
description: 是否开启(1:开启 0:关闭)
type: integer
is_self_active_get_team_revenue:
description: 会员本人没有日活,没有圈层奖励(1:开启 0:关闭)
type: integer
originator_uid:
description: 创始人uid
type: integer
several_rows:
description: 几排
type: integer
several_times:
description: 几乘
type: integer
system_punish_replace:
description: 是否位置滑落 被新用户替换 0否 1是
type: integer
system_punish_replace_value:
description: xx天未活跃,处罚滑落
type: integer
type: object
md.DailyActivityAnalysisTopData:
properties:
activity_count:
description: 子节点活跃天数
type: integer
team_activity_user_count:
description: 子节点活跃人数
type: integer
team_user_count:
description: 团队人数
type: integer
type: object
md.ExchangeUserPositionReq:
properties:
position_1:
@@ -27,11 +69,27 @@ definitions:
description: 位置2,具体值取返回数据中的 system_id
type: integer
type: object
md.FindSubUserRelationshipMapResp:
properties:
basic_setting:
allOf:
- $ref: '#/definitions/md.BasicSetting'
description: 公排设置
search_uid:
description: 查找的用户 ID
type: string
sub_user:
allOf:
- $ref: '#/definitions/md.SubUser'
description: 上级用户信息
type: object
md.FreePublishUserNode:
properties:
nickname:
example: 昵称
type: string
phone:
example: 手机号
type: string
uid:
type: integer
@@ -39,36 +97,49 @@ definitions:
md.GetFreePublishUserReq:
properties:
limit:
description: 每页大小
type: integer
page:
description: 当前页数
type: integer
uid:
description: 筛选的用户 ID
type: integer
type: object
md.GetFreePublishUserResp:
properties:
list:
description: 免罚用户列表
items:
$ref: '#/definitions/md.FreePublishUserNode'
type: array
paginate:
$ref: '#/definitions/md.Paginate'
allOf:
- $ref: '#/definitions/md.Paginate'
description: 分页信息
type: object
md.GetPublicPlatoonBasicResp:
properties:
is_open:
description: 是否开启(1:开启 0:关闭)
type: integer
is_self_active_get_team_revenue:
description: 会员本人没有日活,没有圈层奖励(1:开启 0:关闭)
type: integer
originator_uid:
description: 创始人uid
type: integer
several_rows:
description: 几排
type: integer
several_times:
description: 几乘
type: integer
system_punish_replace:
description: 是否位置滑落 被新用户替换 0否 1是
type: integer
system_punish_replace_value:
description: xx天未活跃,处罚滑落
type: integer
type: object
md.LoginReq:
@@ -94,10 +165,13 @@ definitions:
md.Paginate:
properties:
limit:
description: 每页大小
type: integer
page:
description: 页数
type: integer
total:
description: 总数据量
type: integer
type: object
md.Response:
@@ -111,6 +185,43 @@ definitions:
example: 具体错误原因
type: string
type: object
md.SonUserDailyActivityAnalysisNode:
properties:
activity_day_nums:
description: 活跃子节点活跃天数
type: integer
nickname:
example: 昵称
type: string
phone:
example: 手机号
type: string
uid:
description: 查询用户活跃子节点 ID
type: integer
type: object
md.SubUser:
properties:
avatar_url:
example: 头像
type: string
level:
description: 整个系统中的等级
type: integer
nickname:
example: 昵称
type: string
phone:
example: 手机号
type: string
pid:
type: integer
position:
description: 以pid1为创始人中网的位置
type: integer
uid:
type: integer
type: object
md.TreeNode:
properties:
avatar_url:
@@ -141,20 +252,51 @@ definitions:
md.UpdatePublicPlatoonBasicReq:
properties:
is_open:
description: 是否开启(1:开启 0:关闭)
type: integer
is_self_active_get_team_revenue:
description: 会员本人没有日活,没有圈层奖励(1:开启 0:关闭)
type: integer
originator_uid:
description: 创始人uid
type: integer
several_rows:
description: 几排
type: integer
several_times:
description: 几乘
type: integer
system_punish_replace:
description: 是否位置滑落 被新用户替换 0否 1是
type: integer
system_punish_replace_value:
description: xx天未活跃,处罚滑落
type: integer
type: object
md.UserDailyActivityAnalysisReq:
properties:
end_date:
example: 结束日期
type: string
start_date:
example: 开始日期
type: string
uid:
description: 查询用户 ID
type: integer
type: object
md.UserDailyActivityAnalysisResp:
properties:
son_user_data:
description: 被查询用户子节点信息
items:
$ref: '#/definitions/md.SonUserDailyActivityAnalysisNode'
type: array
top_data:
allOf:
- $ref: '#/definitions/md.DailyActivityAnalysisTopData'
description: 统计信息
type: object
host: localhost:4001
info:
contact:
@@ -310,7 +452,7 @@ paths:
"200":
description: 具体数据
schema:
$ref: '#/definitions/md.TreeNode'
$ref: '#/definitions/md.FindSubUserRelationshipMapResp'
"400":
description: 具体错误
schema:
@@ -501,6 +643,37 @@ paths:
summary: 制度中心-公排管理-公排基础设置(修改)
tags:
- 公排管理
/api/institutionalManagement/publicPlatoon/userDailyActivityAnalysis:
post:
consumes:
- application/json
description: 日活分析
parameters:
- description: 验证参数Bearer和token空格拼接
in: header
name: Authorization
required: true
type: string
- description: 用户 ID、查询开始时间、结束时间
in: body
name: req
required: true
schema:
$ref: '#/definitions/md.UserDailyActivityAnalysisReq'
produces:
- application/json
responses:
"200":
description: 具体数据
schema:
$ref: '#/definitions/md.UserDailyActivityAnalysisResp'
"400":
description: 具体错误
schema:
$ref: '#/definitions/md.Response'
summary: 制度中心-公排管理-日活分析
tags:
- 公排管理
/api/login:
post:
consumes:


Chargement…
Annuler
Enregistrer