service.xpcool.com/internal/dao/internal/house_presale.go
夏犀麟 1e28e02dc1
Some checks failed
Build and Deploy (service.xpcool.com) / build-and-deploy (push) Failing after 31s
feat(house): 新增新房预售证模块并扩展相关功能
- 添加 api/house/presale 接口模块实现新房预售证查询功能
- 新增 POST /api/service/admin/house/presale/list 接口支持 region/purpose/keyword 筛选
- 在 HousePresaleVO 中增加 PublishDate 字段用于存储公示发布日期
- 在 house_presale 表中添加 publish_date 字段并完成数据库同步
- 更新权限种子配置新增菜单 95 新房预售及 950 查询权限
- 完成相关 controller 和 service 层代码实现并验证接口返回正常数据
2026-08-27 02:01:04 +08:00

110 lines
3.7 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"
)
// HousePresaleDao is the data access object for the table house_presale.
type HousePresaleDao 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 HousePresaleColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// HousePresaleColumns defines and stores column names for the table house_presale.
type HousePresaleColumns struct {
Id string //
PresaleNo string // 预售证号
CommunityName string // 楼盘/项目名
Developer string // 房地产开发企业
Region string // 区县
Address string // 建筑位置
BuildingNo string // 楼栋号
HouseCount string // 套数
Area string // 建筑面积(平米)
Purpose string // 规划用途(住宅/商业)
IssueDate string // 初始核发日期
PublishDate string // 公示发布日期(YYYY-MM-DD)
Source string // 数据来源
CreatedAt string //
UpdatedAt string //
DeletedAt string //
}
// housePresaleColumns holds the columns for the table house_presale.
var housePresaleColumns = HousePresaleColumns{
Id: "id",
PresaleNo: "presale_no",
CommunityName: "community_name",
Developer: "developer",
Region: "region",
Address: "address",
BuildingNo: "building_no",
HouseCount: "house_count",
Area: "area",
Purpose: "purpose",
IssueDate: "issue_date",
PublishDate: "publish_date",
Source: "source",
CreatedAt: "created_at",
UpdatedAt: "updated_at",
DeletedAt: "deleted_at",
}
// NewHousePresaleDao creates and returns a new DAO object for table data access.
func NewHousePresaleDao(handlers ...gdb.ModelHandler) *HousePresaleDao {
return &HousePresaleDao{
group: "default",
table: "house_presale",
columns: housePresaleColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *HousePresaleDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *HousePresaleDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *HousePresaleDao) Columns() HousePresaleColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *HousePresaleDao) 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 *HousePresaleDao) 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 *HousePresaleDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}