完成字典、字典类型管理相关
This commit is contained in:
@@ -4,7 +4,29 @@
|
||||
<name>Yi.RBAC.Application</name>
|
||||
</assembly>
|
||||
<members>
|
||||
<member name="M:Yi.RBAC.Application.Identity.AccountService.PostLoginAsync(Yi.RBAC.Application.Contracts.Account.Dtos.LoginInputVo)">
|
||||
<member name="T:Yi.RBAC.Application.Dictionary.DictionaryService">
|
||||
<summary>
|
||||
Dictionary服务实现
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Yi.RBAC.Application.Dictionary.DictionaryService._dictionaryRepository">
|
||||
<summary>
|
||||
查询
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Yi.RBAC.Application.Dictionary.DictionaryService.GetDicType(System.String)">
|
||||
<summary>
|
||||
根据字典类型获取字典列表
|
||||
</summary>
|
||||
<param name="dicType"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:Yi.RBAC.Application.Dictionary.DictionaryTypeService">
|
||||
<summary>
|
||||
DictionaryType服务实现
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Yi.RBAC.Application.Identity.AccountService.PostLoginAsync(Yi.RBAC.Application.Contracts.Identity.Dtos.Account.LoginInputVo)">
|
||||
<summary>
|
||||
登录
|
||||
</summary>
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
using Yi.RBAC.Application.Contracts.Dictionary;
|
||||
using NET.AutoWebApi.Setting;
|
||||
using Yi.RBAC.Application.Contracts.Dictionary.Dtos;
|
||||
using Yi.RBAC.Domain.Dictionary.Entities;
|
||||
using Yi.Framework.Ddd.Services;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Yi.Framework.Ddd.Dtos;
|
||||
using Yi.RBAC.Domain.Dictionary.Repositories;
|
||||
|
||||
namespace Yi.RBAC.Application.Dictionary
|
||||
{
|
||||
/// <summary>
|
||||
/// Dictionary服务实现
|
||||
/// </summary>
|
||||
[AppService]
|
||||
public class DictionaryService : CrudAppService<DictionaryEntity, DictionaryGetOutputDto, DictionaryGetListOutputDto, long, DictionaryGetListInputVo, DictionaryCreateInputVo, DictionaryUpdateInputVo>,
|
||||
IDictionaryService, IAutoApiService
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询
|
||||
/// </summary>
|
||||
[Autowired]
|
||||
private IDictionaryRepository _dictionaryRepository { get; set; }
|
||||
public override async Task<PagedResultDto<DictionaryGetListOutputDto>> GetListAsync(DictionaryGetListInputVo input)
|
||||
{
|
||||
var data = await _dictionaryRepository.SelectGetListAsync(await MapToEntityAsync(input), input);
|
||||
return new PagedResultDto<DictionaryGetListOutputDto>
|
||||
{
|
||||
Total = data.Total,
|
||||
Items = await MapToGetListOutputDtosAsync(data.Items)
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据字典类型获取字典列表
|
||||
/// </summary>
|
||||
/// <param name="dicType"></param>
|
||||
/// <returns></returns>
|
||||
[Route("/api/dictionary/dic-type/{dicType}")]
|
||||
public async Task<List<DictionaryGetListOutputDto>> GetDicType([FromRoute] string dicType)
|
||||
{
|
||||
var entities = await _repository.GetListAsync(u => u.DictType == dicType && u.State == true);
|
||||
var result = await MapToGetListOutputDtosAsync(entities);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
using Yi.RBAC.Application.Contracts.Dictionary;
|
||||
using NET.AutoWebApi.Setting;
|
||||
using Yi.RBAC.Application.Contracts.Dictionary.Dtos;
|
||||
using Yi.RBAC.Domain.Dictionary.Entities;
|
||||
using Yi.Framework.Ddd.Services;
|
||||
using Yi.RBAC.Domain.Dictionary.Repositories;
|
||||
using Yi.Framework.Ddd.Dtos;
|
||||
|
||||
namespace Yi.RBAC.Application.Dictionary
|
||||
{
|
||||
/// <summary>
|
||||
/// DictionaryType服务实现
|
||||
/// </summary>
|
||||
[AppService]
|
||||
public class DictionaryTypeService : CrudAppService<DictionaryTypeEntity, DictionaryTypeGetOutputDto, DictionaryTypeGetListOutputDto, long, DictionaryTypeGetListInputVo, DictionaryTypeCreateInputVo, DictionaryTypeUpdateInputVo>,
|
||||
IDictionaryTypeService, IAutoApiService
|
||||
{
|
||||
|
||||
[Autowired]
|
||||
private IDictionaryTypeRepository _dictionaryTypeRepository { get; set; }
|
||||
|
||||
public async override Task<PagedResultDto<DictionaryTypeGetListOutputDto>> GetListAsync(DictionaryTypeGetListInputVo input)
|
||||
{
|
||||
var data = await _dictionaryTypeRepository.SelectGetListAsync(await MapToEntityAsync(input), input);
|
||||
return new PagedResultDto<DictionaryTypeGetListOutputDto>
|
||||
{
|
||||
Total = data.Total,
|
||||
Items = await MapToGetListOutputDtosAsync(data.Items)
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using AutoMapper;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.RBAC.Application.Contracts.Dictionary.Dtos;
|
||||
using Yi.RBAC.Domain.Dictionary.Entities;
|
||||
|
||||
namespace Yi.RBAC.Application.Dictionary.MapperConfig
|
||||
{
|
||||
public class DictionaryProfile: Profile
|
||||
{
|
||||
public DictionaryProfile()
|
||||
{
|
||||
CreateMap<DictionaryGetListInputVo, DictionaryEntity>();
|
||||
CreateMap<DictionaryCreateInputVo, DictionaryEntity>();
|
||||
CreateMap<DictionaryUpdateInputVo, DictionaryEntity>();
|
||||
CreateMap<DictionaryEntity, DictionaryGetListOutputDto>();
|
||||
CreateMap<DictionaryEntity, DictionaryGetOutputDto>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using AutoMapper;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.RBAC.Application.Contracts.Dictionary.Dtos;
|
||||
using Yi.RBAC.Domain.Dictionary.Entities;
|
||||
|
||||
namespace Yi.RBAC.Application.Dictionary.MapperConfig
|
||||
{
|
||||
public class DictionaryTypeProfile: Profile
|
||||
{
|
||||
public DictionaryTypeProfile()
|
||||
{
|
||||
CreateMap<DictionaryTypeGetListInputVo, DictionaryTypeEntity>();
|
||||
CreateMap<DictionaryTypeCreateInputVo, DictionaryTypeEntity>();
|
||||
CreateMap<DictionaryTypeUpdateInputVo, DictionaryTypeEntity>();
|
||||
CreateMap<DictionaryTypeEntity, DictionaryTypeGetListOutputDto>();
|
||||
CreateMap<DictionaryTypeEntity, DictionaryTypeGetOutputDto>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,6 @@ using Yi.Framework.Core.Exceptions;
|
||||
using Yi.Framework.Ddd.Repositories;
|
||||
using Yi.Framework.Ddd.Services;
|
||||
using Yi.Framework.ThumbnailSharp;
|
||||
using Yi.RBAC.Application.Contracts.Account.Dtos;
|
||||
using Yi.RBAC.Application.Contracts.Identity;
|
||||
using Yi.RBAC.Application.Contracts.Identity.Dtos.Account;
|
||||
using Yi.RBAC.Domain.Identity;
|
||||
|
||||
Reference in New Issue
Block a user