diff --git a/app/hdl/institutional_management/egg_energy/hdl_basic.go b/app/hdl/institutional_management/egg_energy/hdl_basic.go index 55f837a..93d0eba 100644 --- a/app/hdl/institutional_management/egg_energy/hdl_basic.go +++ b/app/hdl/institutional_management/egg_energy/hdl_basic.go @@ -276,7 +276,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 +347,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 } diff --git a/app/md/institutional_management/egg_energy/md_basic.go b/app/md/institutional_management/egg_energy/md_basic.go index ece39e2..f435e40 100644 --- a/app/md/institutional_management/egg_energy/md_basic.go +++ b/app/md/institutional_management/egg_energy/md_basic.go @@ -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:"开始时间"` diff --git a/docs/docs.go b/docs/docs.go index 5a3ffbc..3468ed6 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -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": { diff --git a/docs/swagger.json b/docs/swagger.json index 088ba3a..40233ee 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -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": { diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 62b239c..5834a80 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -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: diff --git a/go.mod b/go.mod index 704a270..96580c9 100644 --- a/go.mod +++ b/go.mod @@ -84,6 +84,7 @@ require ( github.com/pelletier/go-toml/v2 v2.2.1 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d // indirect + github.com/shopspring/decimal v1.3.1 // indirect github.com/streadway/amqp v1.0.0 // indirect github.com/syndtr/goleveldb v1.0.0 // indirect github.com/temoto/robotstxt v1.1.2 // indirect