service.xpcool.com/internal/model/dto/log.go
夏犀麟 ea50261cb8
Some checks failed
Build and Deploy (service.xpcool.com) / build-and-deploy (push) Failing after 35s
feat(house): 扩充看房数据并增强服务器日志功能
- 新增新房预售证表 house_presale 存储预售许可信息
- 为 house_community 表添加 avg_price 字段存储小区参考均价
- 增强服务器操作审计日志功能,新增管理员账号、IP归属地、错误信息、UA等字段
- 实现纯Go版IP归属地离线解析器,无外部依赖,支持二分查找
- 优化看房列表查询逻辑,修复Fields设置位置导致的SQL语法错误
- 集成招聘模块,添加独立数据库配置和Bark推送服务支持
- 重构日志查询接口,支持多维度筛选和综合分页列表展示
- 更新DAO实体结构同步数据库表结构调整
2026-08-27 01:47:32 +08:00

67 lines
2.0 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Package dto — 日志监控相关类型。
package dto
// LogFile 描述一个服务器日志文件。
type LogFile struct {
Name string
Path string
Size int64
ModTime string
}
// LogQuery 管理员操作日志admin 系统日志分页查询参数覆盖时间、账号、IP、方法、结果、耗时、排序等维度。
type LogQuery struct {
Page int
Size int
AdminID uint64 // 按管理员ID精确过滤
Username string // 按管理员账号模糊过滤(冗余字段,便于检索)
IP string // 按来源 IP 模糊过滤
IpLocation string // 按 IP 归属地模糊过滤
Method string // 按 HTTP 方法精确过滤GET/POST/PUT/DELETE...
Status int // 结果筛选0 全部 / 1 成功(2xx) / 2 失败(非2xx)
Keyword string // 关键字:匹配 permission / path / ip
StartTime string // 起始时间 created_at >=,格式 2006-01-02 15:04:05
EndTime string // 结束时间 created_at <=,格式 2006-01-02 15:04:05
MinDuration int // 耗时下限(ms)0 表示不限
MaxDuration int // 耗时上限(ms)0 表示不限
OrderBy string // 排序字段createdAt(默认) | durationMs
OrderDir string // 排序方向desc(默认) | asc
}
// LogItem 一条管理员操作日志记录。
type LogItem struct {
Id uint64
AdminID uint64
AdminUsername string
Permission string
Method string
Path string
IP string
IpLocation string
Param string
DurationMS uint
StatusCode int
ErrorMessage string
UserAgent string
CreatedAt string
}
// LoginLogQuery 管理员登录日志分页查询参数。
type LoginLogQuery struct {
Page int
Size int
Username string // 按账号过滤
Status *int // 按结果过滤1 成功 0 失败nil 为全部
}
// LoginLogItem 一条管理员登录日志记录。
type LoginLogItem struct {
Id uint64
Username string
IP string
UserAgent string
Status int
FailReason string
CreatedAt string
}