Files
nl_cms-api/internal/model/common.go
2025-07-29 12:45:07 +08:00

82 lines
2.5 KiB
Go

package model
// 通用响应结构
type Response struct {
Code int `json:"code"`
Message string `json:"message"`
Data interface{} `json:"data,omitempty"`
}
// 分页响应结构
type PageResponse struct {
List interface{} `json:"list"`
Total int `json:"total"`
Page int `json:"page"`
PageSize int `json:"page_size"`
TotalPages int `json:"total_pages"`
}
// 通用列表请求
type ListRequest struct {
Page int `json:"page" form:"page"`
PageSize int `json:"page_size" form:"page_size"`
Keyword string `json:"keyword" form:"keyword"`
Status int `json:"status" form:"status"`
}
// 文章列表请求
type ArticleListRequest struct {
ListRequest
CategoryId int `json:"category_id" form:"category_id"`
AuthorId int `json:"author_id" form:"author_id"`
IsPublished int `json:"is_published" form:"is_published"`
IsFeatured int `json:"is_featured" form:"is_featured"`
IsTop int `json:"is_top" form:"is_top"`
StartDate string `json:"start_date" form:"start_date"`
EndDate string `json:"end_date" form:"end_date"`
}
// 附件列表请求
type AttachmentListRequest struct {
ListRequest
FileType string `json:"file_type" form:"file_type"`
UploadedBy int `json:"uploaded_by" form:"uploaded_by"`
StartDate string `json:"start_date" form:"start_date"`
EndDate string `json:"end_date" form:"end_date"`
StorageType string `json:"storage_type" form:"storage_type"`
}
// 新闻列表请求
type NewsListRequest struct {
ListRequest
Category string `json:"category" form:"category"`
Author string `json:"author" form:"author"`
Source string `json:"source" form:"source"`
IsPublished int `json:"is_published" form:"is_published"`
IsFeatured int `json:"is_featured" form:"is_featured"`
IsTop int `json:"is_top" form:"is_top"`
StartDate string `json:"start_date" form:"start_date"`
EndDate string `json:"end_date" form:"end_date"`
}
// 合作伙伴列表请求
type PartnerListRequest struct {
ListRequest
Category string `json:"category" form:"category"`
IsFeatured int `json:"is_featured" form:"is_featured"`
}
// 联系我们列表请求
type ContactListRequest struct {
ListRequest
StartDate string `json:"start_date" form:"start_date"`
EndDate string `json:"end_date" form:"end_date"`
}
// 配置列表请求
type ConfigListRequest struct {
ListRequest
GroupName string `json:"group_name" form:"group_name"`
IsSystem int `json:"is_system" form:"is_system"`
}