github.com/SupenBysz/gf-admin-community@v0.7.4/sys_model/sdk_huawei.go (about)

     1  package sys_model
     2  
     3  import (
     4  	"github.com/kysion/base-library/base_model"
     5  	"time"
     6  )
     7  
     8  // 华为云服务配置信息
     9  
    10  type HuaweiSdkConf struct {
    11  	Identifier  string `json:"identifier" v:"required#业务标识符参数错误" dc:"业务标识符,唯一,且不可修改"`
    12  	Description string `json:"description" dc:"描述"`
    13  	AppID       string `json:"appID" v:"required#请输入 AppID" dc:"AppID"`
    14  	AESKey      string `json:"aesKey" v:"required#请输入 AES Key" dc:"AES Key"`
    15  	APIKey      string `json:"apiKey" v:"required#请输入 API Key" dc:"API Key"`
    16  	SecretKey   string `json:"secretKey" v:"required#请输入 Secret Key" dc:"Secret Key"`
    17  }
    18  
    19  // HuaweiAccessToken 华为云平台返回的Token
    20  type HuaweiAccessToken struct {
    21  	AccessToken string   `json:"access_token" dc:"token值"`
    22  	TokenType   string   `json:"token_type" dc:"token类型"`
    23  	ExpiresIn   int      `json:"expires_in" dc:"token有效期" `
    24  	Scope       string   `json:"scope" dc:"该参数可忽略"`
    25  	PlatUser    PlatUser `json:"plat_user"`
    26  }
    27  
    28  type UserExtendMap struct {
    29  	ClientID string `json:"clientId" dc:"客户端秘钥"`
    30  }
    31  
    32  type PlatUser struct {
    33  	UserID           int           `json:"userId" dc:"用户id"`
    34  	UserNo           string        `json:"userNo" dc:"编号"`
    35  	UserName         string        `json:"userName" dc:"用户名"`
    36  	UserType         string        `json:"userType" dc:"用户类型"`
    37  	Phone            interface{}   `json:"phone" dc:"电话"`
    38  	TenantID         int           `json:"tenantId"`
    39  	Status           string        `json:"status"`
    40  	DeleteFlag       int           `json:"deleteFlag"`
    41  	PwdUpdateDate    time.Time     `json:"pwdUpdateDate"`
    42  	UserExtendMap    UserExtendMap `json:"userExtendMap"`
    43  	Password         interface{}   `json:"password"`
    44  	Salt             interface{}   `json:"salt"`
    45  	CurrentLoginType string        `json:"currentLoginType"`
    46  }
    47  
    48  type HuaweiToken struct {
    49  	ExpireTime string `json:"expire_time" dc:"Access Token的有效期"`
    50  	Id         string `json:"id" dc:"请求分配的Token值"`
    51  	UserId     string `json:"user_id" dc:"用户id"`
    52  }
    53  
    54  // HuaweiSdkConfToken 配置信息 + Token信息
    55  type HuaweiSdkConfToken struct {
    56  	HuaweiSdkConf
    57  	HuaweiAccessToken
    58  }
    59  
    60  type HuaweiSdkConfList base_model.CollectRes[*HuaweiSdkConf]
    61  
    62  type HuaweiOSS struct {
    63  	Path      string `json:"path"`
    64  	Bucket    string `json:"bucket"`
    65  	Endpoint  string `json:"endpoint"`
    66  	AccessKey string `json:"accessKey"`
    67  	SecretKey string `json:"secretKey"`
    68  }