1
0
mirror of https://github.com/silenceper/wechat.git synced 2026-02-04 12:52:27 +08:00
Commit Graph

105 Commits

Author SHA1 Message Date
曹晶
cf42cd8d54 feat: 添加获取成员多次收消息详情API (#824)
* feat(media): add getTempFile api

add getTempFile api

* feat: 添加获取成员多次收消息详情API

- 添加customerAcquisitionGetChatInfoURL常量
- 实现GetChatInfo方法及相关请求/响应结构体
- 支持企业微信获客助手多次收消息功能

---------

Co-authored-by: caojing <jingjing.cao@trustbe.cn>
2025-04-21 10:44:12 +08:00
markwang
85ee45580b feat: 企业微信-打卡-添加打卡记录 (#829) 2025-04-21 10:42:47 +08:00
markwang
208d5c528a feat: 企业微信-打卡-新增返回字段 (#827) 2025-04-18 20:08:21 +08:00
markwang
b5f9a8933e 企业微信-通讯录管理-更新成员接口,支持更新企业邮箱别名 (#826)
* feat: 企业微信-通讯录管理,新增更新成员、更新部门、删除部门方法

* feat: 企业微信-通讯录管理-更新成员接口,支持更新企业邮箱别名
2025-04-18 14:13:26 +08:00
mahongran
010e49c35c fix: work js-api signature (#818)
* feat: enhance WorkAccessToken to include AgentID for improved token management

- Added AgentID field to WorkAccessToken struct.
- Updated NewWorkAccessToken function to accept AgentID as a parameter.
- Modified access token cache key to incorporate AgentID, ensuring unique cache entries per agent.

This change improves the handling of access tokens in a multi-agent environment.

* refactor: enhance WorkAccessToken to improve cache key handling

- Updated the AgentID field in WorkAccessToken struct to clarify its optional nature for distinguishing applications.
- Modified the access token cache key construction to support both new and legacy formats based on the presence of AgentID.
- Added comments for better understanding of the cache key logic and its compatibility with historical versions.

This change improves the flexibility and clarity of access token management in multi-agent scenarios.

* feat(work): add JsSdk method for JavaScript SDK integration

- Introduced a new JsSdk method in the Work struct to facilitate the creation of a Js instance.
- This addition enhances the functionality of the Work module by enabling JavaScript SDK support.

This change improves the integration capabilities for developers working with the WeChat Work API.

* fix gofmt

* refactor(jsapi): simplify signature generation in GetConfig and GetAgentConfig methods

- Replaced the use of strconv to format the signature string with fmt.Sprintf for improved readability.
- Updated the signature generation logic in both GetConfig and GetAgentConfig methods to use a single formatted string.

This change enhances code clarity and maintains functionality in the signature generation process.

* fix gofmt

* fix gofmt

* fix gofmt

* fix gofmt

* refactor(js): correct initialization of Config in GetConfig method

- Removed redundant initialization of the Config variable and ensured it is instantiated correctly before use.
- This change improves code clarity and maintains the intended functionality of the GetConfig method.
2025-01-14 17:24:42 +08:00
mahongran
9c87d1cb34 feat:企业微信客户端API JS-SDK wx.config 和 wx.agentConfig 方法权限签名 (#817)
* feat: enhance WorkAccessToken to include AgentID for improved token management

- Added AgentID field to WorkAccessToken struct.
- Updated NewWorkAccessToken function to accept AgentID as a parameter.
- Modified access token cache key to incorporate AgentID, ensuring unique cache entries per agent.

This change improves the handling of access tokens in a multi-agent environment.

* refactor: enhance WorkAccessToken to improve cache key handling

- Updated the AgentID field in WorkAccessToken struct to clarify its optional nature for distinguishing applications.
- Modified the access token cache key construction to support both new and legacy formats based on the presence of AgentID.
- Added comments for better understanding of the cache key logic and its compatibility with historical versions.

This change improves the flexibility and clarity of access token management in multi-agent scenarios.

* feat(work): add JsSdk method for JavaScript SDK integration

- Introduced a new JsSdk method in the Work struct to facilitate the creation of a Js instance.
- This addition enhances the functionality of the Work module by enabling JavaScript SDK support.

This change improves the integration capabilities for developers working with the WeChat Work API.

* fix gofmt
2025-01-14 10:52:24 +08:00
mahongran
71c8ab58fb F ix work access token (#810)
* feat: enhance WorkAccessToken to include AgentID for improved token management

- Added AgentID field to WorkAccessToken struct.
- Updated NewWorkAccessToken function to accept AgentID as a parameter.
- Modified access token cache key to incorporate AgentID, ensuring unique cache entries per agent.

This change improves the handling of access tokens in a multi-agent environment.

* refactor: enhance WorkAccessToken to improve cache key handling

- Updated the AgentID field in WorkAccessToken struct to clarify its optional nature for distinguishing applications.
- Modified the access token cache key construction to support both new and legacy formats based on the presence of AgentID.
- Added comments for better understanding of the cache key logic and its compatibility with historical versions.

This change improves the flexibility and clarity of access token management in multi-agent scenarios.

* feat: enhance WorkAccessToken with new constructor for AgentID support

- Introduced NewWorkAccessTokenWithAgentID function to maintain backward compatibility while allowing for AgentID usage.
- Updated NewWorkAccessToken to call the new constructor, ensuring seamless integration.
- Improved error handling in GetAccessTokenContext by checking for cache availability and handling potential errors during cache operations.

This change enhances the flexibility of access token management, particularly in multi-agent scenarios, while ensuring compatibility with existing implementations.
2025-01-07 22:19:21 +08:00
markwang
17521d047e feat: 企业微信-微信客服,客服账号列表接口支持分页拉取,接待人员增加部门ID (#798)
Co-authored-by: houseme <qzg40737@163.com>
2025-01-06 14:52:42 +08:00
markwang
3bd886d7f2 feat: 企业微信-通讯录管理,新增更新成员、更新部门、删除部门方法 (#799) 2024-12-20 14:34:48 +08:00
曹晶
35af33f0bc feat(media): add UploadImgFromReader api (#802)
* feat(media): add getTempFile api

add getTempFile api

* feat(media): handle error in GetTempFile

handle error in GetTempFile

* feat(media): add UploadImgFromReader api

add UploadImgFromReader api

* fix(media): fixed not return common error

fixed not return common error
2024-12-20 14:34:27 +08:00
markwang
990ba6ede9 feat: 企业微信-接待人员管理增加部门ID及停止接待子类型 (#800) 2024-10-16 16:11:20 +08:00
曹晶
44b09c7c3b feat(media): add getTempFile api (#801)
add getTempFile api
2024-10-16 16:11:03 +08:00
oah8
c1770130a0 add stream_upload_source (#786)
Co-authored-by: _oah <57302072@qq.com>
2024-08-22 14:21:58 +08:00
markwang
9f14122a87 feat:企业微信-打卡-打卡配置及规则管理 (#755)
Co-authored-by: markwang <www.wang61@qq.com>
2024-01-12 19:24:54 +08:00
曹晶
74e3e9c04e feat(work): add member_version field in GroupChatListResponse (#757)
add member_version field in GroupChatListResponse
2024-01-02 17:24:17 +08:00
曹晶
97c9f7d908 fix(work): fix 752 (#753)
fix cannot unmarshal object into Go struct field ExternalUser.external_contact.external_profile of
type string
2024-01-02 17:23:22 +08:00
曹晶
04b62f6c3c fix(work): fixed AddGroupWelcomeTemplate Error (#745)
* fix(work): fixed  AddGroupWelcomeTemplate Error

fixed  AddGroupWelcomeTemplate Error , errcode=40063 , errmsg=some parameters are empty

* fix(work): fixed  AddGroupWelcomeTemplate Error

fixed  AddGroupWelcomeTemplate Error , errcode=40063 , errmsg=some parameters are empty
2023-11-02 09:40:36 +08:00
markwang
4adc59b1b0 feat:企业微信-打卡-新增相关查询接口 (#746)
Co-authored-by: markwang <www.wang61@qq.com>
2023-11-02 09:40:01 +08:00
ourines
dad7932574 feat(work): add department by id (#741)
* feat(work): add department by id

Refactor the DepartmentList function and add the DepartmentListByID function.

* fix: api name

* fix: formatURL name

* chore: format
2023-11-02 09:39:42 +08:00
Thinker
038037b89d feat: 企业微信-打卡-日报与月报数据 (#733)
* feat: 企业微信-打卡-日报数据

* feat: 企业微信-打卡-月报数据

* refactor:重命名checkin为record(该文件内所有方法均为获取记录)

* refactor:修改字段名称以符合golint标准

* fix: ineffectual assignment to err
2023-10-10 22:10:10 -05:00
曹晶
479ff1f242 feat(work): AddMsgTemplate api add params allow_select chat_id_list tag_filter (#730)
* feat(work): add params allow_select chat_id_list tag_filter

add params allow_select chat_id_list tag_filter

* feat(work): add params allow_select chat_id_list tag_filter

add params allow_select chat_id_list tag_filter
2023-10-10 19:32:22 +08:00
markwang
3f1c5e7637 企业微信-移除可省略的错误判断 (#734)
Co-authored-by: markwang <www.wang61@qq.com>
2023-10-10 19:31:23 +08:00
曹晶
da5067bcb2 fix(work): fix json Unmarshal Error in GetExternalUserDetail api (#732)
fix json Unmarshal Error, err=json: cannot unmarshal number into Go struct field
WechatChannel.follow_user.wechat_channels.source of type string
2023-10-09 02:02:37 -05:00
曹晶
9bfebc8a27 fix(work): fix DepartmentGet with commonError is invalid or not struct (#728)
fix DepartmentGet with commonError is invalid or not struct
2023-09-25 14:15:33 +08:00
曹晶
ead8a6fadb fix(work): fix UserGet api error userid not found (#723)
fix UserGet api error userid not found
2023-09-24 10:46:38 +08:00
曹晶
ae40639b56 feat(work): add DepartmentGet api (#718)
get single department detail
2023-09-24 10:46:18 +08:00
曹晶
8bb145155e fix(work): fix GroupChatMember struct without State (#717)
fix GroupChatMember struct without State in joinway config
2023-09-24 10:45:43 +08:00
Feng
b4f2d1793c feat: Add Checkin (#719)
* feat: Add Checkin

- Implement 'getcheckindata' API

* refactor: Change variable names

* refactor: Change struct name
2023-09-24 10:43:41 +08:00
曹晶
4a2c44c7c8 Feature/upload attachment (#720)
* feat(work): add UploadAttachment API

add UploadAttachment API

* feat(work): add UploadAttachment API

add UploadAttachment API

* feat(work): add UploadAttachment API

add UploadAttachment API
2023-09-24 10:43:11 +08:00
markwang
9e810be88a feat:企业微信-微信客服-知识库 (#715)
* feat:企业微信-微信客服=知识库

* fix:golangci-lint

* fix:移除非必要的err判断

---------

Co-authored-by: markwang <www.wang61@qq.com>
2023-09-04 20:15:13 +08:00
markwang
06719f77b7 feat:企业微信-微信客服-统计管理 (#707)
Co-authored-by: markwang <www.wang61@qq.com>
2023-08-31 14:36:22 +08:00
markwang
b70ecd93a7 feat:企业微信-消息推送新增接口 (#705)
Co-authored-by: markwang <www.wang61@qq.com>
2023-08-31 14:34:13 +08:00
曹晶
c81d0b1215 feat: 企业微信-客户联系-获客助手 (#704) 2023-08-25 18:28:21 +08:00
Feng
da80430065 feat: Add APIs for User and Department (#712) 2023-08-25 18:27:30 +08:00
markwang
7df3fe1a09 feat:企业微信-客户联系-客户朋友圈 (#702)
* feat:企业微信-客户联系-客户朋友圈

* fix:golangci-lint

---------

Co-authored-by: markwang <www.wang61@qq.com>
2023-07-31 19:32:34 +08:00
markwang
5a23c5c780 feat:企业微信-客户联系-在职继承/离职继承 (#699)
Co-authored-by: markwang <www.wang61@qq.com>
2023-07-15 23:58:24 +08:00
黄翠刚
c84eb7b550 新增获取部门列表接口:https://qyapi.weixin.qq.com/cgi-bin/department/list (#698) 2023-07-15 23:56:53 +08:00
ourines
45ad2ab8ca 调整结构体中CreateTime (#691)
* fix: 修改FollowInfo结构体中的tag标签为createtime

* fix: 统一CreateTime为int64

* chore: format

* chore: format
2023-06-30 09:54:12 +08:00
markwang
822cfaa6c8 feat:企业微信-身份验证-获取用户身份及敏感信息 (#692)
Co-authored-by: markwang <www.wang61@qq.com>
2023-06-30 09:52:44 +08:00
markwang
acaab64fe7 feat:企业微信-客户联系-规则组/规则组标签 (#697)
Co-authored-by: markwang <www.wang61@qq.com>
2023-06-30 09:51:36 +08:00
markwang
b12825f83b feat:企业微信-电子发票 (#695)
Co-authored-by: markwang <www.wang61@qq.com>
2023-06-21 17:31:08 +08:00
markwang
46c3722308 feat:企业微信-通讯录管理-互联企业 (#688) 2023-06-12 13:34:56 +08:00
jingyuexing
8bae546b77 Improve developer experience (#681)
* feat: 添加query 以及query单元测试
feat: 添加模板字符串解析以及模板字符串单元测试

* improve: 序列化请求参数,使得参数更易读

* delete: delete useless module

* format: format code

* docs: add function comment

* docs: comment method

* fix: fixed type convert error

* feat: support any type

* feat: support other type

* format: format code

* test: check logger

* format: format code

* test: udpate testing case

* del: remove useless code

* del: remove useless module

* test: update testing case

*  feat: support for unsigned integers

*  feat: template string support any type
2023-05-31 17:26:43 +08:00
markwang
9df943df69 企业微信userid与openid互换 (#676)
* 企业微信-客户联系-统计管理

* 企业微信-客户联系-统计管理

* 企业微信-客户联系-统计管理

* debug

* rollback

* debug

* debug

* 获取用户信息

* token

* json.Marshal错误输出

* debug

* bugfix

* 企业微信-通讯录管理相关接口

* 企业微信-通讯录管理

* 企业微信-通讯录管理

* 企业微信-通讯录管理

* 企业微信-[联系我]方式新增和查询

* 企业微信-[联系我]方式新增和获取

* 企业微信-[联系我]方式更新

* 企业微信-[联系我]方式列表、删除

* json.Marshal错误输出

* 已实现接口bug修改

* 历史接口bugfix

* 历史接口bugfix

* comment

* 企业微信:客户联系-消息推送;素材管理-上传图片

* fix

* 企业微信-获取群发记录列表

* 历史接口bugfix

* 1.企业微信-客户联系-消息推送-入群欢迎语素材管理
2.企业微信-通讯录管理-成员管理-获取成员ID列表

* golangci-lint

* gofmt

* 方法访问命名

* 企业微信-批量获取客户详情入参优化

* 企业微信-通讯录管理-标签管理-创建/更新/删除标签

* 请求地址常量无需导出

* 企业微信保持代码风格统一,接口URL不导出

* 企业微信-通讯录管理-标签管理-获取/增加/删除标签成员、获取标签列表

* feat:企业微信userid与openid互换

---------

Co-authored-by: wang.yu <wangyu@uniondrug.com>
Co-authored-by: markwang <www.wang61@qq.com>
2023-05-16 19:22:56 +08:00
just5325
0a37184c2f 新增应用推送消息模块,实现部分常用消息推送:SendText 发送文本消息、SendImage 发送图片消息、SendVoice 发送语音消息 企业微信应用推送消息接口:https://qyapi.weixin.qq.com/cgi-bin/appchat/send (#678)
* 修正work.GetMessage()方法的注释信息

(cherry picked from commit 3dfaf9222910ae4ad977e2852908692d04118abc)

* 新增应用推送消息模块,实现部分常用消息推送:SendText 发送文本消息、SendImage 发送图片消息、SendVoice 发送语音消息
企业微信应用推送消息接口:https://qyapi.weixin.qq.com/cgi-bin/appchat/send

(cherry picked from commit 654ea158d6590a006a8c78ac3c38eafe361fe303)
2023-05-16 19:22:18 +08:00
markwang
d92cd35533 企业微信-通讯录管理-标签管理-获取/增加/删除标签成员、获取标签列表 (#674)
* 企业微信-客户联系-统计管理

* 企业微信-客户联系-统计管理

* 企业微信-客户联系-统计管理

* debug

* rollback

* debug

* debug

* 获取用户信息

* token

* json.Marshal错误输出

* debug

* bugfix

* 企业微信-通讯录管理相关接口

* 企业微信-通讯录管理

* 企业微信-通讯录管理

* 企业微信-通讯录管理

* 企业微信-[联系我]方式新增和查询

* 企业微信-[联系我]方式新增和获取

* 企业微信-[联系我]方式更新

* 企业微信-[联系我]方式列表、删除

* json.Marshal错误输出

* 已实现接口bug修改

* 历史接口bugfix

* 历史接口bugfix

* comment

* 企业微信:客户联系-消息推送;素材管理-上传图片

* fix

* 企业微信-获取群发记录列表

* 历史接口bugfix

* 1.企业微信-客户联系-消息推送-入群欢迎语素材管理
2.企业微信-通讯录管理-成员管理-获取成员ID列表

* golangci-lint

* gofmt

* 方法访问命名

* 企业微信-批量获取客户详情入参优化

* 企业微信-通讯录管理-标签管理-创建/更新/删除标签

* 请求地址常量无需导出

* 企业微信保持代码风格统一,接口URL不导出

* 企业微信-通讯录管理-标签管理-获取/增加/删除标签成员、获取标签列表

---------

Co-authored-by: wang.yu <wangyu@uniondrug.com>
Co-authored-by: markwang <www.wang61@qq.com>
2023-05-08 11:56:48 +08:00
Mark
58621cd79d fix CallbackMessage open_kfid and SyncMsg error (#672)
* 企业微信微信客服字段同步

* fix ci lint

* fix open_kfid xml Unmarshal error and  'syncMsg: field `open_kfid` unexpected empty string. invalid Request Parameter'

* add struct CallbackMessage xml tag

---------

Co-authored-by: liuyuezhong <liuyuezhong@inke.cn>
2023-04-19 16:21:04 +08:00
Mark
4094adc5b4 企业微信微信客服字段同步 (#670)
* 企业微信微信客服字段同步

* fix ci lint

---------

Co-authored-by: liuyuezhong <liuyuezhong@inke.cn>
2023-04-18 11:07:06 +08:00
Ace
01784c2a4a fix:修复互通红包和视频号消息部分字段错误的数据类型声明 (#663)
* fix:修复消息存档内红包祝福语和视频号部分字段数据类型声明错误的问题

* docs:更新注释说明

* fix:校正互通红包内的数据结构声明类型
2023-04-03 20:31:58 +08:00
markwang
ca0b74e082 企业微信保持代码风格统一,接口URL不导出 (#660)
* 企业微信-客户联系-统计管理

* 企业微信-客户联系-统计管理

* 企业微信-客户联系-统计管理

* debug

* rollback

* debug

* debug

* 获取用户信息

* token

* json.Marshal错误输出

* debug

* bugfix

* 企业微信-通讯录管理相关接口

* 企业微信-通讯录管理

* 企业微信-通讯录管理

* 企业微信-通讯录管理

* 企业微信-[联系我]方式新增和查询

* 企业微信-[联系我]方式新增和获取

* 企业微信-[联系我]方式更新

* 企业微信-[联系我]方式列表、删除

* json.Marshal错误输出

* 已实现接口bug修改

* 历史接口bugfix

* 历史接口bugfix

* comment

* 企业微信:客户联系-消息推送;素材管理-上传图片

* fix

* 企业微信-获取群发记录列表

* 历史接口bugfix

* 1.企业微信-客户联系-消息推送-入群欢迎语素材管理
2.企业微信-通讯录管理-成员管理-获取成员ID列表

* golangci-lint

* gofmt

* 方法访问命名

* 企业微信-批量获取客户详情入参优化

* 企业微信-通讯录管理-标签管理-创建/更新/删除标签

* 请求地址常量无需导出

* 企业微信保持代码风格统一,接口URL不导出

---------

Co-authored-by: wang.yu <wangyu@uniondrug.com>
Co-authored-by: markwang <www.wang61@qq.com>
2023-04-03 17:06:07 +08:00