diff --git a/.workbuddy/memory/CHANGELOG.md b/.workbuddy/memory/CHANGELOG.md index 1c5d195..c88e0fb 100644 --- a/.workbuddy/memory/CHANGELOG.md +++ b/.workbuddy/memory/CHANGELOG.md @@ -1,6 +1,8 @@ # service.xpcool.com 变更记录 > 倒序:最新在上。格式:YYYY-MM-DD | 类型 | 摘要 +2026-08-27 | CHG | 看房新增新房预售证模块:api/house/presale + controller/service(POST /api/service/admin/house/presale/list,筛选 region/purpose/keyword,id 倒序);dto 加 HousePresaleVO;house_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 加 AvgPrice);go build 通过 2026-08-27 | CHG | 服务器日志(操作审计 admin_operation_log)全面增强为综合分页列表:① 新增字段 admin_username(冗余账号)、ip_location(IP归属地)、error_message(失败原因)、user_agent;② 自建纯 Go 的 xdb v4 离线解析器 internal/library/iploc(go:embed 嵌入 ip2region.xdb,无外部依赖,单次内存二分),审计写入时解析账号+归属地、记录 UA 与错误摘要;③ 查询筛选覆盖时间范围/账号/IP/归属地/HTTP方法/结果(成功2xx·失败非2xx)/关键字(权限码·路径·IP)/耗时上下限/排序(时间·耗时);④ 接口 POST /api/service/admin/system/log(body 入参,遵守全 POST 无参约定),dto.LogQuery/LogItem 同步;⑤ SQL:001_core.sql 建表补列 + 新增 010_server_log_enhance.sql 增量迁移(须手动导库,DB 结构变更不自动 DDL);go build 通过、iploc 单元冒烟通过 2026-08-27 | FIX | 看房中心接口异常修复:根因=后端进程是旧代码(recruitment 模块中途编译错误致项目编译不过、后端停在旧进程未加载 house 路由),重启后端加载新代码;附带修复 house listing/transaction 的 List 方法 Fields 在 Count 前设置导致 COUNT(t.*,c.name) SQL 语法错误(Fields 移到 Scan 前);7 个看房接口全部 code 0 验证通过 diff --git a/api/house/presale/presale.go b/api/house/presale/presale.go index e359953..bd546f2 100644 --- a/api/house/presale/presale.go +++ b/api/house/presale/presale.go @@ -16,6 +16,7 @@ type PresaleItem struct { Area float64 `json:"area"` Purpose string `json:"purpose"` IssueDate string `json:"issueDate"` + PublishDate string `json:"publishDate"` Source string `json:"source"` } diff --git a/internal/controller/house/presale.go b/internal/controller/house/presale.go index 2cb794f..166ebc5 100644 --- a/internal/controller/house/presale.go +++ b/internal/controller/house/presale.go @@ -28,6 +28,7 @@ func (c *Controller) PresaleList(ctx context.Context, req *presalev1.PresaleList Area: v.Area, Purpose: v.Purpose, IssueDate: v.IssueDate, + PublishDate: v.PublishDate, Source: v.Source, }) } diff --git a/internal/dao/internal/house_presale.go b/internal/dao/internal/house_presale.go index c432901..27b5037 100644 --- a/internal/dao/internal/house_presale.go +++ b/internal/dao/internal/house_presale.go @@ -32,6 +32,7 @@ type HousePresaleColumns struct { Area string // 建筑面积(平米) Purpose string // 规划用途(住宅/商业) IssueDate string // 初始核发日期 + PublishDate string // 公示发布日期(YYYY-MM-DD) Source string // 数据来源 CreatedAt string // UpdatedAt string // @@ -51,6 +52,7 @@ var housePresaleColumns = HousePresaleColumns{ Area: "area", Purpose: "purpose", IssueDate: "issue_date", + PublishDate: "publish_date", Source: "source", CreatedAt: "created_at", UpdatedAt: "updated_at", diff --git a/internal/model/do/house_presale.go b/internal/model/do/house_presale.go index 6daae79..9064a0d 100644 --- a/internal/model/do/house_presale.go +++ b/internal/model/do/house_presale.go @@ -22,6 +22,7 @@ type HousePresale struct { Area any // 建筑面积(平米) Purpose any // 规划用途(住宅/商业) IssueDate any // 初始核发日期 + PublishDate any // 公示发布日期(YYYY-MM-DD) Source any // 数据来源 CreatedAt any // UpdatedAt any // diff --git a/internal/model/entity/house_presale.go b/internal/model/entity/house_presale.go index 2bad8ab..6c81ef7 100644 --- a/internal/model/entity/house_presale.go +++ b/internal/model/entity/house_presale.go @@ -6,19 +6,20 @@ package entity // HousePresale is the golang structure for table house_presale. type HousePresale struct { - Id uint64 `json:"id" orm:"id" description:""` // - PresaleNo string `json:"presaleNo" orm:"presale_no" description:"预售证号"` // 预售证号 - CommunityName string `json:"communityName" orm:"community_name" description:"楼盘/项目名"` // 楼盘/项目名 - Developer string `json:"developer" orm:"developer" description:"房地产开发企业"` // 房地产开发企业 - Region string `json:"region" orm:"region" description:"区县"` // 区县 - Address string `json:"address" orm:"address" description:"建筑位置"` // 建筑位置 - BuildingNo string `json:"buildingNo" orm:"building_no" description:"楼栋号"` // 楼栋号 - HouseCount int `json:"houseCount" orm:"house_count" description:"套数"` // 套数 - Area float64 `json:"area" orm:"area" description:"建筑面积(平米)"` // 建筑面积(平米) - Purpose string `json:"purpose" orm:"purpose" description:"规划用途(住宅/商业)"` // 规划用途(住宅/商业) - IssueDate string `json:"issueDate" orm:"issue_date" description:"初始核发日期"` // 初始核发日期 - Source string `json:"source" orm:"source" description:"数据来源"` // 数据来源 - CreatedAt string `json:"createdAt" orm:"created_at" description:""` // - UpdatedAt string `json:"updatedAt" orm:"updated_at" description:""` // - DeletedAt string `json:"deletedAt" orm:"deleted_at" description:""` // + Id uint64 `json:"id" orm:"id" description:""` // + PresaleNo string `json:"presaleNo" orm:"presale_no" description:"预售证号"` // 预售证号 + CommunityName string `json:"communityName" orm:"community_name" description:"楼盘/项目名"` // 楼盘/项目名 + Developer string `json:"developer" orm:"developer" description:"房地产开发企业"` // 房地产开发企业 + Region string `json:"region" orm:"region" description:"区县"` // 区县 + Address string `json:"address" orm:"address" description:"建筑位置"` // 建筑位置 + BuildingNo string `json:"buildingNo" orm:"building_no" description:"楼栋号"` // 楼栋号 + HouseCount int `json:"houseCount" orm:"house_count" description:"套数"` // 套数 + Area float64 `json:"area" orm:"area" description:"建筑面积(平米)"` // 建筑面积(平米) + Purpose string `json:"purpose" orm:"purpose" description:"规划用途(住宅/商业)"` // 规划用途(住宅/商业) + IssueDate string `json:"issueDate" orm:"issue_date" description:"初始核发日期"` // 初始核发日期 + PublishDate string `json:"publishDate" orm:"publish_date" description:"公示发布日期(YYYY-MM-DD)"` // 公示发布日期(YYYY-MM-DD) + Source string `json:"source" orm:"source" description:"数据来源"` // 数据来源 + CreatedAt string `json:"createdAt" orm:"created_at" description:""` // + UpdatedAt string `json:"updatedAt" orm:"updated_at" description:""` // + DeletedAt string `json:"deletedAt" orm:"deleted_at" description:""` // }