1. 将原Pet实体重命名为UserPet,新增PetTemplate模板实体拆分宠物模板与实例数据 2. 调整IPetService泛型参数为IBaseService<UserPet> 3. 补充宠物模板相关字段与查询逻辑,完善创建默认宠物的流程 4. 替换所有Pet实体引用为UserPet,修正相关服务层查询与更新逻辑
48 lines
1.6 KiB
C#
48 lines
1.6 KiB
C#
using QYZH.InteractiveMagazine.Models.Common;
|
||
using QYZH.InteractiveMagazine.Models.Dto;
|
||
using QYZH.InteractiveMagazine.Models.Dto.Pet;
|
||
using QYZH.InteractiveMagazine.Models.Entity;
|
||
|
||
namespace QYZH.InteractiveMagazine.IService;
|
||
|
||
/// <summary>
|
||
/// 宠物服务接口
|
||
/// </summary>
|
||
public interface IPetService : IBaseService<UserPet>
|
||
{
|
||
/// <summary>
|
||
/// 获取用户宠物信息
|
||
/// </summary>
|
||
/// <param name="userId">用户Id</param>
|
||
/// <returns>宠物信息</returns>
|
||
Task<PetOutput?> GetPetByUserIdAsync(long userId);
|
||
|
||
/// <summary>
|
||
/// 为用户创建默认宠物(最低形态、成长值为0、未激活状态)
|
||
/// </summary>
|
||
/// <param name="userId">用户Id</param>
|
||
Task CreateDefaultPetAsync(long userId);
|
||
|
||
/// <summary>
|
||
/// 激活宠物(将状态从 Inactive 改为 Active)
|
||
/// </summary>
|
||
/// <param name="userId">用户Id</param>
|
||
Task ActivatePetAsync(long userId);
|
||
|
||
/// <summary>
|
||
/// 喂养宠物(增加成长值 + 记录喂养记录 + 触发进化检查)
|
||
/// </summary>
|
||
/// <param name="userId">用户Id</param>
|
||
/// <param name="input">喂养输入</param>
|
||
/// <returns>喂养结果</returns>
|
||
Task<FeedPetOutput> FeedPetAsync(long userId, FeedPetInput input);
|
||
|
||
/// <summary>
|
||
/// 获取宠物喂养记录列表
|
||
/// </summary>
|
||
/// <param name="userId">用户Id</param>
|
||
/// <param name="petId">宠物Id</param>
|
||
/// <returns>喂养记录列表</returns>
|
||
Task<PageListModel<FeedingRecordOutput>> GetFeedingRecordsAsync(long userId, long petId, PageQueryModel pageQuery);
|
||
}
|