Some checks failed
Build and Deploy (service.xpcool.com) / build-and-deploy (push) Failing after 14s
192 lines
6.7 KiB
Go
192 lines
6.7 KiB
Go
// Package recruitment_v1 招聘考试聚合模块接口契约。
|
||
// 规范(2026-08-27):全部 POST;URL 不含任何参数(查询/路径参数均禁止);入参一律走 body。
|
||
package recruitment_v1
|
||
|
||
import "github.com/gogf/gf/v2/frame/g"
|
||
|
||
// ---------- 公告列表 ----------
|
||
type RecruitmentListReq struct {
|
||
g.Meta `path:"/recruitment/info/list" method:"post" tags:"Admin/Recruitment/Info" summary:"招聘公告列表(多维筛选)"`
|
||
Page int `json:"page" d:"1" v:"min:1"`
|
||
Size int `json:"size" d:"10" v:"min:1|max:100"`
|
||
Region string `json:"region"` // 地区过滤(空=全部)
|
||
Category int `json:"category"` // 分类(0=全部)
|
||
Keyword string `json:"keyword"` // 标题/正文/单位关键字
|
||
Status int `json:"status"` // 状态(0=有效+已更正;传 2 只看已失效等)
|
||
DateFrom string `json:"dateFrom"` // 发布日期起点 YYYY-MM-DD
|
||
DateTo string `json:"dateTo"` // 发布日期终点 YYYY-MM-DD
|
||
OrgName string `json:"orgName"` // 发布主体名称模糊匹配
|
||
SourceId uint64 `json:"sourceId"` // 指定数据源
|
||
OnlyNewToday bool `json:"onlyNewToday"` // 仅当日新增
|
||
}
|
||
|
||
type RecruitmentItem 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"`
|
||
}
|
||
|
||
type RecruitmentListRes struct {
|
||
List []*RecruitmentItem `json:"list"`
|
||
Total int `json:"total"`
|
||
}
|
||
|
||
// ---------- 公告详情 ----------
|
||
type RecruitmentDetailReq struct {
|
||
g.Meta `path:"/recruitment/info/detail" method:"post" tags:"Admin/Recruitment/Info" summary:"招聘公告详情"`
|
||
Id uint64 `json:"id" v:"required"`
|
||
}
|
||
|
||
type RecruitmentDetailRes struct {
|
||
Info *RecruitmentItem `json:"info"`
|
||
}
|
||
|
||
// ---------- 看板统计 ----------
|
||
type RecruitmentStatsReq struct {
|
||
g.Meta `path:"/recruitment/stats" method:"post" tags:"Admin/Recruitment/Dashboard" summary:"招聘数据看板统计"`
|
||
Region string `json:"region"` // 可选:按地区过滤统计
|
||
}
|
||
|
||
type RecruitmentStatsRes struct {
|
||
Total int `json:"total"`
|
||
TodayNew int `json:"todayNew"`
|
||
WeekNew int `json:"weekNew"`
|
||
ByCategory []CategoryAggItem `json:"byCategory"`
|
||
ByRegion []RegionAggItem `json:"byRegion"`
|
||
RecentTrend []TrendPointItem `json:"recentTrend"`
|
||
}
|
||
|
||
type CategoryAggItem struct {
|
||
Category int `json:"category"`
|
||
CategoryName string `json:"categoryName"`
|
||
Count int `json:"count"`
|
||
}
|
||
|
||
type RegionAggItem struct {
|
||
Region string `json:"region"`
|
||
Count int `json:"count"`
|
||
}
|
||
|
||
type TrendPointItem struct {
|
||
Date string `json:"date"`
|
||
Count int `json:"count"`
|
||
}
|
||
|
||
// ---------- 趋势分析 ----------
|
||
type RecruitmentTrendReq struct {
|
||
g.Meta `path:"/recruitment/trend" method:"post" tags:"Admin/Recruitment/Dashboard" summary:"招聘公告趋势(按日)"`
|
||
Region string `json:"region"`
|
||
Category int `json:"category"`
|
||
Days int `json:"days" d:"30" v:"min:1|max:365"`
|
||
}
|
||
|
||
type RecruitmentTrendRes struct {
|
||
Trend []TrendPointItem `json:"trend"`
|
||
}
|
||
|
||
// ---------- 数据源状态 ----------
|
||
type RecruitmentSourcesReq struct {
|
||
g.Meta `path:"/recruitment/source/list" method:"post" tags:"Admin/Recruitment/Crawler" summary:"数据源列表与运行状态"`
|
||
}
|
||
|
||
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"`
|
||
}
|
||
|
||
type RecruitmentSourcesRes struct {
|
||
List []*SourceItem `json:"list"`
|
||
}
|
||
|
||
// ---------- 手动触发抓取 ----------
|
||
type RecruitmentTriggerReq struct {
|
||
g.Meta `path:"/recruitment/crawl/trigger" method:"post" tags:"Admin/Recruitment/Crawler" summary:"手动触发抓取(单源或全量)"`
|
||
SourceId uint64 `json:"sourceId"` // 0=全部启用源
|
||
Force bool `json:"force"` // 是否强制全量回溯
|
||
}
|
||
|
||
type RecruitmentTriggerRes struct {
|
||
Triggered int `json:"triggered"` // 触发的源数量
|
||
Summary string `json:"summary"` // 运行摘要
|
||
}
|
||
|
||
// ---------- Bark 推送测试 ----------
|
||
type RecruitmentPushTestReq struct {
|
||
g.Meta `path:"/recruitment/push/test" method:"post" tags:"Admin/Recruitment/Push" summary:"Bark 推送测试"`
|
||
SubscriptionId uint64 `json:"subscriptionId"` // 0=使用首个启用订阅
|
||
Title string `json:"title"`
|
||
Body string `json:"body"`
|
||
}
|
||
|
||
type RecruitmentPushTestRes struct {
|
||
Result bool `json:"result"`
|
||
Message string `json:"message"`
|
||
}
|
||
|
||
// ---------- 推送订阅管理 ----------
|
||
type RecruitmentSubscriptionListReq struct {
|
||
g.Meta `path:"/recruitment/subscription/list" method:"post" tags:"Admin/Recruitment/Push" summary:"推送订阅列表"`
|
||
}
|
||
|
||
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"`
|
||
}
|
||
|
||
type RecruitmentSubscriptionListRes struct {
|
||
List []*SubscriptionItem `json:"list"`
|
||
}
|
||
|
||
type RecruitmentSubscriptionSaveReq struct {
|
||
g.Meta `path:"/recruitment/subscription/save" method:"post" tags:"Admin/Recruitment/Push" summary:"保存推送订阅(新增/更新)"`
|
||
Id uint64 `json:"id"` // 0=新增
|
||
Name string `json:"name" v:"required"`
|
||
DeviceKey string `json:"deviceKey" v:"required"`
|
||
Regions []string `json:"regions"`
|
||
Categories []int `json:"categories"`
|
||
OnlyNew int `json:"onlyNew" d:"1"`
|
||
PushTime string `json:"pushTime" d:"08:00"`
|
||
Enabled int `json:"enabled" d:"1"`
|
||
}
|
||
|
||
type RecruitmentSubscriptionSaveRes struct {
|
||
Id uint64 `json:"id"`
|
||
}
|
||
|
||
type RecruitmentSubscriptionDeleteReq struct {
|
||
g.Meta `path:"/recruitment/subscription/delete" method:"post" tags:"Admin/Recruitment/Push" summary:"删除推送订阅"`
|
||
Id uint64 `json:"id" v:"required"`
|
||
}
|
||
|
||
type RecruitmentSubscriptionDeleteRes struct{}
|