12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- package model
- import (
- "time"
- "ulink-admin/pkg/base"
- )
- type SysNotice struct {
- Id int64 `xorm:"pk autoincr" json:"id"`
- NoticeTitle string `xorm:"notice_title" json:"noticeTitle" binding:"required"`
- NoticeType string `xorm:"notice_type" json:"noticeType"`
- NoticeContent string `json:"noticeContent"`
- Status string `json:"status"`
- CreateBy string `xorm:"varchar(64)" json:"createBy"`
- CreateTime time.Time `xorm:"created" json:"createTime"`
- UpdateBy string `xorm:"varchar(64)" json:"updateBy"`
- UpdateTime time.Time `xorm:"updated" json:"updateTime"`
- Remark string `xorm:"varchar(500)" json:"remark"`
- CompanyId int64 `excel:"name=公司Id" xorm:"bigint(20)" json:"companyId" `
- }
- func (r *SysNotice) BeforeUpdate() {
- user := base.GetCurUser()
- if user != nil {
- r.UpdateBy = user.Name
- }
- }
- func (r *SysNotice) BeforeInsert() {
- user := base.GetCurUser()
- if user != nil {
- r.CreateBy = user.Name
- r.UpdateBy = user.Name
- }
- }
- func (SysNotice) TableName() string {
- return "sys_notice"
- }
- func (r *SysNotice) Key() int64 {
- return r.Id
- }
- func (r *SysNotice) Model() interface{} {
- return r
- }
|