forked from xiangwang25/whale-town-end-v2
feat: add nearby social services
This commit is contained in:
@@ -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: '社区名片已更新' });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user