package bank import ( "mtp2_if/global/app" "mtp2_if/global/e" "mtp2_if/logger" "mtp2_if/models" "net/http" "strconv" "github.com/gin-gonic/gin" ) // QueryBankCusBankExtendConfigs // @Summary 查询托管银行扩展配置信息 // @Produce json // @Security ApiKeyAuth // @Param cusbankid query string true "托管银行编号" // @Param extendbiztype query int false "扩展业务类型 - 1:签约 2:入金 3:出金 4:签约信息修改" // @Success 200 {array} models.Bankcusbankextendconfig // @Failure 500 {object} app.Response // @Router /Bank/QueryBankCusBankExtendConfigs [get] // @Tags 银行 func QueryBankCusBankExtendConfigs(c *gin.Context) { a := app.GinUtils{Gin: app.Gin{C: c}} m := models.Bankcusbankextendconfig{} a.DoBindReq(&m) a.DoGetDataEx(&m) } // QueryBankBranChnumInfo // @Summary 查询银行支行联行号信息表 // @Produce json // @Security ApiKeyAuth // @Param branchname query string true "支行名称(模糊查询)" // @Param page query int false "页码" // @Param pagesize query int false "每页条数" // @Success 200 {array} models.Bankbranchnuminfo // @Failure 500 {object} app.Response // @Router /Bank/QueryBankBranChnumInfo [get] // @Tags 银行 func QueryBankBranChnumInfo(c *gin.Context) { a := app.GinUtils{Gin: app.Gin{C: c}} m := models.Bankbranchnuminfo{} a.DoBindReq(&m) a.DoGetDataByPage(&m) } type GetAmtInByPaidUrlReq struct { AccountId int `form:"accountid" binding:"required"` // 资金账户 Exchticket string `form:"exchticket" binding:"required"` // 银行服务流水号 ChannelMode string `form:"channelmode"` // 渠道类型:ChillPay,PayerMax,AsiaPay } // GetAmtInByPaidUrl 获取银行待支付地址 // @Summary 获取银行待支付地址 // @Produce json // @Security ApiKeyAuth // @Param accountid query int true "资金账户" // @Param exchticket query string true "银行服务流水号" // @Param channelmode query string false "渠道类型:ChillPay,PayerMax,AsiaPay" // @Success 200 {object} models.GetAmtInByPaidUrlRsp // @Failure 500 {object} app.Response // @Router /Bank/GetAmtInByPaidUrl [get] // @Tags 银行 func GetAmtInByPaidUrl(c *gin.Context) { appG := app.Gin{C: c} // 获取请求参数 var req GetAmtInByPaidUrlReq if err := appG.C.ShouldBindQuery(&req); err != nil { logger.GetLogger().Errorf("GetAmtInByPaidUrl failed: %s", err.Error()) appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil) return } rec, err := models.GetAmtInByPaid(req.AccountId, req.Exchticket, req.ChannelMode) if err != nil { // 查询失败 logger.GetLogger().Error("GetAmtInByPaidUrl failed: 获取记录失败") appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil) return } if rec == nil { // 查询失败 logger.GetLogger().Error("GetAmtInByPaidUrl failed: 获取记录失败") appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil) return } // 查询成功返回 appG.Response(http.StatusOK, e.SUCCESS, rec) } // GetCusBankInfos 获取托管银行信息列表 // @Summary 获取托管银行信息列表 // @Produce json // @Security ApiKeyAuth // @Success 200 {array} models.Bankcusbankinfo // @Failure 500 {object} app.Response // @Router /Bank/GetCusBankInfos [get] // @Tags 银行 func GetCusBankInfos(c *gin.Context) { appG := app.Gin{C: c} rec, err := models.GetCusBankInfos() if err != nil { // 查询失败 logger.GetLogger().Errorf("GetCusBankInfos failed: %s", err.Error()) appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil) return } // 查询成功返回 appG.Response(http.StatusOK, e.SUCCESS, rec) } // GetHybridConfigs 获取支付中心混合支付渠道配置信息列表 // @Summary 获取支付中心混合支付渠道配置信息列表 // @Produce json // @Security ApiKeyAuth // @Success 200 {array} models.PaymentCenterHybridConfig // @Failure 500 {object} app.Response // @Router /Bank/GetHybridConfigs [get] // @Tags 银行 func GetHybridConfigs(c *gin.Context) { appG := app.Gin{C: c} rec, err := models.GetPaymentCenterHybridConfig() if err != nil { // 查询失败 logger.GetLogger().Errorf("GetHybridConfigs failed: %s", err.Error()) appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil) return } // 查询成功返回 appG.Response(http.StatusOK, e.SUCCESS, rec) } // QueryHybridReceiverOnboards // @Summary 查询混合支付出金接收者信息 // @Produce json // @Security ApiKeyAuth // @Success 200 {array} models.Hybridreceiveronboard // @Failure 500 {object} app.Response // @Router /Bank/QueryHybridReceiverOnboards [get] // @Tags 银行 func QueryHybridReceiverOnboards(c *gin.Context) { a := app.GinUtils{Gin: app.Gin{C: c}} requserid, _ := a.C.Get("requserid") i, _ := strconv.Atoi(requserid.(string)) m := models.Hybridreceiveronboard{USERID: int64(i)} a.DoBindReq(&m) a.DoGetDataEx(&m) }