syntax="proto3";
package pb;

// 钱包工程专用

enum Ec {
    SUCCESS = 0;                //操作成功
    PARAMS_ = 1;                //参数错误
    TOKEN   = 2;                //Token验证失败
    COMMAND_NOT_FOUND = 3;      //Command 未找到
    ILLEGAL_OP  = 4;            //非法操作
    FMT_DATE    = 10;           //日期格式错误
    FMT_DATA    = 11;           //数据格式错误
    NO_PRIVILEGES = 97;         //没有权限
    FAILED_OP   = 98;           //操作失败
    UNKNOWN     = 99;           //未知错误
    ACCOUNT_LOCKED = 100;       //账号被锁定
    FMT_ACCOUNT = 101;          //账号格式错误
    ACCOUNT_NOT_EXISTS = 102;   //账号不存在
    ACCOUNT_OCCUPIED = 103;     //此账号被占用
    FMT_PASSWORD = 104;         //密码格式错误
    WRONG_PASSWORD = 105;       //密码错误
    PASSWORD_NO_CHANGES = 106;  //新旧密码相同
    INVALID_ACCOUNT = 107;      //会员账号不可用
    FAILED_LOGIN    = 108;      //登入失败
    FAILED_REG      = 109;      //注册失败
    LOGIN_ALREADY   = 110;      //此账号已登入
    LOGOUT_ALREADY  = 111;      //此账号已登出
    NOT_LOGIN       = 112;      //此账号未登入
    NOT_A_AGENT     = 113;      //传入的代理账号不是代理
    MEMBER_NOT_FOUND = 114;     //找不到会员
    ACCOUNT_OCCUPIED2 = 116;    // see 103//账号已占用
    COMPANY_NOT_FOUND = 117;    //找不到会员所属的分公司
    AGENT_NOT_FOUND = 118;      //找不到指定的代理
    BALANCE_INSUFFICIENT = 120; //余额不足
    NO_MORE_FREE_ACCOUNT = 150; //免费试玩账号用完
    SYS_MAINTAIN    = 300;      //系统维护
    API_KEY_ERR     = 320;      //API Key 错误
    LIMITATION_GROUP_NOT_FOUND = 321;//找不到相应的限红组
    CURRENCY_NOT_FOUND = 322;   //找不到指定的货币类型
    TRANSFER_SEQ_NUMBER_OCCUPIED = 323;//转账流水号占用
    FAILED_TRANSFER = 324;      //转账失败
    INVALID_AGENT_STATUS = 325; //代理状态不可用
    MEMBER_NO_VIDEO_GROUP = 326;//会员代理没有视频组
    CLIENT_IP_FORBIDEN = 400;   //客户端IP 受限
    NETWORK_LATENCY = 401;      //网络延迟
    NETWORK_CLOSED = 402;       //连接关闭
    CLIENT_SOURCE_FORBIDDEN = 403;//客户端来源受限
    RESOURCE_NOT_FOUND = 404;     //请求的资源不存在
    REQUEST_FREQUENCY = 405;    //请求太频繁
    REQUEST_TIMEOUT = 406;      //请求超时
    GAME_ADDR_NOT_FOUND = 407;  //找不到游戏地址
    NULL_POINTER_EXCEPTION = 500;//空指针异常
    SYSTEM_EXCEPTION = 501;     //系统异常
    SYSTEM_BUSY = 502;          //系统忙
    DATA_OP_EXCEPTION = 503;    //数据操作异常
}

enum MemberStatus{
    DISBALED = 0;
    OK       = 1;
    BLOCKED  = 2;   // 不能下注
}

message Member{
    string username = 1;        // 会员登入账号
    string password = 2;        // 会员密码 md5
    double balance  = 3;        // 会员余额
    int32  status   = 4;        // 会员状态 see MemberStatus
    string currency = 5;        // 会员货币类型
    double winLimit = 6;        // 会员盈利限制
    double amount   = 7;        // 存取款金额
}

message Order {
    string username     = 1;    // 会员登入账号
    int64   ticketId    = 2;    // 注单ID
    string  serial      = 3;    // 转账流水号
    double  amount      = 4;    // 转账金额
}