初始化项目
This commit is contained in:
46
doc/api/nova-task.api
Normal file
46
doc/api/nova-task.api
Normal file
@@ -0,0 +1,46 @@
|
||||
syntax = "v1"
|
||||
|
||||
@server (
|
||||
prefix: /api/task/v1
|
||||
group: task
|
||||
jwt: Auth
|
||||
)
|
||||
service novatask {
|
||||
@doc "获取任务列表"
|
||||
@handler GetTaskList
|
||||
get /tasks (GetTaskListReq) returns (GetTaskListResp)
|
||||
|
||||
@doc "领取任务奖励"
|
||||
@handler GetTaskReward
|
||||
get /reward/:id (GetTaskRewardReq) returns (GetTaskRewardResp)
|
||||
}
|
||||
|
||||
type GetTaskListReq {
|
||||
CommunityId uint `form:"community_id"`
|
||||
}
|
||||
|
||||
type Task {
|
||||
Id uint `json:"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"`
|
||||
StartAt string `json:"start_at"`
|
||||
EndAt string `json:"end_at"`
|
||||
Status int8 `json:"status"`
|
||||
}
|
||||
|
||||
type GetTaskListResp {
|
||||
Tasks []Task `json:"tasks"`
|
||||
}
|
||||
|
||||
type GetTaskRewardReq {
|
||||
ID uint `path:"id"`
|
||||
}
|
||||
|
||||
type GetTaskRewardResp {
|
||||
Points int `json:"points"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user