添加公告表及相关处理逻辑,支持公告列表查询

This commit is contained in:
2025-05-07 16:48:02 +08:00
parent 1738570c2b
commit 60bbe47368
7 changed files with 494 additions and 1 deletions

View File

@@ -0,0 +1,32 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package models
import (
"platform/web/common"
"gorm.io/gorm"
)
const TableNameAnnouncement = "announcement"
// Announcement mapped from table <announcement>
type Announcement struct {
CreatedAt common.LocalDateTime `gorm:"column:created_at;default:CURRENT_TIMESTAMP" json:"created_at"`
UpdatedAt common.LocalDateTime `gorm:"column:updated_at;default:CURRENT_TIMESTAMP" json:"updated_at"`
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
Type int32 `gorm:"column:type;not null;default:1" json:"type"`
Status int32 `gorm:"column:status;not null;default:1" json:"status"`
Sort int32 `gorm:"column:sort;not null" json:"sort"`
Pin bool `gorm:"column:pin;not null" json:"pin"`
Title string `gorm:"column:title;not null" json:"title"`
Content string `gorm:"column:content;not null" json:"content"`
}
// TableName Announcement's table name
func (*Announcement) TableName() string {
return TableNameAnnouncement
}