package user import ( "context" "git.oa00.com/supply-chain/service/client" ) type message struct { } var ( MessageTypeOrder = messageType{ Type: 1, TypeName: "零售订单", } MessageTypeAfterOrder = messageType{ Type: 2, TypeName: "售后订单", } ) type messageType struct { Type uint TypeName string } type ArgsMessagePublish struct { CustomerId uint // 客户id Message string // 消息内容 Type messageType // 消息类型 TypeId uint // 消息来源id } // Publish @Title 推送消息 func (m *message) Publish(ctx context.Context, args ArgsMessagePublish) error { reply := 0 xClient, err := client.GetClient(m) if err != nil { return err } return xClient.Call(ctx, "Publish", args, &reply) }