Some checks failed
Build and Deploy (service.xpcool.com) / build-and-deploy (push) Failing after 35s
- 新增新房预售证表 house_presale 存储预售许可信息 - 为 house_community 表添加 avg_price 字段存储小区参考均价 - 增强服务器操作审计日志功能,新增管理员账号、IP归属地、错误信息、UA等字段 - 实现纯Go版IP归属地离线解析器,无外部依赖,支持二分查找 - 优化看房列表查询逻辑,修复Fields设置位置导致的SQL语法错误 - 集成招聘模块,添加独立数据库配置和Bark推送服务支持 - 重构日志查询接口,支持多维度筛选和综合分页列表展示 - 更新DAO实体结构同步数据库表结构调整
162 lines
4.8 KiB
Go
162 lines
4.8 KiB
Go
// Package dto 招聘考试聚合模块的服务边界对象(入参/出参)。
|
|
package dto
|
|
|
|
// RecruitmentInfoVO 公告列表/详情的出参视图(由 entity 映射,含派生字段)。
|
|
type RecruitmentInfoVO struct {
|
|
Id uint64 `json:"id"`
|
|
Title string `json:"title"`
|
|
SourceId uint64 `json:"sourceId"`
|
|
SourceName string `json:"sourceName"` // 派生:数据源名称
|
|
OrgId uint64 `json:"orgId"`
|
|
OrgName string `json:"orgName"`
|
|
Category int `json:"category"`
|
|
CategoryName string `json:"categoryName"` // 派生:分类中文名
|
|
Region string `json:"region"`
|
|
PublishDate string `json:"publishDate"`
|
|
Deadline string `json:"deadline"`
|
|
ExamDate string `json:"examDate"`
|
|
Url string `json:"url"`
|
|
Content string `json:"content"`
|
|
Attachments string `json:"attachments"`
|
|
Status int `json:"status"`
|
|
StatusName string `json:"statusName"` // 派生:状态中文名
|
|
GroupKey string `json:"groupKey"`
|
|
CreatedAt string `json:"createdAt"`
|
|
}
|
|
|
|
// RecruitmentFilter 公告查询筛选条件(列表/看板共用)。
|
|
type RecruitmentFilter struct {
|
|
Page int // 页码,从 1 开始
|
|
Size int // 每页大小
|
|
Region string // 地区过滤
|
|
Category int // 分类(0 表示全部)
|
|
Keyword string // 标题/正文/单位关键字
|
|
Status int // 状态(0 表示有效+已更正,即未失效)
|
|
DateFrom string // 发布日期起点 YYYY-MM-DD
|
|
DateTo string // 发布日期终点 YYYY-MM-DD
|
|
OrgName string // 发布主体名称模糊匹配
|
|
SourceId uint64 // 指定数据源
|
|
OnlyNewToday bool // 仅查当日新增
|
|
}
|
|
|
|
// RecruitmentInput 公告写入入参(爬虫/手动录入共用)。
|
|
type RecruitmentInput struct {
|
|
Id uint64 // 更新时必填
|
|
Title string
|
|
SourceId uint64
|
|
OrgId uint64
|
|
OrgName string
|
|
Category int
|
|
Region string
|
|
PublishDate string
|
|
Deadline string
|
|
ExamDate string
|
|
Url string
|
|
Content string
|
|
Attachments string
|
|
Status int
|
|
GroupKey string
|
|
Fingerprint string
|
|
}
|
|
|
|
// CategoryAgg 按分类聚合。
|
|
type CategoryAgg struct {
|
|
Category int `json:"category"`
|
|
CategoryName string `json:"categoryName"`
|
|
Count int `json:"count"`
|
|
}
|
|
|
|
// RegionAgg 按地区聚合。
|
|
type RegionAgg struct {
|
|
Region string `json:"region"`
|
|
Count int `json:"count"`
|
|
}
|
|
|
|
// TrendPoint 按日新增趋势点。
|
|
type TrendPoint struct {
|
|
Date string `json:"date"`
|
|
Count int `json:"count"`
|
|
}
|
|
|
|
// RecruitmentStats 看板统计数据。
|
|
type RecruitmentStats struct {
|
|
Total int `json:"total"` // 有效公告总数
|
|
TodayNew int `json:"todayNew"` // 今日新增
|
|
WeekNew int `json:"weekNew"` // 近7天新增
|
|
ByCategory []CategoryAgg `json:"byCategory"`
|
|
ByRegion []RegionAgg `json:"byRegion"`
|
|
RecentTrend []TrendPoint `json:"recentTrend"` // 近30天每日新增
|
|
}
|
|
|
|
// SourceItem 数据源状态视图。
|
|
type SourceItem struct {
|
|
Id uint64 `json:"id"`
|
|
Name string `json:"name"`
|
|
BaseUrl string `json:"baseUrl"`
|
|
SourceType int `json:"sourceType"`
|
|
Category int `json:"category"`
|
|
Region string `json:"region"`
|
|
Enabled int `json:"enabled"`
|
|
LastSuccessAt string `json:"lastSuccessAt"`
|
|
FailCount int `json:"failCount"`
|
|
LastSummary string `json:"lastSummary"` // 最近一次运行摘要
|
|
}
|
|
|
|
// SubscriptionItem 推送订阅视图。
|
|
type SubscriptionItem struct {
|
|
Id uint64 `json:"id"`
|
|
Name string `json:"name"`
|
|
DeviceKey string `json:"deviceKey"`
|
|
Regions []string `json:"regions"`
|
|
Categories []int `json:"categories"`
|
|
OnlyNew int `json:"onlyNew"`
|
|
PushTime string `json:"pushTime"`
|
|
Enabled int `json:"enabled"`
|
|
}
|
|
|
|
// CrawlRunResult 单次抓取运行结果(用于写日志与返回)。
|
|
type CrawlRunResult struct {
|
|
SourceId uint64
|
|
Fetched int
|
|
NewCount int
|
|
UpdatedCount int
|
|
Err error
|
|
}
|
|
|
|
// SubscriptionInput 推送订阅写入入参。
|
|
type SubscriptionInput struct {
|
|
Id uint64
|
|
Name string
|
|
DeviceKey string
|
|
Regions []string
|
|
Categories []int
|
|
OnlyNew int
|
|
PushTime string
|
|
Enabled int
|
|
}
|
|
|
|
// 分类与状态的中文名映射(派生展示用)。
|
|
var CategoryNameMap = map[int]string{
|
|
1: "公务员", 2: "事业单位", 3: "国企", 4: "央企", 5: "私企", 6: "其他",
|
|
}
|
|
|
|
var StatusNameMap = map[int]string{
|
|
0: "有效", 1: "已更正", 2: "已失效", 3: "已删除",
|
|
}
|
|
|
|
// CategoryName 返回分类中文名。
|
|
func CategoryName(c int) string {
|
|
if v, ok := CategoryNameMap[c]; ok {
|
|
return v
|
|
}
|
|
return "其他"
|
|
}
|
|
|
|
// StatusName 返回状态中文名。
|
|
func StatusName(s int) string {
|
|
if v, ok := StatusNameMap[s]; ok {
|
|
return v
|
|
}
|
|
return "未知"
|
|
}
|