添加banner的接口逻辑
This commit is contained in:
1 parent
e42a4549e9
commit
a52d630acf
8 files changed
+505
-5
No files matched your search
@@ -0,0 +1,34 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"go-admin/common/models"
|
||||
)
|
||||
|
||||
type Banner struct {
|
||||
models.Model
|
||||
|
||||
Title string `json:"title" gorm:"type:varchar(1023);comment:标题"`
|
||||
Url string `json:"url" gorm:"type:text;comment:内容"`
|
||||
Slug string `json:"slug" gorm:"type:varchar(127);comment:slug"`
|
||||
Type int64 `json:"type" gorm:"type:int;comment:类型"`
|
||||
Order int64 `json:"order" gorm:"type:int;comment:排序"`
|
||||
Status int64 `json:"status" gorm:"type:int;comment:状态"`
|
||||
PublishAt time.Time `json:"publishAt" gorm:"type:datetime;comment:发布时间"`
|
||||
models.ModelTime
|
||||
models.ControlBy
|
||||
}
|
||||
|
||||
func (Banner) TableName() string {
|
||||
return "banner"
|
||||
}
|
||||
|
||||
func (e *Banner) Generate() models.ActiveRecord {
|
||||
o := *e
|
||||
return &o
|
||||
}
|
||||
|
||||
func (e *Banner) GetId() interface{} {
|
||||
return e.Id
|
||||
}
|
||||
Reference in new issue
Block a user