feat: wecom tag create items
This commit is contained in:
@@ -14,25 +14,6 @@ import (
|
||||
"lone-services/pkg/utils"
|
||||
)
|
||||
|
||||
type Client struct {
|
||||
CorpId string
|
||||
CorpSecret string
|
||||
}
|
||||
|
||||
type tokenResponse struct {
|
||||
ErrCode int `json:"errcode"`
|
||||
ErrMsg string `json:"errmsg"`
|
||||
AccessToken string `json:"access_token"`
|
||||
ExpiresIn int `json:"expires_in"`
|
||||
}
|
||||
|
||||
func NewClient(corpId, corpSecret string) *Client {
|
||||
return &Client{
|
||||
CorpId: corpId,
|
||||
CorpSecret: corpSecret,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Client) AccessToken(ctx context.Context) (string, error) {
|
||||
secretMd5 := md5.Sum([]byte(c.CorpSecret))
|
||||
key := fmt.Sprintf("wecom:access_token:%s:%s", c.CorpId, hex.EncodeToString(secretMd5[:])[:8])
|
||||
|
||||
Reference in New Issue
Block a user