书籍列表接口新增参数

This commit is contained in:
2025-08-13 15:19:42 +08:00
parent 6ccc87f2bf
commit 8afe651c64
201 changed files with 6987 additions and 1066 deletions

19
api/task/task.go Normal file
View File

@ -0,0 +1,19 @@
// =================================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// =================================================================================
package task
import (
"context"
"server/api/task/v1"
)
type ITaskV1 interface {
List(ctx context.Context, req *v1.ListReq) (res *v1.ListRes, err error)
Add(ctx context.Context, req *v1.AddReq) (res *v1.AddRes, err error)
Edit(ctx context.Context, req *v1.EditReq) (res *v1.EditRes, err error)
Del(ctx context.Context, req *v1.DelReq) (res *v1.DelRes, err error)
AppList(ctx context.Context, req *v1.AppListReq) (res *v1.AppListRes, err error)
}

61
api/task/v1/task.go Normal file
View File

@ -0,0 +1,61 @@
package v1
import (
"server/internal/model"
"github.com/gogf/gf/v2/frame/g"
)
// ================== 任务接口 ==================
type ListReq struct {
g.Meta `path:"/task" tags:"Backend/Task" method:"get" summary:"任务列表"`
Page int `json:"page"`
Size int `json:"size"`
Title string `json:"title" dc:"任务标题(模糊搜索)"`
Status int `json:"status" dc:"状态1启用2禁用"`
}
type ListRes struct {
Total int `json:"total"`
List []model.Task `json:"list"`
}
type AddReq struct {
g.Meta `path:"/task" tags:"Backend/Task" method:"post" summary:"新增任务"`
TaskType uint `json:"taskType"`
Title string `json:"title"`
Description string `json:"description"`
RewardPoints uint `json:"rewardPoints"`
Status int `json:"status"`
}
type AddRes struct {
Success bool `json:"success"`
}
type EditReq struct {
g.Meta `path:"/task" tags:"Backend/Task" method:"put" summary:"编辑任务"`
Id int64 `json:"id"`
TaskType uint `json:"taskType"`
Title string `json:"title"`
Description string `json:"description"`
RewardPoints uint `json:"rewardPoints"`
Status int `json:"status"`
}
type EditRes struct {
Success bool `json:"success"`
}
type DelReq struct {
g.Meta `path:"/task" tags:"Backend/Task" method:"delete" summary:"删除任务"`
Id int64 `json:"id"`
}
type DelRes struct {
Success bool `json:"success"`
}
// ================== App端任务接口 ==================
type AppListReq struct {
g.Meta `path:"/task/appList" tags:"APP/Task" method:"get" summary:"App端任务列表"`
}
type AppListRes struct {
List []model.TaskSimpleItem `json:"list"`
}