| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- package tencent
- import (
- SysConfig "mtp2_if/config"
- "mtp2_if/global/app"
- "mtp2_if/global/e"
- "mtp2_if/logger"
- "mtp2_if/services/tencent"
- "mtp2_if/utils"
- "net/http"
- "github.com/gin-gonic/gin"
- )
- // CreateConsoleLoginUrl 创建电子签控制台登录链接
- // @Summary 创建电子签控制台登录链接
- // @Produce json
- // @Security ApiKeyAuth
- // @accept application/json
- // @Success 200 {object} app.Response
- // @Failure 500 {object} app.Response
- // @Router /Tencent/CreateConsoleLoginUrl [post]
- // @Tags 腾讯电子签
- func CreateConsoleLoginUrl(c *gin.Context) {
- appG := app.Gin{C: c}
- agent := utils.SetAgent(nil, nil, nil)
- proxyOrganizationName := SysConfig.SerCfg.TencentCfg.ProxyOrganizationName
- response, _ := tencent.CreateConsoleLoginUrl(agent, proxyOrganizationName)
- appG.Response(http.StatusOK, e.SUCCESS, *response.Response.ConsoleUrl)
- }
- type GetTemplateInfoReq struct {
- ContractName string `form:"contractName" binding:"required"` // 合同模块名称
- }
- // GetTemplateInfo 获取合同模板信息(测试)
- // @Summary 获取合同模板信息(测试)
- // @Produce json
- // @Security ApiKeyAuth
- // @accept application/json
- // @Param contractName query string true "合同模块名称"
- // @Success 200 {object} app.Response
- // @Failure 500 {object} app.Response
- // @Router /Tencent/GetTemplateInfo [get]
- // @Tags 腾讯电子签
- func GetTemplateInfo(c *gin.Context) {
- appG := app.Gin{C: c}
- // 获取请求参数
- var req GetTemplateInfoReq
- if err := appG.C.ShouldBindQuery(&req); err != nil {
- logger.GetLogger().Errorf("GetTemplateInfo failed: %s", err.Error())
- appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
- return
- }
- if rsp, err := tencent.GetTemplateInfo(&req.ContractName, nil, nil, nil); err == nil {
- appG.Response(http.StatusOK, e.SUCCESS, rsp)
- } else {
- appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
- }
- }
|