添加automapper

This commit is contained in:
橙子
2021-12-25 16:55:11 +08:00
parent e639d3d2cc
commit 5a9b37ffa6
9 changed files with 118 additions and 4 deletions

View File

@@ -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
/// <summary>
/// 登录方法要返回data:{user,token} token
/// </summary>
/// <param name="_user"></param>
/// <param name="login"></param>
/// <returns></returns>
[HttpPost]
public async Task<Result> Login(user _user)
public async Task<Result> Login(loginDto login)
{
var _user= MapperHelper.Map<user, loginDto>(login);
var user_data = await _userService.Login(_user);
if (user_data == null)
{