CreateConsoleLoginUrl.go 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  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(proxyOrganizationOpenId, 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. agent := utils.SetAgent(proxyOrganizationOpenId)
  16. // 实例化一个请求对象,每个接口都会对应一个request对象
  17. request := essbasic.NewCreateConsoleLoginUrlRequest()
  18. request.Agent = agent
  19. request.ProxyOrganizationName = &proxyOrganizationName
  20. response, err = utils.TencentESSClient.CreateConsoleLoginUrl(request)
  21. if _, ok := err.(*errors.TencentCloudSDKError); ok {
  22. logger.GetLogger().Errorf("CreateConsoleLoginUrl failed: %s", err.Error())
  23. return
  24. }
  25. return
  26. }