syntax = "proto3";
option go_package = ".;pb";

message DBTask {
  string id = 1;                 //@go_tags(`bson:"_id"`) ID
  string uid = 2;                //@go_tags(`bson:"uid"`) 用户ID
  repeated TaskData dayList = 4; //@go_tags(`bson:"dayList"`) 日常任务列表
  repeated TaskData weekList = 5; //@go_tags(`bson:"weekList"`) 周常任务列表
  repeated TaskData achieveList =
      6; //@go_tags(`bson:"achieveList"`) 成就任务列表
}

message TaskData {
  int32 taskId = 3;   //@go_tags(`bson:"taskId"`) 任务Id
  int32 tag = 4;      //@go_tags(`bson:"tag"`) 标签
  int32 progress = 5; //@go_tags(`bson:"progress"`) 任务进度/完成次数
  int32 active = 6;   //@go_tags(`bson:"active"`) 活跃度
  int32 status = 7; //@go_tags(`bson:"status"`)  任务状态 默认0未完成 1已完成
  int32 received = 8; //@go_tags(`bson:"received"`) 领取状态 默认0未领取 1已领取
  int32 typeId = 9; //@go_tags(`bson:"typeId"`)
  int32 sort = 10;  //@go_tags(`bson:"sort"`)
}

message DBActivity {
  string id = 1;  //@go_tags(`bson:"_id"`) ID
  string uid = 2; //@go_tags(`bson:"uid"`) 用户ID
  repeated ActivityData activityList =
      3; //@go_tags(`bson:"activityList"`) 活跃度列表
}

message ActivityData {
  int32 taskId = 1; //@go_tags(`bson:"taskId"`) taskId
  int32 tag = 2;    //@go_tags(`bson:"tag"`) 标签
  int32 received = 3; //@go_tags(`bson:"received"`) 领取状态 默认0未领取 1已领取
}

message frtaskIds { repeated int32 rtaskIds = 1; }

// 玩家任务状态
message DBRtask {
  string id = 1;  //@go_tags(`bson:"_id"`) ID
  string uid = 2; //@go_tags(`bson:"uid"`) 用户ID
  map<int32, frtaskIds> frtaskIds =
      3;                 //@go_tags(`bson:"frtaskIds"`) 已完成的任务Id
  bool isReward = 5;     //@go_tags(`bson:"isReward"`) 接收奖励
}

message rtaskData {
  map<int32, int32> data = 1; //@go_tags(`bson:"data"`)  当前任务值
  int32 rtype = 2;            //@go_tags(`bson:"rtype"`)  任务类型
  int64 timestamp = 3;        //@go_tasg(`bson:"timestamp"`) 时间戳
}
// 玩家任务记录
message DBRtaskRecord {
  string id = 1;                  //@go_tags(`bson:"_id"`) ID
  string uid = 2;                 //@go_tags(`bson:"uid"`) 用户ID
  map<int32, rtaskData> vals = 3; //@go_tags(`bson:"vals"`) 任务记录值
  int64 ctime = 4; //@go_tags(`bson:"ctime"`) 创建时间
}