{"id":16953284,"url":"https://github.com/1046102779/wx_relay_server","last_synced_at":"2025-03-22T13:31:31.424Z","repository":{"id":57495653,"uuid":"84458039","full_name":"1046102779/wx_relay_server","owner":"1046102779","description":"微信公众号第三方平台中继服务器，用于刷新公众号平台自身的token和托管的公众号token, 使开发者只关注微信公众号第三方平台的业务逻辑，同时业务实例可以反复重启，不会对已托管的公众号造成任何影响","archived":false,"fork":false,"pushed_at":"2018-03-29T12:09:09.000Z","size":27,"stargazers_count":43,"open_issues_count":0,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-18T11:39:29.148Z","etag":null,"topics":["etcd","official-accounts","token","wechat"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/1046102779.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-09T15:32:54.000Z","updated_at":"2024-03-21T08:08:22.000Z","dependencies_parsed_at":"2022-08-28T19:51:51.694Z","dependency_job_id":null,"html_url":"https://github.com/1046102779/wx_relay_server","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1046102779%2Fwx_relay_server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1046102779%2Fwx_relay_server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1046102779%2Fwx_relay_server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1046102779%2Fwx_relay_server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/1046102779","download_url":"https://codeload.github.com/1046102779/wx_relay_server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244962849,"owners_count":20539230,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["etcd","official-accounts","token","wechat"],"created_at":"2024-10-13T22:06:46.409Z","updated_at":"2025-03-22T13:31:31.093Z","avatar_url":"https://github.com/1046102779.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 微信中继服务器\n 目的：其他服务采用pull模式，通过rpcx进行rpc通信，获取相关微信token. 用户微信公众号第三方平台刷公众号平台和托管的公众号appid的相关token, 该服务不能停超过10分钟(实例自动拉起crontab). 主要刷公众号第三方平台的component_access_token和preauthcode, 公众号的authorizer_access_token和authorizer_refresh_token\n\n 好处：微信公众号第三方平台中继服务器，用于刷新公众号平台自身的token和托管的公众号token, 使开发者只关注微信公众号第三方平台的业务逻辑，同时业务实例可以反复重启，不会对已托管的公众号造成任何影响\n \n\n 存储方式：etcd存储rpc服务地址和微信公众号平台和公众号token, 使用etcd的ttl特性，并watch并刷新\n\n## 新增服务的可靠性措施\n    1. 服务启动后，立即读取etcd中的所有微信公众平台和公众号数据，加载到内存中。 并监听所有token\n\nStandard  `go get`:\n\n```go\n$  go get -v -u github.com/1046102779/wx_relay_server\n```\n\n## Index\n\n```go\ntype WxRelayServer struct{}\n\n// 获取公众号平台基本信息，包括appid，token等信息\nfunc (t *WxRelayServer) GetOfficialAccountPlatformInfo(in *pb.OfficialAccountPlatform, out *pb.OfficialAccountPlatform) error\n\n// 存储托管公众号的token相关信息\nfunc (t *WxRelayServer) StoreOfficialAccountInfo(in *pb.OfficialAccount, out *pb.OfficialAccount) error\n\n// 获取公众号token信息, 用于公众号第三方平台发起公众号的托管业务\nfunc (t *WxRelayServer) GetOfficialAccountInfo(in *pb.OfficialAccount, out *pb.OfficialAccount) error\n\n// 刷新component_verify_ticket， 并同时中继服务器刷公众号第三方平台的其他token\nfunc (t *WxRelayServer) RefreshComponentVerifyTicket(in *pb.ComponentVerifyTicket, out *pb.ComponentVerifyTicket) error\n```\n\n## 说明\n\n+ `希望与大家一起成长，有任何该服务运行或者代码问题，可以及时找我沟通，喜欢开源，热爱开源, 欢迎多交流`   \n+ `联系方式：cdh_cjx@163.com`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1046102779%2Fwx_relay_server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F1046102779%2Fwx_relay_server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1046102779%2Fwx_relay_server/lists"}