Refactor code

pull/141/head
wenxu12345 3 years ago
parent 655f7ff7d0
commit a456936853

@ -57,9 +57,9 @@ func TencentCloudStorageCredential(c *gin.Context) {
resp.ErrCode = constant.ErrTencentCredential.ErrCode resp.ErrCode = constant.ErrTencentCredential.ErrCode
resp.ErrMsg = err.Error() resp.ErrMsg = err.Error()
} else { } else {
resp.Bucket = config.Config.Credential.Tencent.Bucket resp.Data.Bucket = config.Config.Credential.Tencent.Bucket
resp.Region = config.Config.Credential.Tencent.Region resp.Data.Region = config.Config.Credential.Tencent.Region
resp.CredentialResult = res resp.Data.CredentialResult = res
} }
c.JSON(http.StatusOK, resp) c.JSON(http.StatusOK, resp)
} }

@ -6,7 +6,7 @@ type TencentCloudStorageCredentialReq struct {
OperationID string `json:"operationID"` OperationID string `json:"operationID"`
} }
type tencentCloudStorageCredentialRespData struct { type TencentCloudStorageCredentialRespData struct {
*sts.CredentialResult *sts.CredentialResult
Region string `json:"region"` Region string `json:"region"`
Bucket string `json:"bucket"` Bucket string `json:"bucket"`
@ -14,5 +14,5 @@ type tencentCloudStorageCredentialRespData struct {
type TencentCloudStorageCredentialResp struct { type TencentCloudStorageCredentialResp struct {
CommResp CommResp
tencentCloudStorageCredentialRespData `json:"data"` Data TencentCloudStorageCredentialRespData `json:"data"`
} }

Loading…
Cancel
Save