🎨 优化文章相关接口,新增app专用接口

This commit is contained in:
2025-07-19 06:18:33 +08:00
parent cf0f60d221
commit aac13d369c
6 changed files with 126 additions and 4 deletions

View File

@@ -11,8 +11,11 @@ type Article struct {
Content string `json:"content" gorm:"comment:文章内容;type:longtext"`
CoverImg string `json:"coverImg" gorm:"comment:文章封面图"`
TeacherId int `json:"teacherId" gorm:"comment:讲师ID"`
Price int64 `json:"price" gorm:"comment:文章价格(单位为分)"`
TeacherName string `json:"teacherName" gorm:"comment:讲师名称"`
Price int64 `json:"price" gorm:"comment:文章价格(单位为分)"`
IsFree int `json:"isFree" gorm:"comment:是否免费;default:0"` // 是否免费 0-否 1-是
// 分类ID
CategoryId int `json:"categoryId" gorm:"comment:分类ID"`
}
// TableName 文章表

View File

@@ -4,6 +4,10 @@ import "git.echol.cn/loser/lckt/model/common/request"
type GetList struct {
request.PageInfo
Title string `json:"title" form:"title"` // 文章标题
// 分类ID
CategoryId int `json:"categoryId" form:"categoryId"` // 分类ID
TeacherId int `json:"teacherId" form:"teacherId"` // 讲师ID
}
type DeleteIds struct {

View File

@@ -1,5 +1,18 @@
package vo
type ArticleListVo struct {
ID int `json:"id" gorm:"comment:文章ID"`
Title string `json:"title" gorm:"comment:文章标题"`
Desc string `json:"desc" gorm:"comment:文章描述"`
//Content string `json:"content" gorm:"comment:文章内容"`
CoverImg string `json:"coverImg" gorm:"comment:文章封面图"`
Price int64 `json:"price" gorm:"comment:文章价格(单位为分)"`
TeacherId int `json:"teacherId" gorm:"comment:讲师ID"`
TeacherName string `json:"teacherName" gorm:"comment:讲师名称"`
TeacherAvatar string `json:"teacherAvatar" gorm:"comment:讲师头像"`
IsFree int `json:"isFree" gorm:"comment:是否免费;default:0"` // 是否免费 0-否 1-是
}
type ArticleVo struct {
ID int `json:"id" gorm:"comment:文章ID"`
Title string `json:"title" gorm:"comment:文章标题"`
@@ -10,4 +23,6 @@ type ArticleVo struct {
TeacherId int `json:"teacherId" gorm:"comment:讲师ID"`
TeacherName string `json:"teacherName" gorm:"comment:讲师名称"`
TeacherAvatar string `json:"teacherAvatar" gorm:"comment:讲师头像"`
IsFree int `json:"isFree" gorm:"comment:是否免费;default:0"` // 是否免费 0-否 1-是
IsBuy int `json:"isBuy" gorm:"comment:是否购买;default:0"` // 是否购买 0-否 1-是
}