2026-05-09 18:25:04 +08:00
|
|
|
import { Injectable } from '@nestjs/common';
|
|
|
|
|
import { UsersRepository } from './users.repository';
|
|
|
|
|
|
|
|
|
|
@Injectable()
|
|
|
|
|
export class UsersService {
|
|
|
|
|
constructor(private readonly usersRepository: UsersRepository) {}
|
|
|
|
|
|
|
|
|
|
async getProfile(userId: string) {
|
|
|
|
|
return this.usersRepository.findProfileByUserId(userId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async updateProfile(userId: string, dto: any) {
|
|
|
|
|
return this.usersRepository.updateProfile(userId, dto);
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-17 19:08:07 +08:00
|
|
|
async getProfileDetail(userId: string) {
|
|
|
|
|
return this.usersRepository.findUserProfile(userId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async updateProfileDetail(userId: string, dto: any) {
|
|
|
|
|
return this.usersRepository.upsertUserProfile(userId, dto);
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-09 18:25:04 +08:00
|
|
|
async updatePreferences(userId: string, dto: any) {
|
|
|
|
|
return this.usersRepository.updatePreferences(userId, dto);
|
|
|
|
|
}
|
|
|
|
|
}
|