refactor 代码文件位置调整
This commit is contained in:
@@ -5,13 +5,13 @@ VisualStudioVersion = 17.7.34302.85
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Basic", "Basic", "{4EBCE46B-CE3A-4A47-9432-82A1854CA58A}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Canteen", "Canteen", "{3D8A98C1-83C9-4375-AEAB-4F72AFAF365B}"
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "RechargeAndSpend", "RechargeAndSpend", "{3D8A98C1-83C9-4375-AEAB-4F72AFAF365B}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dlhis.Entity", "Src\Dlhis.Entity\Dlhis.Entity.csproj", "{53884925-C9B9-4965-8B0D-100076CA0F43}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Permission", "Permission", "{57074FD8-1A2F-40C7-8476-001778A3F65D}"
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Sys", "Sys", "{57074FD8-1A2F-40C7-8476-001778A3F65D}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dlhis.Permission", "Src\Dlhis.Permission\Dlhis.Permission.csproj", "{5D7096DE-AB81-4423-95AF-6489C0D94CB3}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dlhis.Sys", "Src\Dlhis.Permission\Dlhis.Sys.csproj", "{5D7096DE-AB81-4423-95AF-6489C0D94CB3}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dlhis.ScheduledTask", "Src\Dlhis.ScheduledTask\Dlhis.ScheduledTask.csproj", "{0F1F7144-0BA3-4BDC-814E-E57A4E4A6392}"
|
||||
EndProject
|
||||
@@ -23,11 +23,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dlhis.Common.Api", "Src\Dlh
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scheduled", "Scheduled", "{AA987BDF-EF63-467B-AD04-59F9B10D9000}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C8F6420A-3427-4319-AB69-4F9679E05727}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
.editorconfig = .editorconfig
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dlhis.Basic", "Src\Dlhis.Basic\Dlhis.Basic.csproj", "{D1F81CB7-F3EF-4196-A751-468248368020}"
|
||||
EndProject
|
||||
Global
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using Dlhis.Basic.BusinessPlace.Request;
|
||||
using Dlhis.Basic.BusinessPlace.Response;
|
||||
using Dlhis.Entity.Basic;
|
||||
using Dlhis.Entity.Basic.Entity;
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using Dlhis.Basic.BusinessShift.Request;
|
||||
using Dlhis.Basic.BusinessShift.Response;
|
||||
using Dlhis.Entity.Basic;
|
||||
using Dlhis.Entity.Basic.Entity;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
using Kurisu.Core.CustomClass;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using Dlhis.Basic.Device.Request;
|
||||
using Dlhis.Basic.Device.Response;
|
||||
using Dlhis.Entity.Basic;
|
||||
using Dlhis.Entity.Basic.Entity;
|
||||
using Kurisu.AspNetCore.UnifyResultAndValidation;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using Dlhis.Basic.Device.Request;
|
||||
using Dlhis.Basic.Device.Response;
|
||||
using Dlhis.Entity.Basic;
|
||||
using Dlhis.Entity.Basic.Entity;
|
||||
using Kurisu.AspNetCore.UnifyResultAndValidation;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
|
||||
@@ -25,4 +25,9 @@
|
||||
<ProjectReference Include="..\Dlhis.Entity\Dlhis.Entity.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Organization\Request\" />
|
||||
<Folder Include="Organization\Response\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using Dlhis.Basic.MealUser.Request;
|
||||
using Dlhis.Basic.MealUser.Response;
|
||||
using Dlhis.Entity.Basic;
|
||||
using Dlhis.Entity.Basic.Entity;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Kurisu.SqlSugar.Extensions;
|
||||
using Kurisu.SqlSugar.Services;
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Dlhis.Basic.Organization.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// 部门
|
||||
/// </summary>
|
||||
[Authorize]
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class DepartmentsController : ControllerBase
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Dlhis.Basic.Organization.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// 档案
|
||||
/// </summary>
|
||||
[Authorize]
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class GainfosController : ControllerBase
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Dlhis.Basic.Organization.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// 人事范围
|
||||
/// </summary>
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class PersonalScopesController : ControllerBase
|
||||
{
|
||||
}
|
||||
5
Src/Dlhis.Basic/Organization/Services/IGainfoService.cs
Normal file
5
Src/Dlhis.Basic/Organization/Services/IGainfoService.cs
Normal file
@@ -0,0 +1,5 @@
|
||||
namespace Dlhis.Basic.Organization.Services;
|
||||
|
||||
public interface IGainfoService : IScopeDependency
|
||||
{
|
||||
}
|
||||
19
Src/Dlhis.Basic/Organization/Services/IGainfoStore.cs
Normal file
19
Src/Dlhis.Basic/Organization/Services/IGainfoStore.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using Dlhis.Entity.Basic.Entity;
|
||||
using Dlhis.Entity.Basic.Enums;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Dlhis.Basic.Organization.Services;
|
||||
|
||||
/// <summary>
|
||||
/// 人员档案存储
|
||||
/// </summary>
|
||||
public interface IGainfoStore : IScopeDependency
|
||||
{
|
||||
ISugarQueryable<GainfoEntity> Queryable(GainfoStatusEnumType? gainfoStatus);
|
||||
|
||||
Task InsertAsync(GainfoStatusEnumType? gainfoStatus, List<GainfoEntity> entities);
|
||||
|
||||
Task UpdateAsync(GainfoStatusEnumType? gainfoStatus, List<GainfoEntity> entities);
|
||||
|
||||
Task DeleteAsync(GainfoStatusEnumType? gainfoStatus, List<GainfoEntity> entities);
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
using System.Reflection;
|
||||
using Dlhis.Entity.Basic.Entity;
|
||||
using Dlhis.Entity.Basic.Enums;
|
||||
using Kurisu.SqlSugar.Services;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Dlhis.Basic.Organization.Services.Implements;
|
||||
|
||||
public class GainfoStore : IGainfoStore
|
||||
{
|
||||
private readonly IDbContext _dbContext;
|
||||
private readonly ISqlSugarOptionsService _sqlSugarOptionsService;
|
||||
|
||||
public GainfoStore(IDbContext dbContext, ISqlSugarOptionsService sqlSugarOptionsService)
|
||||
{
|
||||
_dbContext = dbContext;
|
||||
_sqlSugarOptionsService = sqlSugarOptionsService;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 档案表查询分表(按类型)
|
||||
/// </summary>
|
||||
/// <param name="gainfoStatus"></param>
|
||||
/// <returns></returns>
|
||||
public ISugarQueryable<GainfoEntity> Queryable(GainfoStatusEnumType? gainfoStatus)
|
||||
{
|
||||
if (gainfoStatus.HasValue && gainfoStatus != GainfoStatusEnumType.Working)
|
||||
{
|
||||
var tableName = typeof(GainfoEntity).GetCustomAttribute<SugarTable>().TableName;
|
||||
return _dbContext.Queryable<GainfoEntity>().AS(tableName + "_" + gainfoStatus);
|
||||
}
|
||||
|
||||
return _dbContext.Queryable<GainfoEntity>();
|
||||
}
|
||||
|
||||
public async Task InsertAsync(GainfoStatusEnumType? gainfoStatus, List<GainfoEntity> entities)
|
||||
{
|
||||
await _dbContext.Client.Insertable(entities).AS(GetTableName(gainfoStatus)).EnableDiffLogEventIF(_sqlSugarOptionsService.Diff).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
public async Task UpdateAsync(GainfoStatusEnumType? gainfoStatus, List<GainfoEntity> entities)
|
||||
{
|
||||
await _dbContext.Client.Updateable(entities).AS(GetTableName(gainfoStatus)).EnableDiffLogEventIF(_sqlSugarOptionsService.Diff).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
public async Task DeleteAsync(GainfoStatusEnumType? gainfoStatus, List<GainfoEntity> entities)
|
||||
{
|
||||
await _dbContext.Client.Deleteable(entities).AS(GetTableName(gainfoStatus)).EnableDiffLogEventIF(_sqlSugarOptionsService.Diff).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
|
||||
//*************************************************************** help method *********************************************************************************
|
||||
|
||||
/// <summary>
|
||||
/// 获取表名称
|
||||
/// </summary>
|
||||
/// <param name="gainfoStatus"></param>
|
||||
/// <returns></returns>
|
||||
private static string GetTableName(GainfoStatusEnumType? gainfoStatus)
|
||||
{
|
||||
var tableName = typeof(GainfoEntity).GetCustomAttribute<SugarTable>().TableName;
|
||||
if (gainfoStatus.HasValue && gainfoStatus != GainfoStatusEnumType.Working)
|
||||
{
|
||||
return tableName + "_" + gainfoStatus;
|
||||
}
|
||||
|
||||
return tableName;
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Kurisu.AspNetCore" Version="0.4.6" />
|
||||
<PackageReference Include="Kurisu.AspNetCore" Version="0.4.7" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -5,16 +5,16 @@ using Kurisu.Core.DataAccess.Dto;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Dlhis.Canteen.Order.Controllers
|
||||
namespace Dlhis.Canteen.Order.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// 订单
|
||||
/// </summary>
|
||||
[Authorize]
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class OrdersController : ControllerBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 订单
|
||||
/// </summary>
|
||||
[Authorize]
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class OrdersController : ControllerBase
|
||||
{
|
||||
private readonly IOrderService _orderService;
|
||||
|
||||
public OrdersController(IOrderService orderService)
|
||||
@@ -32,5 +32,15 @@ namespace Dlhis.Canteen.Order.Controllers
|
||||
{
|
||||
return await _orderService.GetPageAsync(request);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加充值消费订单
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task AddAsync(OrderAddRequest request)
|
||||
{
|
||||
await _orderService.AddAsync(request);
|
||||
}
|
||||
}
|
||||
|
||||
5
Src/Dlhis.Canteen/Order/Request/OrderAddRequest.cs
Normal file
5
Src/Dlhis.Canteen/Order/Request/OrderAddRequest.cs
Normal file
@@ -0,0 +1,5 @@
|
||||
namespace Dlhis.Canteen.Order.Request;
|
||||
|
||||
public class OrderAddRequest
|
||||
{
|
||||
}
|
||||
@@ -2,10 +2,11 @@
|
||||
using Dlhis.Canteen.Order.Response;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
|
||||
namespace Dlhis.Canteen.Order.Services
|
||||
namespace Dlhis.Canteen.Order.Services;
|
||||
|
||||
public interface IOrderService
|
||||
{
|
||||
public interface IOrderService
|
||||
{
|
||||
Task<Pagination<OrderResponse>> GetPageAsync(OrderPageRequest request);
|
||||
}
|
||||
|
||||
Task AddAsync(OrderAddRequest request);
|
||||
}
|
||||
|
||||
@@ -24,4 +24,9 @@ public class OrderService : IOrderService
|
||||
|
||||
return page;
|
||||
}
|
||||
|
||||
public Task AddAsync(OrderAddRequest request)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,20 @@
|
||||
using Kurisu.AspNetCore.Startup;
|
||||
using Kurisu.Startup;
|
||||
|
||||
class Program
|
||||
namespace Dlhis.Canteen
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
KurisuHost.Run<Startup>(true, args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class Startup : DefaultStartup
|
||||
{
|
||||
public class Startup : DefaultStartup
|
||||
{
|
||||
public Startup(IConfiguration configuration) : base(configuration)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
using Dlhis.Canteen.Setting.Request;
|
||||
using Dlhis.Canteen.Setting.Response;
|
||||
using Dlhis.Entity.Basic;
|
||||
using Dlhis.Entity.Basic.Entity;
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Kurisu.AspNetCore" Version="0.4.6" />
|
||||
<PackageReference Include="Kurisu.AspNetCore" Version="0.4.7" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -3,7 +3,7 @@ using Kurisu.Core.DataAccess.Entity;
|
||||
using SqlSugar;
|
||||
using SqlSugar.DbConvert;
|
||||
|
||||
namespace Dlhis.Entity.Basic;
|
||||
namespace Dlhis.Entity.Basic.Entity;
|
||||
|
||||
/// <summary>
|
||||
/// 营业点
|
||||
@@ -1,7 +1,7 @@
|
||||
using Kurisu.Core.DataAccess.Entity;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Dlhis.Entity.Basic;
|
||||
namespace Dlhis.Entity.Basic.Entity;
|
||||
|
||||
/// <summary>
|
||||
/// 营业点餐次
|
||||
@@ -3,7 +3,7 @@ using Kurisu.Core.DataAccess.Entity;
|
||||
using SqlSugar;
|
||||
using SqlSugar.DbConvert;
|
||||
|
||||
namespace Dlhis.Entity.Basic;
|
||||
namespace Dlhis.Entity.Basic.Entity;
|
||||
|
||||
/// <summary>
|
||||
/// 就餐配置
|
||||
@@ -3,7 +3,7 @@ using Kurisu.Core.DataAccess.Entity;
|
||||
using SqlSugar;
|
||||
using SqlSugar.DbConvert;
|
||||
|
||||
namespace Dlhis.Entity.Basic;
|
||||
namespace Dlhis.Entity.Basic.Entity;
|
||||
|
||||
/// <summary>
|
||||
/// 就餐人员
|
||||
@@ -2,7 +2,7 @@
|
||||
using Kurisu.Core.DataAccess.Entity;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Dlhis.Entity.Basic;
|
||||
namespace Dlhis.Entity.Basic.Entity;
|
||||
|
||||
/// <summary>
|
||||
/// 设备
|
||||
@@ -2,7 +2,7 @@
|
||||
using Kurisu.Core.DataAccess.Entity;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Dlhis.Entity.Basic;
|
||||
namespace Dlhis.Entity.Basic.Entity;
|
||||
|
||||
/// <summary>
|
||||
/// 设备配置模板
|
||||
11
Src/Dlhis.Entity/Basic/Entity/GainfoEntity.cs
Normal file
11
Src/Dlhis.Entity/Basic/Entity/GainfoEntity.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using SqlSugar;
|
||||
|
||||
namespace Dlhis.Entity.Basic.Entity;
|
||||
|
||||
/// <summary>
|
||||
/// 用户档案
|
||||
/// </summary>
|
||||
[SugarTable("Gainfo")]
|
||||
public class GainfoEntity : SugarBaseEntity
|
||||
{
|
||||
}
|
||||
28
Src/Dlhis.Entity/Basic/Enums/GainfoStatusEnumType.cs
Normal file
28
Src/Dlhis.Entity/Basic/Enums/GainfoStatusEnumType.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Dlhis.Entity.Basic.Enums;
|
||||
|
||||
/// <summary>
|
||||
/// 人员档案状态
|
||||
/// </summary>
|
||||
[Description("人员档案状态")]
|
||||
public enum GainfoStatusEnumType
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[Description("在职")]
|
||||
Working = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 离职
|
||||
/// </summary>
|
||||
[Description("离职")]
|
||||
Leave = 2,
|
||||
|
||||
/// <summary>
|
||||
/// 外部人员
|
||||
/// </summary>
|
||||
[Description("外部")]
|
||||
External = 3
|
||||
}
|
||||
@@ -17,15 +17,11 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Kurisu.AspNetCore" Version="0.4.6" />
|
||||
<PackageReference Include="Kurisu.AspNetCore" Version="0.4.7" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Dlhis.Entity\Dlhis.Entity.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Menu\Controllers\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
103
Src/Dlhis.Permission/Menu/Controllers/MenusController.cs
Normal file
103
Src/Dlhis.Permission/Menu/Controllers/MenusController.cs
Normal file
@@ -0,0 +1,103 @@
|
||||
using Dlhis.Entity.Permission.Enums;
|
||||
using Kurisu.SqlSugar.Attributes;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Dlhis.Sys.Menu.Services;
|
||||
using Dlhis.Sys.Menu.Response;
|
||||
using Dlhis.Sys.Menu.Request;
|
||||
|
||||
namespace Dlhis.Sys.Menu.Controllers;
|
||||
|
||||
[Authorize]
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class MenusController : ControllerBase
|
||||
{
|
||||
private readonly IMenuService _menuService;
|
||||
|
||||
public MenusController(IMenuService menuService)
|
||||
{
|
||||
_menuService = menuService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 菜单列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("list")]
|
||||
public async Task<List<MenuResponse>> GetListAsync([EnumDataType(typeof(PlatformEnumType))] PlatformEnumType? platform)
|
||||
{
|
||||
if (!platform.HasValue)
|
||||
{
|
||||
platform = PlatformEnumType.UserMobile;
|
||||
}
|
||||
return await _menuService.GetListAsync(platform.Value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存菜单
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[Transactional]
|
||||
[HttpPost]
|
||||
public async Task Save(SaveMenuRequest request)
|
||||
{
|
||||
await _menuService.SaveMenuAsync(request);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分配权限
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("assign")]
|
||||
public async Task AssignmentAsync(MenuPermissionAssignmentRequest request)
|
||||
{
|
||||
await _menuService.AssignmentAsync(request);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 当前类型的权限分配
|
||||
/// </summary>
|
||||
/// <param name="permissionType">权限类型</param>
|
||||
/// <param name="uniqueValue">类型对应的唯一值</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("assignments")]
|
||||
public async Task<List<string>> GetAssignmentsAsync([EnumDataType(typeof(MenuPermissionTypeEnumType))] MenuPermissionTypeEnumType permissionType, [Required] string uniqueValue)
|
||||
{
|
||||
return await _menuService.GetAssignmentCodesAsync(permissionType, uniqueValue);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取所有权限分配
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("assignments/all")]
|
||||
public async Task<List<string>> GetAllAssignmentsAsync()
|
||||
{
|
||||
return await _menuService.GetAllAssignmentPermissionsAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 我的菜单
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("my")]
|
||||
public async Task<List<MenuResponse>> GetCurrentMenusAsync()
|
||||
{
|
||||
return await _menuService.GetCurrentMenusAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重置
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("reset")]
|
||||
public async Task ResetAsync(List<SaveMenuRequest> request)
|
||||
{
|
||||
await _menuService.ResetAsync(request);
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Dlhis.Entity.Permission.Enums;
|
||||
|
||||
namespace Dlhis.Permission.Menu.Request;
|
||||
namespace Dlhis.Sys.Menu.Request;
|
||||
|
||||
public class MenuPermissionAssignmentRequest
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Dlhis.Entity.Permission.Enums;
|
||||
|
||||
namespace Dlhis.Permission.Menu.Request;
|
||||
namespace Dlhis.Sys.Menu.Request;
|
||||
|
||||
public class SaveMenuRequest : IValidatableObject
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using Dlhis.Entity.Permission.Enums;
|
||||
|
||||
namespace Dlhis.Permission.Menu.Response;
|
||||
namespace Dlhis.Sys.Menu.Response;
|
||||
|
||||
public class MenuResponse
|
||||
{
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using Dlhis.Entity.Permission.Enums;
|
||||
using Dlhis.Permission.Menu.Request;
|
||||
using Dlhis.Permission.Menu.Response;
|
||||
using Dlhis.Sys.Menu.Request;
|
||||
using Dlhis.Sys.Menu.Response;
|
||||
|
||||
namespace Dlhis.Permission.Menu.Services;
|
||||
namespace Dlhis.Sys.Menu.Services;
|
||||
|
||||
public interface IMenuService
|
||||
{
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
using Dlhis.Entity.Permission.Entities;
|
||||
using Dlhis.Entity.Permission.Enums;
|
||||
using Dlhis.Permission.Menu.Request;
|
||||
using Dlhis.Permission.Menu.Response;
|
||||
using Dlhis.Sys.Menu.Request;
|
||||
using Dlhis.Sys.Menu.Response;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
using Kurisu.Core.User.Abstractions;
|
||||
using Kurisu.SqlSugar.Services;
|
||||
using Mapster;
|
||||
|
||||
namespace Dlhis.Permission.Menu.Services.Implements;
|
||||
namespace Dlhis.Sys.Menu.Services.Implements;
|
||||
|
||||
public class MenuService : IMenuService
|
||||
{
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Kurisu.AspNetCore" Version="0.4.6" />
|
||||
<PackageReference Include="Kurisu.AspNetCore" Version="0.4.7" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user