refactor(pet): 重构宠物模块实体与接口

1. 将原Pet实体重命名为UserPet,新增PetTemplate模板实体拆分宠物模板与实例数据
2. 调整IPetService泛型参数为IBaseService<UserPet>
3. 补充宠物模板相关字段与查询逻辑,完善创建默认宠物的流程
4. 替换所有Pet实体引用为UserPet,修正相关服务层查询与更新逻辑
This commit is contained in:
glz
2026-06-05 18:10:34 +08:00
parent 73e4f8e001
commit 866549873a
9 changed files with 136 additions and 20 deletions

View File

@ -60,7 +60,7 @@ public class CheckInService(
}
// 5. 查询用户宠物(如果有)
var pet = await checkInRecordRepository.Context.Queryable<Pet>()
var pet = await checkInRecordRepository.Context.Queryable<UserPet>()
.Where(p => p.UserId == userId && !p.IsDeleted)
.FirstAsync();
@ -258,7 +258,7 @@ public class CheckInService(
throw new BusinessException("用户不存在", 404);
// 查询宠物
var pet = await checkInRecordRepository.Context.Queryable<Pet>()
var pet = await checkInRecordRepository.Context.Queryable<UserPet>()
.Where(p => p.UserId == userId && !p.IsDeleted)
.FirstAsync();