operate_log

package
v1.0.7-alpha8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FieldResource     = "Resource"
	FieldResourceID   = "ResourceID"
	FieldOperate      = "Operate"
	FieldOperatorID   = "OperatorID"
	FieldOperatorName = "OperatorName"
	FieldOperateTime  = "OperateTime"
	FieldContent      = "Content"
)

Variables

View Source
var (
	ColumnResource     = domain.ColumnName(FieldResource)
	ColumnResourceID   = domain.ColumnName(FieldResourceID)
	ColumnOperate      = domain.ColumnName(FieldOperate)
	ColumnOperatorID   = domain.ColumnName(FieldOperatorID)
	ColumnOperatorName = domain.ColumnName(FieldOperatorName)
	ColumnOperateTime  = domain.ColumnName(FieldOperateTime)
	ColumnContent      = domain.ColumnName(FieldContent)
)

Functions

func Bind

func Bind(app *application.App, simple *Simple)

func WriteLog

func WriteLog(dbExecutor database.Executor, dbSchema string, operate string, objects ...CanLogObject) error

Types

type CanLogObject

type CanLogObject interface {
	ObjectInfo() ObjectInfo
	OperatorInfo() OperatorInfo
	LogContent() map[string]any
}

type Info

type Info struct {
	Resource     string `json:"resource" sqlresult:"column:resource"`
	ResourceID   string `json:"resourceId" sqlresult:"column:resource_id"`
	Operate      string `json:"operate" sqlresult:"column:operate"`
	OperatorName string `json:"operatorName" sqlresult:"column:operator_name"`
	OperateTime  string `json:"operateTime" sqlresult:"column:operate_time"`
	Content      string `json:"content" sqlresult:"column:content"`
}

type ObjectInfo

type ObjectInfo struct {
	Resource   string
	ResourceID string
}

type OperatorInfo

type OperatorInfo struct {
	OperatorID   string
	OperatorName string
}

type QueryLogsQueryParams

type QueryLogsQueryParams struct {
	request.BaseQueryParams
	Resource         string `form:"resource"`
	ResourceID       string `form:"resourceId"`
	Operate          string `form:"operate"`
	OperatorName     string `form:"operatorName"`
	StartOperateTime string `form:"startOperateTime"`
	EndOperateTime   string `form:"endOperateTime"`
}

type Simple

type Simple struct {
	// schema
	Schema string
}

Simple Bind参数

type ValueObject

type ValueObject struct {
	value_object.Base
	Resource     string    `sqlmapping:"column:resource" sqlresult:"column:resource"`
	ResourceID   string    `sqlmapping:"column:resource_id" sqlresult:"column:resource_id"`
	Operate      string    `sqlmapping:"column:operate" sqlresult:"column:operate"`
	OperatorID   string    `sqlmapping:"column:operator_id" sqlresult:"column:operator_id"`
	OperatorName string    `sqlmapping:"column:operator_name" sqlresult:"column:operator_name"`
	OperateTime  time.Time `sqlmapping:"column:operate_time" sqlresult:"column:operate_time"`
	Content      string    `sqlmapping:"column:content" sqlresult:"column:content"`
}

func (*ValueObject) DomainCNName

func (v *ValueObject) DomainCNName() string

func (*ValueObject) DomainCamelName

func (v *ValueObject) DomainCamelName() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL