package bank import ( "mtp2_if/global/app" "mtp2_if/global/e" "mtp2_if/logger" "mtp2_if/models" "net/http" "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"` // 银行服务流水号 } // GetAmtInByPaidUrl 获取银行待支付地址 // @Summary 获取银行待支付地址 // @Produce json // @Security ApiKeyAuth // @Param accountid query int true "资金账户" // @Param exchticket query string true "银行服务流水号" // @Success 200 {object} string // @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 := models.GetAmtInByPaid(req.AccountId, req.Exchticket) if rec == "" { // 查询失败 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) }