Jelajahi Sumber

解决企业风管分时图数据获取问题

zhou.xiaoning 4 tahun lalu
induk
melakukan
2277781f07
5 mengubah file dengan 20 tambahan dan 7 penghapusan
  1. 6 6
      config/config.xml
  2. 2 1
      controllers/quote/history.go
  3. 5 0
      docs/docs.go
  4. 5 0
      docs/swagger.json
  5. 2 0
      docs/swagger.yaml

+ 6 - 6
config/config.xml

@@ -13,11 +13,11 @@
     <DbAddress value="192.168.31.117"/>
     <DbName value="orcl"/>
     <DbPort value="1521"/>
-    <DbUser value="mtp2_test220"/>
+    <DbUser value="mtp2_test114"/>
     <DbPwd value="muchinfo"/>
   </DbSetting>
   <RedisSetting>
-    <Address value="192.168.31.220"/>
+    <Address value="192.168.31.114"/>
     <Port value="5007"/>
     <Timeout value="3"/>
     <ConnNum value="1"/>
@@ -25,11 +25,11 @@
     <Pwd value=""/>
   </RedisSetting>
   <MqSetting>
-    <Url value="amqp://guest:guest@192.168.31.220:5020/test"/>
+    <Url value="amqp://guest:guest@192.168.31.114:5020/test"/>
     <Exchange value="entry"/>
   </MqSetting>
   <MongoDBSetting>
-    <HostName value="192.168.31.220"/>
+    <HostName value="192.168.31.114"/>
     <Port value="5025"/>
     <DBName value="HistoryQuote"/>
     <Username value="quote_test01"/>
@@ -38,8 +38,8 @@
   <MySQLSetting>
     <Host value="192.168.30.140"/>
     <Port value="3306"/>
-    <DBName value="historyquote_test220"/>
-    <Username value="quote_test220"/>
+    <DBName value="historyquote_test114"/>
+    <Username value="quote_test114"/>
     <Password value="123456"/>
   </MySQLSetting>
 </Configuration>

+ 2 - 1
controllers/quote/history.go

@@ -263,6 +263,7 @@ type QueryTSDataRsp struct {
 // QueryTSData 分时图数据查询
 // @Summary 分时图数据查询
 // @Produce json
+// @Security ApiKeyAuth
 // @Param goodsCode query string true "商品代码"
 // @Success 200 {object} QueryTSDataRsp
 // @Failure 500 {object} app.Response
@@ -407,7 +408,7 @@ func QueryTSData(c *gin.Context) {
 	}
 	// 按 SECTIONID 顺序排序
 	sort.Slice(curWeekRunSteps, func(i int, j int) bool {
-		return curWeekRunSteps[i]["sectionid"].(int) < curWeekRunSteps[j]["sectionid"].(int)
+		return curWeekRunSteps[i]["sectionid"].(float64) < curWeekRunSteps[j]["sectionid"].(float64)
 	})
 
 	// 把各开休市时间段转化为真实的时间

+ 5 - 0
docs/docs.go

@@ -5243,6 +5243,11 @@ var doc = `{
         },
         "/Quote/QueryTSData": {
             "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
                 "produces": [
                     "application/json"
                 ],

+ 5 - 0
docs/swagger.json

@@ -5227,6 +5227,11 @@
         },
         "/Quote/QueryTSData": {
             "get": {
+                "security": [
+                    {
+                        "ApiKeyAuth": []
+                    }
+                ],
                 "produces": [
                     "application/json"
                 ],

+ 2 - 0
docs/swagger.yaml

@@ -12532,6 +12532,8 @@ paths:
           description: Internal Server Error
           schema:
             $ref: '#/definitions/app.Response'
+      security:
+      - ApiKeyAuth: []
       summary: 分时图数据查询
       tags:
       - 行情服务