feat: 新增铺码回调接口与相关配置,优化模板校验逻辑

1. 调整OSS访问域名从HTTPS改为HTTP
2. 新增宠物默认模板枚举并限制删除默认模板
3. 添加书页铺码回调接口与WebAPI端点
4. 配置Redis、HttpClient与OSS SDK服务
5. 新增打印配置项与回调地址
6. 优化PetService代码格式与宠物模板启停逻辑
7. 完善UpdatePageNoAsync的校验与处理逻辑
This commit is contained in:
glz
2026-06-25 18:01:37 +08:00
parent 8b773cbfe1
commit c5db5d773b
8 changed files with 145 additions and 9 deletions

View File

@ -252,7 +252,7 @@ public class PetService(
logger.LogWarning("喂养失败宠物未激活PetId: {PetId}, Status: {Status}", input.PetId, pet.Status);
throw new BusinessException("宠物未激活,无法喂养", 400);
}
FeedPetOutput result = new FeedPetOutput ();
FeedPetOutput result = new FeedPetOutput();
// 事务保证一致性
await UseTranAsync(async () =>
{
@ -590,6 +590,11 @@ public class PetService(
if (template == null || template.IsDeleted)
throw new BusinessException("宠物模板不存在", 404);
if (template.Type == PetTemplateTypeEnum.Default)
throw new BusinessException("默认模板不允许删除", 400);
// 校验是否有用户宠物实例关联
var hasUserPet = petRepository.Context.Queryable<UserPet>()
.Any(p => p.TemplateId == id && !p.IsDeleted);
@ -659,9 +664,9 @@ public class PetService(
var template = await petTemplateRepository.GetByIdAsync(id);
if (template == null || template.IsDeleted)
throw new BusinessException("宠物模板不存在", 404);
template.Status = template.Status == (int)DefaultStatusEnum.Active
? (int)DefaultStatusEnum.Inactive
template.Status = template.Status == (int)DefaultStatusEnum.Active
? (int)DefaultStatusEnum.Inactive
: (int)DefaultStatusEnum.Active;
template.UpdatedBy = "System";
template.UpdatedAt = DateTime.Now;