fix:填补缺失的object map
This commit is contained in:
parent
ec0acc2421
commit
fc73d4d85c
@ -1,5 +1,6 @@
|
||||
using AutoMapper;
|
||||
using InterfaceForward.Application.Contracts.Dtos.App;
|
||||
using InterfaceForward.Application.HostServices;
|
||||
using InterfaceForward.Repositories.App.Entitys;
|
||||
|
||||
namespace InterfaceForward.Application.AutoMapper;
|
||||
@ -11,5 +12,9 @@ internal class AppProfile : Profile
|
||||
CreateMap<CreateAppInput, AppEntity>(MemberList.None);
|
||||
CreateMap<UpdateAppInput, AppEntity>(MemberList.None);
|
||||
CreateMap<CreateAppScopeInput, AppScopeEntity>(MemberList.None);
|
||||
|
||||
CreateMap<UpsertAppSubscribeConfigInput, AppSubscribeConfigEntity>(MemberList.None);
|
||||
CreateMap<UpsertAppSubscribeConfigInput, AppSubscribeEvent>(MemberList.None);
|
||||
CreateMap<DeleteAppSubscribeConfigInput, AppSubscribeEvent>(MemberList.None);
|
||||
}
|
||||
}
|
||||
@ -15,6 +15,7 @@ public class ParameterProfile: Profile
|
||||
public ParameterProfile()
|
||||
{
|
||||
CreateMap<InterfaceParameterOutputValueObject, ParameterInput>(MemberList.None);
|
||||
CreateMap<InterfaceParameterOutputValueObject, InterfaceParameterOutput>(MemberList.None);
|
||||
CreateMap<ParameterEntity, MapParameterCascadedItem>(MemberList.None);
|
||||
CreateMap<ParameterInput, ParameterEntity>(MemberList.None)
|
||||
.ForMember(dest => dest.Id,
|
||||
|
||||
@ -9,6 +9,7 @@ using InterfaceForward.Repositories;
|
||||
using InterfaceForward.Repositories.Interface.Entitys;
|
||||
using InterfaceForward.Repositories.Interface.Services;
|
||||
using InterfaceForward.Repositories.Interface.ValueObjects;
|
||||
using InterfaceForward.Repositories.Parameter.VO;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace InterfaceForward.Application.Services.Interface;
|
||||
@ -95,9 +96,13 @@ public class SystemInterfaceService : ApplicationService
|
||||
// 构造参数
|
||||
var paras = await _interfaceRepository.GetParameterListByIdAsync(id);
|
||||
// 入参树形列表
|
||||
res.InParameterList = paras.Where(x => x.IsInPara).ToList();
|
||||
res.InParameterList =
|
||||
ObjectMapper.Map<List<InterfaceParameterOutputValueObject>, List<InterfaceParameterOutput>>(
|
||||
paras.Where(x => x.IsInPara).ToList());
|
||||
// 出参树形列表
|
||||
res.OutParameterList = paras.Where(x => !x.IsInPara).ToList();
|
||||
res.OutParameterList =
|
||||
ObjectMapper.Map<List<InterfaceParameterOutputValueObject>, List<InterfaceParameterOutput>>(
|
||||
paras.Where(x => !x.IsInPara).ToList());
|
||||
|
||||
return res;
|
||||
}
|
||||
@ -173,6 +178,7 @@ public class SystemInterfaceService : ApplicationService
|
||||
{
|
||||
await _interfaceMapRepository.SoftDeleteAsync(x => mapIds.Contains(x.Id));
|
||||
}
|
||||
|
||||
// 删缓存
|
||||
await RedisHelper.Client.DelAsync(SystemInterfaceDropdownCacheKey);
|
||||
|
||||
@ -205,8 +211,7 @@ public class SystemInterfaceService : ApplicationService
|
||||
throw new BusinessException(message: $"接口名:{input.Name} 已存在");
|
||||
}
|
||||
|
||||
if (await _interfaceRepository.IsAnyAsync(
|
||||
x => x.Id != input.Id && x.IsUpStream && x.Code.Equals(input.Code)))
|
||||
if (await _interfaceRepository.IsAnyAsync(x => x.Id != input.Id && x.IsUpStream && x.Code.Equals(input.Code)))
|
||||
{
|
||||
throw new BusinessException(message: "接口code已存在");
|
||||
}
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
using InterfaceForward.Repositories.Parameter.VO;
|
||||
using System.Text.Json.Serialization;
|
||||
using InterfaceForward.Repositories.Parameter.VO;
|
||||
|
||||
namespace InterfaceForward.Repositories.Interface.ValueObjects;
|
||||
|
||||
@ -65,10 +66,64 @@ public class SystemInterfaceOutput
|
||||
/// <summary>
|
||||
/// 入参列表
|
||||
/// </summary>
|
||||
public List<InterfaceParameterOutputValueObject> InParameterList { get; set; }
|
||||
public List<InterfaceParameterOutput> InParameterList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 出参列表
|
||||
/// </summary>
|
||||
public List<InterfaceParameterOutputValueObject> OutParameterList { get; set; }
|
||||
public List<InterfaceParameterOutput> OutParameterList { get; set; }
|
||||
}
|
||||
|
||||
public class InterfaceParameterOutput
|
||||
{
|
||||
/// <summary>
|
||||
/// Id
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 父级Id
|
||||
/// </summary>
|
||||
public int PId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 别名
|
||||
/// </summary>
|
||||
public string Alias { get; set; }
|
||||
|
||||
///<summary>
|
||||
/// 参数名
|
||||
///</summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
///<summary>
|
||||
/// 参数名(中文)
|
||||
///</summary>
|
||||
public string CnName { get; set; }
|
||||
|
||||
///<summary>
|
||||
/// 参数类型
|
||||
///</summary>
|
||||
public int Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否必填
|
||||
/// </summary>
|
||||
public bool IsRequired { get; set; }
|
||||
|
||||
///<summary>
|
||||
/// 参数描述
|
||||
///</summary>
|
||||
public string Description { get; set; }
|
||||
|
||||
///<summary>
|
||||
/// 0:返回参数;1:请求参数
|
||||
///</summary>
|
||||
public bool IsInPara { get; set; }
|
||||
|
||||
///<summary>
|
||||
/// 序列
|
||||
///</summary>
|
||||
[JsonIgnore]
|
||||
public string Sort { get; set; }
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user