auth.go 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package tencetcloud
  2. import (
  3. "mtp2_if/global/app"
  4. "mtp2_if/global/e"
  5. "mtp2_if/logger"
  6. asignService "mtp2_if/services/asign"
  7. tencentCloudService "mtp2_if/services/tencent-cloud"
  8. "net/http"
  9. "github.com/gin-gonic/gin"
  10. )
  11. // BankCard4 银行卡四要素认证
  12. // @Summary 银行卡四要素认证
  13. // @Produce json
  14. // @Security ApiKeyAuth
  15. // @accept application/json
  16. // @Param data body asignService.BankCard4Req true "入参"
  17. // @Success 200 {object} asignService.BankCard4Rsp
  18. // @Failure 500 {object} tencentCloudService.BankCard4Rsp
  19. // @Router /TencentCloud/BankCard4 [post]
  20. // @Tags 腾讯云
  21. func BankCard4(c *gin.Context) {
  22. appG := app.Gin{C: c}
  23. // 获取请求参数
  24. var req asignService.BankCard4Req
  25. if err := appG.C.ShouldBindJSON(&req); err != nil {
  26. logger.GetLogger().Errorf(err.Error())
  27. appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
  28. return
  29. }
  30. if rsp, err := tencentCloudService.BankCard4EVerification(req); err == nil {
  31. appG.Response(http.StatusOK, e.SUCCESS, rsp)
  32. } else {
  33. appG.ResponseByMsg(http.StatusBadRequest, e.ERROR, err.Error(), nil)
  34. }
  35. }