org_ad.go 1.01 KB
Newer Older
haoyanbin's avatar
1  
haoyanbin committed
1 2 3 4 5 6
package models

import (
   // "gorm.io/gorm"

	"go-admin/common/models"
haoyanbin's avatar
1  
haoyanbin committed
7
	"time"
haoyanbin's avatar
1  
haoyanbin committed
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
)

type OrgAd struct {
    models.Model
    
    UserId string `json:"userId" gorm:"type:bigint(20);comment:sys_user表id"` 
    AdName string `json:"adName" gorm:"type:varchar(255);comment:广告名称"` 
    AdType string `json:"adType" gorm:"type:varchar(255);comment:类型"` 
    AdImg string `json:"adImg" gorm:"type:varchar(255);comment:广告图"` 
    AdUrl string `json:"adUrl" gorm:"type:varchar(255);comment:链接地址"` 
    Status string `json:"status" gorm:"type:bigint(20);comment:广告状态 1 开启 0关闭"` 
    StartTime time.Time `json:"startTime" gorm:"type:datetime;comment:广告有效期 开始时间"` 
    EndTime time.Time `json:"endTime" gorm:"type:datetime;comment:广告有效期 结束时间"` 
    models.ModelTime
    models.ControlBy
}

func (OrgAd) TableName() string {
    return "org_ad"
}

func (e *OrgAd) Generate() models.ActiveRecord {
	o := *e
	return &o
}

func (e *OrgAd) GetId() interface{} {
	return e.Id
}