add wx code.
Some checks failed
Deploy / Build (push) Failing after 1m35s

This commit is contained in:
amass 2025-06-03 18:48:40 +08:00
parent d881848fa4
commit 0c7e06f3db
3 changed files with 15 additions and 0 deletions

View File

@ -19,6 +19,7 @@ Context::Context(boost::asio::io_context &ioContext) : m_ioContext(ioContext), m
manager->subscribe<Older::NotifyServerChan>(
[this](const boost::beast::http::request<boost::beast::http::string_body> &request) { notify(request); });
}
registerMoneyNote();
}
void Context::sendMessage(MessageType type, const std::string &message) {
@ -124,5 +125,16 @@ void Context::updateAccessToken() {
}
}
void Context::registerMoneyNote() {
// 接口说明: https://developer.work.weixin.qq.com/document/10514
using namespace Core;
using namespace Older;
using namespace boost::urls;
auto manager = Singleton<MessageManager>::instance();
manager->publish<RegisterUrlHandler>(
"/api/v1/wx/moneynote",
[this](HttpSession &session, const HttpRequest &request, const matches &matches) { LOG(info) << request.target(); });
}
} // namespace Corporation
} // namespace WeChat

View File

@ -32,6 +32,7 @@ public:
protected:
Context(boost::asio::io_context &ioContext);
void updateAccessToken();
void registerMoneyNote();
private:
boost::asio::io_context &m_ioContext;

View File

@ -51,3 +51,5 @@ function main() {
}
main $@
# docker run -it -d --name ubuntu -v ~/Projects:/home/amass/Projects registry.cn-shenzhen.aliyuncs.com/amass_toolset/ubuntu_dev:24.04-qt6.9.0