zhouxnsz 1 рік тому
батько
коміт
c3f41edeeb
7 змінених файлів з 25 додано та 314 видалено
  1. 7 7
      config/config.xml
  2. 10 10
      controllers/bank/bank.go
  3. 2 107
      docs/docs.go
  4. 2 107
      docs/swagger.json
  5. 2 81
      docs/swagger.yaml
  6. 1 1
      models/bank.go
  7. 1 1
      routers/router.go

+ 7 - 7
config/config.xml

@@ -16,11 +16,11 @@
     <DbName value="orcl"/>
     <DbPort value="1521"/>
     <!-- DbUser DbPwd 支持明文密文 -->
-    <DbUser value="mtp2_test204"/>
+    <DbUser value="mtp2_test136"/>
     <DbPwd value="muchinfo"/>
   </DbSetting>
   <RedisSetting>
-    <Address value="192.168.31.204"/>
+    <Address value="192.168.31.136"/>
     <Port value="5007"/>
     <Timeout value="3"/>
     <ConnNum value="1"/>
@@ -30,11 +30,11 @@
   </RedisSetting>
   <MqSetting>
     <!-- Url 支持明文密文 -->
-    <Url value="amqp://guest:guest@192.168.31.204:5020/test"/>
+    <Url value="amqp://guest:guest@192.168.31.136:5020/test"/>
     <Exchange value="entry"/>
   </MqSetting>
   <MongoDBSetting>
-    <HostName value="192.168.31.204"/>
+    <HostName value="192.168.31.136"/>
     <Port value="5025"/>
     <DBName value="HistoryQuote"/>
     <!-- Username Password 支持明文密文 -->
@@ -44,9 +44,9 @@
   <MySQLSetting>
     <Host value="192.168.30.72"/>
     <Port value="3306"/>
-    <DBName value="historyquote_test204"/>
+    <DBName value="historyquote_test136"/>
     <!-- Username Password 支持明文密文 -->
-    <Username value="quote_test204"/>
+    <Username value="quote_test136"/>
     <Password value="123456"/>
   </MySQLSetting>
   <Tencent>
@@ -66,6 +66,6 @@
     <AppId value="896210645"/>
     <PrivateKey value="MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCqmByEbXbqqq+FYxD1+mJzqrVxG/7xNF3iZJV9q0PqOVwWPEtND8nNuB2FeAwHc5+W7dZwXheVaQqWXvV6lnWp3KaQ9S4CbeOX7zKKF0j42J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G94KnkLP9mmkH1SOCpdAoGAbheD3ljKilx/cLVxvIRy1vZe8EyNGBPoxMuvhlPVFBloae5RLH3/PfHd4TsnUhdqNOM1op0axlJhxI+iMpR2NKjOrg6m8diBpwvlRrgsvM2KWe0ouAm3e0GCZkd1KQTI2UuVRmaCdtkpF7GeU/BPAlnFpy6zON+61k/Z+wDC++8CgYEA54xmJqIr19BpKkcHAxE2pzDrj6ssu2qObKLfsS27o4RevBnrhoY9kPwn8kUKpngoCTd7tM42y9fcpAdUDv+lENAcIF/kz4u+zkyRGR+SpirgAsCYzxZN3GfRNDHBaFEiTkyL6NFdPGV2GTPcd0b6JGf82Thb0JJCxB/J3hVnDIs="/>
     <NotifyUrl value="http://218.17.158.45:15105/api/Asign/HandleASignCompleted"/>
-    <OpenApiUrl value="http://192.168.31.204:5015/mtp2-onlineopen"/>
+    <OpenApiUrl value="http://192.168.31.136:5015/mtp2-onlineopen"/>
   </Asign>
 </Configuration>

+ 10 - 10
controllers/bank/bank.go

@@ -46,28 +46,28 @@ func QueryBankBranChnumInfo(c *gin.Context) {
 	a.DoGetDataByPage(&m)
 }
 
-type QueryAmtInByPaidReq struct {
+type GetAmtInByPaidUrlReq struct {
 	AccountId  int    `form:"accountid" binding:"required"`  // 资金账户
 	Exchticket string `form:"exchticket" binding:"required"` // 银行服务流水号
 }
 
-// QueryAmtInByPaid 获取银行待支付地址
+// GetAmtInByPaidUrl 获取银行待支付地址
 // @Summary  获取银行待支付地址
 // @Produce  json
 // @Security ApiKeyAuth
 // @Param    accountid  query    int    true "资金账户"
 // @Param    exchticket query    string true "银行服务流水号"
-// @Success  200        {object} models.Chillpayamtinrec
+// @Success  200        {object} string
 // @Failure  500        {object} app.Response
-// @Router   /Bank/QueryAmtInByPaid [get]
+// @Router   /Bank/GetAmtInByPaidUrl [get]
 // @Tags     银行
-func QueryAmtInByPaid(c *gin.Context) {
+func GetAmtInByPaidUrl(c *gin.Context) {
 	appG := app.Gin{C: c}
 
 	// 获取请求参数
-	var req QueryAmtInByPaidReq
+	var req GetAmtInByPaidUrlReq
 	if err := appG.C.ShouldBindQuery(&req); err != nil {
-		logger.GetLogger().Errorf("QueryAmtInByPaid failed: %s", err.Error())
+		logger.GetLogger().Errorf("GetAmtInByPaidUrl failed: %s", err.Error())
 		appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
 		return
 	}
@@ -75,18 +75,18 @@ func QueryAmtInByPaid(c *gin.Context) {
 	rec, err := models.GetAmtInByPaid(req.AccountId, req.Exchticket)
 	if err != nil {
 		// 查询失败
-		logger.GetLogger().Errorf("QueryAmtInByPaid failed: %s", err.Error())
+		logger.GetLogger().Errorf("GetAmtInByPaidUrl failed: %s", err.Error())
 		appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
 		return
 	}
 	if rec == nil {
 		// 查询失败
 		err = errors.New("获取记录失败")
-		logger.GetLogger().Errorf("QueryAmtInByPaid failed: %s", err.Error())
+		logger.GetLogger().Errorf("GetAmtInByPaidUrl failed: %s", err.Error())
 		appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
 		return
 	}
 
 	// 查询成功返回
-	appG.Response(http.StatusOK, e.SUCCESS, rec)
+	appG.Response(http.StatusOK, e.SUCCESS, rec.PAYMENTURL)
 }

+ 2 - 107
docs/docs.go

@@ -707,7 +707,7 @@ const docTemplate = `{
                 }
             }
         },
-        "/Bank/QueryAmtInByPaid": {
+        "/Bank/GetAmtInByPaidUrl": {
             "get": {
                 "security": [
                     {
@@ -741,7 +741,7 @@ const docTemplate = `{
                     "200": {
                         "description": "OK",
                         "schema": {
-                            "$ref": "#/definitions/models.Chillpayamtinrec"
+                            "type": "string"
                         }
                     },
                     "500": {
@@ -30210,111 +30210,6 @@ const docTemplate = `{
                 }
             }
         },
-        "models.Chillpayamtinrec": {
-            "type": "object",
-            "properties": {
-                "accountid": {
-                    "description": "账户ID",
-                    "type": "integer"
-                },
-                "amount": {
-                    "description": "入金金额,需要X100才能给接口调用",
-                    "type": "number"
-                },
-                "channelcode": {
-                    "description": "Reference code for the bank that received payment.",
-                    "type": "string"
-                },
-                "chillpay_desc": {
-                    "description": "Payment information.",
-                    "type": "string"
-                },
-                "created_at": {
-                    "description": "创建时间",
-                    "type": "string"
-                },
-                "currency": {
-                    "description": "Currency data code such as \"764\".",
-                    "type": "string"
-                },
-                "customerid": {
-                    "description": "End User’s reference code (accountid)",
-                    "type": "string"
-                },
-                "customername": {
-                    "description": "Payer Name(For QR Payment only)",
-                    "type": "string"
-                },
-                "deal_desc": {
-                    "description": "状态描述",
-                    "type": "string"
-                },
-                "deal_status": {
-                    "description": "入金状态 0-成功 1-失败 2-已发送 3-初始化",
-                    "type": "integer"
-                },
-                "exch_date": {
-                    "description": "交易日",
-                    "type": "string"
-                },
-                "exch_no": {
-                    "description": "交易所编号",
-                    "type": "string"
-                },
-                "exch_seq": {
-                    "description": "交易所流水号",
-                    "type": "string"
-                },
-                "id": {
-                    "description": "自增ID",
-                    "type": "integer"
-                },
-                "ipaddress": {
-                    "description": "End user’s IP Address.",
-                    "type": "string"
-                },
-                "langcode": {
-                    "description": "Language code to be displayed on the payment website of the bank.",
-                    "type": "string"
-                },
-                "merchantcode": {
-                    "description": "Merchant ID.",
-                    "type": "string"
-                },
-                "orderno": {
-                    "description": "Order number",
-                    "type": "string"
-                },
-                "paymentstatus": {
-                    "description": "Payment result code from the bank.",
-                    "type": "integer"
-                },
-                "paymenturl": {
-                    "description": "URL to be redirected to the bank's payment page.",
-                    "type": "string"
-                },
-                "rec_version": {
-                    "description": "乐观锁",
-                    "type": "integer"
-                },
-                "returnurl": {
-                    "description": "The URL that will be displayed when the End user completes the transaction.",
-                    "type": "string"
-                },
-                "token": {
-                    "description": "Token code for reference list.",
-                    "type": "string"
-                },
-                "transactionid": {
-                    "description": "Transaction Reference number for merchant.",
-                    "type": "integer"
-                },
-                "updated_at": {
-                    "description": "修改时间",
-                    "type": "string"
-                }
-            }
-        },
         "models.Clientfixedadconfig": {
             "type": "object",
             "required": [

+ 2 - 107
docs/swagger.json

@@ -698,7 +698,7 @@
                 }
             }
         },
-        "/Bank/QueryAmtInByPaid": {
+        "/Bank/GetAmtInByPaidUrl": {
             "get": {
                 "security": [
                     {
@@ -732,7 +732,7 @@
                     "200": {
                         "description": "OK",
                         "schema": {
-                            "$ref": "#/definitions/models.Chillpayamtinrec"
+                            "type": "string"
                         }
                     },
                     "500": {
@@ -30201,111 +30201,6 @@
                 }
             }
         },
-        "models.Chillpayamtinrec": {
-            "type": "object",
-            "properties": {
-                "accountid": {
-                    "description": "账户ID",
-                    "type": "integer"
-                },
-                "amount": {
-                    "description": "入金金额,需要X100才能给接口调用",
-                    "type": "number"
-                },
-                "channelcode": {
-                    "description": "Reference code for the bank that received payment.",
-                    "type": "string"
-                },
-                "chillpay_desc": {
-                    "description": "Payment information.",
-                    "type": "string"
-                },
-                "created_at": {
-                    "description": "创建时间",
-                    "type": "string"
-                },
-                "currency": {
-                    "description": "Currency data code such as \"764\".",
-                    "type": "string"
-                },
-                "customerid": {
-                    "description": "End User’s reference code (accountid)",
-                    "type": "string"
-                },
-                "customername": {
-                    "description": "Payer Name(For QR Payment only)",
-                    "type": "string"
-                },
-                "deal_desc": {
-                    "description": "状态描述",
-                    "type": "string"
-                },
-                "deal_status": {
-                    "description": "入金状态 0-成功 1-失败 2-已发送 3-初始化",
-                    "type": "integer"
-                },
-                "exch_date": {
-                    "description": "交易日",
-                    "type": "string"
-                },
-                "exch_no": {
-                    "description": "交易所编号",
-                    "type": "string"
-                },
-                "exch_seq": {
-                    "description": "交易所流水号",
-                    "type": "string"
-                },
-                "id": {
-                    "description": "自增ID",
-                    "type": "integer"
-                },
-                "ipaddress": {
-                    "description": "End user’s IP Address.",
-                    "type": "string"
-                },
-                "langcode": {
-                    "description": "Language code to be displayed on the payment website of the bank.",
-                    "type": "string"
-                },
-                "merchantcode": {
-                    "description": "Merchant ID.",
-                    "type": "string"
-                },
-                "orderno": {
-                    "description": "Order number",
-                    "type": "string"
-                },
-                "paymentstatus": {
-                    "description": "Payment result code from the bank.",
-                    "type": "integer"
-                },
-                "paymenturl": {
-                    "description": "URL to be redirected to the bank's payment page.",
-                    "type": "string"
-                },
-                "rec_version": {
-                    "description": "乐观锁",
-                    "type": "integer"
-                },
-                "returnurl": {
-                    "description": "The URL that will be displayed when the End user completes the transaction.",
-                    "type": "string"
-                },
-                "token": {
-                    "description": "Token code for reference list.",
-                    "type": "string"
-                },
-                "transactionid": {
-                    "description": "Transaction Reference number for merchant.",
-                    "type": "integer"
-                },
-                "updated_at": {
-                    "description": "修改时间",
-                    "type": "string"
-                }
-            }
-        },
         "models.Clientfixedadconfig": {
             "type": "object",
             "required": [

+ 2 - 81
docs/swagger.yaml

@@ -4787,85 +4787,6 @@ definitions:
         description: 求购信息
         type: string
     type: object
-  models.Chillpayamtinrec:
-    properties:
-      accountid:
-        description: 账户ID
-        type: integer
-      amount:
-        description: 入金金额,需要X100才能给接口调用
-        type: number
-      channelcode:
-        description: Reference code for the bank that received payment.
-        type: string
-      chillpay_desc:
-        description: Payment information.
-        type: string
-      created_at:
-        description: 创建时间
-        type: string
-      currency:
-        description: Currency data code such as "764".
-        type: string
-      customerid:
-        description: End User’s reference code (accountid)
-        type: string
-      customername:
-        description: Payer Name(For QR Payment only)
-        type: string
-      deal_desc:
-        description: 状态描述
-        type: string
-      deal_status:
-        description: 入金状态 0-成功 1-失败 2-已发送 3-初始化
-        type: integer
-      exch_date:
-        description: 交易日
-        type: string
-      exch_no:
-        description: 交易所编号
-        type: string
-      exch_seq:
-        description: 交易所流水号
-        type: string
-      id:
-        description: 自增ID
-        type: integer
-      ipaddress:
-        description: End user’s IP Address.
-        type: string
-      langcode:
-        description: Language code to be displayed on the payment website of the bank.
-        type: string
-      merchantcode:
-        description: Merchant ID.
-        type: string
-      orderno:
-        description: Order number
-        type: string
-      paymentstatus:
-        description: Payment result code from the bank.
-        type: integer
-      paymenturl:
-        description: URL to be redirected to the bank's payment page.
-        type: string
-      rec_version:
-        description: 乐观锁
-        type: integer
-      returnurl:
-        description: The URL that will be displayed when the End user completes the
-          transaction.
-        type: string
-      token:
-        description: Token code for reference list.
-        type: string
-      transactionid:
-        description: Transaction Reference number for merchant.
-        type: integer
-      updated_at:
-        description: 修改时间
-        type: string
-    type: object
   models.Clientfixedadconfig:
     properties:
       adsort:
@@ -32160,7 +32081,7 @@ paths:
       summary: 个人意愿核身认证(双录)
       tags:
       - 爱签
-  /Bank/QueryAmtInByPaid:
+  /Bank/GetAmtInByPaidUrl:
     get:
       parameters:
       - description: 资金账户
@@ -32179,7 +32100,7 @@ paths:
         "200":
           description: OK
           schema:
-            $ref: '#/definitions/models.Chillpayamtinrec'
+            type: string
         "500":
           description: Internal Server Error
           schema:

+ 1 - 1
models/bank.go

@@ -100,7 +100,7 @@ func GetAmtInByPaid(accountId int, exchticket string) (*Chillpayamtinrec, error)
 	engine := db.GetEngine()
 
 	var rec Chillpayamtinrec
-	has, err := engine.Where("account = ? and exch_seq = ? and deal_status = 2", accountId, exchticket).Get(&rec)
+	has, err := engine.Where("accountid = ? and exch_seq = ? and deal_status = 2", accountId, exchticket).Get(&rec)
 	if err != nil {
 		return nil, err
 	}

+ 1 - 1
routers/router.go

@@ -816,7 +816,7 @@ func InitRouter() *gin.Engine {
 	{
 		bankR.Use(token.Auth()).GET("QueryBankCusBankExtendConfigs", bank.QueryBankCusBankExtendConfigs)
 		bankR.Use(token.Auth()).GET("QueryBankBranChnumInfo", bank.QueryBankBranChnumInfo)
-		bankR.Use(token.Auth()).GET("QueryAmtInByPaid", bank.QueryAmtInByPaid)
+		bankR.Use(token.Auth()).GET("GetAmtInByPaidUrl", bank.GetAmtInByPaidUrl)
 	}
 
 	// ************************* 报表 *************************