dingtalk

package
v0.0.48 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2024 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init()

Types

type Client

type Client struct {
	*http.Client
	Base      string
	AppKey    string
	AppSecret string
}

func (*Client) Clone

func (c *Client) Clone() *Client

func (*Client) GetAccessToken

func (c *Client) GetAccessToken(request *GetAccessTokenRequest) (*GetAccessTokenResponse, error)

func (*Client) GetJsTicket

func (c *Client) GetJsTicket(accessToken string) (*GetJsTicketResponse, error)

func (*Client) GetUserDetail

func (c *Client) GetUserDetail(userId string, accessToken string) (*GetUserDetailResponse, error)

func (*Client) GetUserInfo

func (c *Client) GetUserInfo(code string, accessToken string) (*GetUserInfoResponse, error)

type DingtalkController

type DingtalkController struct {
	controller.ResourceController
	DingtalkService *DingtalkService `inject:"dingtalkService"`
}

func (*DingtalkController) GetSignature

func (c *DingtalkController) GetSignature(ctx *gin.Context)

func (*DingtalkController) InitRouter

func (e *DingtalkController) InitRouter(g *gin.RouterGroup) *gin.RouterGroup

*

  • 处理WEB验证码的API路由

type DingtalkService

type DingtalkService struct {
	// contains filtered or unexported fields
}

func (*DingtalkService) GetAccessToken

func (s *DingtalkService) GetAccessToken(appId string) (string, bool)

func (*DingtalkService) GetApp

func (s *DingtalkService) GetApp(corpId string, agentId int) *Client

func (*DingtalkService) GetAppByAppId

func (s *DingtalkService) GetAppByAppId(appId string) *Client

func (*DingtalkService) GetJsTicket

func (s *DingtalkService) GetJsTicket(appId string) (string, bool)

func (*DingtalkService) GetSignature

func (s *DingtalkService) GetSignature(ctx context.Context, appId string, url string, nonce string, timestamp int64) (*map[string]interface{}, error)

func (*DingtalkService) GetSocialUserByCode

func (s *DingtalkService) GetSocialUserByCode(ctx context.Context, socialChannelId string, code string) *social.SocialUser

type GetAccessTokenRequest

type GetAccessTokenRequest struct {
	// 应用id
	AppKey *string `json:"appKey,omitempty" xml:"appKey,omitempty"`
	// 应用密码
	AppSecret *string `json:"appSecret,omitempty" xml:"appSecret,omitempty"`
}

func (GetAccessTokenRequest) GoString

func (s GetAccessTokenRequest) GoString() string

func (*GetAccessTokenRequest) SetAppKey

func (*GetAccessTokenRequest) SetAppSecret

func (GetAccessTokenRequest) String

func (s GetAccessTokenRequest) String() string

type GetAccessTokenResponse

type GetAccessTokenResponse struct {
	*OpenAPIResponse
	// accessToken
	AccessToken string `json:"access_token,omitempty" xml:"accessToken,omitempty"`
	// 超时时间
	ExpiresIn int64 `json:"expires_in,omitempty" xml:"expireIn,omitempty"`
}

func (GetAccessTokenResponse) GoString

func (s GetAccessTokenResponse) GoString() string

func (*GetAccessTokenResponse) SetAccessToken

func (*GetAccessTokenResponse) SetExpiresIn

func (GetAccessTokenResponse) String

func (s GetAccessTokenResponse) String() string

type GetJsTicketResponse

type GetJsTicketResponse struct {
	*OpenAPIResponse
	Ticket    string `json:"ticket,omitempty" xml:"ticket,omitempty"`        // accessToken
	ExpiresIn int64  `json:"expires_in,omitempty" xml:"expiresIn,omitempty"` // 超时时间
}

func (GetJsTicketResponse) GoString

func (s GetJsTicketResponse) GoString() string

func (*GetJsTicketResponse) SetExpireIn

func (s *GetJsTicketResponse) SetExpireIn(v int64) *GetJsTicketResponse

func (*GetJsTicketResponse) SetTicket

func (GetJsTicketResponse) String

func (s GetJsTicketResponse) String() string

type GetUserDetailResponse

type GetUserDetailResponse struct {
	*OpenAPIResponse
	Headers map[string]*string         `json:"headers,omitempty" xml:"headers,omitempty" require:"true"`
	Result  *GetUserDetailResponseBody `json:"result,omitempty" xml:"result,omitempty" require:"true"`
}

type GetUserDetailResponseBody

type GetUserDetailResponseBody struct {
	UserId   string `json:"userid" xml:"userid"`
	UnionId  string `json:"unionid" xml:"unionid"`
	Name     string `json:"name" xml:"name"`
	Avatar   string `json:"avatar" xml:"avatar"`
	Mobile   string `json:"mobile" xml:"mobile"`
	Email    string `json:"email" xml:"email"`
	Remark   string `json:"remark" xml:"remark"`
	Title    string `json:"title" xml:"title"`
	DeviceId string `json:"device_id" xml:"deviceId"`
	Sys      bool   `json:"sys" xml:"sys"`
	SysLevel int    `json:"sys_level" xml:"sysLevel"`
}

func (GetUserDetailResponseBody) GoString

func (s GetUserDetailResponseBody) GoString() string

func (GetUserDetailResponseBody) String

func (s GetUserDetailResponseBody) String() string

type GetUserInfoResponse

type GetUserInfoResponse struct {
	*OpenAPIResponse
	Headers map[string]*string       `json:"headers,omitempty" xml:"headers,omitempty" require:"true"`
	Result  *GetUserInfoResponseBody `json:"result,omitempty" xml:"result,omitempty" require:"true"`
}

type GetUserInfoResponseBody

type GetUserInfoResponseBody struct {
	UserId   string `json:"userid" xml:"userid"`
	DeviceId string `json:"device_id" xml:"deviceId"`
	Sys      bool   `json:"sys" xml:"sys"`
	SysLevel int    `json:"sys_level" xml:"sysLevel"`
	UnionId  string `json:"unionid" xml:"unionid"`
	Name     string `json:"name" xml:"name"`
}

func (GetUserInfoResponseBody) GoString

func (s GetUserInfoResponseBody) GoString() string

func (GetUserInfoResponseBody) String

func (s GetUserInfoResponseBody) String() string

type OpenAPIResponse

type OpenAPIResponse struct {
	ErrCode int    `json:"errcode"`
	ErrMsg  string `json:"errmsg"`
}

type Unmarshallable

type Unmarshallable interface {
	// contains filtered or unexported methods
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL