| 123456789101112131415161718192021222324252627282930313233 |
- using Common;
- using Dto.Admin;
- using Mapster;
- using Model;
- using Vo.Admin;
- namespace Util
- {
- public class ModelVoAdapt
- {
- public static void Map()
- {
- TypeAdapterConfig<AddProjectServiceDto, ProjectService>.NewConfig()
- .Map(dest => dest.serverList, src => src.serverList.Length == 0
- ? "" : string.Join(',', src.serverList))
- .Map(dest => dest.databaseList, src => src.databaseList.Length == 0
- ? "" : string.Join(',', src.databaseList));
- TypeAdapterConfig<ProjectService, GetProjectServiceQueryVo>.NewConfig()
- .Map(dest => dest.serverList, src => string.IsNullOrEmpty(src.serverList)
- ? Array.Empty<int>() : Tools.SpitIntArrary(src.serverList))
- .Map(dest => dest.databaseList, src => string.IsNullOrEmpty(src.databaseList)
- ? Array.Empty<int>() : Tools.SpitIntArrary(src.databaseList));
- TypeAdapterConfig<ProjectService, GetProjectServiceListVo>.NewConfig()
- .Map(dest => dest.serverList, src => string.IsNullOrEmpty(src.serverList)
- ? Array.Empty<int>() : Tools.SpitIntArrary(src.serverList))
- .Map(dest => dest.databaseList, src => string.IsNullOrEmpty(src.databaseList)
- ? Array.Empty<int>() : Tools.SpitIntArrary(src.databaseList));
- }
- }
- }
|