增加任务接口逻辑
This commit is contained in:
@@ -10,9 +10,13 @@ service novatask {
|
||||
@handler GetTaskList
|
||||
get /tasks (GetTaskListReq) returns (GetTaskListResp)
|
||||
|
||||
@doc "校验任务结果"
|
||||
@handler VerifyTaskResult
|
||||
get /task/:id (TaskIdPath) returns (VerifyTaskResultResp)
|
||||
|
||||
@doc "领取任务奖励"
|
||||
@handler GetTaskReward
|
||||
get /reward/:id (GetTaskRewardReq) returns (GetTaskRewardResp)
|
||||
get /reward/:id (TaskIdPath) returns (GetTaskRewardResp)
|
||||
}
|
||||
|
||||
type GetTaskListReq {
|
||||
@@ -21,25 +25,32 @@ type GetTaskListReq {
|
||||
|
||||
type Task {
|
||||
Id uint `json:"id"`
|
||||
CommunityId uint `json:"community_id"`
|
||||
Title string `json:"title"`
|
||||
SubTitle string `json:"sub_title"`
|
||||
Description string `json:"description"`
|
||||
Points int `json:"points"`
|
||||
ButtonText string `json:"button_text"`
|
||||
Type int8 `json:"type"`
|
||||
Url string `json:"url"`
|
||||
Status int8 `json:"status"`
|
||||
StartAt string `json:"start_at"`
|
||||
EndAt string `json:"end_at"`
|
||||
Status int8 `json:"status"`
|
||||
FinishState int8 `json:"finish_state"` // 0:未完成 1:待校验 2:已完成未领取 3:已领取
|
||||
}
|
||||
|
||||
type GetTaskListResp {
|
||||
Tasks []Task `json:"tasks"`
|
||||
}
|
||||
|
||||
type GetTaskRewardReq {
|
||||
type TaskIdPath {
|
||||
ID uint `path:"id"`
|
||||
}
|
||||
|
||||
type VerifyTaskResultResp {
|
||||
Finish bool `json:"finish"`
|
||||
}
|
||||
|
||||
type GetTaskRewardResp {
|
||||
Points int `json:"points"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user