dengbiao 1 month ago
parent
commit
8fb45df339
6 changed files with 66 additions and 20 deletions
  1. +15
    -6
      app/hdl/institutional_management/egg_energy/hdl_basic.go
  2. +11
    -6
      app/md/institutional_management/egg_energy/md_basic.go
  3. +2
    -2
      app/router/router.go
  4. +14
    -2
      docs/docs.go
  5. +14
    -2
      docs/swagger.json
  6. +10
    -2
      docs/swagger.yaml

+ 15
- 6
app/hdl/institutional_management/egg_energy/hdl_basic.go View File

@@ -89,6 +89,9 @@ func GetEggEnergyBasic(c *gin.Context) {
var newUserRewardRules md2.NewUserRewardRules
utils.Unserialize([]byte(basicSettings.NewUserIncentiveRules), newUserRewardRules)

var directPushReward md2.TeamRewardSettingStruct
utils.Unserialize([]byte(basicSettings.DirectPushReward), directPushReward)

resp := md.GetEggEnergyBasicResp{
BasicSetting: md.BasicSetting{
IsOpen: basicSettings.IsOpen,
@@ -96,7 +99,12 @@ func GetEggEnergyBasic(c *gin.Context) {
TeamEggEnergyCoinId: basicSettings.TeamEggEnergyCoinId,
PersonEggPointsCoinId: basicSettings.PersonEggPointsCoinId,
TeamEggPointsCoinId: basicSettings.TeamEggPointsCoinId,
DirectPushReward: basicSettings.DirectPushReward,
DirectPushReward: md2.TeamRewardSettingStruct{
RewardDecrementValue: directPushReward.RewardDecrementValue,
RewardEndValue: directPushReward.RewardEndValue,
MemberSelfIsOpenGetTeamReward: directPushReward.MemberSelfIsOpenGetTeamReward,
OneRoundDuration: directPushReward.OneRoundDuration,
},
},
VideoRewardSetting: md.VideoRewardSetting{
VideoRewardIsOpen: basicSettings.VideoRewardIsOpen,
@@ -176,6 +184,7 @@ func UpdateEggEnergyBasic(c *gin.Context) {
exchangeRulesStr := utils.SerializeStr(req.ExchangeRules)
rewardSystemStr := utils.SerializeStr(req.RewardSystem)
newUserIncentiveRulesStr := utils.SerializeStr(req.NewUserIncentiveRules)
directPushRewardStr := utils.SerializeStr(req.BasicSetting.DirectPushReward)

m := model.EggEnergyBasicSetting{
Id: req.SystemID,
@@ -192,7 +201,7 @@ func UpdateEggEnergyBasic(c *gin.Context) {
TotalUserForPerson: req.DataSetting.TotalUserForPerson,
TotalUserForTeam: req.DataSetting.TotalUserForTeam,
DestructionSetting: destructionSettingStr,
DirectPushReward: req.BasicSetting.DirectPushReward,
DirectPushReward: directPushRewardStr,
PriceSetting: priceSettingStr,
VideoRewardIsOpen: req.VideoRewardSetting.VideoRewardIsOpen,
VideoRewardSystem: videoRewardSystemStr,
@@ -276,7 +285,7 @@ func GetEggCoreDataList(c *gin.Context) {
// @Produce json
// @param Authorization header string true "验证参数Bearer和token空格拼接"
// @Param kind query string false "1:按天 2:按小时 3:按周"
// @Success 200 {object} map[string]interface{} "具体数据"
// @Success 200 {object} md.GetPriceCurveResp "具体数据"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/institutionalManagement/eggEnergy/globalData/pointsCenterPriceCurve [get]
func GetPriceCurve(c *gin.Context) {
@@ -347,9 +356,9 @@ func GetPriceCurve(c *gin.Context) {
break
}

e.OutSuc(c, map[string]interface{}{
"yData": yData,
"xData": xData,
e.OutSuc(c, md.GetPriceCurveResp{
YData: yData,
XData: xData,
}, nil)
return
}


+ 11
- 6
app/md/institutional_management/egg_energy/md_basic.go View File

@@ -15,12 +15,12 @@ type VirtualCoin struct {

// BasicSetting 基础设置
type BasicSetting struct {
IsOpen int `json:"is_open" ` // 是否开启(1:开启 0:关闭)
PersonEggEnergyCoinId int `json:"person_egg_energy_coin_id" ` // 个人蛋蛋能量对应虚拟币 id
TeamEggEnergyCoinId int `json:"team_egg_energy_coin_id" ` // 团队蛋蛋能量对应虚拟币 id
PersonEggPointsCoinId int `json:"person_egg_points_coin_id" ` // 个人蛋蛋积分对应虚拟币 id
TeamEggPointsCoinId int `json:"team_egg_points_coin_id" ` // 团队蛋蛋积分对应虚拟币 id
DirectPushReward string `json:"direct_push_reward" example:"直推奖励"` // 直推奖励
IsOpen int `json:"is_open" ` // 是否开启(1:开启 0:关闭)
PersonEggEnergyCoinId int `json:"person_egg_energy_coin_id" ` // 个人蛋蛋能量对应虚拟币 id
TeamEggEnergyCoinId int `json:"team_egg_energy_coin_id" ` // 团队蛋蛋能量对应虚拟币 id
PersonEggPointsCoinId int `json:"person_egg_points_coin_id" ` // 个人蛋蛋积分对应虚拟币 id
TeamEggPointsCoinId int `json:"team_egg_points_coin_id" ` // 团队蛋蛋积分对应虚拟币 id
DirectPushReward md.TeamRewardSettingStruct `json:"direct_push_reward" example:"直推奖励"` // 直推奖励
}

// VideoRewardSetting 视频奖励
@@ -72,6 +72,11 @@ type GetEggCoreDataListResp struct {
UserHoldTotalNums map[string]string `json:"user_hold_total_nums"` // 用户持有总量
}

type GetPriceCurveResp struct {
XData []interface{} `json:"x_data"`
YData []interface{} `json:"y_data"`
}

type GetFundDataListReq struct {
Kind int `json:"kind"` // 数据类型
StartAt string `json:"start_at" example:"开始时间"`


+ 2
- 2
app/router/router.go View File

@@ -52,9 +52,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"))
rSettCenter(r.Group("/settCenter"))
}


+ 14
- 2
docs/docs.go View File

@@ -353,8 +353,7 @@ const docTemplate = `{
"200": {
"description": "具体数据",
"schema": {
"type": "object",
"additionalProperties": true
"$ref": "#/definitions/md.GetPriceCurveResp"
}
},
"400": {
@@ -2312,6 +2311,19 @@ const docTemplate = `{
}
}
},
"md.GetPriceCurveResp": {
"type": "object",
"properties": {
"x_data": {
"type": "array",
"items": {}
},
"y_data": {
"type": "array",
"items": {}
}
}
},
"md.GetPublicPlatoonBasicResp": {
"type": "object",
"properties": {


+ 14
- 2
docs/swagger.json View File

@@ -346,8 +346,7 @@
"200": {
"description": "具体数据",
"schema": {
"type": "object",
"additionalProperties": true
"$ref": "#/definitions/md.GetPriceCurveResp"
}
},
"400": {
@@ -2305,6 +2304,19 @@
}
}
},
"md.GetPriceCurveResp": {
"type": "object",
"properties": {
"x_data": {
"type": "array",
"items": {}
},
"y_data": {
"type": "array",
"items": {}
}
}
},
"md.GetPublicPlatoonBasicResp": {
"type": "object",
"properties": {


+ 10
- 2
docs/swagger.yaml View File

@@ -730,6 +730,15 @@ definitions:
description: 持有该类型用户数
type: integer
type: object
md.GetPriceCurveResp:
properties:
x_data:
items: {}
type: array
y_data:
items: {}
type: array
type: object
md.GetPublicPlatoonBasicResp:
properties:
is_open:
@@ -1364,8 +1373,7 @@ paths:
"200":
description: 具体数据
schema:
additionalProperties: true
type: object
$ref: '#/definitions/md.GetPriceCurveResp'
"400":
description: 具体错误
schema:


Loading…
Cancel
Save