feat: add nearby social services

This commit is contained in:
ANG-Server
2026-07-21 22:19:58 +08:00
parent 77302354ac
commit b5365751bb
17 changed files with 1266 additions and 121 deletions

View File

@@ -9,6 +9,8 @@ import { EconomyService } from './economy.service';
import { UpdatePlayerAppearanceDto } from './dto/update_player_appearance.dto';
import { UpdatePlayerProfileAssetsDto } from './dto/update_player_profile_assets.dto';
import { UpdatePlayerSettingsDto } from './dto/update_player_settings.dto';
import { SocialService } from '../social/social.service';
import { UpdateSocialProfileDto } from '../social/dto/social.dto';
@ApiTags('player')
@ApiBearerAuth()
@@ -18,6 +20,7 @@ export class PlayerController {
constructor(
private readonly playerStateService: PlayerStateService,
private readonly economyService: EconomyService,
private readonly socialService: SocialService,
) {}
@ApiOperation({ summary: '获取当前玩家快照' })
@@ -77,4 +80,16 @@ export class PlayerController {
const data = await this.playerStateService.updateProfileAssets(BigInt(user.sub), dto);
res.status(HttpStatus.OK).json({ success: true, data, message: '玩家资源更新成功' });
}
@ApiOperation({ summary: '更新当前玩家社区名片' })
@Patch('social-profile')
@UsePipes(new ValidationPipe({ transform: true, whitelist: true }))
async updateSocialProfile(
@CurrentUser() user: JwtPayload,
@Body() dto: UpdateSocialProfileDto,
@Res() res: Response,
): Promise<void> {
const data = await this.socialService.updateSocialProfile(BigInt(user.sub), dto);
res.status(HttpStatus.OK).json({ success: true, data, message: '社区名片已更新' });
}
}