89 lines
2.6 KiB
Plaintext
89 lines
2.6 KiB
Plaintext
syntax = "v1"
|
|
|
|
@server (
|
|
prefix: /gapi/task/v1
|
|
group: task
|
|
)
|
|
service novatask {
|
|
@doc "获取任务列表"
|
|
@handler GetTaskList
|
|
get /tasks (GetTaskListReq) returns (GetTaskListResp)
|
|
|
|
@doc "获取社区列表"
|
|
@handler GetCommunityList
|
|
get /community returns (GetCommunityListResp)
|
|
}
|
|
|
|
@server (
|
|
prefix: /gapi/task/v1
|
|
group: task
|
|
jwt: Auth
|
|
)
|
|
service novatask {
|
|
@doc "校验任务结果"
|
|
@handler VerifyTaskResult
|
|
get /task (VerifyTaskResultReq) returns (VerifyTaskResultResp)
|
|
|
|
@doc "领取任务奖励"
|
|
@handler GetTaskReward
|
|
get /reward/:id (TaskIdPath) returns (GetTaskRewardResp)
|
|
}
|
|
|
|
type GetTaskListReq {
|
|
CommunityId uint `form:"community_id,optional"` // 所属社区ID
|
|
}
|
|
|
|
type Task {
|
|
Id uint `json:"id"` // 任务ID
|
|
CommunityId uint `json:"community_id"` // 所属社区ID
|
|
Title string `json:"title"` // 任务标题
|
|
SubTitle string `json:"sub_title"` // 副标题
|
|
Description string `json:"description"` // 任务描述
|
|
Points int `json:"points"` // 任务积分
|
|
ButtonText string `json:"button_text"` // 按钮文字
|
|
Params string `json:"params"` // 参数
|
|
Type int8 `json:"type"` // 任务类型: 0=follow_twitter,1=bind_twitter,2=cast_twitter,3=publish_twitter,4=repost_twitter,5=watch_youtube,6=follow_youtube,7=bind_discord,8=join_telegram,9=daily_pay,10=invite_user
|
|
Url string `json:"url"` // 跳转链接
|
|
Sort int `json:"sort"` // 排序
|
|
StartAt string `json:"start_at"` // 开始时间
|
|
EndAt string `json:"end_at"` // 结束时间
|
|
HasFinishCount int `json:"has_finish_count"` // 当前完成进度
|
|
TotalCount int `json:"total_count"` // 总进度
|
|
FinishState int8 `json:"finish_state"` // 0:未完成 1:待校验 2:已完成未领取 3:已领取
|
|
}
|
|
|
|
type GetTaskListResp {
|
|
Tasks []Task `json:"tasks"`
|
|
}
|
|
|
|
type VerifyTaskResultReq {
|
|
ID uint `form:"id"` // 任务ID
|
|
Params string `form:"params,optional"` // 额外的参数
|
|
}
|
|
|
|
type TaskIdPath {
|
|
ID uint `path:"id"` // 任务ID
|
|
}
|
|
|
|
type VerifyTaskResultResp {
|
|
Finish bool `json:"finish"` // 是否完成
|
|
}
|
|
|
|
type GetTaskRewardResp {
|
|
Points int `json:"points"` // 积分
|
|
}
|
|
|
|
type Community {
|
|
Id uint `json:"id"` // 社区ID
|
|
Title string `json:"title"` // 社区标题
|
|
Logo string `json:"logo"` // 社区图标
|
|
Description string `json:"description"` // 社区描述
|
|
StartAt int64 `json:"start_at"` // 开始时间
|
|
EndAt int64 `json:"end_at"` // 结束时间
|
|
}
|
|
|
|
type GetCommunityListResp {
|
|
CommunityList []Community `json:"community_list"` // 社区列表
|
|
}
|
|
|