feat: add personal space visits and editor

This commit is contained in:
ANG-Server
2026-07-22 13:41:28 +08:00
parent a3341b6a3b
commit b6b32f6676
14 changed files with 288 additions and 135 deletions

View File

@@ -19,6 +19,7 @@ CREATE TABLE IF NOT EXISTS `room_decor_placements` (
`position_x` FLOAT NULL COMMENT '房间内X坐标',
`position_y` FLOAT NULL COMMENT '房间内Y坐标',
`scale` FLOAT NOT NULL DEFAULT 1 COMMENT '摆件缩放',
`rotation_degrees` FLOAT NOT NULL DEFAULT 0 COMMENT '摆件旋转角度',
`z_index` INT NOT NULL DEFAULT 0 COMMENT '摆放层级',
`created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',

View File

@@ -0,0 +1,2 @@
ALTER TABLE `room_decor_placements`
ADD COLUMN IF NOT EXISTS `rotation_degrees` FLOAT NOT NULL DEFAULT 0 COMMENT '摆件旋转角度' AFTER `scale`;

View File

@@ -25,6 +25,9 @@ export class RoomDecorPlacements {
@Column({ type: 'float', nullable: false, default: 1, comment: '摆件缩放' })
scale: number;
@Column({ type: 'float', nullable: false, default: 0, comment: '摆件旋转角度' })
rotation_degrees: number;
@Column({ type: 'int', nullable: false, default: 0, comment: '摆放层级' })
z_index: number;

View File

@@ -33,6 +33,7 @@ export class RoomDecorPlacementsService {
row.position_x = placement.placed ? Number(placement.position_x ?? row.position_x ?? 0) : null;
row.position_y = placement.placed ? Number(placement.position_y ?? row.position_y ?? 0) : null;
row.scale = Number(placement.scale ?? row.scale ?? 1);
row.rotation_degrees = Number(placement.rotation_degrees ?? row.rotation_degrees ?? 0);
row.z_index = Number(placement.z_index ?? row.z_index ?? 0);
row.updated_at = new Date();
return await this.placementsRepository.save(row);

View File

@@ -34,6 +34,7 @@ export class RoomDecorPlacementsMemoryService {
row.position_x = placement.placed ? Number(placement.position_x ?? row.position_x ?? 0) : null;
row.position_y = placement.placed ? Number(placement.position_y ?? row.position_y ?? 0) : null;
row.scale = Number(placement.scale ?? row.scale ?? 1);
row.rotation_degrees = Number(placement.rotation_degrees ?? row.rotation_degrees ?? 0);
row.z_index = Number(placement.z_index ?? row.z_index ?? 0);
row.updated_at = new Date();
return row;