Some checks failed
Build and Deploy (service.xpcool.com) / build-and-deploy (push) Failing after 5m7s
- 新增 9 张房屋相关数据表(社区/楼宇/房源/价格快照/交易/设施/社区设施/学区/偏好) - 添加菜单权限种子数据并绑定超级管理员角色 - 生成 DAO 层代码和实体对象 - 实现房屋模块 API 接口(社区/房源/看板)和控制器服务层 - 支持多平台软关联匹配、笋盘标记和低可信度标记功能 - 更新超级管理员账号为 xxcool/xxCool@2026 - 调整 RBAC 菜单结构,移除管理员管理功能,新增日志管理菜单 - 修复 RBAC 安全漏洞,确保禁用角色权限失效 - 重构认证模块,将登录相关接口迁移到统一包结构下 - 移除废弃的管理模块和工具类接口定义 - 为通用工具包添加中文注释和文档说明
86 lines
2.9 KiB
Go
86 lines
2.9 KiB
Go
// Package house_dashboard 定义看房数据看板聚合接口,路由前缀 /house。
|
|
package house_dashboard
|
|
|
|
import "github.com/gogf/gf/v2/frame/g"
|
|
|
|
// OverviewRes 看板统计概览。
|
|
type OverviewRes struct {
|
|
CommunityCount int `json:"communityCount"` // 小区数
|
|
ListingCount int `json:"listingCount"` // 在售房源数
|
|
BargainCount int `json:"bargainCount"` // 笋盘数
|
|
LowConfidence int `json:"lowConfidence"` // 低可信房源数
|
|
AvgUnitPrice float64 `json:"avgUnitPrice"` // 在售均价(元/平米)
|
|
AvgTotalPrice float64 `json:"avgTotalPrice"` // 在售平均总价(万元)
|
|
AvgListDays float64 `json:"avgListDays"` // 平均挂牌天数
|
|
}
|
|
|
|
// OverviewReq 看板统计概览请求。
|
|
type OverviewReq struct {
|
|
g.Meta `path:"/house/dashboard/overview" method:"post" tags:"Admin/House/Dashboard" summary:"看板概览"`
|
|
Region string `json:"region"`
|
|
}
|
|
|
|
// MapPoint 地图上的一个小区点。
|
|
type MapPoint struct {
|
|
CommunityId uint64 `json:"communityId"`
|
|
Name string `json:"name"`
|
|
Region string `json:"region"`
|
|
Lng float64 `json:"lng"`
|
|
Lat float64 `json:"lat"`
|
|
AvgUnitPrice float64 `json:"avgUnitPrice"`
|
|
ListingCount int `json:"listingCount"`
|
|
BargainCount int `json:"bargainCount"`
|
|
}
|
|
|
|
// MapPointsReq 地图点位查询(带筛选)。
|
|
type MapPointsReq struct {
|
|
g.Meta `path:"/house/dashboard/map-points" method:"post" tags:"Admin/House/Dashboard" summary:"地图点位"`
|
|
Region string `json:"region"`
|
|
PriceMin float64 `json:"priceMin"`
|
|
PriceMax float64 `json:"priceMax"`
|
|
Status int `json:"status"`
|
|
}
|
|
|
|
// MapPointsRes 是 MapPointsReq 的响应。
|
|
type MapPointsRes struct {
|
|
Points []*MapPoint `json:"points"`
|
|
}
|
|
|
|
// TrendPoint 一个日期的均价点。
|
|
type TrendPoint struct {
|
|
Date string `json:"date"`
|
|
AvgListPrice float64 `json:"avgListPrice"` // 挂牌均价(万元)
|
|
AvgDealPrice float64 `json:"avgDealPrice"` // 成交均价(万元)
|
|
}
|
|
|
|
// PriceTrendReq 价格趋势查询。
|
|
type PriceTrendReq struct {
|
|
g.Meta `path:"/house/dashboard/price-trend" method:"post" tags:"Admin/House/Dashboard" summary:"价格趋势"`
|
|
CommunityId uint64 `json:"communityId"`
|
|
Region string `json:"region"`
|
|
Limit int `json:"limit" d:"30"` // 最近 N 天
|
|
}
|
|
|
|
// PriceTrendRes 是 PriceTrendReq 的响应。
|
|
type PriceTrendRes struct {
|
|
Trend []*TrendPoint `json:"trend"`
|
|
}
|
|
|
|
// RegionAgg 一个区域的聚合指标。
|
|
type RegionAgg struct {
|
|
Region string `json:"region"`
|
|
AvgUnitPrice float64 `json:"avgUnitPrice"`
|
|
ListingCount int `json:"listingCount"`
|
|
BargainCount int `json:"bargainCount"`
|
|
}
|
|
|
|
// AggregateRegionReq 区域聚合查询。
|
|
type AggregateRegionReq struct {
|
|
g.Meta `path:"/house/dashboard/aggregate-region" method:"post" tags:"Admin/House/Dashboard" summary:"区域聚合"`
|
|
}
|
|
|
|
// AggregateRegionRes 是 AggregateRegionReq 的响应。
|
|
type AggregateRegionRes struct {
|
|
List []*RegionAgg `json:"list"`
|
|
}
|