@@ -1,13 +1,31 @@ | |||
package egg_energy | |||
import ( | |||
"applet/app/db" | |||
"applet/app/e" | |||
md "applet/app/md/institutional_management/egg_energy" | |||
"code.fnuoos.com/EggPlanet/egg_models.git/src/implement" | |||
"code.fnuoos.com/EggPlanet/egg_system_rules.git/rule/egg_energy/enum" | |||
"fmt" | |||
"github.com/gin-gonic/gin" | |||
) | |||
// DynamicDataFlowList | |||
// @Summary 制度中心-动态数据-动态数据流水(获取) | |||
// @Tags 公排管理 | |||
// @Description 动态数据流水(获取) | |||
// @Accept json | |||
// @Produce json | |||
// @param Authorization header string true "验证参数Bearer和token空格拼接" | |||
// @Param req body md.DynamicDataFlowListReq true "页数、每页大小必传 起止时间、持有类型选传" | |||
// @Success 200 {object} md.DynamicDataFlowListResp "成功返回" | |||
// @Failure 400 {object} md.Response "具体错误" | |||
// @Router /api/institutionalManagement/eggEnergy/availableEnergy/list [post] | |||
func DynamicDataFlowList(c *gin.Context) { | |||
var req *md.DynamicDataFlowListReq | |||
if err1 := c.ShouldBindJSON(&req); err1 != nil { | |||
e.OutErr(c, e.ERR_INVALID_ARGS, err1.Error()) | |||
return | |||
} | |||
var kindList = []map[string]interface{}{ | |||
{ | |||
@@ -48,6 +66,52 @@ func DynamicDataFlowList(c *gin.Context) { | |||
}, | |||
} | |||
fmt.Println(kindList) | |||
e.OutSuc(c, kindList, nil) | |||
energyFlowDb := implement.NewEggEnergyAvailableEnergyFlowDb(db.Db) | |||
flows, total, err := energyFlowDb.EggEnergyAvailableEnergyFlowFindAndCount(req.Kind, req.Page, req.PageSize, req.StartAt, req.EndAt) | |||
if err != nil { | |||
e.OutErr(c, e.ERR_DB_ORM, err.Error()) | |||
return | |||
} | |||
list := make([]md.EggEnergyAvailableEnergyFlow, len(flows)) | |||
for i, flow := range flows { | |||
list[i] = md.EggEnergyAvailableEnergyFlow{ | |||
Id: flow.Id, | |||
Kind: flow.Kind, | |||
Title: flow.Title, | |||
BeforePrice: flow.BeforePrice, | |||
AfterPrice: flow.AfterPrice, | |||
Amount: flow.Amount, | |||
BeforeNowEnergyTotalNums: flow.BeforeNowEnergyTotalNums, | |||
AfterNowEnergyTotalNums: flow.AfterNowEnergyTotalNums, | |||
AfterPlanetTotalValue: flow.AfterPlanetTotalValue, | |||
BeforePlanetTotalValue: flow.BeforePlanetTotalValue, | |||
BeforeMarketplaceMerchantValues: flow.BeforeMarketplaceMerchantValues, | |||
AfterMarketplaceMerchantValues: flow.AfterMarketplaceMerchantValues, | |||
BeforeMarketplaceMerchantFundValues: flow.BeforeMarketplaceMerchantFundValues, | |||
AfterMarketplaceMerchantFundValues: flow.AfterMarketplaceMerchantFundValues, | |||
BeforeDevelopmentCommitteeValues: flow.BeforeDevelopmentCommitteeValues, | |||
AfterDevelopmentCommitteeValues: flow.AfterDevelopmentCommitteeValues, | |||
BeforePublicWelfareAndCharityValues: flow.BeforePublicWelfareAndCharityValues, | |||
AfterPublicWelfareAndCharityValues: flow.AfterPublicWelfareAndCharityValues, | |||
BeforeStarLevelDividendsValues: flow.BeforeStarLevelDividendsValues, | |||
AfterStarLevelDividendsValues: flow.AfterStarLevelDividendsValues, | |||
BeforeDestructionQuantityValues: flow.BeforeDestructionQuantityValues, | |||
AfterDestructionQuantityValues: flow.AfterDestructionQuantityValues, | |||
BeforeCommunityDividends: flow.BeforeCommunityDividends, | |||
AfterCommunityDividends: flow.AfterCommunityDividends, | |||
CreateTime: flow.CreateTime, | |||
} | |||
} | |||
resp := md.DynamicDataFlowListResp{ | |||
KindList: kindList, | |||
List: list, | |||
Paginate: md.Paginate{ | |||
Limit: req.PageSize, | |||
Page: req.Page, | |||
Total: total, | |||
}, | |||
} | |||
e.OutSuc(c, resp, nil) | |||
} |
@@ -0,0 +1,43 @@ | |||
package md | |||
type DynamicDataFlowListReq struct { | |||
Kind int `json:"kind"` // 持有类型 | |||
Page int `json:"page,required"` // 页数 | |||
PageSize int `json:"page_size,required"` // 每页大小 | |||
StartAt string `json:"start_at" example:"开始时间"` // 开始时间 | |||
EndAt string `json:"end_at" example:"结束时间"` // 结束时间 | |||
} | |||
type EggEnergyAvailableEnergyFlow struct { | |||
Id int64 `json:"id"` | |||
Kind int `json:"kind"` | |||
Title string `json:"title"` | |||
BeforePrice string `json:"before_price"` | |||
AfterPrice string `json:"after_price"` | |||
Amount string `json:"amount"` | |||
BeforeNowEnergyTotalNums string `json:"before_now_energy_total_nums"` | |||
AfterNowEnergyTotalNums string `json:"after_now_energy_total_nums"` | |||
AfterPlanetTotalValue string `json:"after_planet_total_value"` | |||
BeforePlanetTotalValue string `json:"before_planet_total_value"` | |||
BeforeMarketplaceMerchantValues string `json:"before_marketplace_merchant_values"` | |||
AfterMarketplaceMerchantValues string `json:"after_marketplace_merchant_values"` | |||
BeforeMarketplaceMerchantFundValues string `json:"before_marketplace_merchant_fund_values"` | |||
AfterMarketplaceMerchantFundValues string `json:"after_marketplace_merchant_fund_values"` | |||
BeforeDevelopmentCommitteeValues string `json:"before_development_committee_values"` | |||
AfterDevelopmentCommitteeValues string `json:"after_development_committee_values"` | |||
BeforePublicWelfareAndCharityValues string `json:"before_public_welfare_and_charity_values"` | |||
AfterPublicWelfareAndCharityValues string `json:"after_public_welfare_and_charity_values"` | |||
BeforeStarLevelDividendsValues string `json:"before_star_level_dividends_values"` | |||
AfterStarLevelDividendsValues string `json:"after_star_level_dividends_values"` | |||
BeforeDestructionQuantityValues string `json:"before_destruction_quantity_values"` | |||
AfterDestructionQuantityValues string `json:"after_destruction_quantity_values"` | |||
BeforeCommunityDividends string `json:"before_community_dividends"` | |||
AfterCommunityDividends string `json:"after_community_dividends"` | |||
CreateTime string `json:"create_time"` | |||
} | |||
type DynamicDataFlowListResp struct { | |||
KindList []map[string]interface{} `json:"kind_list"` | |||
List []EggEnergyAvailableEnergyFlow `json:"list"` | |||
Paginate Paginate `json:"paginate"` | |||
} |
@@ -91,13 +91,13 @@ type GetGreenEnergyUserCoinListResp struct { | |||
} | |||
type GetGreenEnergyUserCoinFlowListReq struct { | |||
CoinId int `json:"coin_id"` // 货币类型 ID | |||
Direction int `json:"direction"` // 流水方向:1收入 2支出 | |||
StartAt string `json:"start_at"` // 开始时间 | |||
EndAt string `json:"end_at"` // 结束时间 | |||
Page int `json:"page"` // 页数 | |||
PageSize int `json:"page_size"` // 每页大小 | |||
Uid int64 `json:"uid"` // 用户 ID | |||
CoinId int `json:"coin_id,required"` // 货币类型 ID | |||
Direction int `json:"direction"` // 流水方向:1收入 2支出 | |||
StartAt string `json:"start_at"` // 开始时间 | |||
EndAt string `json:"end_at"` // 结束时间 | |||
Page int `json:"page,required"` // 页数 | |||
PageSize int `json:"page_size,required"` // 每页大小 | |||
Uid int64 `json:"uid,required"` // 用户 ID | |||
} | |||
type GetGreenEnergyUserCoinFlowListResp struct { |
@@ -95,7 +95,7 @@ func rInstitutionalManagement(r *gin.RouterGroup) { //制度管理 | |||
rEggEnergyUserCoin.POST("/greenEnergyUserCoinList", egg_energy.GetGreenEnergyUserCoinList) | |||
rEggEnergyUserCoin.POST("/greenEnergyUserCoinFlowList", egg_energy.GetGreenEnergyUserCoinFlowList) | |||
} | |||
rEggEnergyAvailableEnergy := rPublicPlatoon.Group("/availableEnergy") | |||
rEggEnergyAvailableEnergy := rEggEnergy.Group("/availableEnergy") | |||
{ | |||
rEggEnergyAvailableEnergy.POST("/list", egg_energy.DynamicDataFlowList) | |||
} | |||
@@ -63,6 +63,53 @@ const docTemplate = `{ | |||
} | |||
} | |||
}, | |||
"/api/institutionalManagement/availableEnergy/list": { | |||
"post": { | |||
"description": "动态数据流水(获取)", | |||
"consumes": [ | |||
"application/json" | |||
], | |||
"produces": [ | |||
"application/json" | |||
], | |||
"tags": [ | |||
"公排管理" | |||
], | |||
"summary": "制度中心-动态数据-动态数据流水(获取)", | |||
"parameters": [ | |||
{ | |||
"type": "string", | |||
"description": "验证参数Bearer和token空格拼接", | |||
"name": "Authorization", | |||
"in": "header", | |||
"required": true | |||
}, | |||
{ | |||
"description": "页数、每页大小必传 起止时间、持有类型选传", | |||
"name": "req", | |||
"in": "body", | |||
"required": true, | |||
"schema": { | |||
"$ref": "#/definitions/md.DynamicDataFlowListReq" | |||
} | |||
} | |||
], | |||
"responses": { | |||
"200": { | |||
"description": "成功返回", | |||
"schema": { | |||
"$ref": "#/definitions/md.DynamicDataFlowListResp" | |||
} | |||
}, | |||
"400": { | |||
"description": "具体错误", | |||
"schema": { | |||
"$ref": "#/definitions/md.Response" | |||
} | |||
} | |||
} | |||
} | |||
}, | |||
"/api/institutionalManagement/eggEnergy/userCoin/activePointsUserCoinFlowList": { | |||
"post": { | |||
"description": "活跃积分持有流水(查询)", | |||
@@ -1036,6 +1083,135 @@ const docTemplate = `{ | |||
} | |||
} | |||
}, | |||
"md.DynamicDataFlowListReq": { | |||
"type": "object", | |||
"properties": { | |||
"end_at": { | |||
"description": "结束时间", | |||
"type": "string" | |||
}, | |||
"kind": { | |||
"description": "持有类型", | |||
"type": "integer" | |||
}, | |||
"page": { | |||
"description": "页数", | |||
"type": "integer" | |||
}, | |||
"page_size": { | |||
"description": "每页大小", | |||
"type": "integer" | |||
}, | |||
"start_at": { | |||
"description": "开始时间", | |||
"type": "string" | |||
} | |||
} | |||
}, | |||
"md.DynamicDataFlowListResp": { | |||
"type": "object", | |||
"properties": { | |||
"kind_list": { | |||
"type": "array", | |||
"items": { | |||
"type": "object", | |||
"additionalProperties": true | |||
} | |||
}, | |||
"list": { | |||
"type": "array", | |||
"items": { | |||
"$ref": "#/definitions/md.EggEnergyAvailableEnergyFlow" | |||
} | |||
}, | |||
"paginate": { | |||
"$ref": "#/definitions/applet_app_md_institutional_management_egg_energy.Paginate" | |||
} | |||
} | |||
}, | |||
"md.EggEnergyAvailableEnergyFlow": { | |||
"type": "object", | |||
"properties": { | |||
"after_community_dividends": { | |||
"type": "string" | |||
}, | |||
"after_destruction_quantity_values": { | |||
"type": "string" | |||
}, | |||
"after_development_committee_values": { | |||
"type": "string" | |||
}, | |||
"after_marketplace_merchant_fund_values": { | |||
"type": "string" | |||
}, | |||
"after_marketplace_merchant_values": { | |||
"type": "string" | |||
}, | |||
"after_now_energy_total_nums": { | |||
"type": "string" | |||
}, | |||
"after_planet_total_value": { | |||
"type": "string" | |||
}, | |||
"after_price": { | |||
"type": "string" | |||
}, | |||
"after_public_welfare_and_charity_values": { | |||
"type": "string" | |||
}, | |||
"after_star_level_dividends_values": { | |||
"type": "string" | |||
}, | |||
"amount": { | |||
"type": "string" | |||
}, | |||
"before_community_dividends": { | |||
"type": "string" | |||
}, | |||
"before_destruction_quantity_values": { | |||
"type": "string" | |||
}, | |||
"before_development_committee_values": { | |||
"type": "string" | |||
}, | |||
"before_marketplace_merchant_fund_values": { | |||
"type": "string" | |||
}, | |||
"before_marketplace_merchant_values": { | |||
"type": "string" | |||
}, | |||
"before_now_energy_total_nums": { | |||
"type": "string" | |||
}, | |||
"before_planet_total_value": { | |||
"type": "string" | |||
}, | |||
"before_price": { | |||
"type": "string" | |||
}, | |||
"before_public_welfare_and_charity_values": { | |||
"type": "string" | |||
}, | |||
"before_star_level_dividends_values": { | |||
"type": "string" | |||
}, | |||
"coin_id": { | |||
"type": "integer" | |||
}, | |||
"create_time": { | |||
"type": "string" | |||
}, | |||
"id": { | |||
"type": "integer" | |||
}, | |||
"kind": { | |||
"type": "integer" | |||
}, | |||
"title": { | |||
"type": "string" | |||
} | |||
} | |||
}, | |||
"md.EggEnergyCommunityDividends": { | |||
"type": "object", | |||
"properties": { | |||
@@ -56,6 +56,53 @@ | |||
} | |||
} | |||
}, | |||
"/api/institutionalManagement/availableEnergy/list": { | |||
"post": { | |||
"description": "动态数据流水(获取)", | |||
"consumes": [ | |||
"application/json" | |||
], | |||
"produces": [ | |||
"application/json" | |||
], | |||
"tags": [ | |||
"公排管理" | |||
], | |||
"summary": "制度中心-动态数据-动态数据流水(获取)", | |||
"parameters": [ | |||
{ | |||
"type": "string", | |||
"description": "验证参数Bearer和token空格拼接", | |||
"name": "Authorization", | |||
"in": "header", | |||
"required": true | |||
}, | |||
{ | |||
"description": "页数、每页大小必传 起止时间、持有类型选传", | |||
"name": "req", | |||
"in": "body", | |||
"required": true, | |||
"schema": { | |||
"$ref": "#/definitions/md.DynamicDataFlowListReq" | |||
} | |||
} | |||
], | |||
"responses": { | |||
"200": { | |||
"description": "成功返回", | |||
"schema": { | |||
"$ref": "#/definitions/md.DynamicDataFlowListResp" | |||
} | |||
}, | |||
"400": { | |||
"description": "具体错误", | |||
"schema": { | |||
"$ref": "#/definitions/md.Response" | |||
} | |||
} | |||
} | |||
} | |||
}, | |||
"/api/institutionalManagement/eggEnergy/userCoin/activePointsUserCoinFlowList": { | |||
"post": { | |||
"description": "活跃积分持有流水(查询)", | |||
@@ -1029,6 +1076,135 @@ | |||
} | |||
} | |||
}, | |||
"md.DynamicDataFlowListReq": { | |||
"type": "object", | |||
"properties": { | |||
"end_at": { | |||
"description": "结束时间", | |||
"type": "string" | |||
}, | |||
"kind": { | |||
"description": "持有类型", | |||
"type": "integer" | |||
}, | |||
"page": { | |||
"description": "页数", | |||
"type": "integer" | |||
}, | |||
"page_size": { | |||
"description": "每页大小", | |||
"type": "integer" | |||
}, | |||
"start_at": { | |||
"description": "开始时间", | |||
"type": "string" | |||
} | |||
} | |||
}, | |||
"md.DynamicDataFlowListResp": { | |||
"type": "object", | |||
"properties": { | |||
"kind_list": { | |||
"type": "array", | |||
"items": { | |||
"type": "object", | |||
"additionalProperties": true | |||
} | |||
}, | |||
"list": { | |||
"type": "array", | |||
"items": { | |||
"$ref": "#/definitions/md.EggEnergyAvailableEnergyFlow" | |||
} | |||
}, | |||
"paginate": { | |||
"$ref": "#/definitions/applet_app_md_institutional_management_egg_energy.Paginate" | |||
} | |||
} | |||
}, | |||
"md.EggEnergyAvailableEnergyFlow": { | |||
"type": "object", | |||
"properties": { | |||
"after_community_dividends": { | |||
"type": "string" | |||
}, | |||
"after_destruction_quantity_values": { | |||
"type": "string" | |||
}, | |||
"after_development_committee_values": { | |||
"type": "string" | |||
}, | |||
"after_marketplace_merchant_fund_values": { | |||
"type": "string" | |||
}, | |||
"after_marketplace_merchant_values": { | |||
"type": "string" | |||
}, | |||
"after_now_energy_total_nums": { | |||
"type": "string" | |||
}, | |||
"after_planet_total_value": { | |||
"type": "string" | |||
}, | |||
"after_price": { | |||
"type": "string" | |||
}, | |||
"after_public_welfare_and_charity_values": { | |||
"type": "string" | |||
}, | |||
"after_star_level_dividends_values": { | |||
"type": "string" | |||
}, | |||
"amount": { | |||
"type": "string" | |||
}, | |||
"before_community_dividends": { | |||
"type": "string" | |||
}, | |||
"before_destruction_quantity_values": { | |||
"type": "string" | |||
}, | |||
"before_development_committee_values": { | |||
"type": "string" | |||
}, | |||
"before_marketplace_merchant_fund_values": { | |||
"type": "string" | |||
}, | |||
"before_marketplace_merchant_values": { | |||
"type": "string" | |||
}, | |||
"before_now_energy_total_nums": { | |||
"type": "string" | |||
}, | |||
"before_planet_total_value": { | |||
"type": "string" | |||
}, | |||
"before_price": { | |||
"type": "string" | |||
}, | |||
"before_public_welfare_and_charity_values": { | |||
"type": "string" | |||
}, | |||
"before_star_level_dividends_values": { | |||
"type": "string" | |||
}, | |||
"coin_id": { | |||
"type": "integer" | |||
}, | |||
"create_time": { | |||
"type": "string" | |||
}, | |||
"id": { | |||
"type": "integer" | |||
}, | |||
"kind": { | |||
"type": "integer" | |||
}, | |||
"title": { | |||
"type": "string" | |||
} | |||
} | |||
}, | |||
"md.EggEnergyCommunityDividends": { | |||
"type": "object", | |||
"properties": { | |||
@@ -99,6 +99,93 @@ definitions: | |||
description: 团队人数 | |||
type: integer | |||
type: object | |||
md.DynamicDataFlowListReq: | |||
properties: | |||
end_at: | |||
description: 结束时间 | |||
type: string | |||
kind: | |||
description: 持有类型 | |||
type: integer | |||
page: | |||
description: 页数 | |||
type: integer | |||
page_size: | |||
description: 每页大小 | |||
type: integer | |||
start_at: | |||
description: 开始时间 | |||
type: string | |||
type: object | |||
md.DynamicDataFlowListResp: | |||
properties: | |||
kind_list: | |||
items: | |||
additionalProperties: true | |||
type: object | |||
type: array | |||
list: | |||
items: | |||
$ref: '#/definitions/md.EggEnergyAvailableEnergyFlow' | |||
type: array | |||
paginate: | |||
$ref: '#/definitions/applet_app_md_institutional_management_egg_energy.Paginate' | |||
type: object | |||
md.EggEnergyAvailableEnergyFlow: | |||
properties: | |||
after_community_dividends: | |||
type: string | |||
after_destruction_quantity_values: | |||
type: string | |||
after_development_committee_values: | |||
type: string | |||
after_marketplace_merchant_fund_values: | |||
type: string | |||
after_marketplace_merchant_values: | |||
type: string | |||
after_now_energy_total_nums: | |||
type: string | |||
after_planet_total_value: | |||
type: string | |||
after_price: | |||
type: string | |||
after_public_welfare_and_charity_values: | |||
type: string | |||
after_star_level_dividends_values: | |||
type: string | |||
amount: | |||
type: string | |||
before_community_dividends: | |||
type: string | |||
before_destruction_quantity_values: | |||
type: string | |||
before_development_committee_values: | |||
type: string | |||
before_marketplace_merchant_fund_values: | |||
type: string | |||
before_marketplace_merchant_values: | |||
type: string | |||
before_now_energy_total_nums: | |||
type: string | |||
before_planet_total_value: | |||
type: string | |||
before_price: | |||
type: string | |||
before_public_welfare_and_charity_values: | |||
type: string | |||
before_star_level_dividends_values: | |||
type: string | |||
coin_id: | |||
type: integer | |||
create_time: | |||
type: string | |||
id: | |||
type: integer | |||
kind: | |||
type: integer | |||
title: | |||
type: string | |||
type: object | |||
md.EggEnergyCommunityDividends: | |||
properties: | |||
coin_id: | |||
@@ -690,6 +777,37 @@ paths: | |||
summary: Demo测试 | |||
tags: | |||
- Demo | |||
/api/institutionalManagement/availableEnergy/list: | |||
post: | |||
consumes: | |||
- application/json | |||
description: 动态数据流水(获取) | |||
parameters: | |||
- description: 验证参数Bearer和token空格拼接 | |||
in: header | |||
name: Authorization | |||
required: true | |||
type: string | |||
- description: 页数、每页大小必传 起止时间、持有类型选传 | |||
in: body | |||
name: req | |||
required: true | |||
schema: | |||
$ref: '#/definitions/md.DynamicDataFlowListReq' | |||
produces: | |||
- application/json | |||
responses: | |||
"200": | |||
description: 成功返回 | |||
schema: | |||
$ref: '#/definitions/md.DynamicDataFlowListResp' | |||
"400": | |||
description: 具体错误 | |||
schema: | |||
$ref: '#/definitions/md.Response' | |||
summary: 制度中心-动态数据-动态数据流水(获取) | |||
tags: | |||
- 公排管理 | |||
/api/institutionalManagement/eggEnergy/userCoin/activePointsUserCoinFlowList: | |||
post: | |||
consumes: | |||