fix(identity): remove address from updateProfile and fix deviceInfo type
- Remove dto.address parameter from updateProfile controller - Remove address property from updateProfile service - Fix deviceInfo JSON serialization for Prisma InputJsonValue type 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
79345a20cf
commit
29f2dc0524
|
|
@ -37,7 +37,9 @@
|
||||||
"Bash(git -C \"c:\\Users\\dong\\Desktop\\rwadurian\" status)",
|
"Bash(git -C \"c:\\Users\\dong\\Desktop\\rwadurian\" status)",
|
||||||
"Bash(git -C \"c:\\Users\\dong\\Desktop\\rwadurian\" add -A)",
|
"Bash(git -C \"c:\\Users\\dong\\Desktop\\rwadurian\" add -A)",
|
||||||
"Bash(git -C \"c:\\Users\\dong\\Desktop\\rwadurian\" commit -m \"$(cat <<''EOF''\nrefactor(identity): remove province/city/address fields\n\n- Remove provinceCode, cityCode, address from UserAccount aggregate\n- Remove ProvinceCode, CityCode value objects\n- Remove UserLocationUpdatedEvent domain event\n- Update Prisma schema to drop province/city/address columns\n- Update repository, mapper, handlers, services and DTOs\n- Clean up tests and factory files\n\nProvince/city should belong to adoption-service as transaction data,\nnot identity-service user data.\n\n🤖 Generated with [Claude Code](https://claude.com/claude-code)\n\nCo-Authored-By: Claude <noreply@anthropic.com>\nEOF\n)\")",
|
"Bash(git -C \"c:\\Users\\dong\\Desktop\\rwadurian\" commit -m \"$(cat <<''EOF''\nrefactor(identity): remove province/city/address fields\n\n- Remove provinceCode, cityCode, address from UserAccount aggregate\n- Remove ProvinceCode, CityCode value objects\n- Remove UserLocationUpdatedEvent domain event\n- Update Prisma schema to drop province/city/address columns\n- Update repository, mapper, handlers, services and DTOs\n- Clean up tests and factory files\n\nProvince/city should belong to adoption-service as transaction data,\nnot identity-service user data.\n\n🤖 Generated with [Claude Code](https://claude.com/claude-code)\n\nCo-Authored-By: Claude <noreply@anthropic.com>\nEOF\n)\")",
|
||||||
"Bash(git -C \"c:\\Users\\dong\\Desktop\\rwadurian\" push)"
|
"Bash(git -C \"c:\\Users\\dong\\Desktop\\rwadurian\" push)",
|
||||||
|
"Bash(git -C \"c:\\Users\\dong\\Desktop\\rwadurian\" commit -m \"$(cat <<''EOF''\nfix(identity): update migration to TEXT avatar and remove province/city/address\n\n- Change avatar_url column from VARCHAR(500) to TEXT\n- Remove province_code, city_code, address columns from user_accounts\n- Remove idx_province_city index\n\n🤖 Generated with [Claude Code](https://claude.com/claude-code)\n\nCo-Authored-By: Claude <noreply@anthropic.com>\nEOF\n)\")",
|
||||||
|
"Bash(git -C \"c:\\Users\\dong\\Desktop\\rwadurian\" commit -m \"$(cat <<''EOF''\nfix(identity): remove address from updateProfile and fix deviceInfo type\n\n- Remove dto.address parameter from updateProfile controller\n- Remove address property from updateProfile service\n- Fix deviceInfo JSON serialization for Prisma InputJsonValue type\n\n🤖 Generated with [Claude Code](https://claude.com/claude-code)\n\nCo-Authored-By: Claude <noreply@anthropic.com>\nEOF\n)\")"
|
||||||
],
|
],
|
||||||
"deny": [],
|
"deny": [],
|
||||||
"ask": []
|
"ask": []
|
||||||
|
|
|
||||||
|
|
@ -124,7 +124,7 @@ export class UserAccountController {
|
||||||
@ApiOperation({ summary: '更新用户资料' })
|
@ApiOperation({ summary: '更新用户资料' })
|
||||||
async updateProfile(@CurrentUser() user: CurrentUserData, @Body() dto: UpdateProfileDto) {
|
async updateProfile(@CurrentUser() user: CurrentUserData, @Body() dto: UpdateProfileDto) {
|
||||||
await this.userService.updateProfile(
|
await this.userService.updateProfile(
|
||||||
new UpdateProfileCommand(user.userId, dto.nickname, dto.avatarUrl, dto.address),
|
new UpdateProfileCommand(user.userId, dto.nickname, dto.avatarUrl),
|
||||||
);
|
);
|
||||||
return { message: '更新成功' };
|
return { message: '更新成功' };
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -371,7 +371,6 @@ export class UserApplicationService {
|
||||||
account.updateProfile({
|
account.updateProfile({
|
||||||
nickname: command.nickname,
|
nickname: command.nickname,
|
||||||
avatarUrl: command.avatarUrl,
|
avatarUrl: command.avatarUrl,
|
||||||
address: command.address,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
await this.userRepository.save(account);
|
await this.userRepository.save(account);
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ export class UserAccountRepositoryImpl implements UserAccountRepository {
|
||||||
userId: savedUserId,
|
userId: savedUserId,
|
||||||
deviceId: d.deviceId,
|
deviceId: d.deviceId,
|
||||||
deviceName: d.deviceName,
|
deviceName: d.deviceName,
|
||||||
deviceInfo: d.deviceInfo || null, // 100% 保存完整 JSON
|
deviceInfo: d.deviceInfo ? JSON.parse(JSON.stringify(d.deviceInfo)) : null, // 100% 保存完整 JSON
|
||||||
platform: (info as any).platform || null,
|
platform: (info as any).platform || null,
|
||||||
deviceModel: (info as any).model || null,
|
deviceModel: (info as any).model || null,
|
||||||
osVersion: (info as any).osVersion || null,
|
osVersion: (info as any).osVersion || null,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue