@@ -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 蛋蛋能量 | |||
@@ -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"` | |||
@@ -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) | |||
@@ -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() { | |||
@@ -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": { | |||
@@ -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: | |||