chore(init): 初始化解忧商行项目并完成 Phase 0 基座
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
package announcement
|
||||
|
||||
import "time"
|
||||
|
||||
type AnnouncementDTO struct {
|
||||
ID uint64 `json:"id"`
|
||||
DistributionSiteID uint64 `json:"distribution_site_id"`
|
||||
DistributionSiteName string `json:"distribution_site_name,omitempty"`
|
||||
Title string `json:"title"`
|
||||
Content string `json:"content"`
|
||||
Category string `json:"category"`
|
||||
Priority int `json:"priority"`
|
||||
IsPinned bool `json:"is_pinned"`
|
||||
IsImportant bool `json:"is_important"`
|
||||
IsPopup bool `json:"is_popup"`
|
||||
ViewCount int `json:"view_count"`
|
||||
Status string `json:"status"`
|
||||
PublishedAt *time.Time `json:"published_at"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
type AnnouncementListQuery struct {
|
||||
Category string
|
||||
Status string
|
||||
Page int
|
||||
PageSize int
|
||||
// AllowedSiteIDs 前台可见范围:主站=[0];分站 inherit=[0, siteID];分站 own_only=[siteID]。
|
||||
AllowedSiteIDs []uint64
|
||||
// AdminSiteID 管理端按站点筛选:nil=全部,0=仅主站,>0=指定分站。
|
||||
AdminSiteID *uint64
|
||||
}
|
||||
|
||||
type PaginatedResult struct {
|
||||
Items interface{} `json:"items"`
|
||||
Total int64 `json:"total"`
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
}
|
||||
|
||||
type CreateAnnouncementRequest struct {
|
||||
// DistributionSiteID 归属站点,0=主站(平台后台可指定分站代发)。
|
||||
DistributionSiteID uint64 `json:"distribution_site_id"`
|
||||
Title string `json:"title" binding:"required,max=255"`
|
||||
Content string `json:"content" binding:"required"`
|
||||
Category string `json:"category" binding:"required,oneof=notice tutorial rule faq"`
|
||||
Priority int `json:"priority"`
|
||||
IsPinned bool `json:"is_pinned"`
|
||||
IsImportant bool `json:"is_important"`
|
||||
// IsPopup 弹窗公告:前台首页弹出且需用户手动关闭,同一天只弹一次。
|
||||
IsPopup bool `json:"is_popup"`
|
||||
}
|
||||
|
||||
type UpdateAnnouncementRequest struct {
|
||||
Title string `json:"title" binding:"max=255"`
|
||||
Content string `json:"content"`
|
||||
Category string `json:"category" binding:"omitempty,oneof=notice tutorial rule faq"`
|
||||
Priority int `json:"priority"`
|
||||
IsPinned bool `json:"is_pinned"`
|
||||
IsImportant bool `json:"is_important"`
|
||||
IsPopup bool `json:"is_popup"`
|
||||
}
|
||||
Reference in New Issue
Block a user