wangting
2025-01-16 18c43123b51a1688ab4ae01fe3d171c7d92e619b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
// **********************************************************************
//
// Copyright (c) 2008-2023 VCI-Tech, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described the
// ICE_LICENSE file included this distribution.
//
// **********************************************************************
 
#pragma once
 
#include "01-common.ice"
 
[["java:package:com.vci.corba"]]
["cs:namespace:com.vci.corba"]
 
// module com {
// module vci {
// module corba {
module message {
    module data {
        struct RefObject {
            string btName;        // 业务对象类型
            string oid;        // 对象OID
        };
        sequence<RefObject> RefObjectList;
        
        // 消息对象
        struct PLMessage{
            string oid;        // ID
            string title;        // 标题
            string content;     // 内容
            string creator;     // 创建者
            string createTime; // 创建时间
            string status;        // 状态
            RefObjectList refObjs; // 关联的业务对象
        };
        sequence<PLMessage> PLMessageList;
    }
 
    // 消息订阅回调
    interface MessageCallback {
        // 发送消息通知
        void notify(data::PLMessage msg);
        // 判断接口关联的客户端是否活着
        bool isAlive();
    }
    
    // 消息服务
    interface MessageService {
        // 注册业务对象事件消息
        //long regBusinessObjectMessage(string btName, string eventName) throws common::VCIError;
        
        // 订阅事件消息
        //bool subscribeMessage(string user, string btName, string eventName) throws common::VCIError;
 
        // 注册回调接口
        void regMessageCallback(MessageCallback* callback);
    
        // 检查我的消息数量, 根据状态查询我的消息数量,如果不设置status,则查询未读消息
        long checkMessage(string user);
        
        // 获取指定消息
        data::PLMessage getMessage(string msgid) throws common::VCIError;
        
        // 获取指定用户的所有未读消息
        data::PLMessageList getMessages(string user) throws common::VCIError;
        
        // 获取指定消息
        data::PLMessageList getMessagesByIds(common::data::StringArray msgids) throws common::VCIError;
 
        // 获取指定用户的所有指定状态的消息,不指定状态则获取所有消息
        data::PLMessageList getMessagesByPage(string user, string status, int pageNo, int pageSize) throws common::VCIError;
 
        // 设置指定消息指定用户已读
        bool setMessageReaded(string user, string msgid) throws common::VCIError;
        
        // 设置指定用户指定消息已完成
        bool setMessageCompleted(string user, string msgid) throws common::VCIError;
 
        // 创建消息,返回消息OID
        string createMessage(string title, string msg, data::RefObjectList refObjs) throws common::VCIError;
 
        // 保存并发送消息,用户账号数组
        bool createAndSendMessage(string title, string msg, data::RefObjectList refObjs, common::data::StringArray users) throws common::VCIError;
 
        // 发送消息给指定用户
        bool sendMessageTo(string msgid, common::data::StringArray users) throws common::VCIError;
    }
}
// }}}