feat: 30个景点替换为真实照片,添加图片批处理脚本
AI Code Review / review (pull_request) Successful in 2m58s

This commit is contained in:
2026-07-31 18:11:38 +08:00
parent 09f8ec7ecf
commit d01525fd51
36 changed files with 511 additions and 15 deletions
+20 -11
View File
@@ -1,7 +1,9 @@
import type { Poi, PoiDataset, PoiImageAsset } from '@/domain/poi'
import { coverPhotoUrlFor, hasCoverPhoto } from './photos'
const SNAPSHOT_CAPTURED_AT = '2026-07-30T01:00:33Z'
const POC_REVIEWED_AT = '2026-07-30T01:30:00Z'
const PHOTOS_REVIEWED_AT = '2026-07-31T00:00:00Z'
const PLACEHOLDER_URL = '/static/poi/placeholder.png'
const AMAP_DATA_SOURCE = '高德地图 Web Service POI 2.0 离线候选快照(2026-07-30),POC 内容映射待项目方复核'
@@ -416,19 +418,26 @@ const poiSeeds: PocPoiSeed[] = [
},
]
function createPlaceholderImage(seed: PocPoiSeed): PoiImageAsset {
function createCoverImage(seed: PocPoiSeed): PoiImageAsset {
const photoReady = hasCoverPhoto(seed.id)
return {
id: `img_${seed.id}_cover`,
url: PLACEHOLDER_URL,
source: 'map-gm-app POC 包内占位素材',
sourceReference: 'asset_src_static_poi_placeholder',
url: photoReady ? coverPhotoUrlFor(seed.id) : PLACEHOLDER_URL,
source: photoReady
? '项目方提供实景照片(本地静态资源)'
: 'map-gm-app POC 包内占位素材',
sourceReference: photoReady
? `asset_src_static_poi_photos_${seed.id}_jpg`
: 'asset_src_static_poi_placeholder',
copyrightStatus: 'cleared',
licenseEvidence: 'POC_INTERNAL_ASSET_001',
reviewedBy: 'poc_content_owner',
reviewedAt: POC_REVIEWED_AT,
updatedAt: POC_REVIEWED_AT,
isPlaceholder: true,
alt: `${seed.name} POC 占位图`,
licenseEvidence: photoReady
? 'PROJECT_PROVIDED_COVER_PHOTO_2026Q3'
: 'POC_INTERNAL_ASSET_001',
reviewedBy: photoReady ? 'project_content_owner' : 'poc_content_owner',
reviewedAt: photoReady ? PHOTOS_REVIEWED_AT : POC_REVIEWED_AT,
updatedAt: photoReady ? PHOTOS_REVIEWED_AT : POC_REVIEWED_AT,
isPlaceholder: !photoReady,
alt: photoReady ? `${seed.name}实景照片` : `${seed.name} POC 占位图`,
}
}
@@ -544,6 +553,6 @@ export const poiDataset: PoiDataset = {
{ code: 'science_learning', name: '科普体验', sortOrder: 90, status: 'enabled', synonyms: ['科普'] },
{ code: 'walking', name: '漫步休闲', sortOrder: 100, status: 'enabled', synonyms: ['徒步', '散步'] },
],
images: poiSeeds.map(createPlaceholderImage),
images: poiSeeds.map(createCoverImage),
pois: poiSeeds.map(createPoi),
}
+60
View File
@@ -0,0 +1,60 @@
/**
* POI 封面照片注册表
*
* 如何添加一张真实照片:
* 1. 压缩图片:800×600 px4:3 横版),JPEG 质量 75-82,文件 ≤ 120 KB
* 2. 命名为 <poiId>.jpg(例如 poi_gm_culture_center.jpg
* 3. 放入 src/static/poi/photos/ 目录
* 4. 将 poiId 加入下方 POI_COVER_PHOTOS_READY 集合
*
* 未在此集合中的 POI 会继续使用占位图 /static/poi/placeholder.png
*/
/** 已放入真实照片的 POI ID 集合 */
export const POI_COVER_PHOTOS_READY: ReadonlySet<string> = new Set<string>([
// 文化场馆
'poi_gm_culture_center', // 光明文化艺术中心
'poi_amap_b0hbtu4bfr', // 光明区图书馆
'poi_amap_b0ffk306gx', // 光明区文化馆
'poi_amap_b02f38meio', // 光明区少年儿童图书馆
'poi_amap_b0jun773j3', // 深圳国际美术馆
'poi_amap_b0jbbzx4oo', // 光明区城市规划展览馆
'poi_amap_b0k025w32e', // 茅洲河图书馆
// 公园湿地
'poi_hongqiao_park', // 虹桥公园
'poi_honghuashan_park', // 红花山公园
'poi_amap_b0j2jc4n0w', // 科学公园
'poi_amap_b0ffmdhve1', // 鹅颈水湿地公园
'poi_amap_b0fffwu1l5', // 明湖公园
'poi_amap_b0ffhfbsje', // 光明新城公园(牛山公园)
'poi_amap_b0ffjf1b20', // 光明开明公园
'poi_amap_b0g0kzrt5s', // 左岸科技公园
'poi_amap_b02f30abgs', // 西田公园
'poi_amap_b0jgbp18uf', // 大雁山森林公园
'poi_amap_b0grac6nzz', // 楼村湿地公园
'poi_amap_b02f309r88', // 大顶岭山林公园
// 田园休闲
'poi_farm_grand_view', // 光明农场大观园
'poi_happy_pastoral', // 华侨城光明欢乐田园
'poi_amap_b0ffkkmzsc', // 双晖稻田农场
// 人文地标
'poi_amap_b02f38nj9k', // 弘源寺
'poi_amap_b0ffgthbcf', // 陈仙姑祠
'poi_amap_b0fffttiov', // 黄氏大宗祠
'poi_amap_b0kb4cxaby', // 玉律醒狮文化馆
// 绿道户外
'poi_dadingling_greenway', // 大顶岭绿道
'poi_amap_b0ldbsbeea', // 光明湖碧道
'poi_amap_b0kup558j4', // 茅洲河碧道
'poi_amap_b0jb2aurvw', // 五指耙森林公园(光明片区)
])
const POI_PHOTOS_BASE_URL = '/static/poi/photos'
export function coverPhotoUrlFor(poiId: string): string {
return `${POI_PHOTOS_BASE_URL}/${poiId}.jpg`
}
export function hasCoverPhoto(poiId: string): boolean {
return POI_COVER_PHOTOS_READY.has(poiId)
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB