github.com/lianghucheng/zrddz@v0.0.0-20200923083010-c71f680932e2/src/msg/share.go (about)

     1  package msg
     2  
     3  func init() {
     4  	Processor.Register(&S2C_ShareTasksInfo{})
     5  	Processor.Register(&C2S_GetShareTaskInfo{})
     6  	Processor.Register(&C2S_BindSharer{})
     7  	Processor.Register(&S2C_BindSharer{})
     8  	Processor.Register(&C2S_ShareRecord{})
     9  	Processor.Register(&S2C_ShareRecord{})
    10  	Processor.Register(&C2S_CopyExchangeCode{})
    11  	Processor.Register(&S2C_CopyExchangeCode{})
    12  	Processor.Register(&C2S_Achievement{})
    13  	Processor.Register(&S2C_Achievement{})
    14  	Processor.Register(&C2S_AbleProfit{})
    15  	Processor.Register(&S2C_AbleProfit{})
    16  	Processor.Register(&C2S_AgentNumbersProfit{})
    17  	Processor.Register(&S2C_AgentNumbersProfit{})
    18  	Processor.Register(&C2S_ReceiveShareProfit{})
    19  	Processor.Register(&S2C_ReceiveShareProfit{})
    20  	Processor.Register(&C2S_TakenProfit{})
    21  	Processor.Register(&S2C_TakenProfit{})
    22  }
    23  
    24  //任务列表
    25  type C2S_GetShareTaskInfo struct {
    26  }
    27  type S2C_ShareTasksInfo struct {
    28  	ShareTasks []*ShareTasks //分享任务列表
    29  }
    30  type ShareTasks struct {
    31  	FeeDes string //奖励
    32  	Desc   string //任务描述
    33  }
    34  
    35  //绑定邀请人
    36  type C2S_BindSharer struct {
    37  	AccountID string //绑定玩家的邀请码
    38  }
    39  
    40  const (
    41  	BindSharerOK       = 0 //成功
    42  	BindSharerAbnormal = 1 //格式错误,请重新绑定
    43  	BindShareLate      = 2 //邀请人注册时间较晚,请绑定其他推荐码
    44  	BindNotToLevel     = 3 //下级不能绑定到上级
    45  	BindRobot          = 4 //绑定目标是机器人或者自己是机器人
    46  	BindDuplicate      = 5 //已绑定
    47  	BindSelf           = 6 //绑定自己
    48  )
    49  
    50  type S2C_BindSharer struct {
    51  	Error    int   //详见错误码描述
    52  	ParentId int64 //(绑定成功后)更新玩家的绑定码
    53  }
    54  
    55  //获取领取记录
    56  type C2S_ShareRecord struct {
    57  	Page int //页码
    58  	Per  int //条数
    59  }
    60  
    61  type S2C_ShareRecord struct {
    62  	Page              int                 //页码
    63  	Per               int                 //条数
    64  	Total             int                 //总数
    65  	ShareTakenRecords []*ShareTakenRecord //数据
    66  }
    67  
    68  type ShareTakenRecord struct {
    69  	ID           int     //唯一标识
    70  	Fee          float64 //奖励金额
    71  	Level        int     //来源代理层级
    72  	DirID        int     `json:"-"` //目标人
    73  	CreatedAt    int64   //创建时间
    74  	IsCopy       bool    //是否已复制
    75  	ExchangeCode string  //兑换码
    76  }
    77  
    78  //累计总收入
    79  type C2S_TakenProfit struct {
    80  }
    81  
    82  type S2C_TakenProfit struct {
    83  	TakenProfit float64 //累计总收入
    84  }
    85  
    86  //复制兑换码
    87  type C2S_CopyExchangeCode struct {
    88  	ShareRecordID int //要复制的记录id
    89  }
    90  
    91  const (
    92  	CopyOK   = 0 //复制操作成功
    93  	CopyFail = 1 //复制操作失败
    94  )
    95  
    96  type S2C_CopyExchangeCode struct {
    97  	Error         int //错误码
    98  	ShareRecordID int //要复制的记录id
    99  }
   100  
   101  //业绩详情列表
   102  type C2S_Achievement struct {
   103  	Level int //代理级别
   104  	Page  int //页码
   105  	Per   int //条数
   106  }
   107  
   108  type Achievement struct {
   109  	Createdat int64   `json:"-"` //创建时间
   110  	AccountId int64   //用户Id
   111  	Recharge  float64 //累计充值金额
   112  	AllProfit float64 //贡献总收益
   113  	Profit    float64 //可领取收益
   114  	Updatedat int64   `json:"-"` //更新时间
   115  }
   116  type S2C_Achievement struct {
   117  	Page         int           //页码
   118  	Per          int           //条数
   119  	Total        int           //总数
   120  	Achievements []Achievement //业绩数据
   121  }
   122  
   123  //可领取收益
   124  type C2S_AbleProfit struct {
   125  	Level int //代理级别
   126  }
   127  
   128  type S2C_AbleProfit struct {
   129  	AbleProfit float64 //可领取收益
   130  }
   131  
   132  //代理人数和对应的总收益
   133  type C2S_AgentNumbersProfit struct {
   134  }
   135  
   136  type S2C_AgentNumbersProfit struct {
   137  	NumbersProfits []NumbersProfit //代理人数和对应的总收益数据
   138  }
   139  
   140  type NumbersProfit struct {
   141  	Level  int     //代理级别
   142  	Number int     //数量
   143  	Profit float64 //可领取收益
   144  }
   145  
   146  //领取总收益
   147  type C2S_ReceiveShareProfit struct {
   148  	Level int //代理级别
   149  }
   150  
   151  const (
   152  	ReceiveOK   = 0 //成功
   153  	ReceiveFail = 1 //失败
   154  )
   155  
   156  type S2C_ReceiveShareProfit struct {
   157  	Error        int     //错误码
   158  	Profit       float64 //领取成功的收益
   159  	ExchangeCode string  //兑换码
   160  }