123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- package model
- import (
- "time"
- "ulink-admin/pkg/base"
- )
- type Violation struct {
- Id int64 `excel:"name=主键id " xorm:"pk autoincr notnull comment('主键id')" json:"id" ` //主键id
- Item string `excel:"name=服务项 " xorm:"varchar(255) notnull default('0') comment('服务项')" json:"item" binding:"required"` //服务项
- Label string `excel:"name=项目 " xorm:"varchar(255) comment('项目')" json:"label" ` //项目
- Content string `excel:"name=标准 " xorm:"text comment('标准')" json:"content" ` //标准
- Score int `excel:"name=分数 " xorm:"int(10) notnull default(0) comment('分数')" json:"score" binding:"required"` //分数
- CreateTime time.Time `excel:"name=创建时间 " xorm:"datetime comment('创建时间')" json:"createTime" ` //创建时间
- CreateBy string `excel:"name=创建人 " xorm:"varchar(255) comment('创建人')" json:"createBy" ` //创建人
- UpdateTime time.Time `excel:"name=更新时间 " xorm:"datetime comment('更新时间')" json:"updateTime" ` //更新时间
- UpdateBy string `excel:"name=更新人 " xorm:"varchar(255) comment('更新人')" json:"updateBy" ` //更新人
- }
- func (this Violation) TableName() string {
- return "violation"
- }
- func (this *Violation) Key() int64 {
- return this.Id
- }
- func (this *Violation) Model() interface{} {
- return this
- }
- func (this *Violation) BeforeUpdate() {
- user := base.GetCurUser()
- if user != nil {
- this.UpdateBy = user.Name
- }
- }
- func (this *Violation) BeforeInsert() {
- user := base.GetCurUser()
- if user != nil {
- this.CreateBy = user.Name
- this.UpdateBy = user.Name
- }
- }
|