Documentation ¶
Index ¶
Constants ¶
View Source
const ( DEFAULT_REMARK = "NA" // 默认的Remark值 OP_ACTION_ADD = "add" // 增 OP_ACTION_DELETE = "delete" // 删 OP_ACTION_ALTER = "alter" // 改 OP_ACTION_QUERY = "query" // 查 OP_ACTION_IMPORT = "import" // 导入 )
行为
Variables ¶
This section is empty.
Functions ¶
func AddOperationLog ¶
记录操作日志 AddOperationLog insert a new operation log into database and returns last inserted Id on success.
func GetAllOpLog ¶
func GetAllOpLog(dbInst *gorm.DB, opModel interface{}, ret interface{}, querys []*common.QueryConditon, fields []string, sortby []string, order []string, offset int, limit int) (ml interface{}, totalcount int64, err error)
查询操作日志 GetAllOpLog retrieves all oplogs matches certain condition. Returns empty list if no records exist
Types ¶
type OpLog ¶
type OpLog struct { ID uint `gorm:"primary_key" json:"id"` // 自增主键 User string `gorm:"size:100;column:user;index" json:"user"` // 操作者的账户id Action string `gorm:"size:20;column:action;index" json:"action"` // 行为 FlowId uint `gorm:"column:flow_id;index" json:"flowId"` // FlowId Flow string `gorm:"size:50;column:flow;index" json:"flow"` // FlowType Remark string `gorm:"type:text;column:remark" json:"remark"` // 操作详情 CreatedAt time.Time `json:"created_at"` // 创建时间 UpdatedAt time.Time `json:"updated_at"` // 最后更新时间 }
Click to show internal directories.
Click to hide internal directories.