CHG: house 成交记录(transaction)模块:api/service/controller 全链路 + cmd 注册 + dto 扩展
Some checks failed
Build and Deploy (service.xpcool.com) / build-and-deploy (push) Failing after 25s

This commit is contained in:
夏犀麟 2026-08-27 00:33:52 +08:00
parent b439c4d89c
commit 69137f366c
4 changed files with 42 additions and 0 deletions

View File

@ -1,6 +1,7 @@
# service.xpcool.com 变更记录 # service.xpcool.com 变更记录
> 倒序最新在上格式YYYY-MM-DD | 类型 | 摘要 > 倒序最新在上格式YYYY-MM-DD | 类型 | 摘要
2026-08-27 | CHG | 看房成交模块api/house/transaction + service/house/transaction + controller/house/transaction 实现成交记录 list 接口/api/service/admin/house/transaction/list POST 分页关联小区名按成交日期倒序dto HouseTransactionVOcmd.go 注册012_house_transaction_menu.sql 权限种子house:data:transaction id=941 挂数据明细 94go build 通过
2026-08-26 | CFG | 新增 Gitea act_runner 自动部署.gitea/workflows/deploy.ymlpush main/dev 下载 Go1.23 工具链 npmmirror + GOPROXY goproxy.cn CGO=0 linux/amd64 交叉编译 组装 main+manifest/config(config.yaml+config.prod.yaml)+resource+deploy/Dockerfile docker build 重建容器 127.0.0.1:10100xpcool-netGF_GCFG_ENV=prodDB_DSN/JWT_SECRET Gitea Actions secrets curl /api.json 冒烟deploy/Dockerfile 仓库内维护DB 结构变更不自动 DDL需手动导 manifest/sql 2026-08-26 | CFG | 新增 Gitea act_runner 自动部署.gitea/workflows/deploy.ymlpush main/dev 下载 Go1.23 工具链 npmmirror + GOPROXY goproxy.cn CGO=0 linux/amd64 交叉编译 组装 main+manifest/config(config.yaml+config.prod.yaml)+resource+deploy/Dockerfile docker build 重建容器 127.0.0.1:10100xpcool-netGF_GCFG_ENV=prodDB_DSN/JWT_SECRET Gitea Actions secrets curl /api.json 冒烟deploy/Dockerfile 仓库内维护DB 结构变更不自动 DDL需手动导 manifest/sql
2026-08-26 | FIX | 本地登录 no rows 修复根因=本地库 service_xpcool_com admin_user 空表本地/服务器库两套此前仅改服务器 super_admin 角色 + 导入 009_admin_account_v2.sql --default-character-set=utf8mb4 否则中文 Data too long 本地 xxcool/xxCool@2026 登录成功subject=3同时服务器废弃 webhook 方案已删除deploy-webhook.service/webhook.py/secrets.env/deploy.sh自动部署改走 Gitea act_runner + .gitea/workflows仓库内尚未配置待补 2026-08-26 | FIX | 本地登录 no rows 修复根因=本地库 service_xpcool_com admin_user 空表本地/服务器库两套此前仅改服务器 super_admin 角色 + 导入 009_admin_account_v2.sql --default-character-set=utf8mb4 否则中文 Data too long 本地 xxcool/xxCool@2026 登录成功subject=3同时服务器废弃 webhook 方案已删除deploy-webhook.service/webhook.py/secrets.env/deploy.sh自动部署改走 Gitea act_runner + .gitea/workflows仓库内尚未配置待补
2026-08-26 | CHG | 看房 house 模块后端落地010_house_tables.sql 9 community/building/listing/price_snapshot/transaction/facility/community_facility/school_district/preference+ 011_house_menu.sql 菜单/权限种子超管 role_id=1 绑定gf gen dao 生成 dao/entity/do实现 api/house/{community,listing,dashboard} + controller/house + service/house管理 CRUD + 看板聚合 POST 动作式前缀 /api/service/admin/house含多平台软关联 match_group_id笋盘/低可信标记cmd.go 注册 housectl + 3 RegisterServicego build 通过gf CLI com.lib.gf.v2 分支gen dao 产物 import sed github.com/gogf/gf/v218 文件mysql 客户端须 --default-character-set=utf8mb4 否则中文 COMMENT/INSERT 乱码TINYINT 字段 comment 0/1 gf 映射 boolstatus 三值改 INThack/config.yaml link+tables 已指向本地库 2026-08-26 | CHG | 看房 house 模块后端落地010_house_tables.sql 9 community/building/listing/price_snapshot/transaction/facility/community_facility/school_district/preference+ 011_house_menu.sql 菜单/权限种子超管 role_id=1 绑定gf gen dao 生成 dao/entity/do实现 api/house/{community,listing,dashboard} + controller/house + service/house管理 CRUD + 看板聚合 POST 动作式前缀 /api/service/admin/house含多平台软关联 match_group_id笋盘/低可信标记cmd.go 注册 housectl + 3 RegisterServicego build 通过gf CLI com.lib.gf.v2 分支gen dao 产物 import sed github.com/gogf/gf/v218 文件mysql 客户端须 --default-character-set=utf8mb4 否则中文 COMMENT/INSERT 乱码TINYINT 字段 comment 0/1 gf 映射 boolstatus 三值改 INThack/config.yaml link+tables 已指向本地库

View File

@ -0,0 +1,33 @@
// Package house_transaction 定义成交记录查询接口,路由前缀 /house。
package house_transaction
import "github.com/gogf/gf/v2/frame/g"
// TransactionItem 一条成交记录。
type TransactionItem struct {
Id uint64 `json:"id"`
CommunityId uint64 `json:"communityId"`
CommunityName string `json:"communityName"`
Layout string `json:"layout"`
Area float64 `json:"area"`
DealPrice float64 `json:"dealPrice"`
DealUnitPrice float64 `json:"dealUnitPrice"`
ListDays int `json:"listDays"`
DealDate string `json:"dealDate"`
Source string `json:"source"`
}
// TransactionListReq 分页查询成交记录。
type TransactionListReq struct {
g.Meta `path:"/house/transaction/list" method:"post" tags:"Admin/House/Transaction" summary:"成交记录列表"`
Page int `json:"page" d:"1" v:"min:1"`
Size int `json:"size" d:"10" v:"min:1|max:100"`
Region string `json:"region"`
Keyword string `json:"keyword"` // 匹配小区名/户型
}
// TransactionListRes 是 TransactionListReq 的响应。
type TransactionListRes struct {
List []*TransactionItem `json:"list"`
Total int `json:"total"`
}

View File

@ -27,6 +27,7 @@ import (
housecommunity "service.xpcool.com/internal/service/house/community" housecommunity "service.xpcool.com/internal/service/house/community"
housedashboard "service.xpcool.com/internal/service/house/dashboard" housedashboard "service.xpcool.com/internal/service/house/dashboard"
houselisting "service.xpcool.com/internal/service/house/listing" houselisting "service.xpcool.com/internal/service/house/listing"
housetransaction "service.xpcool.com/internal/service/house/transaction"
) )
// injectEnv 手动把关键环境变量写入配置系统。 // injectEnv 手动把关键环境变量写入配置系统。
@ -66,6 +67,7 @@ var (
housecommunity.RegisterCommunity(housecommunity.NewCommunity()) housecommunity.RegisterCommunity(housecommunity.NewCommunity())
houselisting.RegisterListing(houselisting.NewListing()) houselisting.RegisterListing(houselisting.NewListing())
housedashboard.RegisterDashboard(housedashboard.NewDashboard()) housedashboard.RegisterDashboard(housedashboard.NewDashboard())
housetransaction.RegisterTransaction(housetransaction.NewTransaction())
s.Group("/api/service/open", func(group *ghttp.RouterGroup) { s.Group("/api/service/open", func(group *ghttp.RouterGroup) {
group.Middleware(middleware.Recover, middleware.CORS, ghttp.MiddlewareHandlerResponse) group.Middleware(middleware.Recover, middleware.CORS, ghttp.MiddlewareHandlerResponse)
group.Bind(openctl.New()) // Open tools API for frontends, no auth required. group.Bind(openctl.New()) // Open tools API for frontends, no auth required.

View File

@ -73,6 +73,12 @@ type HouseListingVO struct {
CommunityName string `json:"communityName" orm:"community_name"` CommunityName string `json:"communityName" orm:"community_name"`
} }
// HouseTransactionVO 成交记录查询结果(内嵌实体 + 关联小区名)。
type HouseTransactionVO struct {
entity.HouseTransaction
CommunityName string `json:"communityName" orm:"community_name"`
}
// DashboardOverview 看板统计概览。 // DashboardOverview 看板统计概览。
type DashboardOverview struct { type DashboardOverview struct {
CommunityCount int CommunityCount int