书籍列表接口新增参数
This commit is contained in:
27
api/activity/activity.go
Normal file
27
api/activity/activity.go
Normal file
@ -0,0 +1,27 @@
|
||||
// =================================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// =================================================================================
|
||||
|
||||
package activity
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"server/api/activity/v1"
|
||||
)
|
||||
|
||||
type IActivityV1 interface {
|
||||
RuleList(ctx context.Context, req *v1.RuleListReq) (res *v1.RuleListRes, err error)
|
||||
RuleAdd(ctx context.Context, req *v1.RuleAddReq) (res *v1.RuleAddRes, err error)
|
||||
RuleEdit(ctx context.Context, req *v1.RuleEditReq) (res *v1.RuleEditRes, err error)
|
||||
RuleDel(ctx context.Context, req *v1.RuleDelReq) (res *v1.RuleDelRes, err error)
|
||||
RuleSetStatus(ctx context.Context, req *v1.RuleSetStatusReq) (res *v1.RuleSetStatusRes, err error)
|
||||
ItemList(ctx context.Context, req *v1.ItemListReq) (res *v1.ItemListRes, err error)
|
||||
ItemAdd(ctx context.Context, req *v1.ItemAddReq) (res *v1.ItemAddRes, err error)
|
||||
ItemEdit(ctx context.Context, req *v1.ItemEditReq) (res *v1.ItemEditRes, err error)
|
||||
ItemDel(ctx context.Context, req *v1.ItemDelReq) (res *v1.ItemDelRes, err error)
|
||||
ItemGet(ctx context.Context, req *v1.ItemGetReq) (res *v1.ItemGetRes, err error)
|
||||
ItemSetStatus(ctx context.Context, req *v1.ItemSetStatusReq) (res *v1.ItemSetStatusRes, err error)
|
||||
SignInList(ctx context.Context, req *v1.SignInListReq) (res *v1.SignInListRes, err error)
|
||||
SignIn(ctx context.Context, req *v1.SignInReq) (res *v1.SignInRes, err error)
|
||||
}
|
||||
143
api/activity/v1/activity.go
Normal file
143
api/activity/v1/activity.go
Normal file
@ -0,0 +1,143 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"server/internal/model"
|
||||
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
type RuleListReq struct {
|
||||
g.Meta `path:"/activity" tags:"Backend/Activity" method:"get" summary:"获取签到奖励规则列表"`
|
||||
Page int `json:"page" dc:"页码"`
|
||||
Size int `json:"size" dc:"每页数量"`
|
||||
Status int `json:"status" dc:"状态"`
|
||||
RuleName string `json:"ruleName" dc:"规则名称"`
|
||||
}
|
||||
type RuleListRes struct {
|
||||
Total int `json:"total" dc:"总数"`
|
||||
List []model.SignInRewardRule `json:"list" dc:"规则列表"`
|
||||
}
|
||||
|
||||
type RuleAddReq struct {
|
||||
g.Meta `path:"/activity" tags:"Backend/Activity" method:"post" summary:"新增签到奖励规则"`
|
||||
RuleName string `json:"ruleName" dc:"规则名称" v:"required"`
|
||||
CycleDays int `json:"cycleDays" dc:"周期天数" v:"required"`
|
||||
StartDate string `json:"startDate" dc:"开始日期" v:"required"`
|
||||
EndDate string `json:"endDate" dc:"结束日期" v:"required"`
|
||||
Status int `json:"status" dc:"状态" v:"required"`
|
||||
}
|
||||
type RuleAddRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
|
||||
type RuleEditReq struct {
|
||||
g.Meta `path:"/activity/{id}" tags:"Backend/Activity" method:"put" summary:"编辑签到奖励规则"`
|
||||
Id int64 `json:"id" dc:"规则ID" v:"required"`
|
||||
RuleName string `json:"ruleName" dc:"规则名称" v:"required"`
|
||||
CycleDays int `json:"cycleDays" dc:"周期天数" v:"required"`
|
||||
StartDate string `json:"startDate" dc:"开始日期" v:"required"`
|
||||
EndDate string `json:"endDate" dc:"结束日期" v:"required"`
|
||||
Status int `json:"status" dc:"状态" v:"required"`
|
||||
}
|
||||
type RuleEditRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
|
||||
type RuleDelReq struct {
|
||||
g.Meta `path:"/activity/{id}" tags:"Backend/Activity" method:"delete" summary:"删除签到奖励规则"`
|
||||
Id int64 `json:"id" dc:"规则ID" v:"required"`
|
||||
}
|
||||
type RuleDelRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
|
||||
type RuleSetStatusReq struct {
|
||||
g.Meta `path:"/activity/{id}/status" tags:"Backend/Activity" method:"patch" summary:"设置签到奖励规则状态"`
|
||||
Id int64 `json:"id" dc:"规则ID" v:"required"`
|
||||
Status int `json:"status" dc:"状态" v:"required"`
|
||||
}
|
||||
type RuleSetStatusRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
|
||||
// 签到奖励明细列表
|
||||
type ItemListReq struct {
|
||||
g.Meta `path:"/activity/items" tags:"Backend/Activity" method:"get" summary:"获取签到奖励明细列表"`
|
||||
RuleId int64 `json:"ruleId" dc:"规则ID" v:"required"`
|
||||
}
|
||||
type ItemListRes struct {
|
||||
List []model.SignInRewardDetail `json:"list" dc:"明细列表"`
|
||||
}
|
||||
|
||||
// 新增签到奖励明细
|
||||
type ItemAddReq struct {
|
||||
g.Meta `path:"/activity/item" tags:"Backend/Activity" method:"post" summary:"新增签到奖励明细"`
|
||||
RuleId int64 `json:"ruleId" dc:"规则ID" v:"required"`
|
||||
DayNumber int `json:"dayNumber" dc:"签到天数" v:"required"`
|
||||
RewardType int `json:"rewardType" dc:"奖励类型" v:"required"`
|
||||
Quantity int `json:"quantity" dc:"奖励数量" v:"required"`
|
||||
Status int `json:"status" dc:"状态" v:"required"`
|
||||
}
|
||||
type ItemAddRes struct {
|
||||
Id int64 `json:"id" dc:"明细ID"`
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
|
||||
// 编辑签到奖励明细
|
||||
type ItemEditReq struct {
|
||||
g.Meta `path:"/activity/item/{id}" tags:"Backend/Activity" method:"put" summary:"编辑签到奖励明细"`
|
||||
Id int64 `json:"id" dc:"明细ID" v:"required"`
|
||||
RuleId int64 `json:"ruleId" dc:"规则ID" v:"required"`
|
||||
DayNumber int `json:"dayNumber" dc:"签到天数" v:"required"`
|
||||
RewardType int `json:"rewardType" dc:"奖励类型" v:"required"`
|
||||
Quantity int `json:"quantity" dc:"奖励数量" v:"required"`
|
||||
Status int `json:"status" dc:"状态" v:"required"`
|
||||
}
|
||||
type ItemEditRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
|
||||
// 删除签到奖励明细
|
||||
type ItemDelReq struct {
|
||||
g.Meta `path:"/activity/item/{id}" tags:"Backend/Activity" method:"delete" summary:"删除签到奖励明细"`
|
||||
Id int64 `json:"id" dc:"明细ID" v:"required"`
|
||||
}
|
||||
type ItemDelRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
|
||||
// 查询单个签到奖励明细
|
||||
type ItemGetReq struct {
|
||||
g.Meta `path:"/activity/item/{id}" tags:"Backend/Activity" method:"get" summary:"获取单个签到奖励明细"`
|
||||
Id int64 `json:"id" dc:"明细ID" v:"required"`
|
||||
}
|
||||
type ItemGetRes struct {
|
||||
model.SignInRewardDetail
|
||||
}
|
||||
|
||||
// 设置签到奖励明细状态
|
||||
type ItemSetStatusReq struct {
|
||||
g.Meta `path:"/activity/item/{id}/status" tags:"Backend/Activity" method:"patch" summary:"设置签到奖励明细状态"`
|
||||
Id int64 `json:"id" dc:"明细ID" v:"required"`
|
||||
Status int `json:"status" dc:"状态" v:"required"`
|
||||
}
|
||||
type ItemSetStatusRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
|
||||
type SignInListReq struct {
|
||||
g.Meta `path:"/activity/sign" tags:"APP/Activity" method:"get" summary:"用户签到任务列表"`
|
||||
}
|
||||
type SignInListRes struct {
|
||||
List []model.SignInListItem `json:"list" dc:"签到列表"`
|
||||
}
|
||||
|
||||
// 用户签到
|
||||
type SignInReq struct {
|
||||
g.Meta `path:"/activity/sign" tags:"APP/Activity" method:"post" summary:"用户签到"`
|
||||
RuleId int64 `json:"ruleId" dc:"规则ID" v:"required"`
|
||||
RewardDetailId int64 `json:"rewardDetailId" dc:"奖励明细ID" v:"required"`
|
||||
}
|
||||
type SignInRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
@ -9,8 +9,9 @@ type InfoReq struct {
|
||||
}
|
||||
type InfoRes struct {
|
||||
g.Meta `mime:"application/json"`
|
||||
AdminId int64 `json:"adminId"`
|
||||
Id int64 `json:"id"`
|
||||
Username string `json:"username"`
|
||||
Role string `json:"role"`
|
||||
}
|
||||
|
||||
type EditPassReq struct {
|
||||
|
||||
15
api/ads/ads.go
Normal file
15
api/ads/ads.go
Normal file
@ -0,0 +1,15 @@
|
||||
// =================================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// =================================================================================
|
||||
|
||||
package ads
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"server/api/ads/v1"
|
||||
)
|
||||
|
||||
type IAdsV1 interface {
|
||||
Upload(ctx context.Context, req *v1.UploadReq) (res *v1.UploadRes, err error)
|
||||
}
|
||||
16
api/ads/v1/ads.go
Normal file
16
api/ads/v1/ads.go
Normal file
@ -0,0 +1,16 @@
|
||||
package v1
|
||||
|
||||
import "github.com/gogf/gf/v2/frame/g"
|
||||
|
||||
// UploadReq 广告数据上传请求
|
||||
type UploadReq struct {
|
||||
g.Meta `path:"/ads/upload" tags:"APP/Ads" method:"post" summary:"广告数据上传"`
|
||||
NodeUid string `json:"node_uid" dc:"节点ID" v:"required"`
|
||||
DeviceCode string `json:"device_code" dc:"设备编号" v:"required"`
|
||||
Data string `json:"data" dc:"广告数据" v:"required"`
|
||||
}
|
||||
|
||||
// UploadRes 广告数据上传响应
|
||||
type UploadRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
@ -16,4 +16,5 @@ type IAuthV1 interface {
|
||||
UserRegister(ctx context.Context, req *v1.UserRegisterReq) (res *v1.UserRegisterRes, err error)
|
||||
UserEditPass(ctx context.Context, req *v1.UserEditPassReq) (res *v1.UserEditPassRes, err error)
|
||||
UserCode(ctx context.Context, req *v1.UserCodeReq) (res *v1.UserCodeRes, err error)
|
||||
AuthorLogin(ctx context.Context, req *v1.AuthorLoginReq) (res *v1.AuthorLoginRes, err error)
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@ package v1
|
||||
import "github.com/gogf/gf/v2/frame/g"
|
||||
|
||||
type AdminLoginReq struct {
|
||||
g.Meta `path:"/admin/login" tags:"Admin" method:"post" summary:"管理员登录"`
|
||||
g.Meta `path:"/admin/login" tags:"Backend/Admin" method:"post" summary:"管理员登录"`
|
||||
Username string `json:"username" v:"required" dc:"用户名"`
|
||||
Password string `json:"password" v:"required" dc:"密码"`
|
||||
}
|
||||
@ -45,3 +45,12 @@ type UserCodeReq struct {
|
||||
type UserCodeRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
|
||||
type AuthorLoginReq struct {
|
||||
g.Meta `path:"/author/login" tags:"APP/Author" method:"post" summary:"作者登录"`
|
||||
Email string `json:"email" v:"required" dc:"邮箱"`
|
||||
Password string `json:"password" v:"required" dc:"密码"`
|
||||
}
|
||||
type AuthorLoginRes struct {
|
||||
Token string `json:"token" dc:"token"`
|
||||
}
|
||||
|
||||
@ -18,4 +18,7 @@ type IAuthorV1 interface {
|
||||
Follow(ctx context.Context, req *v1.FollowReq) (res *v1.FollowRes, err error)
|
||||
Unfollow(ctx context.Context, req *v1.UnfollowReq) (res *v1.UnfollowRes, err error)
|
||||
Detail(ctx context.Context, req *v1.DetailReq) (res *v1.DetailRes, err error)
|
||||
AuthorInfo(ctx context.Context, req *v1.AuthorInfoReq) (res *v1.AuthorInfoRes, err error)
|
||||
Apply(ctx context.Context, req *v1.ApplyReq) (res *v1.ApplyRes, err error)
|
||||
Review(ctx context.Context, req *v1.ReviewReq) (res *v1.ReviewRes, err error)
|
||||
}
|
||||
|
||||
@ -1,12 +1,13 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"server/internal/model"
|
||||
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
type ListReq struct {
|
||||
g.Meta `path:"/author" tags:"Backend/Admin" method:"get" summary:"获取作者列表"`
|
||||
g.Meta `path:"/author" tags:"Backend/Author" method:"get" summary:"获取作者列表"`
|
||||
Page int `json:"page" dc:"页码"`
|
||||
Size int `json:"size" dc:"每页数量"`
|
||||
PenName string `json:"penName" dc:"笔名(模糊搜索)"`
|
||||
@ -18,7 +19,7 @@ type ListRes struct {
|
||||
}
|
||||
|
||||
type AddReq struct {
|
||||
g.Meta `path:"/author" tags:"Backend/Admin" method:"post" summary:"新增作者"`
|
||||
g.Meta `path:"/author" tags:"Backend/Author" method:"post" summary:"新增作者"`
|
||||
UserId int64 `json:"userId" dc:"用户ID" v:"required"`
|
||||
PenName string `json:"penName" dc:"笔名" v:"required"`
|
||||
Bio string `json:"bio" dc:"作者简介"`
|
||||
@ -29,7 +30,7 @@ type AddRes struct {
|
||||
}
|
||||
|
||||
type EditReq struct {
|
||||
g.Meta `path:"/author" tags:"Backend/Admin" method:"put" summary:"编辑作者"`
|
||||
g.Meta `path:"/author" tags:"Backend/Author" method:"put" summary:"编辑作者"`
|
||||
Id int64 `json:"id" dc:"作者ID" v:"required"`
|
||||
PenName string `json:"penName" dc:"笔名" v:"required"`
|
||||
Bio string `json:"bio" dc:"作者简介"`
|
||||
@ -40,7 +41,7 @@ type EditRes struct {
|
||||
}
|
||||
|
||||
type DelReq struct {
|
||||
g.Meta `path:"/author" tags:"Backend/Admin" method:"delete" summary:"删除作者"`
|
||||
g.Meta `path:"/author" tags:"Backend/Author" method:"delete" summary:"删除作者"`
|
||||
Id int64 `json:"id" dc:"作者ID" v:"required"`
|
||||
}
|
||||
type DelRes struct {
|
||||
@ -50,7 +51,7 @@ type DelRes struct {
|
||||
// 关注作者
|
||||
// =============================
|
||||
type FollowReq struct {
|
||||
g.Meta `path:"/author/follow" tags:"APP" method:"post" summary:"关注作者"`
|
||||
g.Meta `path:"/author/follow" tags:"APP/Author" method:"post" summary:"关注作者"`
|
||||
AuthorId int64 `json:"authorId" dc:"作者ID" v:"required"`
|
||||
}
|
||||
type FollowRes struct {
|
||||
@ -60,16 +61,48 @@ type FollowRes struct {
|
||||
// 取消关注作者
|
||||
// =============================
|
||||
type UnfollowReq struct {
|
||||
g.Meta `path:"/author/unfollow" tags:"APP" method:"post" summary:"取消关注作者"`
|
||||
g.Meta `path:"/author/unfollow" tags:"APP/Author" method:"post" summary:"取消关注作者"`
|
||||
AuthorId int64 `json:"authorId" dc:"作者ID" v:"required"`
|
||||
}
|
||||
type UnfollowRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
type DetailReq struct {
|
||||
g.Meta `path:"/author/detail" tags:"APP" method:"get" summary:"作者详情"`
|
||||
g.Meta `path:"/author/detail" tags:"APP/Author" method:"get" summary:"作者详情"`
|
||||
AuthorId int64 `json:"authorId" dc:"作者ID" v:"required"`
|
||||
}
|
||||
type DetailRes struct {
|
||||
Author *model.AuthorDetailOut `json:"author" dc:"作者信息"`
|
||||
*model.AuthorDetailOut
|
||||
}
|
||||
|
||||
type AuthorInfoReq struct {
|
||||
g.Meta `path:"/author/info" tags:"Backend/Author" method:"get" summary:"作者基础信息"`
|
||||
}
|
||||
type AuthorInfoRes struct {
|
||||
Id int64 `json:"id"`
|
||||
PenName string `json:"penName"`
|
||||
Role string `json:"role"`
|
||||
}
|
||||
|
||||
type ApplyReq struct {
|
||||
g.Meta `path:"/author/apply" tags:"APP/Author" method:"post" summary:"申请作者"`
|
||||
Bio string `json:"bio" dc:"作者简介"`
|
||||
PenName string `json:"penName" dc:"笔名"`
|
||||
}
|
||||
|
||||
type ApplyRes struct {
|
||||
g.Meta `path:"/author/apply" tags:"APP/Author" method:"post" summary:"申请作者"`
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
Msg string `json:"msg" dc:"消息"`
|
||||
}
|
||||
|
||||
// 审核作者
|
||||
// =============================
|
||||
type ReviewReq struct {
|
||||
g.Meta `path:"/author/review" tags:"Backend/Author" method:"post" summary:"审核作者申请"`
|
||||
AuthorId int64 `json:"authorId" dc:"作者ID" v:"required"`
|
||||
Status int `json:"status" dc:"审核状态:1通过,3拒绝" v:"required|in:1,3"`
|
||||
}
|
||||
type ReviewRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
|
||||
@ -17,10 +17,13 @@ type IBookV1 interface {
|
||||
Del(ctx context.Context, req *v1.DelReq) (res *v1.DelRes, err error)
|
||||
ShelfAdd(ctx context.Context, req *v1.ShelfAddReq) (res *v1.ShelfAddRes, err error)
|
||||
ShelfRemove(ctx context.Context, req *v1.ShelfRemoveReq) (res *v1.ShelfRemoveRes, err error)
|
||||
HistoryRemove(ctx context.Context, req *v1.HistoryRemoveReq) (res *v1.HistoryRemoveRes, err error)
|
||||
AppList(ctx context.Context, req *v1.AppListReq) (res *v1.AppListRes, err error)
|
||||
AppDetail(ctx context.Context, req *v1.AppDetailReq) (res *v1.AppDetailRes, err error)
|
||||
AppRate(ctx context.Context, req *v1.AppRateReq) (res *v1.AppRateRes, err error)
|
||||
MyList(ctx context.Context, req *v1.MyListReq) (res *v1.MyListRes, err error)
|
||||
BookSetFeatured(ctx context.Context, req *v1.BookSetFeaturedReq) (res *v1.BookSetFeaturedRes, err error)
|
||||
BookSetRecommended(ctx context.Context, req *v1.BookSetRecommendedReq) (res *v1.BookSetRecommendedRes, err error)
|
||||
BookSetHot(ctx context.Context, req *v1.BookSetHotReq) (res *v1.BookSetHotRes, err error)
|
||||
BookCoverImage(ctx context.Context, req *v1.BookCoverImageReq) (res *v1.BookCoverImageRes, err error)
|
||||
}
|
||||
|
||||
@ -3,11 +3,13 @@ package v1
|
||||
import (
|
||||
"server/internal/model"
|
||||
|
||||
"github.com/gogf/gf/v2/net/ghttp"
|
||||
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
type ListReq struct {
|
||||
g.Meta `path:"/book" tags:"Backend/Author" method:"get" summary:"获取小说列表"`
|
||||
g.Meta `path:"/book" tags:"Backend/Book" method:"get" summary:"获取小说列表"`
|
||||
Page int `json:"page" dc:"页码"`
|
||||
Size int `json:"size" dc:"每页数量"`
|
||||
Title string `json:"title" dc:"书名模糊搜索"`
|
||||
@ -23,7 +25,7 @@ type ListRes struct {
|
||||
}
|
||||
|
||||
type AddReq struct {
|
||||
g.Meta `path:"/book" tags:"Backend/Author" method:"post" summary:"新增小说"`
|
||||
g.Meta `path:"/book" tags:"Backend/Book" method:"post" summary:"新增小说"`
|
||||
AuthorId int64 `json:"authorId" dc:"作者ID" v:"required"`
|
||||
CategoryId int64 `json:"categoryId" dc:"分类ID" v:"required"`
|
||||
Title string `json:"title" dc:"书名" v:"required"`
|
||||
@ -40,7 +42,7 @@ type AddRes struct {
|
||||
}
|
||||
|
||||
type EditReq struct {
|
||||
g.Meta `path:"/book" tags:"Backend/Author" method:"put" summary:"编辑小说"`
|
||||
g.Meta `path:"/book" tags:"Backend/Book" method:"put" summary:"编辑小说"`
|
||||
Id int64 `json:"id" dc:"书籍ID" v:"required"`
|
||||
AuthorId int64 `json:"authorId" dc:"作者ID" v:"required"`
|
||||
CategoryId int64 `json:"categoryId" dc:"分类ID" v:"required"`
|
||||
@ -58,7 +60,7 @@ type EditRes struct {
|
||||
}
|
||||
|
||||
type DelReq struct {
|
||||
g.Meta `path:"/book" tags:"Backend/Author" method:"delete" summary:"删除小说"`
|
||||
g.Meta `path:"/book" tags:"Backend/Book" method:"delete" summary:"删除小说"`
|
||||
Id int64 `json:"id" dc:"书籍ID" v:"required"`
|
||||
}
|
||||
type DelRes struct {
|
||||
@ -67,7 +69,7 @@ type DelRes struct {
|
||||
|
||||
// 加入书架
|
||||
type ShelfAddReq struct {
|
||||
g.Meta `path:"/book/shelf/add" tags:"APP" method:"post" summary:"加入书架"`
|
||||
g.Meta `path:"/book/shelf/add" tags:"APP/Book" method:"post" summary:"加入书架"`
|
||||
BookId int64 `json:"bookId" dc:"小说ID" v:"required"`
|
||||
}
|
||||
type ShelfAddRes struct {
|
||||
@ -76,21 +78,30 @@ type ShelfAddRes struct {
|
||||
|
||||
// 移除书架
|
||||
type ShelfRemoveReq struct {
|
||||
g.Meta `path:"/book/shelf/remove" tags:"APP" method:"post" summary:"移除书架(支持批量)"`
|
||||
g.Meta `path:"/book/shelf/remove" tags:"APP/Book" method:"post" summary:"移除书架(支持批量)"`
|
||||
BookIds []int64 `json:"bookIds" dc:"小说ID列表" v:"required"`
|
||||
}
|
||||
type ShelfRemoveRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
|
||||
type HistoryRemoveReq struct {
|
||||
g.Meta `path:"/book/history/remove" tags:"APP/Book" method:"post" summary:"移除阅读记录(支持批量)"`
|
||||
BookIds []int64 `json:"bookIds" dc:"小说ID列表" v:"required"`
|
||||
}
|
||||
type HistoryRemoveRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
|
||||
// App 获取书籍列表
|
||||
type AppListReq struct {
|
||||
g.Meta `path:"/book/app/list" tags:"APP" method:"get" summary:"App获取书籍列表"`
|
||||
g.Meta `path:"/book/app/list" tags:"APP/Book" method:"get" summary:"App获取书籍列表"`
|
||||
Page int `json:"page" dc:"页码"`
|
||||
Size int `json:"size" dc:"每页数量"`
|
||||
IsRecommended bool `json:"isRecommended" dc:"是否推荐"`
|
||||
IsFeatured bool `json:"isFeatured" dc:"是否精选"`
|
||||
IsLatest int `json:"isLatest" dc:"是否最新"`
|
||||
IsHot bool `json:"isHot" dc:"是否最热"`
|
||||
CategoryId int64 `json:"categoryId" dc:"分类ID"`
|
||||
Title string `json:"title" dc:"书名模糊搜索"`
|
||||
AuthorId int `json:"authorId" dc:"作者ID"`
|
||||
@ -104,34 +115,42 @@ type AppListRes struct {
|
||||
|
||||
// App 获取书籍详情
|
||||
type AppDetailReq struct {
|
||||
g.Meta `path:"/book/app/detail" tags:"APP" method:"get" summary:"App获取书籍详情"`
|
||||
g.Meta `path:"/book/app/detail" tags:"APP/Book" method:"get" summary:"App获取书籍详情"`
|
||||
Id int64 `json:"id" dc:"书籍ID" v:"required"`
|
||||
}
|
||||
type AppDetailRes struct {
|
||||
Id int64 `json:"id" dc:"书籍ID"`
|
||||
AuthorId int64 `json:"authorId" dc:"作者ID"`
|
||||
CategoryId int64 `json:"categoryId" dc:"分类ID"`
|
||||
Title string `json:"title" dc:"书名"`
|
||||
CoverUrl string `json:"coverUrl" dc:"封面图"`
|
||||
Description string `json:"description" dc:"简介"`
|
||||
Status int `json:"status" dc:"状态"`
|
||||
Tags string `json:"tags" dc:"标签"`
|
||||
IsRecommended int `json:"isRecommended" dc:"是否推荐"`
|
||||
IsFeatured int `json:"isFeatured" dc:"是否精选"`
|
||||
Language string `json:"language" dc:"语言"`
|
||||
Rating float64 `json:"rating" dc:"评分"`
|
||||
CurrentReaders int64 `json:"currentReaders" dc:"在读人数"`
|
||||
CreatedAt string `json:"createdAt" dc:"创建时间"`
|
||||
UpdatedAt string `json:"updatedAt" dc:"更新时间"`
|
||||
HasRead bool `json:"hasRead" dc:"是否读过"`
|
||||
ReadProgress int `json:"readProgress" dc:"阅读进度百分比"`
|
||||
LastChapterId int64 `json:"lastChapterId" dc:"最近阅读章节ID"`
|
||||
LastReadAt string `json:"lastReadAt" dc:"最近阅读时间"`
|
||||
Id int64 `json:"id" dc:"书籍ID"`
|
||||
CoverUrl string `json:"coverUrl" dc:"封面图"`
|
||||
Rating float64 `json:"rating" dc:"评分"`
|
||||
Title string `json:"title" dc:"标题"`
|
||||
Description string `json:"description" dc:"简介"`
|
||||
AuthorId int64 `json:"authorId" dc:"作者ID"`
|
||||
Author model.AppAuthor `json:"author" dc:"作者信息"`
|
||||
IsFeatured int `json:"isFeatured" dc:"是否精选"`
|
||||
Language string `json:"language" dc:"语言"`
|
||||
CategoryId int64 `json:"categoryId" dc:"分类ID"`
|
||||
Category model.Category `json:"category" dc:"分类信息"`
|
||||
Status int `json:"status" dc:"状态"`
|
||||
WordsCount int `json:"wordsCount" dc:"字数"`
|
||||
ChaptersCount int `json:"chaptersCount" dc:"章节数"`
|
||||
ReadCount int64 `json:"readCount" dc:"阅读人数"`
|
||||
CurrentReaders int64 `json:"currentReaders" dc:"在读人数"`
|
||||
Tags string `json:"tags" dc:"标签"`
|
||||
IsRecommended int `json:"isRecommended" dc:"是否推荐"`
|
||||
HasRated bool `json:"hasRated" dc:"当前用户是否已评分"`
|
||||
MyRating float64 `json:"myRating" dc:"当前用户评分(未评分为0)"`
|
||||
HasRead bool `json:"hasRead" dc:"是否读过"`
|
||||
ReadProgress int `json:"readProgress" dc:"阅读进度百分比"`
|
||||
LastChapterId int64 `json:"lastChapterId" dc:"最近阅读章节ID"`
|
||||
LastReadAt string `json:"lastReadAt" dc:"最近阅读时间"`
|
||||
IsInBookshelf bool `json:"isInBookshelf" dc:"当前用户是否已加入书架"`
|
||||
CreatedAt string `json:"createdAt" dc:"创建时间"`
|
||||
UpdatedAt string `json:"updatedAt" dc:"更新时间"`
|
||||
}
|
||||
|
||||
// App 用户评分
|
||||
type AppRateReq struct {
|
||||
g.Meta `path:"/book/app/rate" tags:"APP" method:"post" summary:"App用户评分"`
|
||||
g.Meta `path:"/book/app/rate" tags:"APP/Book" method:"post" summary:"App用户评分"`
|
||||
BookId int64 `json:"bookId" dc:"书籍ID" v:"required"`
|
||||
Rating float64 `json:"rating" dc:"评分(1-10分)" v:"required"`
|
||||
}
|
||||
@ -152,7 +171,7 @@ type BookAppItem struct {
|
||||
// 我的书籍列表
|
||||
// =============================
|
||||
type MyListReq struct {
|
||||
g.Meta `path:"/book/app/my-books" tags:"APP" method:"get" summary:"获取我的书籍列表"`
|
||||
g.Meta `path:"/book/app/my-books" tags:"APP/Book" method:"get" summary:"获取我的书籍列表"`
|
||||
Type int `json:"type" dc:"类型:1-正在读 2-已读完 3-历史记录" v:"required"`
|
||||
Page int `json:"page" dc:"页码"`
|
||||
Size int `json:"size" dc:"每页数量"`
|
||||
@ -183,3 +202,20 @@ type BookSetRecommendedReq struct {
|
||||
type BookSetRecommendedRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
|
||||
type BookSetHotReq struct {
|
||||
g.Meta `path:"/book/set-hot" tags:"Backend/Book" method:"post" summary:"设置书籍热门状态"`
|
||||
Id int64 `json:"id" dc:"书籍ID" v:"required"`
|
||||
IsHot int `json:"isHot" dc:"是否热门" v:"required"`
|
||||
}
|
||||
type BookSetHotRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
|
||||
type BookCoverImageReq struct {
|
||||
g.Meta `path:"/book/coverImage" tags:"Backend/Book" method:"post" summary:"上传封面图"`
|
||||
File *ghttp.UploadFile `json:"file" v:"required#请上传文件"`
|
||||
}
|
||||
type BookCoverImageRes struct {
|
||||
ImageUrl string `json:"imageUrl" dc:"图片地址"`
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@ import (
|
||||
)
|
||||
|
||||
type ListReq struct {
|
||||
g.Meta `path:"/category" tags:"APP" method:"get" summary:"获取分类列表"`
|
||||
g.Meta `path:"/category" tags:"Backend-APP/Category" method:"get" summary:"获取分类列表"`
|
||||
Page int `json:"page" dc:"页码"`
|
||||
Size int `json:"size" dc:"每页数量"`
|
||||
Name string `json:"name" dc:"分类名称(模糊搜索)"`
|
||||
@ -19,7 +19,7 @@ type ListRes struct {
|
||||
}
|
||||
|
||||
type AddReq struct {
|
||||
g.Meta `path:"/category" tags:"Backend/Admin" method:"post" summary:"新增分类"`
|
||||
g.Meta `path:"/category" tags:"Backend/Category" method:"post" summary:"新增分类"`
|
||||
Name string `json:"name" dc:"分类名称" v:"required"`
|
||||
Channel int `json:"channel" dc:"频道类型:1=男频,2=女频" v:"required"`
|
||||
}
|
||||
@ -28,7 +28,7 @@ type AddRes struct {
|
||||
}
|
||||
|
||||
type EditReq struct {
|
||||
g.Meta `path:"/category" tags:"Backend/Admin" method:"put" summary:"编辑分类"`
|
||||
g.Meta `path:"/category" tags:"Backend/Category" method:"put" summary:"编辑分类"`
|
||||
Id int64 `json:"id" dc:"分类ID" v:"required"`
|
||||
Name string `json:"name" dc:"分类名称" v:"required"`
|
||||
Channel int `json:"channel" dc:"频道类型:1=男频,2=女频" v:"required"`
|
||||
@ -38,7 +38,7 @@ type EditRes struct {
|
||||
}
|
||||
|
||||
type DelReq struct {
|
||||
g.Meta `path:"/category" tags:"Backend/Admin" method:"delete" summary:"删除分类"`
|
||||
g.Meta `path:"/category" tags:"Backend/Category" method:"delete" summary:"删除分类"`
|
||||
Id int64 `json:"id" dc:"分类ID" v:"required"`
|
||||
}
|
||||
type DelRes struct {
|
||||
|
||||
@ -7,7 +7,7 @@ import (
|
||||
)
|
||||
|
||||
type ListReq struct {
|
||||
g.Meta `path:"/chapter" tags:"Backend/Author" method:"get" summary:"获取章节列表"`
|
||||
g.Meta `path:"/chapter" tags:"Backend/Chapter" method:"get" summary:"获取章节列表"`
|
||||
Page int `json:"page" dc:"页码"`
|
||||
Size int `json:"size" dc:"每页数量"`
|
||||
BookId int64 `json:"bookId" dc:"小说ID"`
|
||||
@ -20,7 +20,7 @@ type ListRes struct {
|
||||
}
|
||||
|
||||
type AddReq struct {
|
||||
g.Meta `path:"/chapter" tags:"Backend/Author" method:"post" summary:"新增章节"`
|
||||
g.Meta `path:"/chapter" tags:"Backend/Chapter" method:"post" summary:"新增章节"`
|
||||
BookId int64 `json:"bookId" dc:"小说ID" v:"required"`
|
||||
Title string `json:"title" dc:"章节标题" v:"required"`
|
||||
Content string `json:"content" dc:"章节内容" v:"required"`
|
||||
@ -34,7 +34,7 @@ type AddRes struct {
|
||||
}
|
||||
|
||||
type EditReq struct {
|
||||
g.Meta `path:"/chapter" tags:"Backend/Author" method:"put" summary:"编辑章节"`
|
||||
g.Meta `path:"/chapter" tags:"Backend/Chapter" method:"put" summary:"编辑章节"`
|
||||
Id int64 `json:"id" dc:"章节ID" v:"required"`
|
||||
BookId int64 `json:"bookId" dc:"小说ID" v:"required"`
|
||||
Title string `json:"title" dc:"章节标题" v:"required"`
|
||||
@ -49,7 +49,7 @@ type EditRes struct {
|
||||
}
|
||||
|
||||
type DelReq struct {
|
||||
g.Meta `path:"/chapter" tags:"Backend/Author" method:"delete" summary:"删除章节"`
|
||||
g.Meta `path:"/chapter" tags:"Backend/Chapter" method:"delete" summary:"删除章节"`
|
||||
Id int64 `json:"id" dc:"章节ID" v:"required"`
|
||||
}
|
||||
type DelRes struct {
|
||||
@ -57,7 +57,7 @@ type DelRes struct {
|
||||
}
|
||||
|
||||
type AppListReq struct {
|
||||
g.Meta `path:"/chapter/app/list" tags:"APP" method:"get" summary:"App获取章节列表"`
|
||||
g.Meta `path:"/chapter/app/list" tags:"APP/Chapter" method:"get" summary:"App获取章节列表"`
|
||||
BookId int64 `json:"bookId" dc:"书籍ID" v:"required"`
|
||||
IsDesc bool `json:"isDesc" dc:"是否逆序排列"`
|
||||
Page int `json:"page" dc:"页码"`
|
||||
@ -69,7 +69,7 @@ type AppListRes struct {
|
||||
}
|
||||
|
||||
type AppDetailReq struct {
|
||||
g.Meta `path:"/chapter/app/detail" tags:"APP" method:"get" summary:"App获取章节详情"`
|
||||
g.Meta `path:"/chapter/app/detail" tags:"APP/Chapter" method:"get" summary:"App获取章节详情"`
|
||||
Id int64 `json:"id" dc:"章节ID" v:"required"`
|
||||
}
|
||||
type AppDetailRes struct {
|
||||
@ -85,7 +85,7 @@ type AppDetailRes struct {
|
||||
}
|
||||
|
||||
type AppPurchaseReq struct {
|
||||
g.Meta `path:"/chapter/app/purchase" tags:"APP" method:"post" summary:"App购买章节"`
|
||||
g.Meta `path:"/chapter/app/purchase" tags:"APP/Chapter" method:"post" summary:"App购买章节"`
|
||||
Id int64 `json:"id" dc:"章节ID" v:"required"`
|
||||
}
|
||||
type AppPurchaseRes struct {
|
||||
@ -93,11 +93,11 @@ type AppPurchaseRes struct {
|
||||
}
|
||||
|
||||
type AppProgressReq struct {
|
||||
g.Meta `path:"/chapter/app/progress" tags:"APP" method:"post" summary:"App上传阅读进度"`
|
||||
BookId int64 `json:"bookId" dc:"书籍ID" v:"required"`
|
||||
ChapterId int64 `json:"chapterId" dc:"章节ID" v:"required"`
|
||||
Progress int `json:"progress" dc:"阅读进度百分比(0-100)"`
|
||||
g.Meta `path:"/chapter/app/progress" tags:"APP/Chapter" method:"post" summary:"App上传阅读进度"`
|
||||
BookId int64 `json:"bookId" dc:"书籍ID" v:"required"`
|
||||
Chapters []model.ChapterProgressItem `json:"chapters" dc:"章节进度列表" v:"required"`
|
||||
}
|
||||
|
||||
type AppProgressRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@ import (
|
||||
)
|
||||
|
||||
type ListReq struct {
|
||||
g.Meta `path:"/feedback" tags:"Backend/Admin" method:"get" summary:"获取反馈列表"`
|
||||
g.Meta `path:"/feedback" tags:"Backend/Feedback" method:"get" summary:"获取反馈列表"`
|
||||
Page int `json:"page" dc:"页码"`
|
||||
Size int `json:"size" dc:"每页数量"`
|
||||
UserId int64 `json:"userId" dc:"用户ID"`
|
||||
@ -19,7 +19,7 @@ type ListRes struct {
|
||||
}
|
||||
|
||||
type AddReq struct {
|
||||
g.Meta `path:"/feedback" tags:"APP" method:"post" summary:"新增反馈"`
|
||||
g.Meta `path:"/feedback" tags:"APP/Feedback" method:"post" summary:"新增反馈"`
|
||||
Content string `json:"content" dc:"反馈内容" v:"required"`
|
||||
}
|
||||
type AddRes struct {
|
||||
|
||||
22
api/recommend/recommend.go
Normal file
22
api/recommend/recommend.go
Normal file
@ -0,0 +1,22 @@
|
||||
// =================================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// =================================================================================
|
||||
|
||||
package recommend
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"server/api/recommend/v1"
|
||||
)
|
||||
|
||||
type IRecommendV1 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)
|
||||
SetStatus(ctx context.Context, req *v1.SetStatusReq) (res *v1.SetStatusRes, err error)
|
||||
SortOrder(ctx context.Context, req *v1.SortOrderReq) (res *v1.SortOrderRes, err error)
|
||||
AppList(ctx context.Context, req *v1.AppListReq) (res *v1.AppListRes, err error)
|
||||
UploadCover(ctx context.Context, req *v1.UploadCoverReq) (res *v1.UploadCoverRes, err error)
|
||||
}
|
||||
93
api/recommend/v1/recommend.go
Normal file
93
api/recommend/v1/recommend.go
Normal file
@ -0,0 +1,93 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"server/internal/model"
|
||||
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/net/ghttp"
|
||||
)
|
||||
|
||||
type ListReq struct {
|
||||
g.Meta `path:"/recommend" tags:"Backend/Recommend" method:"get" summary:"获取推荐列表"`
|
||||
Page int `json:"page" dc:"页码"`
|
||||
Size int `json:"size" dc:"每页数量"`
|
||||
Type int `json:"type" dc:"推荐类型"`
|
||||
Status int `json:"status" dc:"状态"`
|
||||
BookId int64 `json:"bookId" dc:"书籍ID"`
|
||||
}
|
||||
type ListRes struct {
|
||||
Total int `json:"total" dc:"总数"`
|
||||
List []model.BookRecommendation `json:"list" dc:"推荐列表"`
|
||||
}
|
||||
|
||||
type AddReq struct {
|
||||
g.Meta `path:"/recommend" tags:"Backend/Recommend" method:"post" summary:"新增推荐"`
|
||||
BookId int64 `json:"bookId" dc:"书籍ID" v:"required"`
|
||||
Type int `json:"type" dc:"推荐类型" v:"required"`
|
||||
CoverUrl string `json:"coverUrl" dc:"封面图" v:"required"`
|
||||
SortOrder int `json:"sortOrder" dc:"排序" v:"required"`
|
||||
Status int `json:"status" dc:"状态" v:"required"`
|
||||
}
|
||||
type AddRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
|
||||
type EditReq struct {
|
||||
g.Meta `path:"/recommend" tags:"Backend/Recommend" method:"put" summary:"编辑推荐"`
|
||||
Id int64 `json:"id" dc:"推荐ID" v:"required"`
|
||||
BookId int64 `json:"bookId" dc:"书籍ID" v:"required"`
|
||||
Type int `json:"type" dc:"推荐类型" v:"required"`
|
||||
CoverUrl string `json:"coverUrl" dc:"封面图" v:"required"`
|
||||
SortOrder int `json:"sortOrder" dc:"排序" v:"required"`
|
||||
Status int `json:"status" dc:"状态" v:"required"`
|
||||
}
|
||||
type EditRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
|
||||
type DelReq struct {
|
||||
g.Meta `path:"/recommend" tags:"Backend/Recommend" method:"delete" summary:"删除推荐"`
|
||||
Id int64 `json:"id" dc:"推荐ID" v:"required"`
|
||||
}
|
||||
type DelRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
|
||||
type SetStatusReq struct {
|
||||
g.Meta `path:"/recommend/set-status" tags:"Backend/Recommend" method:"post" summary:"设置推荐状态"`
|
||||
Id int64 `json:"id" dc:"推荐ID" v:"required"`
|
||||
Status int `json:"status" dc:"状态" v:"required"`
|
||||
}
|
||||
type SetStatusRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
|
||||
type SortOrderReq struct {
|
||||
g.Meta `path:"/recommend/sort-order" tags:"Backend/Recommend" method:"post" summary:"设置推荐排序"`
|
||||
Id int64 `json:"id" dc:"推荐ID" v:"required"`
|
||||
SortOrder int `json:"sortOrder" dc:"排序" v:"required"`
|
||||
}
|
||||
type SortOrderRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
|
||||
type AppListReq struct {
|
||||
g.Meta `path:"/recommend/app/list" tags:"APP/Recommend" method:"get" summary:"App获取推荐列表"`
|
||||
Type int `json:"type" dc:"推荐类型"`
|
||||
Status int `json:"status" dc:"状态"`
|
||||
Page int `json:"page" dc:"页码"`
|
||||
Size int `json:"size" dc:"每页数量"`
|
||||
}
|
||||
|
||||
type AppListRes struct {
|
||||
Total int `json:"total" dc:"总数"`
|
||||
List []model.RecommendAppItem `json:"list" dc:"推荐列表"`
|
||||
}
|
||||
|
||||
type UploadCoverReq struct {
|
||||
g.Meta `path:"/recommend/upload-cover" tags:"Backend/Recommend" method:"post" summary:"上传推荐封面图"`
|
||||
File *ghttp.UploadFile `json:"file" type:"file" dc:"图片文件"`
|
||||
}
|
||||
type UploadCoverRes struct {
|
||||
Url string `json:"url" dc:"图片访问地址"`
|
||||
}
|
||||
16
api/system/system.go
Normal file
16
api/system/system.go
Normal file
@ -0,0 +1,16 @@
|
||||
// =================================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// =================================================================================
|
||||
|
||||
package system
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"server/api/system/v1"
|
||||
)
|
||||
|
||||
type ISystemV1 interface {
|
||||
SystemSave(ctx context.Context, req *v1.SystemSaveReq) (res *v1.SystemSaveRes, err error)
|
||||
SystemVersion(ctx context.Context, req *v1.SystemVersionReq) (res *v1.SystemVersionRes, err error)
|
||||
}
|
||||
19
api/system/v1/system.go
Normal file
19
api/system/v1/system.go
Normal file
@ -0,0 +1,19 @@
|
||||
package v1
|
||||
|
||||
import "github.com/gogf/gf/v2/frame/g"
|
||||
|
||||
type SystemSaveReq struct {
|
||||
g.Meta `path:"/system/save" method:"post" tags:"Backend/System" sm:"(管理员)保存系统设置"`
|
||||
Key string
|
||||
Value string
|
||||
}
|
||||
type SystemSaveRes struct {
|
||||
}
|
||||
type SystemVersionReq struct {
|
||||
g.Meta `path:"/system/version" method:"get" tags:"APP/System" sm:"(访客、用户、管理员)获取版本信息"`
|
||||
}
|
||||
|
||||
type SystemVersionRes struct {
|
||||
Ios map[string]string `json:"ios"`
|
||||
Android map[string]string `json:"android"`
|
||||
}
|
||||
19
api/task/task.go
Normal file
19
api/task/task.go
Normal 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
61
api/task/v1/task.go
Normal 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"`
|
||||
}
|
||||
@ -5,19 +5,24 @@ import (
|
||||
)
|
||||
|
||||
type InfoReq struct {
|
||||
g.Meta `path:"/user/info" tags:"APP" method:"get" summary:"获取用户信息"`
|
||||
g.Meta `path:"/user/info" tags:"APP/User" method:"get" summary:"获取用户信息"`
|
||||
}
|
||||
type InfoRes struct {
|
||||
g.Meta `mime:"application/json"`
|
||||
UserId int64 `json:"userId"`
|
||||
Username string `json:"username"` // 用户名
|
||||
Avatar string `json:"avatar"` // 头像 URL
|
||||
Email string `json:"email"` // 邮箱
|
||||
Points uint64 `json:"points"`
|
||||
g.Meta `mime:"application/json"`
|
||||
Id int64 `json:"id" dc:"用户ID"`
|
||||
Username string `json:"username" dc:"用户名"`
|
||||
Avatar string `json:"avatar" dc:"头像URL"`
|
||||
Email string `json:"email" dc:"邮箱"`
|
||||
Points uint64 `json:"points" dc:"积分数量"`
|
||||
BackgroundUrl string `json:"backgroundUrl" dc:"背景图片URL"`
|
||||
AttentionCount int `json:"attentionCount" dc:"关注数量"`
|
||||
Role string `json:"role" dc:"用户角色"`
|
||||
IsAuthor bool `json:"isAuthor" dc:"是否是作者"`
|
||||
AuthorStatus int `json:"authorStatus" dc:"作者申请状态:0=未申请,1=审核中,2=已通过,3=已拒绝"`
|
||||
}
|
||||
|
||||
type DeleteReq struct {
|
||||
g.Meta `path:"/user/delete" tags:"APP" method:"post" summary:"删除用户"`
|
||||
g.Meta `path:"/user/delete" tags:"APP/User" method:"post" summary:"删除用户"`
|
||||
Password string `json:"password" v:"required" dc:"密码"`
|
||||
}
|
||||
|
||||
@ -26,7 +31,7 @@ type DeleteRes struct {
|
||||
}
|
||||
|
||||
type LogoutReq struct {
|
||||
g.Meta `path:"/user/logout" tags:"APP" method:"post" summary:"登出"`
|
||||
g.Meta `path:"/user/logout" tags:"APP/User" method:"post" summary:"登出"`
|
||||
}
|
||||
type LogoutRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
|
||||
Reference in New Issue
Block a user