CreateConsoleLoginUrl.go 998 B

12345678910111213141516171819202122232425262728293031
  1. package essapi
  2. import (
  3. "fmt"
  4. "mtp2_if/logger"
  5. "mtp2_if/utils"
  6. "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors"
  7. essbasic "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/essbasic/v20210526"
  8. )
  9. func CreateConsoleLoginUrl(agent *essbasic.Agent, proxyOrganizationName string) (response *essbasic.CreateConsoleLoginUrlResponse, err error) {
  10. if utils.TencentESSClient == nil {
  11. err = fmt.Errorf("腾讯电子签客户端未初始化")
  12. logger.GetLogger().Errorf("CreateConsoleLoginUrl failed: %s", err.Error())
  13. return
  14. }
  15. // 实例化一个请求对象,每个接口都会对应一个request对象
  16. request := essbasic.NewCreateConsoleLoginUrlRequest()
  17. request.Agent = agent
  18. request.ProxyOrganizationName = &proxyOrganizationName
  19. response, err = utils.TencentESSClient.CreateConsoleLoginUrl(request)
  20. if _, ok := err.(*errors.TencentCloudSDKError); ok {
  21. logger.GetLogger().Errorf("CreateConsoleLoginUrl failed: %s", err.Error())
  22. return
  23. }
  24. return
  25. }