service.xpcool.com/internal/dao/internal/house_school_district.go
夏犀麟 4aca0c7f6f
Some checks failed
Build and Deploy (service.xpcool.com) / build-and-deploy (push) Failing after 5m7s
feat(house): 实现看房模块后端功能
- 新增 9 张房屋相关数据表(社区/楼宇/房源/价格快照/交易/设施/社区设施/学区/偏好)
- 添加菜单权限种子数据并绑定超级管理员角色
- 生成 DAO 层代码和实体对象
- 实现房屋模块 API 接口(社区/房源/看板)和控制器服务层
- 支持多平台软关联匹配、笋盘标记和低可信度标记功能
- 更新超级管理员账号为 xxcool/xxCool@2026
- 调整 RBAC 菜单结构,移除管理员管理功能,新增日志管理菜单
- 修复 RBAC 安全漏洞,确保禁用角色权限失效
- 重构认证模块,将登录相关接口迁移到统一包结构下
- 移除废弃的管理模块和工具类接口定义
- 为通用工具包添加中文注释和文档说明
2026-08-26 23:42:38 +08:00

96 lines
3.4 KiB
Go

// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// HouseSchoolDistrictDao is the data access object for the table house_school_district.
type HouseSchoolDistrictDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns HouseSchoolDistrictColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// HouseSchoolDistrictColumns defines and stores column names for the table house_school_district.
type HouseSchoolDistrictColumns struct {
Id string //
SchoolName string // 学校名
CommunityId string // 小区ID
DistrictPolygon string // 划片范围GeoJSON
DistrictYear string // 划片年度
Note string // 备注
CreatedAt string //
UpdatedAt string //
DeletedAt string //
}
// houseSchoolDistrictColumns holds the columns for the table house_school_district.
var houseSchoolDistrictColumns = HouseSchoolDistrictColumns{
Id: "id",
SchoolName: "school_name",
CommunityId: "community_id",
DistrictPolygon: "district_polygon",
DistrictYear: "district_year",
Note: "note",
CreatedAt: "created_at",
UpdatedAt: "updated_at",
DeletedAt: "deleted_at",
}
// NewHouseSchoolDistrictDao creates and returns a new DAO object for table data access.
func NewHouseSchoolDistrictDao(handlers ...gdb.ModelHandler) *HouseSchoolDistrictDao {
return &HouseSchoolDistrictDao{
group: "default",
table: "house_school_district",
columns: houseSchoolDistrictColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *HouseSchoolDistrictDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *HouseSchoolDistrictDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *HouseSchoolDistrictDao) Columns() HouseSchoolDistrictColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *HouseSchoolDistrictDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *HouseSchoolDistrictDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *HouseSchoolDistrictDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}