:art:新增请求日志记录
This commit is contained in:
@@ -10,3 +10,26 @@ type Setting struct {
|
||||
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"
|
||||
}
|
||||
|
||||
14
model/vo/dashboard.go
Normal file
14
model/vo/dashboard.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package vo
|
||||
|
||||
import "wireguard-dashboard/model/entity"
|
||||
|
||||
type SystemLogItem struct {
|
||||
Id string `json:"id"`
|
||||
Username string `json:"username"`
|
||||
ClientIP string `json:"clientIP"`
|
||||
Method string `json:"method"`
|
||||
Host string `json:"host"`
|
||||
Uri string `json:"uri"`
|
||||
StatusCode int `json:"statusCode"`
|
||||
CreatedAt entity.JsonTime `json:"createdAt"`
|
||||
}
|
||||
Reference in New Issue
Block a user