From 0dbc8273bdfbcabcc4b770546245f6b17d787de9 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期五, 13 三月 2026 14:44:50 +0800
Subject: [PATCH] fix: 修复API控制器依赖注入和路由配置
---
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Filter/CustomProfile.cs | 22 ++++++++++------------
1 files changed, 10 insertions(+), 12 deletions(-)
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Filter/CustomProfile.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Filter/CustomProfile.cs
index 2f33853..dc716d8 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Filter/CustomProfile.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Filter/CustomProfile.cs
@@ -1,9 +1,4 @@
-锘縰sing AutoMapper;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+锘縰sing Mapster;
using WIDESEA_DTO.System;
using WIDESEAWCS_DTO.TaskInfo;
using WIDESEAWCS_Model.Models;
@@ -13,17 +8,20 @@
namespace WIDESEAWCS_WCSServer.Filter
{
- public class CustomProfile : Profile
+ public static class CustomProfile
{
/// <summary>
/// 閰嶇疆鏋勯�犲嚱鏁帮紝鐢ㄦ潵鍒涘缓鍏崇郴鏄犲皠
/// </summary>
- public CustomProfile()
+ public static void Register(TypeAdapterConfig config)
{
- CreateMap<Sys_Menu, MenuDTO>();
- CreateMap<Dt_DeviceInfo,DeviceInfoDTO>();
- CreateMap<WMSTaskDTO, Dt_Task>();
- CreateMap<Dt_Task, ConveyorLineTaskCommand>().ForMember(a => a.TargetAddress, b => b.MapFrom(b => b.NextAddress)).ForMember(a => a.Barcode, b => b.MapFrom(b => b.PalletCode)).ForMember(a => a.TaskNum, b => b.MapFrom(b => b.TaskNum));
+ config.NewConfig<Sys_Menu, MenuDTO>();
+ config.NewConfig<Dt_DeviceInfo, DeviceInfoDTO>();
+ config.NewConfig<WMSTaskDTO, Dt_Task>();
+ config.NewConfig<Dt_Task, ConveyorLineTaskCommand>()
+ .Map(dest => dest.TargetAddress, src => src.NextAddress)
+ .Map(dest => dest.Barcode, src => src.PalletCode)
+ .Map(dest => dest.TaskNum, src => src.TaskNum);
}
}
}
--
Gitblit v1.9.3