zhangzengfei
2023-09-07 55aa27a6ad0e012d62dcea2db37528a1b18836fb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package models
 
import "basic.com/valib/logc.git"
 
type VaSystemLog logc.VaSystemLog
type VaSystemProcName struct {
    ProcName string `gorm:"column:procName" json:"procName"`
    Desc     string `gorm:"column:desc" json:"desc"`
}
 
type VaSystemQuery struct {
    TimeStart   string   `json:"timeStart" example:"2020-01-02 15:04:05"` // 开始时间,不传为结束时间前一个小时
    TimeEnd     string   `json:"timeEnd" example:"2020-01-02 16:00:00"`   // 结束时间,不传为当前时间
    ProcName    []string `json:"procName" example:"addCamera"`            // 功能
    Level       int      `json:"level"`                                   // 日志级别
    FuzzySearch string   `json:"fuzzySearch" example:"启动"`                // 模糊查询
    Page        int      `json:"page" example:"2"`                        // 页码
    PageSize    int      `json:"pageSize" example:"20"`                   // 分页大小
}
 
func (VaSystemLog) TableName() string {
    return "t_vasystem_log"
}
 
func (v *VaSystemLog) Insert() error {
 
    result := db.Table(v.TableName()).Create(&v)
 
    return result.Error
}