diff --git a/src/SJZY.Track.Application/AutoMapper/TrackTemplateAutoMapperProfile.cs b/src/SJZY.Track.Application/AutoMapper/TrackTemplateAutoMapperProfile.cs index 79a142eb..94219051 100644 --- a/src/SJZY.Track.Application/AutoMapper/TrackTemplateAutoMapperProfile.cs +++ b/src/SJZY.Track.Application/AutoMapper/TrackTemplateAutoMapperProfile.cs @@ -1,4 +1,5 @@ using AutoMapper; +using AutoMapper.Internal.Mappers; using SJZY.Track.Application.Dtos.TrackTemplates; using SJZY.Track.Domain.Aggregates.TrackTemplateAggregate; using SJZY.Track.Domain.Dtos.TrackTemplate; @@ -17,5 +18,7 @@ public class TrackTemplateAutoMapperProfile : Profile //CreateMap, UnifyResultDto>(MemberList.None); CreateMap(MemberList.None); + + CreateMap(MemberList.None); } } \ No newline at end of file diff --git a/src/SJZY.Track.Application/Dtos/TrackTemplates/GetTrackDetailDto.cs b/src/SJZY.Track.Application/Dtos/TrackTemplates/GetTrackDetailDto.cs index b0c8dc6b..6269ba0b 100644 --- a/src/SJZY.Track.Application/Dtos/TrackTemplates/GetTrackDetailDto.cs +++ b/src/SJZY.Track.Application/Dtos/TrackTemplates/GetTrackDetailDto.cs @@ -85,7 +85,7 @@ /// /// 模板名称 /// - public int Name { set; get; } + public string Name { set; get; } /// /// 模板代码 diff --git a/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs b/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs index fb7bacb5..95504518 100644 --- a/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs +++ b/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs @@ -1,4 +1,5 @@ -using SJZY.Track.Application.Dtos.TrackContents; +using Microsoft.AspNetCore.Authorization; +using SJZY.Track.Application.Dtos.TrackContents; using SJZY.Track.Application.Dtos.TrackStatus; using SJZY.Track.Domain.Aggregates.TrackContentAggregate; using SJZY.Track.Domain.Dtos.TrackContents; @@ -33,6 +34,7 @@ namespace SJZY.Track.Application.Services.TrackContents /// /// [HttpPost("Edit")] + [AllowAnonymous] public async Task EditAsync(EditTrackContentInput input) { return input.Options switch diff --git a/src/SJZY.Track.Application/Validations/TrackTemplates/EditTrackTemplateInputValidation.cs b/src/SJZY.Track.Application/Validations/TrackTemplates/EditTrackTemplateInputValidation.cs index 412e5ef9..8768b688 100644 --- a/src/SJZY.Track.Application/Validations/TrackTemplates/EditTrackTemplateInputValidation.cs +++ b/src/SJZY.Track.Application/Validations/TrackTemplates/EditTrackTemplateInputValidation.cs @@ -19,10 +19,12 @@ namespace SJZY.Track.Application.Validations.TrackTemplates When(x => x.Options == OptionType.新增, () => { RuleFor(x => x.Id).Equal(0).WithMessage("新增时Id必须等于0!"); + }); When(x => x.Options == OptionType.修改 || x.Options == OptionType.新增, () => { + RuleFor(x => x.SubSystemId).GreaterThan(0).WithMessage("子系统的id必须大于0!"); RuleFor(x => x.Name).NotNull().WithMessage("模版名称必填!").NotEmpty().WithMessage("模版名称不能为空!"); RuleFor(x => x.Code).NotNull().WithMessage("模版代码必填!").NotEmpty().WithMessage("模版代码不能为空!"); });