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

574 Commits

Author SHA1 Message Date
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
LarryLiu
52fb5596d3 修改最新版本的授权地址 (#823)
* Update accessToken.go

add openplatform refresh_token

* Update accessToken.go

openplatform add refresh_token expire set 10 year

* Update openplatform/context/accessToken.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update accessToken.go

修改最新的授权H5链接地址

* Update accessToken.go

增加新版本授权链接

* Update accessToken.go

增加新版本授权链接

---------

Co-authored-by: houseme <housemecn@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-03-31 10:51:46 +08:00
LarryLiu
44150c557e 微信开放平台增加refreshtoken缓存 (#822)
* Update accessToken.go

add openplatform refresh_token

* Update accessToken.go

openplatform add refresh_token expire set 10 year

* Update openplatform/context/accessToken.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: houseme <housemecn@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-03-28 11:38:57 +08:00
fearlessfei
635a0c640d feat(auth): getAccessToken with context (#820) 2025-03-25 14:20:12 +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.
v2.1.8-rc.1 v2.1.8
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
mqf20
92bf6c7699 use context when getting access token (#815)
* use context

Signed-off-by: mqf20 <mingqingfoo@gmail.com>

* added docs

Signed-off-by: mqf20 <mingqingfoo@gmail.com>

* improved docs

Signed-off-by: mqf20 <mingqingfoo@gmail.com>

* added SetAccessTokenContextHandle

Signed-off-by: mqf20 <mingqingfoo@gmail.com>

---------

Signed-off-by: mqf20 <mingqingfoo@gmail.com>
2025-01-07 22:13:03 +08:00
mqf20
6b9d4f82da added GetPhoneNumberWithContext (#812)
Signed-off-by: mqf20 <mingqingfoo@gmail.com>
2025-01-07 13:31:43 +08:00
markwang
17521d047e feat: 企业微信-微信客服,客服账号列表接口支持分页拉取,接待人员增加部门ID (#798)
Co-authored-by: houseme <qzg40737@163.com>
2025-01-06 14:52:42 +08:00
Lien Li
d38e750876 add is_expire field for generateScheme (#808) 2025-01-03 10:32:30 +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
yangyl12345
4a8371e178 Feature/mini program template (#806)
* feat: 小程序发送订阅消息支持返回 msgid

* 小程序发送订阅消息支持返回 msgid

---------

Co-authored-by: w_yangyili <w_yangyili@xiwang.com>
2024-11-27 11:56:14 +08:00
yangyl12345
a571bf3546 Update default_access_token.go (#805)
* Update default_access_token.go

微信获取稳定版token,只有不等于空字符串的情况下才会返回access_token信息,未空的情况,继续调去微信服务

* 微信稳定性获取 access_token 接口,添加防止并发性获取 access_token 和多次微信服务获取代码

---------

Co-authored-by: w_yangyili <w_yangyili@xiwang.com>
2024-11-26 12:13:49 +08:00
CyJaySong
3fbe8634d9 officeaccount 和 miniprogram 添加UseStableAK 配置项 (#788) 2024-11-23 18:25:24 +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
Lien Li
2e0708845b add-show_splash_ad-for-qrcodeparam (#794) v2.1.7 2024-08-26 10:20:39 +08:00
oah8
c1770130a0 add stream_upload_source (#786)
Co-authored-by: _oah <57302072@qq.com>
2024-08-22 14:21:58 +08:00
一叶知秋
c22a036b7f fix: 增加一个用户信息接口 (#793) 2024-08-22 12:08:44 +08:00
Ji Luo Yang
05ac7148d4 feat: 公众号新增模板接口,支持模板参数传递 (#783)
* feat: 公众号新增模板接口,支持模板参数传递

* fix: 公众号新增模板接口,合并定义参数

* fix: 公众号新增模板接口,统一代码风格

---------

Co-authored-by: yangj23 <yangj23@mingyuanyun.com>
2024-07-16 21:02:59 +08:00
sam
6b3532cc2d feat: Material 增加 AddMaterialFromReader 与 AddVideoFromReader 方法 (#780)
* feat: Material 增加 AddMaterialFromReader 与 AddVideoFromReader 方法

* update: 调整 PostFileFromReader 参数。
2024-07-16 15:43:18 +08:00
ccfish
1138a7db0e feat:追加动态消息接口 (#775)
* 小程序发货信息管理

* fix golang lint

* fix miss

* fix lint

* fix lint

* fix lint

* 修复查询参数last_index=“”时异常

* 小程序消息推送

* fix lint errors

* fix lint

* fix lint

* fix lint,

* 简化写法

* fix 简化写法

* fix name in comments

* Update miniprogram.go

* add events

* change GoodsInfo type

* change statements to 50

* 追加xml支持

* fix cl lint

* 追加动态消息

* 删除多余空格

* 修复命名

* 修复createActivityId返回值类型
v2.1.7-rc.1
2024-04-23 10:03:08 +08:00
houseme
1842f08f4c fix:modify mediaID type (#771)
* fix:modify mediaID type

* upgrade action version

* upgrade

* upgrade
2024-04-16 10:52:47 +08:00
markwang
d28ca4f334 feat: optimized-error-handling&remove unused constant (#772)
* feat: optimized-error-handling&remove unused constant

* feat: optimized-error-handling

---------

Co-authored-by: markwang <www.wang61@qq.com>
2024-04-16 10:51:51 +08:00
Leo
74795e86ee fix:群发视频消息及预览图片消息错误修复 (#774)
* fix:群发图片预览消息无效

* fix:群发视频消息参数名称错误

---------

Co-authored-by: wuweichao <wuweichao@dobest.com>
2024-03-28 16:28:03 +08:00
sotoupx
179704187b fix query url scheme error bug (#766)
Co-authored-by: sotoup <sotoup@gmail.com>
2024-02-19 10:05:03 +08:00
braumye
ceb006bf58 开放平台修改小程序基础信息 (#642)
* 开放平台修改小程序基础信息

* 统一错误处理
2024-01-29 14:36:32 +08:00
markwang
9f14122a87 feat:企业微信-打卡-打卡配置及规则管理 (#755)
Co-authored-by: markwang <www.wang61@qq.com>
2024-01-12 19:24:54 +08:00
ren-jimmy
7fcd7a34dd 添加小程序获取红包封面接口 (#760)
* ADD 获取红包封面

* Update redpacketcover.go

* MOD 修改为统一错误方法

* Update go.yml
2024-01-12 19:24:08 +08:00
Jiaxi_Wu
5b29289dbb fix: 修复缓存失效时,可能会重复获取accessToken的问题 (#762)
* fix: 修复缓存失效时,可能会重复获取accessToken的问题

* feat: 添加获取AK失败时的错误信息返回

---------

Co-authored-by: wujiaxi <wujiaxi@expandera.cn>
2024-01-12 19:23:09 +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
oscar
97e1af5904 支持设置全局HTTPClient (#761)
* [新增]支持设置httpClient

* 增加说明

* 增加说明

* 格式化imports

* [fix]1.21.5 和golangci 有兼容性问题

* [fix]优化imports
2024-01-02 17:19:59 +08:00
zxfishhack
a5e674bf10 支持在请求前修改各api的地址 (#736)
* 增加URI修改接口,以支持正向代理

* Update http.go

* Update http.go
v2.1.6
2023-11-02 09:44:08 +08:00
leonard627
0ffe34187a fix:compatibility cache expiration returns empty string issue (#742) 2023-11-02 09:42:17 +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
houseme
56a3734546 Feature: improve code message subscribe (#739)
* fix

* feat(miniapp): 小程序订阅消息 (#429)

1. 用户订阅消息服务端回调处理
2. 用户订阅消息订阅通知事件推送

Co-authored-by: houseme <qzg40737@163.com>

* feat: improve subscribe msg

* feat: add v1.21 and feature branch

* feat: improve code for subscribe

* test

* test

* fix

* fix

* improve comment

* improve code for message

* improve code for unmarshal message

* improve code for message

---------

Co-authored-by: Ralph Maas <stuchilde@outlook.com>
2023-11-02 09:39:10 +08:00
施国鹏
d4fd145bb5 add: oauth 添加 ctx, 且增加 GetUserInfoByCodeCtx 方法快速获取用户信息 (#747)
* add: oauth 添加 ctx, 且增加 GetUserInfoByCodeCtx 方法快速获取用户信息

* fix: code style

* fix: white space

---------

Co-authored-by: seth-shi <shiguopeng@mampod.com>
2023-11-02 09:38: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
houseme
8f10936479 fix: util.DecodeWithError result (#729) 2023-10-07 12:55:11 +08: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
silenceper
4f6cbc3d59 remove goreleaser (#727) 2023-09-24 20:24:15 +08:00