feat(house): 新增新房预售证模块并扩展相关功能
Some checks failed
Build and Deploy (service.xpcool.com) / build-and-deploy (push) Failing after 31s

- 添加 api/house/presale 接口模块实现新房预售证查询功能
- 新增 POST /api/service/admin/house/presale/list 接口支持 region/purpose/keyword 筛选
- 在 HousePresaleVO 中增加 PublishDate 字段用于存储公示发布日期
- 在 house_presale 表中添加 publish_date 字段并完成数据库同步
- 更新权限种子配置新增菜单 95 新房预售及 950 查询权限
- 完成相关 controller 和 service 层代码实现并验证接口返回正常数据
This commit is contained in:
夏犀麟 2026-08-27 02:01:04 +08:00
parent ea50261cb8
commit 1e28e02dc1
6 changed files with 23 additions and 15 deletions

View File

@ -1,6 +1,8 @@
# service.xpcool.com 变更记录 # service.xpcool.com 变更记录
> 倒序最新在上格式YYYY-MM-DD | 类型 | 摘要 > 倒序最新在上格式YYYY-MM-DD | 类型 | 摘要
2026-08-27 | CHG | 看房新增新房预售证模块api/house/presale + controller/servicePOST /api/service/admin/house/presale/list筛选 region/purpose/keywordid 倒序dto HousePresaleVOhouse_presale publish_date 字段013 SQL 同步 + hack/config.yaml tables house_presale + gen dao 更新权限种子 014菜单 95 新房预售 + 950 查询权限go build 通过接口返回 487 条干净数据presaleNo/publishDate 正确
2026-08-27 | CHG | 看房数据扩充013_house_presale.sql 建预售证表presale_no 唯一house_community avg_price 字段010 SQL 同步 + gen dao 更新 entity/do AvgPricego build 通过 2026-08-27 | CHG | 看房数据扩充013_house_presale.sql 建预售证表presale_no 唯一house_community avg_price 字段010 SQL 同步 + gen dao 更新 entity/do AvgPricego build 通过
2026-08-27 | CHG | 服务器日志操作审计 admin_operation_log全面增强为综合分页列表 新增字段 admin_username(冗余账号)ip_location(IP归属地)error_message(失败原因)user_agent 自建纯 Go xdb v4 离线解析器 internal/library/iplocgo:embed 嵌入 ip2region.xdb无外部依赖单次内存二分审计写入时解析账号+归属地记录 UA 与错误摘要 查询筛选覆盖时间范围/账号/IP/归属地/HTTP方法/结果(成功2xx·失败非2xx)/关键字(权限码·路径·IP)/耗时上下限/排序(时间·耗时) 接口 POST /api/service/admin/system/logbody 入参遵守全 POST 无参约定dto.LogQuery/LogItem 同步 SQL001_core.sql 建表补列 + 新增 010_server_log_enhance.sql 增量迁移须手动导库DB 结构变更不自动 DDLgo build 通过iploc 单元冒烟通过 2026-08-27 | CHG | 服务器日志操作审计 admin_operation_log全面增强为综合分页列表 新增字段 admin_username(冗余账号)ip_location(IP归属地)error_message(失败原因)user_agent 自建纯 Go xdb v4 离线解析器 internal/library/iplocgo:embed 嵌入 ip2region.xdb无外部依赖单次内存二分审计写入时解析账号+归属地记录 UA 与错误摘要 查询筛选覆盖时间范围/账号/IP/归属地/HTTP方法/结果(成功2xx·失败非2xx)/关键字(权限码·路径·IP)/耗时上下限/排序(时间·耗时) 接口 POST /api/service/admin/system/logbody 入参遵守全 POST 无参约定dto.LogQuery/LogItem 同步 SQL001_core.sql 建表补列 + 新增 010_server_log_enhance.sql 增量迁移须手动导库DB 结构变更不自动 DDLgo build 通过iploc 单元冒烟通过
2026-08-27 | FIX | 看房中心接口异常修复根因=后端进程是旧代码recruitment 模块中途编译错误致项目编译不过后端停在旧进程未加载 house 路由重启后端加载新代码附带修复 house listing/transaction List 方法 Fields Count 前设置导致 COUNT(t.*,c.name) SQL 语法错误Fields 移到 Scan 7 个看房接口全部 code 0 验证通过 2026-08-27 | FIX | 看房中心接口异常修复根因=后端进程是旧代码recruitment 模块中途编译错误致项目编译不过后端停在旧进程未加载 house 路由重启后端加载新代码附带修复 house listing/transaction List 方法 Fields Count 前设置导致 COUNT(t.*,c.name) SQL 语法错误Fields 移到 Scan 7 个看房接口全部 code 0 验证通过

View File

@ -16,6 +16,7 @@ type PresaleItem struct {
Area float64 `json:"area"` Area float64 `json:"area"`
Purpose string `json:"purpose"` Purpose string `json:"purpose"`
IssueDate string `json:"issueDate"` IssueDate string `json:"issueDate"`
PublishDate string `json:"publishDate"`
Source string `json:"source"` Source string `json:"source"`
} }

View File

@ -28,6 +28,7 @@ func (c *Controller) PresaleList(ctx context.Context, req *presalev1.PresaleList
Area: v.Area, Area: v.Area,
Purpose: v.Purpose, Purpose: v.Purpose,
IssueDate: v.IssueDate, IssueDate: v.IssueDate,
PublishDate: v.PublishDate,
Source: v.Source, Source: v.Source,
}) })
} }

View File

@ -32,6 +32,7 @@ type HousePresaleColumns struct {
Area string // 建筑面积(平米) Area string // 建筑面积(平米)
Purpose string // 规划用途(住宅/商业) Purpose string // 规划用途(住宅/商业)
IssueDate string // 初始核发日期 IssueDate string // 初始核发日期
PublishDate string // 公示发布日期(YYYY-MM-DD)
Source string // 数据来源 Source string // 数据来源
CreatedAt string // CreatedAt string //
UpdatedAt string // UpdatedAt string //
@ -51,6 +52,7 @@ var housePresaleColumns = HousePresaleColumns{
Area: "area", Area: "area",
Purpose: "purpose", Purpose: "purpose",
IssueDate: "issue_date", IssueDate: "issue_date",
PublishDate: "publish_date",
Source: "source", Source: "source",
CreatedAt: "created_at", CreatedAt: "created_at",
UpdatedAt: "updated_at", UpdatedAt: "updated_at",

View File

@ -22,6 +22,7 @@ type HousePresale struct {
Area any // 建筑面积(平米) Area any // 建筑面积(平米)
Purpose any // 规划用途(住宅/商业) Purpose any // 规划用途(住宅/商业)
IssueDate any // 初始核发日期 IssueDate any // 初始核发日期
PublishDate any // 公示发布日期(YYYY-MM-DD)
Source any // 数据来源 Source any // 数据来源
CreatedAt any // CreatedAt any //
UpdatedAt any // UpdatedAt any //

View File

@ -6,19 +6,20 @@ package entity
// HousePresale is the golang structure for table house_presale. // HousePresale is the golang structure for table house_presale.
type HousePresale struct { type HousePresale struct {
Id uint64 `json:"id" orm:"id" description:""` // Id uint64 `json:"id" orm:"id" description:""` //
PresaleNo string `json:"presaleNo" orm:"presale_no" description:"预售证号"` // 预售证号 PresaleNo string `json:"presaleNo" orm:"presale_no" description:"预售证号"` // 预售证号
CommunityName string `json:"communityName" orm:"community_name" description:"楼盘/项目名"` // 楼盘/项目名 CommunityName string `json:"communityName" orm:"community_name" description:"楼盘/项目名"` // 楼盘/项目名
Developer string `json:"developer" orm:"developer" description:"房地产开发企业"` // 房地产开发企业 Developer string `json:"developer" orm:"developer" description:"房地产开发企业"` // 房地产开发企业
Region string `json:"region" orm:"region" description:"区县"` // 区县 Region string `json:"region" orm:"region" description:"区县"` // 区县
Address string `json:"address" orm:"address" description:"建筑位置"` // 建筑位置 Address string `json:"address" orm:"address" description:"建筑位置"` // 建筑位置
BuildingNo string `json:"buildingNo" orm:"building_no" description:"楼栋号"` // 楼栋号 BuildingNo string `json:"buildingNo" orm:"building_no" description:"楼栋号"` // 楼栋号
HouseCount int `json:"houseCount" orm:"house_count" description:"套数"` // 套数 HouseCount int `json:"houseCount" orm:"house_count" description:"套数"` // 套数
Area float64 `json:"area" orm:"area" description:"建筑面积(平米)"` // 建筑面积(平米) Area float64 `json:"area" orm:"area" description:"建筑面积(平米)"` // 建筑面积(平米)
Purpose string `json:"purpose" orm:"purpose" description:"规划用途(住宅/商业)"` // 规划用途(住宅/商业) Purpose string `json:"purpose" orm:"purpose" description:"规划用途(住宅/商业)"` // 规划用途(住宅/商业)
IssueDate string `json:"issueDate" orm:"issue_date" description:"初始核发日期"` // 初始核发日期 IssueDate string `json:"issueDate" orm:"issue_date" description:"初始核发日期"` // 初始核发日期
Source string `json:"source" orm:"source" description:"数据来源"` // 数据来源 PublishDate string `json:"publishDate" orm:"publish_date" description:"公示发布日期(YYYY-MM-DD)"` // 公示发布日期(YYYY-MM-DD)
CreatedAt string `json:"createdAt" orm:"created_at" description:""` // Source string `json:"source" orm:"source" description:"数据来源"` // 数据来源
UpdatedAt string `json:"updatedAt" orm:"updated_at" description:""` // CreatedAt string `json:"createdAt" orm:"created_at" description:""` //
DeletedAt string `json:"deletedAt" orm:"deleted_at" description:""` // UpdatedAt string `json:"updatedAt" orm:"updated_at" description:""` //
DeletedAt string `json:"deletedAt" orm:"deleted_at" description:""` //
} }