diff --git a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/AccountController.cs b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/AccountController.cs
index 32d475a2..62ec149c 100644
--- a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/AccountController.cs
+++ b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/AccountController.cs
@@ -16,6 +16,7 @@ using Yi.Framework.DTOModel;
using Yi.Framework.Interface;
using Yi.Framework.Model.Models;
using Yi.Framework.WebCore;
+using Yi.Framework.WebCore.Mapper;
namespace Yi.Framework.ApiMicroservice.Controllers
{
@@ -46,11 +47,12 @@ namespace Yi.Framework.ApiMicroservice.Controllers
///
/// 登录方法,要返回data:{user,token} token
///
- ///
+ ///
///
[HttpPost]
- public async Task Login(user _user)
+ public async Task Login(loginDto login)
{
+ var _user= MapperHelper.Map(login);
var user_data = await _userService.Login(_user);
if (user_data == null)
{
diff --git a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/SwaggerDoc.xml b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/SwaggerDoc.xml
index 3173de6a..2eed29be 100644
--- a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/SwaggerDoc.xml
+++ b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/SwaggerDoc.xml
@@ -4,11 +4,11 @@
Yi.Framework.ApiMicroservice
-
+
登录方法,要返回data:{user,token} token
-
+
diff --git a/Yi.Framework.Net6/Yi.Framework.Common/Helper/HttpHelper.cs b/Yi.Framework.Net6/Yi.Framework.Common/Helper/HttpHelper.cs
index 96b7c4c0..afc9c4d7 100644
--- a/Yi.Framework.Net6/Yi.Framework.Common/Helper/HttpHelper.cs
+++ b/Yi.Framework.Net6/Yi.Framework.Common/Helper/HttpHelper.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
+using System.Net.Http;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
diff --git a/Yi.Framework.Net6/Yi.Framework.DTOModel/loginDto.cs b/Yi.Framework.Net6/Yi.Framework.DTOModel/loginDto.cs
new file mode 100644
index 00000000..456237b4
--- /dev/null
+++ b/Yi.Framework.Net6/Yi.Framework.DTOModel/loginDto.cs
@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Yi.Framework.DTOModel
+{
+ public class loginDto
+ {
+ public string username { get; set; }
+ public string password { get; set; }
+ }
+}
diff --git a/Yi.Framework.Net6/Yi.Framework.WebCore/Mapper/MapperHelper.cs b/Yi.Framework.Net6/Yi.Framework.WebCore/Mapper/MapperHelper.cs
new file mode 100644
index 00000000..d8b1b5f9
--- /dev/null
+++ b/Yi.Framework.Net6/Yi.Framework.WebCore/Mapper/MapperHelper.cs
@@ -0,0 +1,32 @@
+using AutoMapper;
+using AutoMapper.Configuration;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Yi.Framework.WebCore.Mapper
+{
+ public class MapperHelper
+ {
+ public static IMapper Profile()
+ {
+ var cfg = new MapperConfigurationExpression();
+ cfg.AddProfile();
+ cfg.AddProfile();
+ var config = new MapperConfiguration(cfg);
+ IMapper mapper = new AutoMapper.Mapper(config);
+ return mapper;
+ }
+
+ public static Target Map(Source source)
+ {
+ var cfg = new MapperConfigurationExpression();
+ cfg.CreateMap();
+ var config = new MapperConfiguration(cfg);
+ IMapper mapper = new AutoMapper.Mapper(config);
+ return mapper.Map(source);
+ }
+ }
+}
diff --git a/Yi.Framework.Net6/Yi.Framework.WebCore/Mapper/Profile/AutoMapperProfile.cs b/Yi.Framework.Net6/Yi.Framework.WebCore/Mapper/Profile/AutoMapperProfile.cs
new file mode 100644
index 00000000..a8e2a78c
--- /dev/null
+++ b/Yi.Framework.Net6/Yi.Framework.WebCore/Mapper/Profile/AutoMapperProfile.cs
@@ -0,0 +1,20 @@
+using AutoMapper;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Yi.Framework.WebCore.Mapper
+{
+ public class AutoMapperProfile : Profile
+ {
+ // 添加你的实体映射关系.
+ public AutoMapperProfile()
+ {
+ //CreateMap();
+ }
+ }
+
+
+}
diff --git a/Yi.Framework.Net6/Yi.Framework.WebCore/Mapper/Profile/RegisterMapProfile.cs b/Yi.Framework.Net6/Yi.Framework.WebCore/Mapper/Profile/RegisterMapProfile.cs
new file mode 100644
index 00000000..f72e2518
--- /dev/null
+++ b/Yi.Framework.Net6/Yi.Framework.WebCore/Mapper/Profile/RegisterMapProfile.cs
@@ -0,0 +1,25 @@
+using AutoMapper;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Yi.Framework.WebCore.Mapper
+{
+ public class RegisterMapProfile : Profile
+ {
+ //添加你的实体映射关系和出参字段
+ //public RegisterMapProfile()
+ //{
+ // #region 排班信息
+ // CreateMap()
+ // .ForMember(dest => dest.HospitalId,
+ // options => options.MapFrom(c => c.SelectToken("Hospital_ID")))
+ // .ForMember(dest => dest.BranchId,
+ // options => options.MapFrom(c => c.SelectToken("Branch_ID")))
+ // .ForMember(dest => dest.SchedulId,
+ // options => options.MapFrom(c => c.SelectToken("ScheduHeadID")));
+ //}
+ }
+}
diff --git a/Yi.Framework.Net6/Yi.Framework.WebCore/MiddlewareExtend/AutoMapperExtension.cs b/Yi.Framework.Net6/Yi.Framework.WebCore/MiddlewareExtend/AutoMapperExtension.cs
new file mode 100644
index 00000000..daefb162
--- /dev/null
+++ b/Yi.Framework.Net6/Yi.Framework.WebCore/MiddlewareExtend/AutoMapperExtension.cs
@@ -0,0 +1,19 @@
+using Microsoft.AspNetCore.Builder;
+using Microsoft.Extensions.DependencyInjection;
+using System;
+using System.IO;
+
+namespace Yi.Framework.WebCore.MiddlewareExtend
+{
+ ///
+ /// 通用autoMapper扩展
+ ///
+ public static class AutoMapperExtension
+ {
+ public static IServiceCollection AddAutoMapperExtensionService(this IServiceCollection services,Type type)
+ {
+ services.AddAutoMapper(type);
+ return services;
+ }
+ }
+}
diff --git a/Yi.Framework.Net6/Yi.Framework.WebCore/Yi.Framework.WebCore.csproj b/Yi.Framework.Net6/Yi.Framework.WebCore/Yi.Framework.WebCore.csproj
index b0418029..95c39335 100644
--- a/Yi.Framework.Net6/Yi.Framework.WebCore/Yi.Framework.WebCore.csproj
+++ b/Yi.Framework.Net6/Yi.Framework.WebCore/Yi.Framework.WebCore.csproj
@@ -8,6 +8,7 @@
+