| | |
| | | // Severity 严重程度 |
| | | Severity struct { |
| | | Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"` |
| | | Name string `json:"name" gorm:"column:name"` |
| | | Name string `json:"name" gorm:"column:name"` |
| | | } |
| | | |
| | | // SeveritySearch 严重程度搜索条件 |
| | | SeveritySearch struct { |
| | | Severity |
| | | Orm *gorm.DB |
| | | QueryClass constvar.SeverityQueryClass |
| | | KeywordType constvar.SeverityKeywordType |
| | | Keyword string |
| | | PageNum int |
| | | PageSize int |
| | | Orm *gorm.DB |
| | | QueryClass constvar.SeverityQueryClass |
| | | KeywordType constvar.SeverityKeywordType |
| | | Keyword string |
| | | PageNum int |
| | | PageSize int |
| | | } |
| | | ) |
| | | |
| | |
| | | if total != 0 { |
| | | return nil |
| | | } |
| | | records := []*Severity{} |
| | | records := []*Severity{ |
| | | {1, "轻"}, |
| | | {2, "严重"}, |
| | | {3, "较严重"}, |
| | | {4, "特严重"}, |
| | | } |
| | | return slf.CreateBatch(records) |
| | | } |