|
@@ -8,4 +8,11 @@ type modelType = ReturnModelType<typeof User>;
|
|
|
export class UserService extends BaseService<modelType> {
|
|
|
@InjectEntityModel(User)
|
|
|
model: modelType;
|
|
|
+
|
|
|
+ async detail(id) {
|
|
|
+ const arr = await this.model.findById(id).lean();
|
|
|
+ let role_type;
|
|
|
+ if (arr && arr.role && arr.role.length > 1) role_type = arr.role[1];
|
|
|
+ return { ...arr, role_type };
|
|
|
+ }
|
|
|
}
|