| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- package tencetcloud
- import (
- "mtp2_if/config"
- "mtp2_if/global/app"
- "mtp2_if/global/e"
- "mtp2_if/logger"
- asignService "mtp2_if/services/asign"
- tencentCloudService "mtp2_if/services/tencent-cloud"
- "net/http"
- "strconv"
- "github.com/gin-gonic/gin"
- )
- // BankCard4 银行卡四要素认证
- // @Summary 银行卡四要素认证
- // @Produce json
- // @Security ApiKeyAuth
- // @accept application/json
- // @Param data body asignService.BankCard4Req true "入参"
- // @Success 200 {object} asignService.BankCard4Rsp
- // @Failure 500 {object} tencentCloudService.BankCard4Rsp
- // @Router /TencentCloud/BankCard4 [post]
- // @Tags 腾讯云
- func BankCard4(c *gin.Context) {
- appG := app.Gin{C: c}
- // 获取请求参数
- var req asignService.BankCard4Req
- if err := appG.C.ShouldBindJSON(&req); err != nil {
- logger.GetLogger().Errorf(err.Error())
- appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
- return
- }
- if !config.SerCfg.GetDebugMode() {
- requserid, _ := appG.C.Get("requserid")
- if requserid != strconv.Itoa(req.UserId) {
- appG.Response(http.StatusOK, e.SUCCESS, tencentCloudService.BankCard4Rsp{Code: "2", Description: "请求参数非法"})
- return
- }
- }
- rsp := tencentCloudService.BankCard4EVerification(req)
- appG.Response(http.StatusOK, e.SUCCESS, rsp)
- }
|