From 58c2e4b5c89b2833c40fa7807e6cd968374f8a0b Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Fri, 13 Dec 2024 19:06:17 +0800 Subject: [PATCH 1/9] update --- .../egg_energy/hdl_basic.go | 82 ++++++++ .../egg_energy/md_basic.go | 26 +++ app/router/router.go | 2 + docs/docs.go | 180 +++++++++++++++++- docs/swagger.json | 175 ++++++++++++++++- docs/swagger.yaml | 122 +++++++++++- 6 files changed, 577 insertions(+), 10 deletions(-) diff --git a/app/hdl/institutional_management/egg_energy/hdl_basic.go b/app/hdl/institutional_management/egg_energy/hdl_basic.go index 7fdc2e6..3b06e67 100644 --- a/app/hdl/institutional_management/egg_energy/hdl_basic.go +++ b/app/hdl/institutional_management/egg_energy/hdl_basic.go @@ -474,6 +474,88 @@ func UpdateEggEnergyVipSetting(c *gin.Context) { e.OutSuc(c, affected, nil) } +// GetEggEnergyCoreData +// @Summary 制度中心-蛋蛋能量-核心数据(获取) +// @Tags 蛋蛋能量 +// @Description 核心数据(获取) +// @Accept json +// @Produce json +// @param Authorization header string true "验证参数Bearer和token空格拼接" +// @Success 200 {object} md.GetEggEnergyCoreDataResp "具体数据" +// @Failure 400 {object} md.Response "具体错误" +// @Router /api/institutionalManagement/eggEnergy/coreData [GET] +func GetEggEnergyCoreData(c *gin.Context) { + dataDb := implement.NewEggEnergyCoreDataDb(db.Db) + coreData, err := dataDb.EggEnergyCoreDataGet() + if err != nil { + e.OutErr(c, e.ERR_DB_ORM, err.Error()) + return + } + resp := md.GetEggEnergyCoreDataResp{ + Id: coreData.Id, + NowPrice: coreData.NowPrice, + PlanetTotalValue: coreData.PlanetTotalValue, + NowEnergyTotalNums: coreData.NowEnergyTotalNums, + MarketplaceMerchantNums: coreData.MarketplaceMerchantNums, + MarketplaceMerchantFunds: coreData.MarketplaceMerchantFunds, + DevelopmentCommittee: coreData.DevelopmentCommittee, + PublicWelfareAndCharity: coreData.PublicWelfareAndCharity, + StarLevelDividends: coreData.StarLevelDividends, + CommunityDividends: coreData.CommunityDividends, + } + e.OutSuc(c, resp, nil) +} + +// UpdateEggEnergyCoreData +// @Summary 制度中心-蛋蛋能量-核心数据(更新) +// @Tags 蛋蛋能量 +// @Description 核心数据(更新) +// @Accept json +// @Produce json +// @param Authorization header string true "验证参数Bearer和token空格拼接" +// @Param req body md.UpdateEggEnergyCoreDataReq true "需要修改的内容和 id" +// @Success 200 {int} "修改数据条数" +// @Failure 400 {object} md.Response "具体错误" +// @Router /api/institutionalManagement/eggEnergy/coreData [POST] +func UpdateEggEnergyCoreData(c *gin.Context) { + var req *md.UpdateEggEnergyCoreDataReq + if err1 := c.ShouldBindJSON(&req); err1 != nil { + e.OutErr(c, e.ERR_INVALID_ARGS, err1.Error()) + return + } + + coreDataDb := implement.NewEggEnergyCoreDataDb(db.Db) + session := db.Db.NewSession() + defer session.Close() + + m := model.EggEnergyCoreData{ + NowPrice: req.NowPrice, + PlanetTotalValue: req.PlanetTotalValue, + NowEnergyTotalNums: req.NowEnergyTotalNums, + MarketplaceMerchantNums: req.MarketplaceMerchantNums, + MarketplaceMerchantFunds: req.MarketplaceMerchantFunds, + DevelopmentCommittee: req.DevelopmentCommittee, + PublicWelfareAndCharity: req.PublicWelfareAndCharity, + StarLevelDividends: req.StarLevelDividends, + CommunityDividends: req.CommunityDividends, + } + + affected, err := coreDataDb.EggEnergyCoreDataUpdateBySession(session, req.Id, &m) + if err != nil { + session.Rollback() + e.OutErr(c, e.ERR_DB_ORM, err.Error()) + return + } + err = session.Commit() + if err != nil { + session.Rollback() + e.OutErr(c, e.ERR_DB_ORM, err.Error()) + return + } + + e.OutSuc(c, affected, nil) +} + // GetEggCoreDataList // @Summary 制度中心-蛋蛋能量-数据概览(获取) // @Tags 蛋蛋能量 diff --git a/app/md/institutional_management/egg_energy/md_basic.go b/app/md/institutional_management/egg_energy/md_basic.go index 81908a9..f420e83 100644 --- a/app/md/institutional_management/egg_energy/md_basic.go +++ b/app/md/institutional_management/egg_energy/md_basic.go @@ -126,6 +126,32 @@ type GetEggCoreDataListResp struct { UserHoldTotalNums string `json:"user_hold_total_nums"` // 用户持有总量 } +type GetEggEnergyCoreDataResp struct { + Id int `json:"id"` + NowPrice string `json:"now_price"` // 当前价格 + PlanetTotalValue string `json:"planet_total_value"` // 星球总价值 + NowEnergyTotalNums string `json:"now_energy_total_nums"` // 现行总量 + MarketplaceMerchantNums string `json:"marketplace_merchant_nums"` // 市商数量 + MarketplaceMerchantFunds string `json:"marketplace_merchant_funds"` // 市商资金 + DevelopmentCommittee string `json:"development_committee"` // 发展委员会 + PublicWelfareAndCharity string `json:"public_welfare_and_charity"` // 公益慈善 + StarLevelDividends string `json:"star_level_dividends"` // 星级分红 + CommunityDividends string `json:"community_dividends"` // 社区分红 +} + +type UpdateEggEnergyCoreDataReq struct { + Id int `json:"id"` + NowPrice string `json:"now_price"` // 当前价格 + PlanetTotalValue string `json:"planet_total_value"` // 星球总价值 + NowEnergyTotalNums string `json:"now_energy_total_nums"` // 现行总量 + MarketplaceMerchantNums string `json:"marketplace_merchant_nums"` // 市商数量 + MarketplaceMerchantFunds string `json:"marketplace_merchant_funds"` // 市商资金 + DevelopmentCommittee string `json:"development_committee"` // 发展委员会 + PublicWelfareAndCharity string `json:"public_welfare_and_charity"` // 公益慈善 + StarLevelDividends string `json:"star_level_dividends"` // 星级分红 + CommunityDividends string `json:"community_dividends"` // 社区分红 +} + type GetPriceCurveResp struct { XData []interface{} `json:"x_data"` YData []interface{} `json:"y_data"` diff --git a/app/router/router.go b/app/router/router.go index accebaa..e742b79 100644 --- a/app/router/router.go +++ b/app/router/router.go @@ -256,6 +256,8 @@ func rInstitutionalManagement(r *gin.RouterGroup) { //制度管理 rEggEnergy.GET("/getVipSetting", egg_energy.GetEggEnergyVipSetting) rEggEnergy.POST("/addVipSetting", egg_energy.AddEggEnergyVipSetting) rEggEnergy.POST("/updateVipSetting", egg_energy.UpdateEggEnergyVipSetting) + rEggEnergy.GET("/coreData", egg_energy.GetEggEnergyCoreData) + rEggEnergy.POST("/coreData", egg_energy.UpdateEggEnergyCoreData) rEggEnergyUserCoin := rEggEnergy.Group("/userCoin") { rEggEnergyUserCoin.POST("/eggEnergyUserCoinList", egg_energy.GetEggEnergyUserCoinList) diff --git a/docs/docs.go b/docs/docs.go index 5a0bd0d..af1def6 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -1,5 +1,4 @@ -// Code generated by swaggo/swag. DO NOT EDIT. - +// Package docs Code generated by swaggo/swag. DO NOT EDIT package docs import "github.com/swaggo/swag" @@ -1609,9 +1608,7 @@ const docTemplate = `{ "name": "req", "in": "body", "required": true, - "schema": { - "type": "object" - } + "schema": {} } ], "responses": { @@ -3556,6 +3553,89 @@ const docTemplate = `{ } } }, + "/api/institutionalManagement/eggEnergy/coreData": { + "get": { + "description": "核心数据(获取)", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "蛋蛋能量" + ], + "summary": "制度中心-蛋蛋能量-核心数据(获取)", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "具体数据", + "schema": { + "$ref": "#/definitions/md.GetEggEnergyCoreDataResp" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + }, + "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.UpdateEggEnergyCoreDataReq" + } + } + ], + "responses": { + "200": { + "description": "修改数据条数", + "schema": { + "type": "int" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, "/api/institutionalManagement/eggEnergy/deleteVirtualCoin/{$id}": { "delete": { "description": "删除币种", @@ -12298,6 +12378,50 @@ const docTemplate = `{ } } }, + "md.GetEggEnergyCoreDataResp": { + "type": "object", + "properties": { + "community_dividends": { + "description": "社区分红", + "type": "string" + }, + "development_committee": { + "description": "发展委员会", + "type": "string" + }, + "id": { + "type": "integer" + }, + "marketplace_merchant_funds": { + "description": "市商资金", + "type": "string" + }, + "marketplace_merchant_nums": { + "description": "市商数量", + "type": "string" + }, + "now_energy_total_nums": { + "description": "现行总量", + "type": "string" + }, + "now_price": { + "description": "当前价格", + "type": "string" + }, + "planet_total_value": { + "description": "星球总价值", + "type": "string" + }, + "public_welfare_and_charity": { + "description": "公益慈善", + "type": "string" + }, + "star_level_dividends": { + "description": "星级分红", + "type": "string" + } + } + }, "md.GetEggEnergyVipSettingResp": { "type": "object", "properties": { @@ -15076,6 +15200,50 @@ const docTemplate = `{ } } }, + "md.UpdateEggEnergyCoreDataReq": { + "type": "object", + "properties": { + "community_dividends": { + "description": "社区分红", + "type": "string" + }, + "development_committee": { + "description": "发展委员会", + "type": "string" + }, + "id": { + "type": "integer" + }, + "marketplace_merchant_funds": { + "description": "市商资金", + "type": "string" + }, + "marketplace_merchant_nums": { + "description": "市商数量", + "type": "string" + }, + "now_energy_total_nums": { + "description": "现行总量", + "type": "string" + }, + "now_price": { + "description": "当前价格", + "type": "string" + }, + "planet_total_value": { + "description": "星球总价值", + "type": "string" + }, + "public_welfare_and_charity": { + "description": "公益慈善", + "type": "string" + }, + "star_level_dividends": { + "description": "星级分红", + "type": "string" + } + } + }, "md.UpdateEggEnergyVipSettingReq": { "type": "object", "properties": { @@ -16935,6 +17103,8 @@ var SwaggerInfo = &swag.Spec{ Description: "管理后台接口文档", InfoInstanceName: "swagger", SwaggerTemplate: docTemplate, + LeftDelim: "{{", + RightDelim: "}}", } func init() { diff --git a/docs/swagger.json b/docs/swagger.json index c04b1cd..6c38b4d 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -1601,9 +1601,7 @@ "name": "req", "in": "body", "required": true, - "schema": { - "type": "object" - } + "schema": {} } ], "responses": { @@ -3548,6 +3546,89 @@ } } }, + "/api/institutionalManagement/eggEnergy/coreData": { + "get": { + "description": "核心数据(获取)", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "蛋蛋能量" + ], + "summary": "制度中心-蛋蛋能量-核心数据(获取)", + "parameters": [ + { + "type": "string", + "description": "验证参数Bearer和token空格拼接", + "name": "Authorization", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "具体数据", + "schema": { + "$ref": "#/definitions/md.GetEggEnergyCoreDataResp" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + }, + "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.UpdateEggEnergyCoreDataReq" + } + } + ], + "responses": { + "200": { + "description": "修改数据条数", + "schema": { + "type": "int" + } + }, + "400": { + "description": "具体错误", + "schema": { + "$ref": "#/definitions/md.Response" + } + } + } + } + }, "/api/institutionalManagement/eggEnergy/deleteVirtualCoin/{$id}": { "delete": { "description": "删除币种", @@ -12290,6 +12371,50 @@ } } }, + "md.GetEggEnergyCoreDataResp": { + "type": "object", + "properties": { + "community_dividends": { + "description": "社区分红", + "type": "string" + }, + "development_committee": { + "description": "发展委员会", + "type": "string" + }, + "id": { + "type": "integer" + }, + "marketplace_merchant_funds": { + "description": "市商资金", + "type": "string" + }, + "marketplace_merchant_nums": { + "description": "市商数量", + "type": "string" + }, + "now_energy_total_nums": { + "description": "现行总量", + "type": "string" + }, + "now_price": { + "description": "当前价格", + "type": "string" + }, + "planet_total_value": { + "description": "星球总价值", + "type": "string" + }, + "public_welfare_and_charity": { + "description": "公益慈善", + "type": "string" + }, + "star_level_dividends": { + "description": "星级分红", + "type": "string" + } + } + }, "md.GetEggEnergyVipSettingResp": { "type": "object", "properties": { @@ -15068,6 +15193,50 @@ } } }, + "md.UpdateEggEnergyCoreDataReq": { + "type": "object", + "properties": { + "community_dividends": { + "description": "社区分红", + "type": "string" + }, + "development_committee": { + "description": "发展委员会", + "type": "string" + }, + "id": { + "type": "integer" + }, + "marketplace_merchant_funds": { + "description": "市商资金", + "type": "string" + }, + "marketplace_merchant_nums": { + "description": "市商数量", + "type": "string" + }, + "now_energy_total_nums": { + "description": "现行总量", + "type": "string" + }, + "now_price": { + "description": "当前价格", + "type": "string" + }, + "planet_total_value": { + "description": "星球总价值", + "type": "string" + }, + "public_welfare_and_charity": { + "description": "公益慈善", + "type": "string" + }, + "star_level_dividends": { + "description": "星级分红", + "type": "string" + } + } + }, "md.UpdateEggEnergyVipSettingReq": { "type": "object", "properties": { diff --git a/docs/swagger.yaml b/docs/swagger.yaml index c7b9d70..818dee9 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -2099,6 +2099,38 @@ definitions: - $ref: '#/definitions/md.VideoRewardSetting' description: 视频奖励 type: object + md.GetEggEnergyCoreDataResp: + properties: + community_dividends: + description: 社区分红 + type: string + development_committee: + description: 发展委员会 + type: string + id: + type: integer + marketplace_merchant_funds: + description: 市商资金 + type: string + marketplace_merchant_nums: + description: 市商数量 + type: string + now_energy_total_nums: + description: 现行总量 + type: string + now_price: + description: 当前价格 + type: string + planet_total_value: + description: 星球总价值 + type: string + public_welfare_and_charity: + description: 公益慈善 + type: string + star_level_dividends: + description: 星级分红 + type: string + type: object md.GetEggEnergyVipSettingResp: properties: level_list: @@ -4038,6 +4070,38 @@ definitions: - $ref: '#/definitions/md.VideoRewardSetting' description: 视频奖励 type: object + md.UpdateEggEnergyCoreDataReq: + properties: + community_dividends: + description: 社区分红 + type: string + development_committee: + description: 发展委员会 + type: string + id: + type: integer + marketplace_merchant_funds: + description: 市商资金 + type: string + marketplace_merchant_nums: + description: 市商数量 + type: string + now_energy_total_nums: + description: 现行总量 + type: string + now_price: + description: 当前价格 + type: string + planet_total_value: + description: 星球总价值 + type: string + public_welfare_and_charity: + description: 公益慈善 + type: string + star_level_dividends: + description: 星级分红 + type: string + type: object md.UpdateEggEnergyVipSettingReq: properties: list: @@ -6367,8 +6431,7 @@ paths: in: body name: req required: true - schema: - type: object + schema: {} produces: - application/json responses: @@ -7655,6 +7718,61 @@ paths: summary: 制度中心-蛋蛋能量-贡献值-基础设置(更新) tags: - 贡献值 + /api/institutionalManagement/eggEnergy/coreData: + get: + consumes: + - application/json + description: 核心数据(获取) + parameters: + - description: 验证参数Bearer和token空格拼接 + in: header + name: Authorization + required: true + type: string + produces: + - application/json + responses: + "200": + description: 具体数据 + schema: + $ref: '#/definitions/md.GetEggEnergyCoreDataResp' + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 制度中心-蛋蛋能量-核心数据(获取) + tags: + - 蛋蛋能量 + 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.UpdateEggEnergyCoreDataReq' + produces: + - application/json + responses: + "200": + description: 修改数据条数 + schema: + type: int + "400": + description: 具体错误 + schema: + $ref: '#/definitions/md.Response' + summary: 制度中心-蛋蛋能量-核心数据(更新) + tags: + - 蛋蛋能量 /api/institutionalManagement/eggEnergy/deleteVirtualCoin/{$id}: delete: consumes: From d5b2c2c60f143d5bfb44e8fe29f2e3f0dbfd0064 Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Fri, 13 Dec 2024 19:15:32 +0800 Subject: [PATCH 2/9] update --- .../egg_energy/hdl_basic.go | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/app/hdl/institutional_management/egg_energy/hdl_basic.go b/app/hdl/institutional_management/egg_energy/hdl_basic.go index 3b06e67..71be716 100644 --- a/app/hdl/institutional_management/egg_energy/hdl_basic.go +++ b/app/hdl/institutional_management/egg_energy/hdl_basic.go @@ -1,14 +1,17 @@ package egg_energy import ( + "applet/app/cfg" "applet/app/db" "applet/app/e" md "applet/app/md/institutional_management/egg_energy" "applet/app/utils" "code.fnuoos.com/EggPlanet/egg_models.git/src/implement" "code.fnuoos.com/EggPlanet/egg_models.git/src/model" + rule "code.fnuoos.com/EggPlanet/egg_system_rules.git" "code.fnuoos.com/EggPlanet/egg_system_rules.git/rule/egg_energy/enum" md2 "code.fnuoos.com/EggPlanet/egg_system_rules.git/rule/egg_energy/md" + "code.fnuoos.com/EggPlanet/egg_system_rules.git/rule/egg_energy/svc" "errors" "fmt" "github.com/gin-gonic/gin" @@ -524,8 +527,18 @@ func UpdateEggEnergyCoreData(c *gin.Context) { return } - coreDataDb := implement.NewEggEnergyCoreDataDb(db.Db) - session := db.Db.NewSession() + engine := db.Db + coreDataDb := implement.NewEggEnergyCoreDataDb(engine) + rule.Init(cfg.RedisAddr) + _, cb, err := svc.GetEggEnergyCoreData(engine) + if err != nil { + return + } + if cb != nil { + defer cb() // 释放锁 + } + + session := engine.NewSession() defer session.Close() m := model.EggEnergyCoreData{ From 61c2cc198c29d3e6e56b2f2214feb324009c5056 Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Fri, 13 Dec 2024 20:25:29 +0800 Subject: [PATCH 3/9] update --- app/hdl/member_center/hdl_tag__management.go | 4 +--- app/md/member_center/md_tag_management.go | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/hdl/member_center/hdl_tag__management.go b/app/hdl/member_center/hdl_tag__management.go index e5f9ce0..8a024aa 100644 --- a/app/hdl/member_center/hdl_tag__management.go +++ b/app/hdl/member_center/hdl_tag__management.go @@ -68,9 +68,7 @@ func AddTag(c *gin.Context) { TagName: req.Name, Memo: req.Memo, CreateAt: time.Now().Format("2006-01-02 15:04:05"), - } - if req.IsPunish == "1" { - tag.IsPunish = 1 + IsPunish: req.IsPunish, } tagDb := implement.NewUserTagDb(db.Db) tagID, err := tagDb.UserTagInsert(&tag) diff --git a/app/md/member_center/md_tag_management.go b/app/md/member_center/md_tag_management.go index aa81633..bdb4bdd 100644 --- a/app/md/member_center/md_tag_management.go +++ b/app/md/member_center/md_tag_management.go @@ -17,7 +17,7 @@ type GetTagListResp struct { type AddTagReq struct { Name string `json:"name,required"` // 标签名称 Memo string `json:"memo,required"` // 备注 - IsPunish string `json:"is_punish,required"` // 是否为处罚标签(0:否 1:是) + IsPunish int `json:"is_punish,required"` // 是否为处罚标签(0:否 1:是) } type UpdateTagReq struct { From 7c0257ae53647c62b5f7574f3bce703ef0138109 Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Fri, 13 Dec 2024 21:49:08 +0800 Subject: [PATCH 4/9] update --- .../institutional_management/egg_energy/hdl_basic.go | 2 ++ app/md/institutional_management/egg_energy/md_basic.go | 10 ++++++---- docs/docs.go | 10 +++++++++- docs/swagger.json | 10 +++++++++- docs/swagger.yaml | 8 +++++++- go.mod | 2 +- 6 files changed, 34 insertions(+), 8 deletions(-) diff --git a/app/hdl/institutional_management/egg_energy/hdl_basic.go b/app/hdl/institutional_management/egg_energy/hdl_basic.go index 71be716..99d09ba 100644 --- a/app/hdl/institutional_management/egg_energy/hdl_basic.go +++ b/app/hdl/institutional_management/egg_energy/hdl_basic.go @@ -238,6 +238,7 @@ func GetEggEnergyBasic(c *gin.Context) { RewardSystem: rewardSystem, NewUserIncentiveRules: newUserRewardRules, SystemID: basicSettings.Id, + SettlementQuantity: basicSettings.SettlementQuantity, } e.OutSuc(c, resp, nil) @@ -292,6 +293,7 @@ func UpdateEggEnergyBasic(c *gin.Context) { RewardSystem: rewardSystemStr, NewUserIncentiveRules: newUserIncentiveRulesStr, TotalTeamDividends: req.DataSetting.TotalTeamDividends, + SettlementQuantity: req.SettlementQuantity, } forceColums := []string{"is_open", "video_reward_is_open"} diff --git a/app/md/institutional_management/egg_energy/md_basic.go b/app/md/institutional_management/egg_energy/md_basic.go index f420e83..39ab719 100644 --- a/app/md/institutional_management/egg_energy/md_basic.go +++ b/app/md/institutional_management/egg_energy/md_basic.go @@ -10,9 +10,9 @@ const ( type VirtualCoin struct { Id int `json:"id" ` - Name string `json:"name" ` // 名称 + Name string `json:"name" ` // 名称 ExchangeRatio string `json:"exchange_ratio" example:"兑换比例(与金额)"` // 兑换比例(与金额) - IsUse int `json:"is_use" ` // 是否开启: 0否 1是 + IsUse int `json:"is_use" ` // 是否开启: 0否 1是 CreateAt string `json:"create_at" ` UpdateAt string `json:"update_at" ` } @@ -37,7 +37,7 @@ type VideoRewardSetting struct { type DataSetting struct { TotalIssuanceAmount string `json:"total_issuance_amount" example:"总发行量"` // 总发行量 TotalTechnologyTeam string `json:"total_technology_team" example:"技术团队"` // 技术团队 - TotalAngelInvestor string `json:"total_angel_investor" example:"天使投资人"` // 天使投资人 + TotalAngelInvestor string `json:"total_angel_investor" example:"天使投资人"` // 天使投资人 TotalOperateFund string `json:"total_operate_fund" example:"运营资金"` // 运营资金 TotalEcologicalDevelopment string `json:"total_ecological_development" example:"当前价格"` // 生态建设 TotalTeamDividends string `json:"total_team_dividends" example:"团队分红"` // 团队分红 @@ -55,6 +55,7 @@ type GetEggEnergyBasicResp struct { RewardSystem []md.RewardSystemStruct `json:"reward_system"` // 圈层奖励 NewUserIncentiveRules md.NewUserRewardRules `json:"new_user_incentive_rules"` // 新用户奖励规则 SystemID int `json:"system_id"` // 该设置系统 ID + SettlementQuantity int `json:"settlement_quantity"` // 结算数量(百分比) } type UpdateEggEnergyBasicReq struct { @@ -67,6 +68,7 @@ type UpdateEggEnergyBasicReq struct { ExchangeRules md.ExchangeRulesStruct `json:"exchange_rules"` // 兑换规则 RewardSystem []md.RewardSystemStruct `json:"reward_system"` // 圈层奖励 NewUserIncentiveRules md.NewUserRewardRules `json:"new_user_incentive_rules"` // 新用户奖励规则 // 新用户奖励规则 + SettlementQuantity int `json:"settlement_quantity"` // 结算数量(百分比) } type AddVirtualCoinNode struct { @@ -123,7 +125,7 @@ type GetEggCoreDataListResp struct { PlanetTotalValue string `json:"planet_total_value" example:"星球价值"` // 星球价值 NowPrice string `json:"now_price" example:"当前价格"` // 当前价格 NowEnergyTotalNums string `json:"now_energy_total_nums" example:"现行总量"` // 现行总量 - UserHoldTotalNums string `json:"user_hold_total_nums"` // 用户持有总量 + UserHoldTotalNums string `json:"user_hold_total_nums"` // 用户持有总量 } type GetEggEnergyCoreDataResp struct { diff --git a/docs/docs.go b/docs/docs.go index af1def6..6d6a6b5 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -10056,7 +10056,7 @@ const docTemplate = `{ "properties": { "is_punish": { "description": "是否为处罚标签(0:否 1:是)", - "type": "string" + "type": "integer" }, "memo": { "description": "备注", @@ -12364,6 +12364,10 @@ const docTemplate = `{ "$ref": "#/definitions/md.RewardSystemStruct" } }, + "settlement_quantity": { + "description": "结算数量(百分比)", + "type": "integer" + }, "system_id": { "description": "该设置系统 ID", "type": "integer" @@ -15186,6 +15190,10 @@ const docTemplate = `{ "$ref": "#/definitions/md.RewardSystemStruct" } }, + "settlement_quantity": { + "description": "结算数量(百分比)", + "type": "integer" + }, "system_id": { "description": "该设置系统 ID", "type": "integer" diff --git a/docs/swagger.json b/docs/swagger.json index 6c38b4d..2164428 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -10049,7 +10049,7 @@ "properties": { "is_punish": { "description": "是否为处罚标签(0:否 1:是)", - "type": "string" + "type": "integer" }, "memo": { "description": "备注", @@ -12357,6 +12357,10 @@ "$ref": "#/definitions/md.RewardSystemStruct" } }, + "settlement_quantity": { + "description": "结算数量(百分比)", + "type": "integer" + }, "system_id": { "description": "该设置系统 ID", "type": "integer" @@ -15179,6 +15183,10 @@ "$ref": "#/definitions/md.RewardSystemStruct" } }, + "settlement_quantity": { + "description": "结算数量(百分比)", + "type": "integer" + }, "system_id": { "description": "该设置系统 ID", "type": "integer" diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 818dee9..0357ded 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -510,7 +510,7 @@ definitions: properties: is_punish: description: 是否为处罚标签(0:否 1:是) - type: string + type: integer memo: description: 备注 type: string @@ -2091,6 +2091,9 @@ definitions: items: $ref: '#/definitions/md.RewardSystemStruct' type: array + settlement_quantity: + description: 结算数量(百分比) + type: integer system_id: description: 该设置系统 ID type: integer @@ -4062,6 +4065,9 @@ definitions: items: $ref: '#/definitions/md.RewardSystemStruct' type: array + settlement_quantity: + description: 结算数量(百分比) + type: integer system_id: description: 该设置系统 ID type: integer diff --git a/go.mod b/go.mod index f887ff0..138ab8f 100644 --- a/go.mod +++ b/go.mod @@ -33,7 +33,7 @@ require ( ) require ( - code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241213070558-a1f0ce782dff + code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241213133441-2deb4b1095b4 code.fnuoos.com/EggPlanet/egg_system_rules.git v0.0.4-0.20241212140020-c99f60b4f868 code.fnuoos.com/go_rely_warehouse/zyos_go_es.git v1.0.1-0.20241118083738-0f22da9ba0be code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git v0.0.5 From eae86920dca43bff8a922bed4fc113818e473dc1 Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Fri, 13 Dec 2024 21:56:53 +0800 Subject: [PATCH 5/9] update --- .../institutional_management/egg_energy/hdl_basic.go | 2 +- .../egg_energy/hdl_user_coin.go | 8 ++++---- app/md/institutional_management/egg_energy/md_basic.go | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/hdl/institutional_management/egg_energy/hdl_basic.go b/app/hdl/institutional_management/egg_energy/hdl_basic.go index 99d09ba..5a5d4d1 100644 --- a/app/hdl/institutional_management/egg_energy/hdl_basic.go +++ b/app/hdl/institutional_management/egg_energy/hdl_basic.go @@ -293,7 +293,7 @@ func UpdateEggEnergyBasic(c *gin.Context) { RewardSystem: rewardSystemStr, NewUserIncentiveRules: newUserIncentiveRulesStr, TotalTeamDividends: req.DataSetting.TotalTeamDividends, - SettlementQuantity: req.SettlementQuantity, + SettlementQuantity: utils.StrToInt(req.SettlementQuantity), } forceColums := []string{"is_open", "video_reward_is_open"} diff --git a/app/hdl/institutional_management/egg_energy/hdl_user_coin.go b/app/hdl/institutional_management/egg_energy/hdl_user_coin.go index cf91109..4544a57 100644 --- a/app/hdl/institutional_management/egg_energy/hdl_user_coin.go +++ b/app/hdl/institutional_management/egg_energy/hdl_user_coin.go @@ -47,12 +47,12 @@ func GetEggEnergyUserCoinList(c *gin.Context) { kind1 := md.VirtualCoinListNode{ Kind: 1, CoinID: eggEnergyBasicSetting.PersonEggEnergyCoinId, - Name: "个人蛋蛋能量", + Name: "个人能量值", } kind2 := md.VirtualCoinListNode{ Kind: 2, CoinID: eggEnergyBasicSetting.TeamEggEnergyCoinId, - Name: "团队蛋蛋能量", + Name: "团队能量值", } kindList[0] = kind1 kindList[1] = kind2 @@ -215,12 +215,12 @@ func GetEggPointsUserCoinList(c *gin.Context) { kind1 := md.VirtualCoinListNode{ Kind: 1, CoinID: eggEnergyBasicSetting.PersonEggPointsCoinId, - Name: "个人蛋蛋积分", + Name: "个人活跃值", } kind2 := md.VirtualCoinListNode{ Kind: 2, CoinID: eggEnergyBasicSetting.TeamEggPointsCoinId, - Name: "团队蛋蛋积分", + Name: "团队活跃值", } kindList[0] = kind1 kindList[1] = kind2 diff --git a/app/md/institutional_management/egg_energy/md_basic.go b/app/md/institutional_management/egg_energy/md_basic.go index 39ab719..edd0290 100644 --- a/app/md/institutional_management/egg_energy/md_basic.go +++ b/app/md/institutional_management/egg_energy/md_basic.go @@ -10,9 +10,9 @@ const ( type VirtualCoin struct { Id int `json:"id" ` - Name string `json:"name" ` // 名称 + Name string `json:"name" ` // 名称 ExchangeRatio string `json:"exchange_ratio" example:"兑换比例(与金额)"` // 兑换比例(与金额) - IsUse int `json:"is_use" ` // 是否开启: 0否 1是 + IsUse int `json:"is_use" ` // 是否开启: 0否 1是 CreateAt string `json:"create_at" ` UpdateAt string `json:"update_at" ` } @@ -37,7 +37,7 @@ type VideoRewardSetting struct { type DataSetting struct { TotalIssuanceAmount string `json:"total_issuance_amount" example:"总发行量"` // 总发行量 TotalTechnologyTeam string `json:"total_technology_team" example:"技术团队"` // 技术团队 - TotalAngelInvestor string `json:"total_angel_investor" example:"天使投资人"` // 天使投资人 + TotalAngelInvestor string `json:"total_angel_investor" example:"天使投资人"` // 天使投资人 TotalOperateFund string `json:"total_operate_fund" example:"运营资金"` // 运营资金 TotalEcologicalDevelopment string `json:"total_ecological_development" example:"当前价格"` // 生态建设 TotalTeamDividends string `json:"total_team_dividends" example:"团队分红"` // 团队分红 @@ -68,7 +68,7 @@ type UpdateEggEnergyBasicReq struct { ExchangeRules md.ExchangeRulesStruct `json:"exchange_rules"` // 兑换规则 RewardSystem []md.RewardSystemStruct `json:"reward_system"` // 圈层奖励 NewUserIncentiveRules md.NewUserRewardRules `json:"new_user_incentive_rules"` // 新用户奖励规则 // 新用户奖励规则 - SettlementQuantity int `json:"settlement_quantity"` // 结算数量(百分比) + SettlementQuantity string `json:"settlement_quantity"` // 结算数量(百分比) } type AddVirtualCoinNode struct { @@ -125,7 +125,7 @@ type GetEggCoreDataListResp struct { PlanetTotalValue string `json:"planet_total_value" example:"星球价值"` // 星球价值 NowPrice string `json:"now_price" example:"当前价格"` // 当前价格 NowEnergyTotalNums string `json:"now_energy_total_nums" example:"现行总量"` // 现行总量 - UserHoldTotalNums string `json:"user_hold_total_nums"` // 用户持有总量 + UserHoldTotalNums string `json:"user_hold_total_nums"` // 用户持有总量 } type GetEggEnergyCoreDataResp struct { From c21c5df1a69dc0da6fc20e68d863e1883934e778 Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Fri, 13 Dec 2024 22:08:13 +0800 Subject: [PATCH 6/9] update --- docs/docs.go | 2 +- docs/swagger.json | 2 +- docs/swagger.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/docs.go b/docs/docs.go index 6d6a6b5..860019c 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -15192,7 +15192,7 @@ const docTemplate = `{ }, "settlement_quantity": { "description": "结算数量(百分比)", - "type": "integer" + "type": "string" }, "system_id": { "description": "该设置系统 ID", diff --git a/docs/swagger.json b/docs/swagger.json index 2164428..d32f53a 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -15185,7 +15185,7 @@ }, "settlement_quantity": { "description": "结算数量(百分比)", - "type": "integer" + "type": "string" }, "system_id": { "description": "该设置系统 ID", diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 0357ded..05fea96 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -4067,7 +4067,7 @@ definitions: type: array settlement_quantity: description: 结算数量(百分比) - type: integer + type: string system_id: description: 该设置系统 ID type: integer From c0dc47389bf17e1dda7843782aa00c97a62b11bd Mon Sep 17 00:00:00 2001 From: dengbiao Date: Sat, 14 Dec 2024 15:13:15 +0800 Subject: [PATCH 7/9] 123 --- go.mod | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 138ab8f..fde97b2 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/go-playground/universal-translator v0.18.1 github.com/go-playground/validator/v10 v10.20.0 github.com/go-redis/redis v6.15.9+incompatible - github.com/gomodule/redigo v2.0.0+incompatible + github.com/gomodule/redigo v1.9.2 github.com/jinzhu/copier v0.4.0 github.com/makiuchi-d/gozxing v0.0.0-20210324052758-57132e828831 github.com/qiniu/api.v7/v7 v7.8.2 @@ -33,8 +33,8 @@ require ( ) require ( - code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241213133441-2deb4b1095b4 - code.fnuoos.com/EggPlanet/egg_system_rules.git v0.0.4-0.20241212140020-c99f60b4f868 + code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241214062221-cde2ce240fa8 + code.fnuoos.com/EggPlanet/egg_system_rules.git v0.0.4-0.20241214064241-afe361162281 code.fnuoos.com/go_rely_warehouse/zyos_go_es.git v1.0.1-0.20241118083738-0f22da9ba0be code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git v0.0.5 github.com/360EntSecGroup-Skylar/excelize v1.4.1 @@ -44,7 +44,6 @@ require ( github.com/alibabacloud-go/tea v1.2.2 github.com/alibabacloud-go/tea-utils/v2 v2.0.6 github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible - github.com/gin-contrib/sessions v1.0.1 github.com/go-pay/gopay v1.5.98 github.com/go-sql-driver/mysql v1.8.1 github.com/gocolly/colly v1.2.0 From bf7b8fe55e41681c48b557801be12cad08843145 Mon Sep 17 00:00:00 2001 From: dengbiao Date: Sat, 14 Dec 2024 15:59:06 +0800 Subject: [PATCH 8/9] update --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index fde97b2..76fabb1 100644 --- a/go.mod +++ b/go.mod @@ -34,7 +34,7 @@ require ( require ( code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241214062221-cde2ce240fa8 - code.fnuoos.com/EggPlanet/egg_system_rules.git v0.0.4-0.20241214064241-afe361162281 + code.fnuoos.com/EggPlanet/egg_system_rules.git v0.0.4-0.20241214075617-9e3855ecf0c0 code.fnuoos.com/go_rely_warehouse/zyos_go_es.git v1.0.1-0.20241118083738-0f22da9ba0be code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git v0.0.5 github.com/360EntSecGroup-Skylar/excelize v1.4.1 From 47350a20467781f77aedcfa855181e41b5ff6911 Mon Sep 17 00:00:00 2001 From: dengbiao Date: Sat, 14 Dec 2024 16:18:24 +0800 Subject: [PATCH 9/9] update --- app/hdl/institutional_management/egg_energy/hdl_basic.go | 1 + app/md/institutional_management/egg_energy/md_basic.go | 1 + 2 files changed, 2 insertions(+) diff --git a/app/hdl/institutional_management/egg_energy/hdl_basic.go b/app/hdl/institutional_management/egg_energy/hdl_basic.go index 5a5d4d1..71f93bf 100644 --- a/app/hdl/institutional_management/egg_energy/hdl_basic.go +++ b/app/hdl/institutional_management/egg_energy/hdl_basic.go @@ -507,6 +507,7 @@ func GetEggEnergyCoreData(c *gin.Context) { PublicWelfareAndCharity: coreData.PublicWelfareAndCharity, StarLevelDividends: coreData.StarLevelDividends, CommunityDividends: coreData.CommunityDividends, + DestructionQuantityNums: coreData.DestructionQuantityNums, } e.OutSuc(c, resp, nil) } diff --git a/app/md/institutional_management/egg_energy/md_basic.go b/app/md/institutional_management/egg_energy/md_basic.go index edd0290..58ece3e 100644 --- a/app/md/institutional_management/egg_energy/md_basic.go +++ b/app/md/institutional_management/egg_energy/md_basic.go @@ -139,6 +139,7 @@ type GetEggEnergyCoreDataResp struct { PublicWelfareAndCharity string `json:"public_welfare_and_charity"` // 公益慈善 StarLevelDividends string `json:"star_level_dividends"` // 星级分红 CommunityDividends string `json:"community_dividends"` // 社区分红 + DestructionQuantityNums string `json:"destruction_quantity_nums"` // 销毁数量 } type UpdateEggEnergyCoreDataReq struct {