3 Star 2 Fork 1

fotomxq/weeekj_core

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
sub_nats.go 1.05 KB
一键复制 编辑 原始数据 按行查看 历史
fotomxq 提交于 2025-02-05 18:52 +08:00 . 修改项目路径;
package OrgMap
import (
BaseService "gitee.com/fotomxq/weeekj_core/v5/base/service"
CoreFilter "gitee.com/fotomxq/weeekj_core/v5/core/filter"
CoreLog "gitee.com/fotomxq/weeekj_core/v5/core/log"
CoreNats "gitee.com/fotomxq/weeekj_core/v5/core/nats"
"github.com/nats-io/nats.go"
)
func subNats() {
//订阅初始化
_ = BaseService.SetService(&BaseService.ArgsSetService{
ExpireAt: CoreFilter.GetNowTimeCarbon().AddDay().Time,
Name: "组织地图审核通知",
Description: "",
EventSubType: "all",
Code: "org_map_audit",
EventType: "nats",
EventURL: "/org/map/audit",
//TODO:待补充
EventParams: "",
})
//缴费成功
CoreNats.SubDataByteNoErr("finance_pay_finish", "/finance/pay/finish", subNatsPayFinish)
}
// 通知已经缴费
func subNatsPayFinish(_ *nats.Msg, action string, id int64, _ string, _ []byte) {
switch action {
case "finish":
//缴费完成
// 根据ID标记完成缴费
err := updateMapPay(id)
if err != nil {
CoreLog.Error("org map sub nats pay finish error: ", err)
return
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/fotomxq/weeekj_core.git
git@gitee.com:fotomxq/weeekj_core.git
fotomxq
weeekj_core
weeekj_core
v5.3.83

搜索帮助