-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: dict list functionality temp stage
- Loading branch information
Showing
10 changed files
with
135 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
dl-api-csharp/Doublelives.Api/Controllers/DictController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using Doublelives.Api.Mappers; | ||
using Doublelives.Api.Models.Dicts.Requests; | ||
using Doublelives.Service.Dicts; | ||
using Doublelives.Service.WorkContextAccess; | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
namespace Doublelives.Api.Controllers | ||
{ | ||
public class DictController : AuthControllerBase | ||
{ | ||
private readonly IDictService _dictService; | ||
|
||
public DictController( | ||
IWorkContextAccessor workContextAccessor, | ||
IDictService dictService) | ||
: base(workContextAccessor) | ||
{ | ||
_dictService = dictService; | ||
} | ||
|
||
[HttpGet("list")] | ||
public IActionResult List([FromQuery]DictListSearchRequest request) | ||
{ | ||
var result = _dictService.GetPagedList(DictMapper.ToDictSearchDto(request)); | ||
|
||
return Ok(""); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using Doublelives.Api.Models.Dicts.Requests; | ||
using Doublelives.Domain.Sys.Dto; | ||
|
||
namespace Doublelives.Api.Mappers | ||
{ | ||
public class DictMapper | ||
{ | ||
public static DictSearchDto ToDictSearchDto(DictListSearchRequest request) | ||
{ | ||
var dto = new DictSearchDto | ||
{ | ||
Limit = request.Limit == 0 ? 20 : request.Limit, | ||
Page = request.Page == 0 ? 1 : request.Page, | ||
Name = request.Name | ||
}; | ||
|
||
return dto; | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
dl-api-csharp/Doublelives.Api/Models/Dicts/Requests/DictListSearchRequest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Doublelives.Api.Models.Dicts.Requests | ||
{ | ||
public class DictListSearchRequest : BasePagedListRequest | ||
{ | ||
public string Name { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
dl-api-csharp/Doublelives.Domain/Sys/Dto/DictProfileDto.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System; | ||
|
||
namespace Doublelives.Domain.Sys.Dto | ||
{ | ||
public class DictProfileDto | ||
{ | ||
public int Id { get; set; } | ||
|
||
public string Name { get; set; } | ||
|
||
public string Num { get; set; } | ||
|
||
/// <summary> | ||
/// 上级dict的id | ||
/// </summary> | ||
public int? Pid { get; set; } | ||
|
||
/// <summary> | ||
/// 所有的下级的字典内容的信息 e.g."1:启用,2:禁用" | ||
/// </summary> | ||
public string Detail { get; set; } | ||
|
||
public string Tips { get; set; } | ||
|
||
public DateTime? CreateTime { get; set; } | ||
|
||
public int? CreateBy { get; set; } | ||
|
||
public DateTime? ModifyTime { get; set; } | ||
|
||
public int? ModifyBy { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Doublelives.Domain.Sys.Dto | ||
{ | ||
public class DictSearchDto : BasePagedListDto | ||
{ | ||
public string Name { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using Doublelives.Domain.Sys; | ||
using Doublelives.Domain.Sys.Dto; | ||
using Doublelives.Persistence; | ||
using Doublelives.Shared.Models; | ||
|
||
namespace Doublelives.Service.Dicts | ||
{ | ||
public class DictService : IDictService | ||
{ | ||
private readonly IUnitOfWork _unitOfWork; | ||
|
||
public DictService(IUnitOfWork unitOfWork) | ||
{ | ||
_unitOfWork = unitOfWork; | ||
} | ||
|
||
public PagedModel<DictProfileDto> GetPagedList(DictSearchDto criteria) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using Doublelives.Domain.Sys; | ||
using Doublelives.Domain.Sys.Dto; | ||
using Doublelives.Shared.Models; | ||
|
||
namespace Doublelives.Service.Dicts | ||
{ | ||
public interface IDictService | ||
{ | ||
/// <summary> | ||
/// 获取分页数据 | ||
/// </summary> | ||
PagedModel<DictProfileDto> GetPagedList(DictSearchDto criteria); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters