package entity

type Setting struct {
	Base
	Code     string `json:"code" gorm:"type:char(20);not null;comment:'设定code'"`
	Data     string `json:"data" gorm:"type:text;not null;comment:'值'"`
	Describe string `json:"describe" gorm:"type:text;default null;comment:'默认值'"`
}

func (Setting) TableName() string {
	return "t_setting"
}

// SystemLog
// @description: 系统日志
type SystemLog struct {
	Base
	UserId     string `json:"userId" gorm:"type:char(40);comment:'用户id'"`
	ClientIP   string `json:"clientIP" gorm:"type:varchar(60);not null;comment:'客户端IP'"`
	Host       string `json:"host" gorm:"type:varchar(255);not null;comment:'请求域名'"`
	Method     string `json:"method" gorm:"type:varchar(20);not null;comment:'请求方法[GET POST DELETE PUT PATCH]'"`
	Uri        string `json:"uri" gorm:"type:varchar(255);not null;comment:'请求path'"`
	Header     string `json:"header" gorm:"type:text;comment:'请求头'"`
	Body       string `json:"body" gorm:"type:text;comment:'请求体'"`
	Form       string `json:"form" gorm:"type:text;comment:'请求表单'"`
	Query      string `json:"query" gorm:"type:text;comment:'请求query'"`
	UserAgent  string `json:"userAgent" gorm:"type:text;comment:'ua信息'"`
	Cost       int64  `json:"cost" gorm:"type:int(10);comment:'请求耗时'"`
	StatusCode int    `json:"statusCode" gorm:"type:int(10);comment:'响应状态码'"`
	Response   string `json:"response" gorm:"type:text;comment:'返回数据'"`
}

func (SystemLog) TableName() string {
	return "t_system_log"
}