wecom

package module
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

README

wecom-app-sdk

JetBrains Logo (Main) logo

wecom-app-sdk golang版企业微信自建应用sdk

主要功能

  • 自动维护accesstoken
  • 统一格式返回,只需要判断 resp.ErrCode 是不是为 0 即可

注意事项

  • 自建应用需要有客户联系权限
  • 通讯录写权限较高,所以需要配置通讯录和自建应用两个secret

联系我

contactme

安装使用

go get github.com/go-laoji/wecom-app-sdk

使用样例

样例中配置为测试使用,请根据实际情况修改,但切记不要公开secret配置

package main

import (
    "github.com/go-laoji/wecom-app-sdk"
    "log"
)

func main() {
    defer func() {
        if e := recover(); e != nil {
            log.Println("recover", e)
        }
    }()
    var testConfig = wecom.WorkChatConfig{
        CorpId:        "ww190690c489d2eb53",
        ContactSecret: "08tnu5LGrsbKwvEDfTGlBMFMw3CsUCwRMavxvkLZSH8",
        AppId:         "1000002",
        AppSecret:     "pedn4nqraARPFOG_A-aVFz1F9pp1sdR-3K1fsCpTwg0",
    }
    weworkApp := wecom.NewWeComApp(testConfig)
    resp := weworkApp.CorpTagList([]string{}, []string{})
    log.Println(resp)
}

接口列表(更新ing...)

  • 通讯录管理

    • 成员管理
      • 创建成员
      • 读取成员
      • 更新成员
      • 删除成员
      • 批量删除成员
      • 获取部门成员
      • 获取部门成员详情
      • userid与openid互换
      • 二次验证
      • 邀请成员
      • 获取加入企业二维码
      • 获取企业活跃成员数
    • 部门管理
      • 创建部门
      • 更新部门
      • 删除部门
      • 获取部门列表
    • 标签管理
      • 创建标签
      • 更新标签名字
      • 删除标签
      • 获取标签成员
      • 删除标签成员
      • 获取标签列表
    • 异步批量接口
      • 增量更新成员
      • 全量覆盖成员
      • 全量覆盖部门
      • 获取异步任务结果
    • 通讯录回调通知
      • 成员变更通知
      • 部门变更通知
      • 标签变更通知
      • 异步任务完成通知
    • 互联企业
      • 获取应用的可见范围
      • 获取互联企业成员详细信息
      • 获取互联企业部门成员
      • 获取互联企业部门成员详情
      • 获取互联企业部门列表
    • 异步导出接口
      • 导出成员
      • 导出成员详情
      • 导出部门
      • 导出标签成员
      • 获取导出结果
      • 导出任务完成通知
  • 客户联系

    • 企业服务人员管理
      • 获取配置了客户联系功能的成员列表
    • 客户联系「联系我」管理
      • 配置客户联系「联系我」方式
      • 获取企业已配置的「联系我」方式
      • 获取企业已配置的「联系我」列表
      • 更新企业已配置的「联系我」方式
      • 删除企业已配置的「联系我」方式
      • 结束临时会话
    • 客户群「加入群聊」管理
      • 配置客户群进群方式
      • 获取客户群进群方式配置
      • 更新客户群进群方式配置
      • 删除客户群进群方式配置
    • 客户管理
      • 获取客户列表
      • 获取客户详情
      • 批量获取客户详情
      • 修改客户备注信息
    • 客户联系规则组管理
      • 获取规则组列表
      • 获取规则组详情
      • 获取规则组管理范围
      • 创建新的规则组
      • 编辑规则组及其管理范围
      • 删除规则组
    • 客户标签管理
      • 管理企业标签
        • 获取企业标签库
        • 添加企业客户标签
        • 编辑企业客户标签
        • 删除企业客户标签
      • 编辑客户企业标签
    • 在职继承
      • 分配在职成员的客户
      • 查询客户接替状态
    • 离职继承
      • 获取待分配的离职成员列表
      • 分配离职成员的客户
      • 查询客户接替状态
      • 分配离职成员的客户群
    • 客户群管理
      • 获取客户群列表
      • 获取客户群详情
      • 客户群opengid转换
    • 客户朋友圈
      • 企业发表内容到客户的朋友圈
        • 创建发表任务
        • 获取任务创建结果
      • 获取客户朋友圈全部的发表记录
        • 获取企业全部的发表列表
        • 获取客户朋友圈企业发表的列表
    • 上传附件资源
    • 消息推送
      • 创建企业群发
      • 获取企业的全部群发记录
        • 获取群发记录列表
        • 获取群发成员发送任务列表
        • 获取企业群发成员执行结果
  • 应用管理

    • 获取应用
      • 获取指定的应用详情
      • 获取access_token对应的应用列表
  • 消息推送

    • 发送应用消息
      • 文本消息
      • 图片消息
      • 语音消息
      • 视频消息
      • 文件消息
      • 文本卡片消息
      • 图文消息
      • 图文消息(mpnews)
      • markdown消息
      • 小程序通知消息
      • 模板卡片消息
        • 文本通知
        • 图文展示
        • 按钮交互
        • 投票选择
        • 多项选择
    • 更新模板卡片消息
    • 撤回应用消息
    • 发送消息到群聊会话
      • 创建群聊会话
      • 修改群聊会话
      • 获取群聊会话
      • 应用推送消息
  • 身份验证

    • 获取访问用户身份

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionList

type ActionList struct {
	Text string `json:"text" validate:"required"`
	Key  string `json:"key" validate:"required"`
}

type ActionMenu

type ActionMenu struct {
	Desc       string       `json:"desc"`
	ActionList []ActionList `json:"action_list" validate:"required,max=3,min=1"`
}

type AddMomentTaskResponse

type AddMomentTaskResponse struct {
	internal.BizResponse
	JobId string `json:"jobid"`
}

type AddMsgTemplateResponse

type AddMsgTemplateResponse struct {
	internal.BizResponse
	FailList []string `json:"fail_list"`
	MsgId    string   `json:"msgid"`
}

type AgentGetResponse

type AgentGetResponse struct {
	internal.BizResponse
	Agentid        int    `json:"agentid"`
	Name           string `json:"name"`
	SquareLogoURL  string `json:"square_logo_url"`
	Description    string `json:"description"`
	AllowUserinfos struct {
		User []struct {
			Userid string `json:"userid"`
		} `json:"user"`
	} `json:"allow_userinfos"`
	AllowPartys struct {
		Partyid []int `json:"partyid"`
	} `json:"allow_partys"`
	AllowTags struct {
		Tagid []int `json:"tagid"`
	} `json:"allow_tags"`
	Close              int    `json:"close"`
	RedirectDomain     string `json:"redirect_domain"`
	ReportLocationFlag int    `json:"report_location_flag"`
	Isreportenter      int    `json:"isreportenter"`
	HomeURL            string `json:"home_url"`
}

type AgentListResponse

type AgentListResponse struct {
	internal.BizResponse
	AgentList []struct {
		AgentId       int    `json:"agentid"`
		Name          string `json:"name"`
		SquareLogoUrl string `json:"square_logo_url"`
	}
}

type AppChatCreateRequest

type AppChatCreateRequest struct {
	Name     string   `json:"name,omitempty"`
	Owner    string   `json:"owner,omitempty"`
	UserList []string `json:"userlist" validate:"required,min=2,max=2000"`
	ChatId   string   `json:"chatid,omitempty"`
}

type AppChatCreateResponse

type AppChatCreateResponse struct {
	internal.BizResponse
	ChatId string `json:"chatid"`
}

type AppChatGetResponse

type AppChatGetResponse struct {
	internal.BizResponse
	ChatInfo struct {
		ChatId   string   `json:"chatid"`
		Name     string   `json:"name"`
		Owner    string   `json:"owner"`
		UserList []string `json:"userlist"`
	} `json:"chat_info"`
}

type AppChatUpdateRequest

type AppChatUpdateRequest struct {
	ChatId      string   `json:"chatid" validate:"required"`
	Name        string   `json:"name,omitempty"`
	Owner       string   `json:"owner,omitempty"`
	AddUserList []string `json:"add_user_list,omitempty"`
	DelUserList []string `json:"del_user_list,omitempty"`
}

type Article

type Article struct {
	Title       string `json:"title"`
	Description string `json:"description"`
	Url         string `json:"url"`
	PicUrl      string `json:"picurl"`
	AppId       string `json:"appid" validate:"required_without=Url,required_with=PagePath"`
	PagePath    string `json:"pagepath" validate:"required_with=AppId"`
}

type Attachments

type Attachments struct {
	Msgtype string `json:"msgtype" validate:"required,oneof=image link video"`
	Image   *Image `json:"image,omitempty" validate:"required_without_all=Video Link"`
	Video   *Video `json:"video,omitempty" validate:"required_without_all=Image Link"`
	Link    *Link  `json:"link,omitempty" validate:"required_without_all=Video Image"`
}

type Attrs

type Attrs struct {
	Type int    `json:"type" validate:"required,oneof= 0 1 2"`
	Name string `json:"name" validate:"required"`
	Text struct {
		Value string `json:"value"`
	} `json:"text,omitempty"`
	Web struct {
		URL   string `json:"url" validate:"required"`
		Title string `json:"title" validate:"required"`
	} `json:"web,omitempty"`
}

type Button

type Button struct {
	Type  int    `json:"type,omitempty"` //按钮点击事件类型,0 或不填代表回调点击事件,1 代表跳转url
	Text  string `json:"text" validate:"required"`
	Style int    `json:"style,omitempty"` //按钮样式,目前可填1~4,不填或错填默认1
	Key   string `json:"key,omitempty"`   // 按钮key值,用户点击后,会产生回调事件将本参数作为EventKey返回,回调事件会带上该key值,最长支持1024字节,不可重复,button_list.type是0时必填
	Url   string `json:"url,omitempty"`   //跳转事件的url,button_list.type是1时必填
}

type ButtonSelection

type ButtonSelection struct {
	QuestionKey string `json:"question_key" validate:"required"`
	Title       string `json:"title"`
	OptionList  []struct {
		ID   string `json:"id" validate:"required"`
		Text string `json:"text" validate:"required"`
	} `json:"option_list" validate:"required"`
	SelectedID string `json:"selected_id"`
}

ButtonSelection 按钮交互型

type CardAction

type CardAction struct {
	Type     int    `json:"type"`
	URL      string `json:"url"`
	Appid    string `json:"appid"`
	Pagepath string `json:"pagepath"`
}

type CardImage

type CardImage struct {
	Url         string  `json:"url" validate:"required"`
	AspectRatio float32 `json:"aspect_ratio" validate:"max=2.25,min=1.3"`
}

type CheckBox

type CheckBox struct {
	QuestionKey string `json:"question_key" validate:"required"`
	OptionList  []struct {
		ID        string `json:"id" validate:"required"`
		Text      string `json:"text" validate:"required"`
		IsChecked bool   `json:"is_checked" validate:"required"`
	} `json:"option_list" validate:"required,min=1,max=20"`
	Mode int `json:"mode" validate:"omitempty,oneof=0 1"`
}

CheckBox 投票选择型

type ConclusionsImage

type ConclusionsImage struct {
	MediaId string `json:"media_id"`
	PicUrl  string `json:"pic_url"`
}
type ConclusionsLink struct {
	Title  string `json:"title"`
	PicUrl string `json:"pic_url"`
	Desc   string `json:"desc"`
	Url    string `json:"url"`
}

type ConclusionsMiniProgram

type ConclusionsMiniProgram struct {
	Title      string `json:"title"`
	PicMediaId string `json:"pic_media_id"`
	AppId      string `json:"appid"`
	Page       string `json:"page"`
}

type ConclusionsText

type ConclusionsText struct {
	Content string `json:"content"`
}

type ContactMe

type ContactMe struct {
	ConfigId      string   `json:"config_id,omitempty"`
	Type          int      `json:"type" validate:"required,oneof=1 2"`
	Scene         int      `json:"scene" validate:"required,oneof=1 2"`
	Style         int      `json:"style"`
	Remark        string   `json:"remark"`
	SkipVerify    bool     `json:"skip_verify"`
	State         string   `json:"state"`
	User          []string `json:"user"`
	Party         []int32  `json:"party"`
	IsTemp        bool     `json:"is_temp"`
	ExpiresIn     int32    `json:"expires_in"`
	ChatExpiresIn int32    `json:"chat_expires_in"`
	UnionId       string   `json:"unionid"`
	Conclusions   struct {
		*ConclusionsText        `json:"text,omitempty"`
		*ConclusionsImage       `json:"image,omitempty"`
		*ConclusionsLink        `json:"link,omitempty"`
		*ConclusionsMiniProgram `json:"miniprogram,omitempty"`
	} `json:"conclusions"`
}

type ContactMeAddResponse

type ContactMeAddResponse struct {
	internal.BizResponse
	ConfigId string `json:"config_id"`
	QrCode   string `json:"qr_code"`
}

type ContactMeGetResponse

type ContactMeGetResponse struct {
	internal.BizResponse
	ContactWay struct {
		ConfigId string `json:"config_id"`
		ContactMe
	} `json:"contact_way"`
}

type ContactMeListResponse

type ContactMeListResponse struct {
	internal.BizResponse
	ContactWay []struct {
		ConfigId string `json:"config_id"`
	} `json:"contact_way"`
	NextCursor string `json:"next_cursor"`
}

type CorpTag

type CorpTag struct {
	Id         string `json:"id,omitempty"`
	Name       string `json:"name" validate:"required,max=30"`
	Order      int32  `json:"order"`
	CreateTime uint64 `json:"create_time,omitempty"`
	Deleted    bool   `json:"deleted,omitempty"`
}

type CorpTagAddResponse

type CorpTagAddResponse struct {
	internal.BizResponse
	TagGroup CorpTagGroup `json:"tag_group"`
}

type CorpTagGroup

type CorpTagGroup struct {
	GroupId    string    `json:"group_id"`
	GroupName  string    `json:"group_name"`
	CreateTime uint64    `json:"create_time,omitempty"`
	Order      int       `json:"order,omitempty"`
	Deleted    bool      `json:"deleted,omitempty"`
	Tag        []CorpTag `json:"tag"`
}

type CorpTagListResponse

type CorpTagListResponse struct {
	internal.BizResponse
	TagGroup []CorpTagGroup `json:"tag_group"`
}

type Department

type Department struct {
	Id               int32    `json:"id"`
	Order            int      `json:"order,omitempty"`
	ParentId         int32    `json:"parentid" validate:"required"`
	Name             string   `json:"name" validate:"required,min=1,max=32"`
	NameEn           string   `json:"name_en,omitempty" validate:"omitempty,min=1,max=32"`
	DepartmentLeader []string `json:"department_leader"`
}

type DepartmentCreateResponse

type DepartmentCreateResponse struct {
	internal.BizResponse
	Id int32 `json:"id"`
}

type DepartmentGetResponse

type DepartmentGetResponse struct {
	internal.BizResponse
	Department Department `json:"department"`
}

type DepartmentListResponse

type DepartmentListResponse struct {
	internal.BizResponse
	Department []Department `json:"department"`
}

type DepartmentSimpleListResponse

type DepartmentSimpleListResponse struct {
	internal.BizResponse
	DepartmentId []struct {
		Id       int32 `json:"id"`
		ParentId int32 `json:"parentid"`
		Order    int   `json:"order"`
	}
}

type EmphasisContent

type EmphasisContent struct {
	Title string `json:"title"`
	Desc  string `json:"desc"`
}

EmphasisContent 文本通知型

type ExternalAttachments

type ExternalAttachments struct {
	Msgtype     string              `json:"msgtype" validate:"required"`
	Image       ExternalImage       `json:"image,omitempty"`
	Link        ExternalLink        `json:"link,omitempty"`
	Miniprogram ExternalMiniprogram `json:"miniprogram,omitempty"`
	Video       ExternalVideo       `json:"video,omitempty"`
	File        ExternalFile        `json:"file,omitempty"`
}

type ExternalAttr

type ExternalAttr struct {
	Type int    `json:"type"`
	Name string `json:"name"`
	Text struct {
		Value string `json:"value"`
	} `json:"text,omitempty"`
	Web struct {
		URL   string `json:"url"`
		Title string `json:"title"`
	} `json:"web,omitempty"`
	Miniprogram struct {
		Appid    string `json:"appid"`
		Pagepath string `json:"pagepath"`
		Title    string `json:"title"`
	} `json:"miniprogram,omitempty"`
}

type ExternalContact

type ExternalContact struct {
	ExternalUserId  string `json:"external_userid"`
	Name            string `json:"name"`
	Position        string `json:"position"`
	Avatar          string `json:"avatar"`
	CorpName        string `json:"corp_name"`
	CorpFullName    string `json:"corp_full_name"`
	Type            int    `json:"type"`
	Gender          int    `json:"gender"`
	UnionId         string `json:"unionid"`
	ExternalProfile struct {
		ExternalAttr []struct {
			Type int    `json:"type"`
			Name string `json:"name"`
			Text struct {
				Value string `json:"value"`
			} `json:"text,omitempty"`
			Web struct {
				Url   string `json:"url"`
				Title string `json:"title"`
			} `json:"web,omitempty"`
			MiniProgram struct {
				AppId    string `json:"appid"`
				PagePath string `json:"pagepath"`
				Title    string `json:"title"`
			} `json:"miniprogram,omitempty"`
		}
	} `json:"external_profile"`
}

type ExternalContactBatchGetByUserResponse

type ExternalContactBatchGetByUserResponse struct {
	internal.BizResponse
	ExternalContactList []struct {
		ExternalContact ExternalContact `json:"external_contact"`
		FollowInfo      FollowUser      `json:"follow_info"`
	} `json:"external_contact_list"`
	NextCursor string `json:"next_cursor"`
}

type ExternalContactCustomerStrategyCreateRequest

type ExternalContactCustomerStrategyCreateRequest struct {
	Strategy
	Range []StrategyRange `json:"range" validate:"required"`
}

type ExternalContactCustomerStrategyCreateResponse

type ExternalContactCustomerStrategyCreateResponse struct {
	internal.BizResponse
	StrategyId int `json:"strategy_id"`
}

type ExternalContactCustomerStrategyEditRequest

type ExternalContactCustomerStrategyEditRequest struct {
	Strategy
	RangeAdd []StrategyRange `json:"range_add"`
	RangeDel []StrategyRange `json:"range_del"`
}

type ExternalContactCustomerStrategyGetRangeResponse

type ExternalContactCustomerStrategyGetRangeResponse struct {
	internal.BizResponse
	Range []struct {
		Type    int    `json:"type"`
		UserId  string `json:"userid,omitempty"`
		PartyId int32  `json:"partyid,omitempty"`
	} `json:"range"`
	NextCursor string `json:"next_cursor"`
}

type ExternalContactCustomerStrategyGetResponse

type ExternalContactCustomerStrategyGetResponse struct {
	internal.BizResponse
	Strategy Strategy `json:"strategy"`
}

type ExternalContactCustomerStrategyListResponse

type ExternalContactCustomerStrategyListResponse struct {
	internal.BizResponse
	Strategy []struct {
		StrategyId int `json:"strategy_id"`
	} `json:"strategy"`
	NextCursor string `json:"next_cursor"`
}

type ExternalContactGetFollowUserListResponse

type ExternalContactGetFollowUserListResponse struct {
	internal.BizResponse
	FollowUser []string `json:"follow_user"`
}

type ExternalContactGetResponse

type ExternalContactGetResponse struct {
	internal.BizResponse
	ExternalContact ExternalContact `json:"external_contact"`
	FollowUser      []FollowUser    `json:"follow_user"`
	NextCursor      string          `json:"next_cursor"`
}

type ExternalContactList

type ExternalContactList struct {
	TagList []string `json:"tag_list"`
}

type ExternalContactListResponse

type ExternalContactListResponse struct {
	internal.BizResponse
	ExternalUserId []string `json:"external_userid"`
}

type ExternalContactRemarkRequest

type ExternalContactRemarkRequest struct {
	UserId           string   `json:"user_id" validate:"required"`
	ExternalUserid   string   `json:"external_userid" validate:"required"`
	Remark           string   `json:"remark"`
	Description      string   `json:"description"`
	RemarkCompany    string   `json:"remark_company"`
	RemarkMobiles    []string `json:"remark_mobiles"`
	RemarkPicMediaId string   `json:"remark_pic_mediaid"`
}

type ExternalFile

type ExternalFile struct {
	MediaID string `json:"media_id" validate:"required"`
}

type ExternalImage

type ExternalImage struct {
	MediaID string `json:"media_id" validate:"required_without=PicURL"`
	PicURL  string `json:"pic_url" validate:"required_without=MediaID"`
}
type ExternalLink struct {
	Title  string `json:"title" validate:"required"`
	Picurl string `json:"picurl,omitempty"`
	Desc   string `json:"desc,omitempty"`
	URL    string `json:"url"  validate:"required"`
}

type ExternalMiniprogram

type ExternalMiniprogram struct {
	Title      string `json:"title"  validate:"required"`
	PicMediaID string `json:"pic_media_id"  validate:"required"`
	Appid      string `json:"appid"  validate:"required"`
	Page       string `json:"page"  validate:"required"`
}

type ExternalMsg

type ExternalMsg struct {
	ChatType       string                `json:"chat_type,omitempty" validate:"omitempty,oneof=single group"`
	ExternalUserid []string              `json:"external_userid,omitempty" validate:"required_without=Sender"`
	Sender         string                `json:"sender,omitempty" validate:"required_without=ExternalUserid"`
	Text           ExternalText          `json:"text,omitempty" validate:"required_without=Attachments"`
	Attachments    []ExternalAttachments `json:"attachments,omitempty" validate:"required_without=Text"`
}

type ExternalText

type ExternalText struct {
	Content string `json:"content"`
}

type ExternalVideo

type ExternalVideo struct {
	MediaID string `json:"media_id" validate:"required"`
}

type FileMessage

type FileMessage struct {
	Message
	Safe int        `json:"safe,omitempty"`
	File MultiMedia `json:"file" validate:"required"`
}

type FollowUser

type FollowUser struct {
	UserId      string `json:"userid"`
	Remark      string `json:"remark,omitempty"`
	Description string `json:"description,omitempty"`
	CreateTime  int64  `json:"createtime"`
	Tags        []struct {
		GroupName string `json:"group_name"`
		TagName   string `json:"tag_name"`
		TagId     string `json:"tag_id"`
		Type      int    `json:"type"`
	} `json:"tags,omitempty"`
	RemarkCorpName string   `json:"remark_corp_name,omitempty"`
	RemarkMobiles  []string `json:"remark_mobiles,omitempty"`
	State          string   `json:"state,omitempty"`
	OperUserId     string   `json:"oper_userid,omitempty"`
	AddWay         int      `json:"add_way,omitempty"`
}

type GetGroupMsgListV2Response

type GetGroupMsgListV2Response struct {
	internal.BizResponse
	NextCursor   string         `json:"next_cursor"`
	GroupMsgList []GroupMsgList `json:"group_msg_list"`
}

type GetGroupMsgSendResultResponse

type GetGroupMsgSendResultResponse struct {
	internal.BizResponse
	SendList []struct {
		ExternalUserId string `json:"external_user_id"`
		ChatId         string `json:"chat_id"`
		UserId         string `json:"userid"`
		Status         int    `json:"status"`
		SendTime       int64  `json:"send_time"`
	} `json:"send_list"`
}

type GetGroupMsgTaskResponse

type GetGroupMsgTaskResponse struct {
	internal.BizResponse
	NextCursor string `json:"next_cursor"`
	TaskList   []struct {
		UserId   string `json:"userid"`
		Status   int    `json:"status"`
		SendTime int64  `json:"send_time"`
	} `json:"task_list"`
}

type GetJoinWayResponse

type GetJoinWayResponse struct {
	internal.BizResponse
	JoinWay struct {
		ConfigID       string   `json:"config_id"`
		Type           int      `json:"type"`
		Scene          int      `json:"scene"`
		Remark         string   `json:"remark"`
		AutoCreateRoom int      `json:"auto_create_room"`
		RoomBaseName   string   `json:"room_base_name"`
		RoomBaseID     int      `json:"room_base_id"`
		ChatIDList     []string `json:"chat_id_list"`
		QrCode         string   `json:"qr_code"`
		State          string   `json:"state"`
	} `json:"join_way"`
}

type GetMomentListResponse

type GetMomentListResponse struct {
	internal.BizResponse
	NextCursor string       `json:"next_cursor"`
	MomentList []MomentList `json:"moment_list"`
}

type GetMomentTaskResponse

type GetMomentTaskResponse struct {
	internal.BizResponse
	NextCursor string `json:"next_cursor"`
	TaskList   []struct {
		UserId        string `json:"userid"`
		PublishStatus int    `json:"publish_status"`
	} `json:"task_list"`
}

type GetMomentTaskResultResponse

type GetMomentTaskResultResponse struct {
	internal.BizResponse
	Status int    `json:"status"`
	Type   string `json:"type"`
	Result struct {
		internal.BizResponse
		MomentId          string `json:"moment_id"`
		InvalidSenderList struct {
			UserList       []string `json:"user_list"`
			DepartmentList []int32  `json:"department_list"`
		} `json:"invalid_sender_list"`
		InvalidExternalContactList struct {
			TagList []string `json:"tag_list"`
		} `json:"invalid_external_contact_list"`
	}
}

type GroupChatAddJoinWayResponse

type GroupChatAddJoinWayResponse struct {
	internal.BizResponse
	ConfigId string `json:"config_id"`
}

type GroupChatJoinWayRequest

type GroupChatJoinWayRequest struct {
	ConfigId       string   `json:"config_id,omitempty"`
	Scene          int      `json:"scene" validate:"required"`
	Remark         string   `json:"remark"`
	AutoCreateRoom int      `json:"auto_create_room"`
	RoomBaseName   string   `json:"room_base_name"`
	RoomBaseID     int      `json:"room_base_id"`
	ChatIDList     []string `json:"chat_id_list" validate:"required,max=5"`
	State          string   `json:"state"`
}

type GroupChatListFilter

type GroupChatListFilter struct {
	StatusFilter int `json:"status_filter,omitempty" validate:"omitempty,oneof=0 1 2 3"`
	OwnerFilter  struct {
		UserIdList []string `json:"userid_list"`
	} `json:"owner_filter,omitempty"`
	Cursor string `json:"cursor,omitempty"`
	Limit  int    `json:"limit" validate:"required,min=1,max=1000"`
}

type GroupChatListResponse

type GroupChatListResponse struct {
	internal.BizResponse
	GroupChatList []struct {
		ChatId string `json:"chat_id"`
		Status int    `json:"status"`
	} `json:"group_chat_list"`
	NextCursor string `json:"next_cursor"`
}

type GroupChatRequest

type GroupChatRequest struct {
	ChatId   string `json:"chat_id" validate:"required"`
	NeedName int    `json:"need_name" validate:"omitempty,oneof=0 1"`
}

type GroupChatResponse

type GroupChatResponse struct {
	internal.BizResponse
	GroupChat struct {
		ChatID     string `json:"chat_id"`
		Name       string `json:"name"`
		Owner      string `json:"owner"`
		CreateTime int    `json:"create_time"`
		Notice     string `json:"notice"`
		MemberList []struct {
			Userid    string `json:"userid"`
			Type      int    `json:"type"`
			JoinTime  int    `json:"join_time"`
			JoinScene int    `json:"join_scene"`
			State     string `json:"state,omitempty"`
			Invitor   struct {
				Userid string `json:"userid"`
			} `json:"invitor,omitempty"`
			GroupNickname string `json:"group_nickname"`
			Name          string `json:"name"`
			Unionid       string `json:"unionid,omitempty"`
		} `json:"member_list"`
		AdminList []struct {
			Userid string `json:"userid"`
		} `json:"admin_list"`
	} `json:"group_chat"`
}

type GroupChatTransferRequest

type GroupChatTransferRequest struct {
	ChatIdList []string `json:"chat_id_list"`
	NewOwner   string   `json:"new_owner"`
}

type GroupChatTransferResponse

type GroupChatTransferResponse struct {
	internal.BizResponse
	FailedChatList []struct {
		ChatId  string `json:"chat_id"`
		ErrCode int    `json:"errcode"`
		ErrMsg  string `json:"errmsg"`
	} `json:"failed_chat_list"`
}

type GroupMsgList

type GroupMsgList struct {
	Msgid       string                `json:"msgid"`
	Creator     string                `json:"creator"`
	CreateTime  string                `json:"create_time"`
	CreateType  int                   `json:"create_type"`
	Text        ExternalText          `json:"text"`
	Attachments []ExternalAttachments `json:"attachments"`
}

type GroupMsgListFilter

type GroupMsgListFilter struct {
	ChatType   string `json:"chat_type" validate:"required,oneof=single group"`
	StartTime  int64  `json:"start_time" validate:"required"`
	EndTime    int64  `json:"end_time" validate:"required"`
	Creator    string `json:"creator,omitempty"`
	FilterType int    `json:"filter_type,omitempty" validate:"omitempty,oneof=0 1 2"`
	Limit      int    `json:"limit" validate:"max=100"`
	Cursor     string `json:"cursor"`
}

type GroupMsgSendResultFilter

type GroupMsgSendResultFilter struct {
	MsgId  string `json:"msgid" validate:"required"`
	UserId string `json:"userid" validate:"required"`
	Limit  int    `json:"limit"`
	Cursor string `json:"cursor"`
}

type GroupMsgTaskFilter

type GroupMsgTaskFilter struct {
	MsgId  string `json:"msgid" validate:"required"`
	Limit  int    `json:"limit"`
	Cursor string `json:"cursor"`
}

type GroupOpengId2ChatIdResponse

type GroupOpengId2ChatIdResponse struct {
	internal.BizResponse
	ChatId string `json:"chat_id"`
}

type H

type H map[string]interface{}

type HorizontalContentList

type HorizontalContentList struct {
	KeyName string `json:"keyname"`
	Value   string `json:"value"`
	Type    int    `json:"type,omitempty"`
	URL     string `json:"url,omitempty"`
	MediaID string `json:"media_id,omitempty"`
	Userid  string `json:"userid,omitempty"`
}

type IWeCom

type IWeCom interface {
	GetCorpId() string

	UserCreate(User) internal.BizResponse
	UserGet(string) UserGetResponse
	UserUpdate(User) internal.BizResponse
	UserDelete(string) internal.BizResponse
	UserBatchDelete([]string) internal.BizResponse
	UserSimpleList(int32, int) UserSimpleListResponse
	UserList(int32, int) UserListResponse
	UserId2OpenId(string) UserId2OpenIdResponse
	GetUserInfo(code string) (resp UserInfoResponse)

	DepartmentCreate(Department) DepartmentCreateResponse
	DepartmentUpdate(Department) internal.BizResponse
	DepartmentDelete(int32) internal.BizResponse
	DepartmentList(int32) DepartmentListResponse
	DepartmentSimpleList(id int32) (resp DepartmentSimpleListResponse)
	DepartmentGet(id int32) (resp DepartmentGetResponse)

	TagCreate(Tag) TagCreateResponse
	TagUpdate(Tag) internal.BizResponse
	TagDelete(int) internal.BizResponse
	TagList() TagListResponse
	TagUserList(int) TagUserListResponse
	TagAddUsers(int, []string, []int32) TagAddOrDelUsersResponse
	TagDelUsers(int, []string, []int32) TagAddOrDelUsersResponse

	ExternalAddContactWay(ContactMe) ContactMeAddResponse
	ExternalUpdateContactWay(ContactMe) internal.BizResponse
	ExternalGetContactWay(string) ContactMeGetResponse
	ExternalListContactWay(int64, int64, string, int) ContactMeListResponse
	ExternalDeleteContactWay(string) internal.BizResponse
	ExternalCloseTempChat(string, string) internal.BizResponse

	ExternalContactGetFollowUserList() ExternalContactGetFollowUserListResponse

	ExternalContactCustomerStrategyList(string, int) ExternalContactCustomerStrategyListResponse
	ExternalContactCustomerStrategyGet(int) ExternalContactCustomerStrategyGetResponse
	ExternalContactCustomerStrategyGetRange(int, string, int) ExternalContactCustomerStrategyGetRangeResponse
	ExternalContactCustomerStrategyCreate(ExternalContactCustomerStrategyCreateRequest) ExternalContactCustomerStrategyCreateResponse
	ExternalContactCustomerStrategyEdit(ExternalContactCustomerStrategyEditRequest) internal.BizResponse
	ExternalContactCustomerStrategyDelete(int) internal.BizResponse

	AgentGet() AgentGetResponse
	AgentList() (resp AgentListResponse)

	CorpTagList([]string, []string) CorpTagListResponse
	CorpTagAdd(CorpTagGroup) CorpTagAddResponse
	CorpTagUpdate(CorpTag) internal.BizResponse
	CorpTagDelete([]string, []string) internal.BizResponse

	TransferCustomer(TransferCustomerRequest) TransferCustomerResponse
	TransferResult(TransferResultRequest) TransferResultResponse

	GetUnassignedList(request UnAssignedRequest) (resp UnAssignedResponse)
	TransferCustomerResigned(request TransferCustomerRequest) (resp TransferCustomerResponse)
	TransferResultResigned(request TransferResultRequest) (resp TransferResultResponse)
	TransferGroupChat(request GroupChatTransferRequest) (resp GroupChatTransferResponse)

	GroupChatList(GroupChatListFilter) GroupChatListResponse
	GroupChat(GroupChatRequest) GroupChatResponse
	GroupOpengId2ChatId(string) GroupOpengId2ChatIdResponse
	GroupChatAddJoinWay(request GroupChatJoinWayRequest) (resp GroupChatAddJoinWayResponse)
	GroupChatGetJoinWay(configId string) (resp GetJoinWayResponse)
	GroupChatUpdateJoinWay(request GroupChatJoinWayRequest) (resp internal.BizResponse)
	GroupChatDeleteJoinWay(configId string) (resp internal.BizResponse)

	AddMomentTask(task MomentTask) (resp AddMomentTaskResponse)
	GetMomentTaskResult(jobId string) (resp GetMomentTaskResultResponse)
	GetMomentList(filter MomentListFilter) (resp GetMomentListResponse)
	GetMomentTask(filter MomentTaskFilter) (resp GetMomentTaskResponse)

	MediaUploadAttachment(Media) MediaUploadResponse
	MediaUpload(fileType MediaType, filePath string, fileName string) (resp MediaUploadResponse)
	MediaUploadImg(filePath string, fileName string) (resp MediaUploadImgResponse)

	AddMsgTemplate(msg ExternalMsg) (resp AddMsgTemplateResponse)
	GetGroupMsgListV2(filter GroupMsgListFilter) (resp GetGroupMsgListV2Response)
	GetGroupMsgTask(filter GroupMsgTaskFilter) (resp GetGroupMsgTaskResponse)
	GetGroupMsgSendResult(filter GroupMsgSendResultFilter) (resp GetGroupMsgSendResultResponse)

	MessageSend(msg interface{}) (resp MessageSendResponse)
	MessageReCall(msgId string) (resp internal.BizResponse)
	MessageUpdateTemplateCard(msg TemplateCardUpdateMessage) (resp MessageUpdateTemplateCardResponse)
	AppChatCreate(request AppChatCreateRequest) (resp AppChatCreateResponse)
	AppChatUpdate(request AppChatUpdateRequest) (resp internal.BizResponse)
	AppChatGet(chatId string) (resp AppChatGetResponse)
	AppChatSend(msg interface{}, chatId string) (resp internal.BizResponse)
	// contains filtered or unexported methods
}

func NewWeComApp

func NewWeComApp(c WorkChatConfig) IWeCom

type Image

type Image struct {
	MediaID string `json:"media_id" validate:"required"`
}

type ImageMessage

type ImageMessage struct {
	Message
	Safe  int        `json:"safe,omitempty" validate:"omitempty,oneof=0 1"`
	Image MultiMedia `json:"image" validate:"required"`
}

type ImageTextArea

type ImageTextArea struct {
	Type     int    `json:"type" validate:"omitempty,oneof=0 1 2"`
	URL      string `json:"url"`
	AppId    string `json:"appid,omitempty"`
	PagePath string `json:"pagepath,omitempty"`
	Title    string `json:"title"`
	Desc     string `json:"desc"`
	ImageURL string `json:"image_url" validate:"required"`
}

ImageTextArea 图文展示型

type JumpList

type JumpList struct {
	Type     int    `json:"type"`
	Title    string `json:"title"`
	URL      string `json:"url,omitempty"`
	Appid    string `json:"appid,omitempty"`
	PagePath string `json:"pagepath,omitempty"`
}
type Link struct {
	Title   string `json:"title"`
	URL     string `json:"url" validate:"required"`
	MediaID string `json:"media_id" validate:"required"`
}

type Location

type Location struct {
	Latitude  string `json:"latitude"`
	Longitude string `json:"longitude"`
	Name      string `json:"name"`
}

type MainTitle

type MainTitle struct {
	Title string `json:"title"`
	Desc  string `json:"desc"`
}

type MarkDownMessage

type MarkDownMessage struct {
	Message
	MarkDown Text `json:"markdown" validate:"required"`
}

type Media

type Media struct {
	Type           MediaType `json:"type" validate:"required,oneof=image voice video file"`
	AttachmentType int       `json:"attachment_type" validate:"required,oneof=1 2"`
	FilePath       string    `json:"file_path" validate:"required"`
	FileName       string    `json:"file_name"`
}

type MediaType

type MediaType string
const (
	MediaImage MediaType = "image"
	MediaVoice MediaType = "voice"
	MediaVideo MediaType = "video"
	MediaFile  MediaType = "file"
)

type MediaUploadImgResponse

type MediaUploadImgResponse struct {
	internal.BizResponse
	Url string `json:"url"`
}

type MediaUploadResponse

type MediaUploadResponse struct {
	internal.BizResponse
	Type     string `json:"type"`
	MediaId  string `json:"media_id"`
	CreateAt uint64 `json:"create_at"`
}

type Message

type Message struct {
	ToUser                 string `json:"touser,omitempty" validate:"omitempty,required_without=ToParty ToTag"`
	ToParty                string `json:"toparty,omitempty" validate:"omitempty,required_without=ToUser ToTag"`
	ToTag                  string `json:"totag,omitempty" validate:"omitempty,required_without=ToParty ToUser"`
	EnableIDTrans          int    `json:"enable_id_trans,omitempty"`
	EnableDuplicateCheck   int    `json:"enable_duplicate_check,omitempty"`
	DuplicateCheckInterval int    `json:"duplicate_check_interval,omitempty"`
}

type MessageSendResponse

type MessageSendResponse struct {
	internal.BizResponse
	InvalidUser  string `json:"invaliduser"`
	InvalidParty string `json:"invalidparty"`
	InvalidTag   string `json:"invalidtag"`
	MsgId        string `json:"msgid"`
	ResponseCode string `json:"response_code"`
}

type MessageUpdateTemplateCardResponse

type MessageUpdateTemplateCardResponse struct {
	internal.BizResponse
	InvalidUser []string `json:"invalid_user"`
}

type MiniProgramMessage

type MiniProgramMessage struct {
	Message
	MiniProgramNotice MiniProgramNotice `json:"miniprogram_notice"`
}

type MiniProgramNotice

type MiniProgramNotice struct {
	Appid             string `json:"appid" validate:"required"`
	Page              string `json:"page"`
	Title             string `json:"title" validate:"required"`
	Description       string `json:"description"`
	EmphasisFirstItem bool   `json:"emphasis_first_item"`
	ContentItem       []struct {
		Key   string `json:"key" validate:"required"`
		Value string `json:"value" validate:"required"`
	} `json:"content_item"`
}

type MomentList

type MomentList struct {
	MomentID    string   `json:"moment_id"`
	Creator     string   `json:"creator"`
	CreateTime  string   `json:"create_time"`
	CreateType  int      `json:"create_type"`
	VisibleType int      `json:"visible_type"`
	Text        Text     `json:"text"`
	Image       []Image  `json:"image"`
	Video       Video    `json:"video"`
	Link        Link     `json:"link"`
	Location    Location `json:"location"`
}

type MomentListFilter

type MomentListFilter struct {
	StartTime  int64  `json:"start_time" validate:"required"`
	EndTime    int64  `json:"end_time" validate:"required"`
	Creator    string `json:"creator,omitempty"`
	FilterType int    `json:"filter_type,omitempty" validate:"omitempty,oneof=0 1 2"`
	Cursor     string `json:"cursor"`
	Limit      int    `json:"limit"`
}

type MomentTask

type MomentTask struct {
	Text         Text          `json:"text,omitempty"`
	Attachments  []Attachments `json:"attachments" validate:"required_without=Text.Content"`
	VisibleRange VisibleRange  `json:"visible_range,omitempty"`
}

type MomentTaskFilter

type MomentTaskFilter struct {
	MomentId string `json:"moment_id" validate:"required"`
	Cursor   string `json:"cursor"`
	Limit    int    `json:"limit"`
}

type MpArticle

type MpArticle struct {
	Title            string `json:"title" validate:"required"`
	ThumbMediaId     string `json:"thumb_media_id" validate:"required"`
	Author           string `json:"author,omitempty"`
	ContentSourceUrl string `json:"content_source_url,omitempty"`
	Content          string `json:"content" validate:"required"`
	Digest           string `json:"digest,omitempty"`
}

type MpNews

type MpNews struct {
	Articles []MpArticle `json:"articles" validate:"required"`
}

type MpNewsMessage

type MpNewsMessage struct {
	Message
	Safe   int    `json:"safe,omitempty" validate:"omitempty,oneof=0 1 2"`
	MpNews MpNews `json:"mpnews" validate:"required"`
}

type MultiMedia

type MultiMedia struct {
	MediaId string `json:"media_id" validate:"required"`
}

type News

type News struct {
	Articles []Article `json:"articles" validate:"required,max=8"`
}

type NewsMessage

type NewsMessage struct {
	Message
	News News `json:"news" validate:"required"`
}

type QuoteArea

type QuoteArea struct {
	Type      int    `json:"type"`
	URL       string `json:"url"`
	Title     string `json:"title"`
	QuoteText string `json:"quote_text"`
}

type SelectList

type SelectList struct {
	QuestionKey string `json:"question_key" validate:"required"`
	Title       string `json:"title,omitempty"`
	SelectedID  string `json:"selected_id,omitempty"`
	OptionList  []struct {
		ID   string `json:"id" validate:"required"`
		Text string `json:"text" validate:"required"`
	} `json:"option_list" validate:"required"`
}

SelectList 多项选择型

type SenderList

type SenderList struct {
	UserList       []string `json:"user_list"`
	DepartmentList []int    `json:"department_list"`
}

type Source

type Source struct {
	IconURL   string `json:"icon_url"`
	Desc      string `json:"desc"`
	DescColor int    `json:"desc_color"`
}

type Strategy

type Strategy struct {
	StrategyID   int      `json:"strategy_id,omitempty"`
	ParentID     int      `json:"parent_id"`
	StrategyName string   `json:"strategy_name" validate:"required"`
	CreateTime   int      `json:"create_time,omitempty"`
	AdminList    []string `json:"admin_list" validate:"required,max=20"`
	Privilege    struct {
		ViewCustomerList        bool `json:"view_customer_list"`
		ViewCustomerData        bool `json:"view_customer_data"`
		ViewRoomList            bool `json:"view_room_list"`
		ContactMe               bool `json:"contact_me"`
		JoinRoom                bool `json:"join_room"`
		ShareCustomer           bool `json:"share_customer"`
		OperResignCustomer      bool `json:"oper_resign_customer"`
		OperResignGroup         bool `json:"oper_resign_group"`
		SendCustomerMsg         bool `json:"send_customer_msg"`
		EditWelcomeMsg          bool `json:"edit_welcome_msg"`
		ViewBehaviorData        bool `json:"view_behavior_data"`
		ViewRoomData            bool `json:"view_room_data"`
		SendGroupMsg            bool `json:"send_group_msg"`
		RoomDeduplication       bool `json:"room_deduplication"`
		RapidReply              bool `json:"rapid_reply"`
		OnjobCustomerTransfer   bool `json:"onjob_customer_transfer"`
		EditAntiSpamRule        bool `json:"edit_anti_spam_rule"`
		ExportCustomerList      bool `json:"export_customer_list"`
		ExportCustomerData      bool `json:"export_customer_data"`
		ExportCustomerGroupList bool `json:"export_customer_group_list"`
		ManageCustomerTag       bool `json:"manage_customer_tag"`
	} `json:"privilege"`
}

type StrategyRange

type StrategyRange struct {
	Type    int    `json:"type" validate:"required,oneof=1 2"`
	UserId  string `json:"userid,omitempty"`
	PartyId int32  `json:"partyid,omitempty"`
}

type SubmitButton

type SubmitButton struct {
	Text string `json:"text" validate:"required"`
	Key  string `json:"key" validate:"required"`
}

type Tag

type Tag struct {
	TagId   int    `json:"tagid"`
	TagName string `json:"tagname" validate:"required,max=32"`
}

type TagAddOrDelUsersResponse

type TagAddOrDelUsersResponse struct {
	internal.BizResponse
	InvalidList  string  `json:"invalidlist,omitempty"`
	InvalidParty []int32 `json:"invalidparty,omitempty"`
}

type TagCreateResponse

type TagCreateResponse struct {
	internal.BizResponse
	TagId int `json:"tagid"`
}

type TagListResponse

type TagListResponse struct {
	internal.BizResponse
	TagList []Tag `json:"taglist"`
}

type TagUserListResponse

type TagUserListResponse struct {
	internal.BizResponse
	TagName  string `json:"tagname"`
	UserList []struct {
		UserId string `json:"userid"`
		Name   string `json:"name"`
	} `json:"userlist"`
	PartyList []int32 `json:"partylist"`
}

type TemplateCard

type TemplateCard struct {
	CardType   TemplateCardType `json:"card_type"`
	Source     Source           `json:"source"`
	ActionMenu *ActionMenu      `json:"action_menu,omitempty" validate:"required_with=TaskID"`
	TaskID     string           `json:"task_id,omitempty" validate:"required_with=ActionMenu"`
	MainTitle  MainTitle        `json:"main_title"`
	QuoteArea  QuoteArea        `json:"quote_area"`
	// 文本通知型
	EmphasisContent *EmphasisContent `json:"emphasis_content,omitempty"`
	SubTitleText    string           `json:"sub_title_text,omitempty"`
	// 图文展示型
	ImageTextArea         *ImageTextArea          `json:"image_text_area,omitempty"`
	CardImage             *CardImage              `json:"card_image,omitempty"`
	HorizontalContentList []HorizontalContentList `json:"horizontal_content_list"`
	JumpList              []JumpList              `json:"jump_list"`
	CardAction            CardAction              `json:"card_action,omitempty"`
	// 按钮交互型
	ButtonSelection *ButtonSelection `json:"button_selection,omitempty"`
	ButtonList      []Button         `json:"button_list,omitempty" validate:"omitempty,max=6"`
	// 投票选择型
	CheckBox     *CheckBox     `json:"checkbox,omitempty"`
	SelectList   []SelectList  `json:"select_list,omitempty" validate:"max=3"`
	SubmitButton *SubmitButton `json:"submit_button,omitempty"`
}

TODO: CardAction 必填(text_notice,news_notice)判断

type TemplateCardMessage

type TemplateCardMessage struct {
	Message
	TemplateCard TemplateCard `json:"template_card"`
}

TemplateCardMessage 测试发送模板卡片消息必需配置应用回调地址

type TemplateCardType

type TemplateCardType string
const (
	CardTypeTextNotice          TemplateCardType = "text_notice"
	CardTypeNewsNotice          TemplateCardType = "news_notice"
	CardTypeButtonInteraction   TemplateCardType = "button_interaction"
	CardTypeVoteInteraction     TemplateCardType = "vote_interaction"
	CardTypeMultipleInteraction TemplateCardType = "multiple_interaction"
)

type TemplateCardUpdateMessage

type TemplateCardUpdateMessage struct {
	UserIds      []string `json:"userids" validate:"omitempty,max=100"`
	PartyIds     []int64  `json:"partyids" validate:"omitempty,max=100"`
	TagIds       []int32  `json:"tagids" validate:"omitempty,max=100"`
	AtAll        int      `json:"atall,omitempty"`
	ResponseCode string   `json:"response_code" validate:"required"`
	Button       struct {
		ReplaceName string `json:"replace_name" validate:"required"`
	} `json:"button" validate:"required_without=TemplateCard"`
	TemplateCard TemplateCard `json:"template_card" validate:"required_without=Button"`
	ReplaceText  string       `json:"replace_text,omitempty"`
}

type Text

type Text struct {
	Content string `json:"content"`
}

type TextCard

type TextCard struct {
	Title       string `json:"title" validate:"required"`
	Description string `json:"description" validate:"required"`
	Url         string `json:"url" validate:"required"`
	BtnTxt      string `json:"btntxt"`
}

type TextCardMessage

type TextCardMessage struct {
	Message
	TextCard TextCard `json:"textcard" validate:"required"`
}

type TextMessage

type TextMessage struct {
	Message
	Safe int  `json:"safe,omitempty" validate:"omitempty,oneof=0 1"`
	Text Text `json:"text" validate:"required"`
}

type TransferCustomerRequest

type TransferCustomerRequest struct {
	HandoverUserId     string   `json:"handover_userid" validate:"required"`
	TakeoverUserId     string   `json:"takeover_userid" validate:"required"`
	ExternalUserId     []string `json:"external_userid" validate:"required"`
	TransferSuccessMsg string   `json:"transfer_success_msg,omitempty" validate:"omitempty,max=200"`
}

type TransferCustomerResponse

type TransferCustomerResponse struct {
	internal.BizResponse
	Customer []struct {
		ExternalUserId string `json:"external_userid"`
		ErrCode        int    `json:"errcode"`
	}
}

type TransferResultRequest

type TransferResultRequest struct {
	HandoverUserId string `json:"handover_userid" validate:"required"`
	TakeoverUserId string `json:"takeover_userid" validate:"required"`
	Cursor         string `json:"cursor"`
}

type TransferResultResponse

type TransferResultResponse struct {
	internal.BizResponse
	Customer []struct {
		ExternalUserId string `json:"external_userid"`
		Status         int    `json:"status"`
		TakeoverTime   uint64 `json:"takeover_time"`
	} `json:"customer"`
	NextCursor string `json:"next_cursor"`
}

type UnAssignedInfo

type UnAssignedInfo struct {
	HandoverUserId string `json:"handover_userid"`
	ExternalUserId string `json:"external_userid"`
	DimissionTime  uint64 `json:"dimission_time"`
}

type UnAssignedRequest

type UnAssignedRequest struct {
	PageId   int    `json:"page_id" validate:"required_without=Cursor,omitempty"`
	PageSize int    `json:"page_size" validate:"max=1000"`
	Cursor   string `json:"cursor" validate:"required_without=PageId,omitempty"`
}

type UnAssignedResponse

type UnAssignedResponse struct {
	internal.BizResponse
	Info       []UnAssignedInfo `json:"info"`
	IsLast     bool             `json:"is_last"`
	NextCursor string           `json:"next_cursor"`
}

type User

type User struct {
	OpenUserId     string   `json:"open_userid,omitempty"` // 仅在查询时返回
	Userid         string   `json:"userid" validate:"required"`
	Name           string   `json:"name" validate:"required"`
	Alias          string   `json:"alias,omitempty"`
	Mobile         string   `json:"mobile"  validate:"required_without=Email,omitempty"`
	Department     []int32  `json:"department" validate:"required,max=100"`
	Order          []int32  `json:"order,omitempty"`
	Position       string   `json:"position,omitempty"`
	Gender         string   `json:"gender,omitempty" validate:"omitempty,oneof=1 2"`
	Email          string   `json:"email"  validate:"required_without=Mobile,omitempty,email"`
	BizEmail       string   `json:"biz_email"`
	IsLeaderInDept []int    `json:"is_leader_in_dept,omitempty"`
	DirectLeader   []string `json:"direct_leader"`
	Enable         int      `json:"enable"`
	AvatarMediaid  string   `json:"avatar_mediaid,omitempty"`
	Telephone      string   `json:"telephone,omitempty"`
	Address        string   `json:"address,omitempty"`
	MainDepartment int32    `json:"main_department,omitempty"`
	Extattr        struct {
		Attrs []Attrs `json:"attrs,omitempty"`
	} `json:"extattr,omitempty"`
	ToInvite         bool   `json:"to_invite,omitempty"`
	ExternalPosition string `json:"external_position,omitempty"`
	ExternalProfile  struct {
		ExternalCorpName string `json:"external_corp_name,omitempty"`
		WechatChannels   struct {
			Nickname string `json:"nickname,omitempty"`
		} `json:"wechat_channels,omitempty"`
		ExternalAttr []ExternalAttr `json:"external_attr,omitempty"`
	} `json:"external_profile,omitempty"`
}

User 成员定义  可以参考连接:https://open.work.weixin.qq.com/api/doc/90000/90135/90195

type UserGetResponse

type UserGetResponse struct {
	internal.BizResponse
	User
}

type UserId2OpenIdResponse

type UserId2OpenIdResponse struct {
	internal.BizResponse
	OpenId string `json:"openid"`
}

type UserInfoResponse

type UserInfoResponse struct {
	internal.BizResponse
	UserId         string `json:"UserId"`
	DeviceId       string `json:"DeviceId"`
	OpenId         string `json:"OpenId"`
	ExternalUserId string `json:"external_userid"`
}

type UserListResponse

type UserListResponse struct {
	internal.BizResponse
	UserList []User `json:"userlist"`
}

type UserSimpleListResponse

type UserSimpleListResponse struct {
	internal.Error
	UserList []struct {
		UserId     string `json:"userid"`
		Name       string `json:"name"`
		Department []int  `json:"department"`
	} `json:"userlist"`
}

type Video

type Video struct {
	MediaID     string `json:"media_id" validate:"required"`
	Title       string `json:"title,omitempty"`
	Description string `json:"description,omitempty"`
}

Video 应用消息发关时title和description为可选项 朋友圈发送时只设置 media_id即可

type VideoMessage

type VideoMessage struct {
	Message
	Safe  int   `json:"safe,omitempty" validate:"omitempty,oneof=0 1"`
	Video Video `json:"video" validate:"required"`
}

type VisibleRange

type VisibleRange struct {
	SenderList          SenderList          `json:"sender_list,omitempty"`
	ExternalContactList ExternalContactList `json:"external_contact_list,omitempty"`
}

type VoiceMessage

type VoiceMessage struct {
	Message
	Safe  int        `json:"safe,omitempty"`
	Voice MultiMedia `json:"voice" validate:"required"`
}

type WorkChatConfig

type WorkChatConfig struct {
	CorpId        string
	ContactSecret string
	AppId         string
	AppSecret     string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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