添加项目文件。
This commit is contained in:
74
src/BarCode.Web.Domain/Mappers/AppMapper.cs
Normal file
74
src/BarCode.Web.Domain/Mappers/AppMapper.cs
Normal file
@@ -0,0 +1,74 @@
|
||||
using AutoMapper;
|
||||
using BarCode.Web.Core.Dto;
|
||||
using BarCode.Web.Core.Dto.Login;
|
||||
using BarCode.Web.Core.Dto.Login.Temp;
|
||||
using BarCode.Web.Core.Dto.Login.Temp.v3;
|
||||
using BarCode.Web.Core.Help;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using BarCode.Web.Domain.Entitys;
|
||||
|
||||
namespace BarCode.Web.Domain.Mappers
|
||||
{
|
||||
/// <summary>
|
||||
/// mapper映射
|
||||
/// </summary>
|
||||
public class AppMapper : Profile
|
||||
{
|
||||
public AppMapper()
|
||||
{
|
||||
//pc端登录的相关dto
|
||||
CreateMap<LoginJsonTokenTempDto, UserInfoDto>()
|
||||
.ForMember(x => x.Email, ops => ops.MapFrom(x => x.email))
|
||||
.ForMember(x => x.Avatar, ops => ops.MapFrom(x => x.avatar))
|
||||
.ForMember(x => x.RoleId, ops => ops.MapFrom(x => x.role_id))
|
||||
.ForMember(x => x.CreatedAt, ops => ops.MapFrom(x => x.created_at))
|
||||
.ForMember(x => x.SigninAt, ops => ops.MapFrom(x => x.signin_at))
|
||||
.ForMember(x => x.UpdatedAt, ops => ops.MapFrom(x => x.updated_at))
|
||||
.ReverseMap();
|
||||
|
||||
CreateMap<LoginJsonDeptTempDto, DeptInfoDto>()
|
||||
.ForMember(x => x.Id, ops => ops.MapFrom(x => x.id))
|
||||
.ForMember(x => x.DeptCode, ops => ops.MapFrom(x => x.dept_code))
|
||||
.ForMember(x => x.DeptName, ops => ops.MapFrom(x => x.dept_name))
|
||||
.ForMember(x => x.ManagerId, ops => ops.MapFrom(x => x.manager)).ReverseMap();
|
||||
|
||||
//app端和小程序端登录的相关dto
|
||||
|
||||
|
||||
CreateMap<LoginJsonDeptV3TempDto, TagInfoDto>()
|
||||
.ForMember(x => x.Id, ops => ops.MapFrom(x => x.dept_id))
|
||||
.ForMember(x => x.Name, ops => ops.MapFrom(x => x.dept_name))
|
||||
.ForMember(x => x.Code, ops => ops.MapFrom(x => x.dept_code)).ReverseMap();
|
||||
CreateMap<LoginJsonCompanyTempDto, TagInfoDto>()
|
||||
.ForMember(x => x.Id, ops => ops.MapFrom(x => x.company_id))
|
||||
.ForMember(x => x.Name, ops => ops.MapFrom(x => x.company_name))
|
||||
.ForMember(x => x.Code, ops => ops.MapFrom(x => x.company_code)).ReverseMap();
|
||||
CreateMap<LoginJsonRoleTempDto, TagInfoDto>()
|
||||
.ForMember(x => x.Id, ops => ops.MapFrom(x => x.role_id))
|
||||
.ForMember(x => x.Name, ops => ops.MapFrom(x => x.role_name))
|
||||
.ForMember(x => x.Code, ops => ops.MapFrom(x => x.role_code)).ReverseMap();
|
||||
|
||||
CreateMap<LoginJsonTokenV3TempDto, UserInfoV3Dto>()
|
||||
.ForMember(x => x.Id, ops => ops.MapFrom(x => x.id))
|
||||
.ForMember(x => x.DingtalkUid, ops => ops.MapFrom(x => x.dingtalk_uid))
|
||||
.ForMember(x => x.DingtalkUnionid, ops => ops.MapFrom(x => x.dingtalk_unionid))
|
||||
.ForMember(x => x.Nickname, ops => ops.MapFrom(x => x.nickname))
|
||||
.ForMember(x => x.Realname, ops => ops.MapFrom(x => x.realname))
|
||||
.ForMember(x => x.Mobile, ops => ops.MapFrom(x => x.mobile))
|
||||
.ForMember(x => x.Identity, ops => ops.MapFrom(x => x.identity))
|
||||
.ForMember(x => x.Company, ops => ops.MapFrom(x => x.company))
|
||||
.ForMember(x => x.Orgs, opt => opt.Ignore())
|
||||
.ForMember(x => x.Depts, opt => opt.Ignore())
|
||||
.ForMember(x => x.Roles, opt => opt.Ignore()).ReverseMap();
|
||||
|
||||
|
||||
CreateMap<FileDownManager, FileDownInfoManagerResponse>()
|
||||
.ForMember(x => x.Date, ops => ops.MapFrom(x => x.Date.DateToStringSeconds()))
|
||||
//.ForMember(x => x.StatusKey, ops => ops.MapFrom(x => (int)x.Status))
|
||||
// .ForMember(x => x.Status, ops => ops.MapFrom(x => x.Status.GetRemark()))
|
||||
.ForMember(x => x.Type, ops => ops.MapFrom(x => (int)x.Type));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user