CHG: house 成交记录(transaction)模块:api/service/controller 全链路 + cmd 注册 + dto 扩展
Some checks failed
Build and Deploy (service.xpcool.com) / build-and-deploy (push) Failing after 25s
Some checks failed
Build and Deploy (service.xpcool.com) / build-and-deploy (push) Failing after 25s
This commit is contained in:
parent
b439c4d89c
commit
69137f366c
@ -1,6 +1,7 @@
|
||||
# service.xpcool.com 变更记录
|
||||
> 倒序:最新在上。格式: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 加 HouseTransactionVO,cmd.go 注册;012_house_transaction_menu.sql 权限种子(house:data:transaction id=941 挂数据明细 94);go build 通过
|
||||
2026-08-26 | CFG | 新增 Gitea act_runner 自动部署:.gitea/workflows/deploy.yml(push 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:10100(xpcool-net,GF_GCFG_ENV=prod,DB_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 | 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 个 RegisterService;go build 通过。坑①gf CLI 为 com.lib.gf.v2 分支,gen dao 产物 import 需 sed 回 github.com/gogf/gf/v2(18 文件);②mysql 客户端须 --default-character-set=utf8mb4 否则中文 COMMENT/INSERT 乱码;③TINYINT 字段 comment 含 0/1 被 gf 映射 bool(status 三值改 INT);hack/config.yaml 的 link+tables 已指向本地库
|
||||
|
||||
33
api/house/transaction/transaction.go
Normal file
33
api/house/transaction/transaction.go
Normal 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"`
|
||||
}
|
||||
@ -27,6 +27,7 @@ import (
|
||||
housecommunity "service.xpcool.com/internal/service/house/community"
|
||||
housedashboard "service.xpcool.com/internal/service/house/dashboard"
|
||||
houselisting "service.xpcool.com/internal/service/house/listing"
|
||||
housetransaction "service.xpcool.com/internal/service/house/transaction"
|
||||
)
|
||||
|
||||
// injectEnv 手动把关键环境变量写入配置系统。
|
||||
@ -66,6 +67,7 @@ var (
|
||||
housecommunity.RegisterCommunity(housecommunity.NewCommunity())
|
||||
houselisting.RegisterListing(houselisting.NewListing())
|
||||
housedashboard.RegisterDashboard(housedashboard.NewDashboard())
|
||||
housetransaction.RegisterTransaction(housetransaction.NewTransaction())
|
||||
s.Group("/api/service/open", func(group *ghttp.RouterGroup) {
|
||||
group.Middleware(middleware.Recover, middleware.CORS, ghttp.MiddlewareHandlerResponse)
|
||||
group.Bind(openctl.New()) // Open tools API for frontends, no auth required.
|
||||
|
||||
@ -73,6 +73,12 @@ type HouseListingVO struct {
|
||||
CommunityName string `json:"communityName" orm:"community_name"`
|
||||
}
|
||||
|
||||
// HouseTransactionVO 成交记录查询结果(内嵌实体 + 关联小区名)。
|
||||
type HouseTransactionVO struct {
|
||||
entity.HouseTransaction
|
||||
CommunityName string `json:"communityName" orm:"community_name"`
|
||||
}
|
||||
|
||||
// DashboardOverview 看板统计概览。
|
||||
type DashboardOverview struct {
|
||||
CommunityCount int
|
||||
|
||||
Loading…
Reference in New Issue
Block a user