123456789101112131415161718192021222324 |
- package bizhi
- import orm "duoduo/database"
- type Download struct {
- ID int `gorm:"column:id;type:bigint(20);primary_key;AUTO_INCREMENT" json:"id"` // 主键
- OpenID string `gorm:"column:open_id;type:varchar(255)" json:"openId"`
- BizhiID int `gorm:"column:bizhi_id;type:bigint(20)" json:"bizhiId"` // 壁纸id
- Url string `gorm:"column:url;type:varchar(255)" json:"url"` // 壁纸url
- CreateTime string `gorm:"column:create_time;type:datetime" json:"createTime"` // 创建时间
- }
- func (m *Download) TableName() string {
- return "download"
- }
- func (m *Download) Insert() error {
- result := orm.BzMysql.Table(m.TableName()).Create(&m)
- if result.Error != nil {
- err := result.Error
- return err
- }
- return nil
- }
|