service.xpcool.com/internal/dao/recruitment.go
夏犀麟 4445b8e8bf
Some checks failed
Build and Deploy (service.xpcool.com) / build-and-deploy (push) Failing after 14s
CHG: house transaction service 层 + recruitment 招聘模块 + 012 菜单 SQL(补提交未推送代码)
2026-08-27 00:41:59 +08:00

64 lines
2.1 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 dao 招聘考试聚合模块数据访问层(手写,未跑 gf gen
// 仅暴露 Ctx(ctx) *gdb.Model供 service 层链式调用,形态与生成产物一致。
// 全部表落在独立数据库 recruitment由 database.recruitment.link 配置)。
package dao
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// dbGroup 招聘模块独立数据库分组名,对应 config 中 database.recruitment.link。
const dbGroup = "recruitment"
// model 返回指向指定表的安全 Model。
func model(table string) func(ctx context.Context) *gdb.Model {
return func(ctx context.Context) *gdb.Model {
return g.DB(dbGroup).Model(table).Safe()
}
}
type recruitmentInfoDao struct{ table string }
// RecruitmentInfo 公告主表全局访问对象。
var RecruitmentInfo = recruitmentInfoDao{table: "recruitment_info"}
func (d recruitmentInfoDao) Ctx(ctx context.Context) *gdb.Model { return model(d.table)(ctx) }
type organizationDao struct{ table string }
// Organization 发布主体表全局访问对象。
var Organization = organizationDao{table: "organization"}
func (d organizationDao) Ctx(ctx context.Context) *gdb.Model { return model(d.table)(ctx) }
type crawlSourceDao struct{ table string }
// CrawlSource 数据源表全局访问对象。
var CrawlSource = crawlSourceDao{table: "crawl_source"}
func (d crawlSourceDao) Ctx(ctx context.Context) *gdb.Model { return model(d.table)(ctx) }
type crawlLogDao struct{ table string }
// CrawlLog 抓取日志表全局访问对象。
var CrawlLog = crawlLogDao{table: "crawl_log"}
func (d crawlLogDao) Ctx(ctx context.Context) *gdb.Model { return model(d.table)(ctx) }
type pushSubscriptionDao struct{ table string }
// PushSubscription 推送订阅表全局访问对象。
var PushSubscription = pushSubscriptionDao{table: "push_subscription"}
func (d pushSubscriptionDao) Ctx(ctx context.Context) *gdb.Model { return model(d.table)(ctx) }
type pushLogDao struct{ table string }
// PushLog 推送记录表全局访问对象。
var PushLog = pushLogDao{table: "push_log"}
func (d pushLogDao) Ctx(ctx context.Context) *gdb.Model { return model(d.table)(ctx) }