weixin

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResultWeixin

type ResultWeixin struct {
	AccessToken string `json:"access_token"`
	ExpiresIn   int64  `json:"expires_in"` //秒 默认返回是2小时
	InvalidUser string `json:"invaliduser"`
	ErrorCode   int    `json:"errcode"`
	ErrorMsg    string `json:"errmsg"`
}

type TAccessToken

type TAccessToken struct {
	TResult
	AccessToken string `json:"access_token"`
	ExpiresIn   int    `json:"expires_in"`
	CreateDate  time.Time
}

func (*TAccessToken) IsValid

func (Self *TAccessToken) IsValid() bool

func (*TAccessToken) String

func (Self *TAccessToken) String() string

type TAdmin

type TAdmin struct {
	UserId   string `json:"userid"`
	SysLevel int    `json:"sys_level"`
}

func (*TAdmin) String

func (Self *TAdmin) String() string

type TAdmins

type TAdmins struct {
	TResult
	Admins []TAdmin `json:"adminList"`
}

func (*TAdmins) String

func (Self *TAdmins) String() string

type TDepartmentInfo

type TDepartmentInfo struct {
	TResult
	Id      int    `json:"id"`
	PId     int    `json:"parentid"`
	Name    string `json:"name"`
	MUserId string `json:"deptManagerUseridList"` //部门的主管列表,取值为由主管的userid组成的字符串,不同的userid使用“\|”符号进行分割
	IsSub   bool   `json:"groupContainSubDept"`   //部门群是否包含子部门
}

func (*TDepartmentInfo) String

func (Self *TDepartmentInfo) String() string

type TDingTalkClient

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

func GetDingTalkClient

func GetDingTalkClient(appkey, appsecret string) *TDingTalkClient

func (*TDingTalkClient) GetAccessToken

func (Self *TDingTalkClient) GetAccessToken() (string, error)

https://oapi.dingtalk.com/gettoken?appkey=key&appsecret=secret {"errorCode":503,"success":false,"errorMsg":"不合法的access_token"}

func (*TDingTalkClient) GetAdmins

func (Self *TDingTalkClient) GetAdmins() (*TAdmins, error)

{"sys_level":2,"userid":"userid2"}, https://oapi.dingtalk.com/user/get_admin?access_token=ACCESS_TOKEN

func (*TDingTalkClient) GetDepartment

func (Self *TDingTalkClient) GetDepartment(depid int) (*TDepartmentInfo, error)

https://oapi.dingtalk.com/department/get?access_token=ACCESS_TOKEN&id=123 获取部门详情

func (*TDingTalkClient) GetFullDepartmentName

func (Self *TDingTalkClient) GetFullDepartmentName(depid int) (string, error)

func (*TDingTalkClient) GetJobName

func (Self *TDingTalkClient) GetJobName(depids []int) (string, error)

func (*TDingTalkClient) GetOrgName

func (Self *TDingTalkClient) GetOrgName(depids []int) (string, error)

func (*TDingTalkClient) SendWorkNotify

func (Self *TDingTalkClient) SendWorkNotify(msg string) (int, error)

type TLoginInfo

type TLoginInfo struct {
	TResult
	UserId string `json:"userid"`
}

func (*TLoginInfo) String

func (Self *TLoginInfo) String() string

type TResult

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

type TUserInfo

type TUserInfo struct {
	TResult
	UUID        string `json:"unionid"`
	UserId      string `json:"userid"`
	StaffCode   string `json:"jobnumber"`
	StaffName   string `json:"name"`
	Email       string `json:"email"`
	Phone       string `json:"mobile"`
	Job         string `json:"job"`
	Org         string `json:"org"`
	Departments []int  `json:"department"` //成员所属部门id列表
	Position    string `json:"position"`   //职位信息
	Avatar      string `json:"avatar"`     //头像url
}

type TWorkNotify

type TWorkNotify struct {
	TResult
	TaskId int `json:"task_id"`
}

func (*TWorkNotify) String

func (Self *TWorkNotify) String() string

type WorkWeixin

type WorkWeixin struct {
	CorpID     string
	CorpSecret string
	AgentID    int
	Token      string
	BeginTime  time.Time
	EndTime    time.Time
}

func (*WorkWeixin) GetAccessToken

func (w *WorkWeixin) GetAccessToken() string

func (*WorkWeixin) Init

func (w *WorkWeixin) Init(corpid string, corpsecret string, agentId int)

adb shell am start -n org.autojs.autojs/.external.open.RunIntentActivity -d /sdcard/AData/MyJS/auto_run.js -t application/x-javascript

func (*WorkWeixin) SendMessage

func (w *WorkWeixin) SendMessage(text string) bool

func (*WorkWeixin) SendUserMessage

func (w *WorkWeixin) SendUserMessage(touser, text string) bool

Jump to

Keyboard shortcuts

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