syntax = "proto3";

package tutorial;

option java_package = "com.duowan.allstar.proto";
option java_outer_classname = "MessageProtos";

message Message {

    enum Type {
        SELF = 0;
        DATA = 1;
        NOTIFY = 2;
        ROLEOPT = 3;
    }

    Type type = 1;

    message DataMessage {
        int32 code = 1;
        int32 result = 2;
        string data = 3;
        string msg = 4;
    }

    DataMessage dataMessage = 2;

    // Enum nType {1: 普通通知;2: 好友列表通知; 3: 艺人列表通知}
    message NotificationMessage{
        int32 nType = 1;
    }

    NotificationMessage notificationMessage = 3;

    // 即对 targetUid 做了什么操作 opt
    // e.g.: 向 targetUid 赎身; 向 targetUid 签约
    // Enum opt {1: 赎身; 2: 抢夺; 3: 签约; 4: 解雇; 5: 入驻;6: 召回;7: 驱赶;8: 举报;9:通过好友申请;10:成为好友}
    message RoleOptMessage{
        // 目标用户
        int64 targetUid = 1;

        // 赎身或者抢夺成功时，前任老板的uid
        int64 exBossUid = 2;

        // 操作类型
        int32 opt = 3;
    }

    RoleOptMessage roleOptMessage = 4;

    string msg = 6;

}