@@ -8,7 +8,7 @@ using System.Threading.Tasks; | |||||
namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Material.Dtos | namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Material.Dtos | ||||
{ | { | ||||
public class MaterialPageInputDto: BaseEPDto | |||||
public class MaterialPageInputDto | |||||
{ | { | ||||
/// <summary> | /// <summary> | ||||
/// 当前页码 | /// 当前页码 | ||||
@@ -90,13 +90,13 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Material.Dtos | |||||
} | } | ||||
public class DelMaterialDto : BaseEPDto | |||||
public class DelMaterialDto | |||||
{ | { | ||||
public string MaterialId { get; set; } | public string MaterialId { get; set; } | ||||
} | } | ||||
public class MaterialCreateDto : BaseEPDto | |||||
public class MaterialCreateDto | |||||
{ | { | ||||
/// <summary> | /// <summary> | ||||
/// 原料编码 | /// 原料编码 | ||||
@@ -125,7 +125,7 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Material.Dtos | |||||
} | } | ||||
public class MaterialUpdateDto : BaseEPDto | |||||
public class MaterialUpdateDto | |||||
{ | { | ||||
public string Id { get; set; } | public string Id { get; set; } | ||||
@@ -154,7 +154,7 @@ namespace BPA.SAAS.Manage.Application.Auth | |||||
/// </summary> | /// </summary> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
[HttpPost("/api/authorization/addauthorization")] | [HttpPost("/api/authorization/addauthorization")] | ||||
public async Task<bool> AddAuthorization() | |||||
public async Task<bool> AddAuthorization(CreateOrUpDatePlatformAuthorizationDto input) | |||||
{ | { | ||||
var data = _db.Queryable<BPA_PlatformAuthorization>().ToList(); | var data = _db.Queryable<BPA_PlatformAuthorization>().ToList(); | ||||
if (data.Count > 0) | if (data.Count > 0) | ||||
@@ -165,6 +165,7 @@ namespace BPA.SAAS.Manage.Application.Auth | |||||
var res = await _db.Insertable(new BPA_PlatformAuthorization() | var res = await _db.Insertable(new BPA_PlatformAuthorization() | ||||
{ | { | ||||
Key = Guid.NewGuid().ToString(), | Key = Guid.NewGuid().ToString(), | ||||
PeriodValidity = input.PeriodValidity, | |||||
}).CallEntityMethod(t => t.Create()).ExecuteCommandAsync(); | }).CallEntityMethod(t => t.Create()).ExecuteCommandAsync(); | ||||
@@ -177,14 +178,15 @@ namespace BPA.SAAS.Manage.Application.Auth | |||||
/// <param name="id"></param> | /// <param name="id"></param> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
[HttpPost("/api/authorization/updateauthorization")] | [HttpPost("/api/authorization/updateauthorization")] | ||||
public async Task<bool> UpdateAuthorization(string id) | |||||
public async Task<bool> UpdateAuthorization(CreateOrUpDatePlatformAuthorizationDto input) | |||||
{ | { | ||||
var data = await _db.Queryable<BPA_PlatformAuthorization>().FirstAsync(x => x.Id == id); | |||||
var data = await _db.Queryable<BPA_PlatformAuthorization>().FirstAsync(x => x.Id == input.Id); | |||||
if (data == null) | if (data == null) | ||||
{ | { | ||||
throw Oops.Oh("授权信息不存在"); | throw Oops.Oh("授权信息不存在"); | ||||
} | } | ||||
data.Key = Guid.NewGuid().ToString(); | data.Key = Guid.NewGuid().ToString(); | ||||
data.PeriodValidity = input.PeriodValidity; | |||||
return await _db.Updateable(data).ExecuteCommandHasChangeAsync(); | return await _db.Updateable(data).ExecuteCommandHasChangeAsync(); | ||||
} | } | ||||
@@ -9,5 +9,19 @@ namespace BPA.SAAS.Manage.Application.Auth.Dtos | |||||
{ | { | ||||
public class PlatformAuthorizationDto: BPA_PlatformAuthorization | public class PlatformAuthorizationDto: BPA_PlatformAuthorization | ||||
{ | { | ||||
} | |||||
public class CreateOrUpDatePlatformAuthorizationDto | |||||
{ | |||||
public string Id { get; set; } | |||||
public string Key { get; set; } | |||||
/// <summary> | |||||
/// 有效期 长期有效为空 | |||||
/// </summary> | |||||
public DateTime? PeriodValidity { get; set;} | |||||
} | } | ||||
} | } |
@@ -27,14 +27,14 @@ namespace BPA.SAAS.Manage.Application.Auth | |||||
/// 添加授权码 | /// 添加授权码 | ||||
/// </summary> | /// </summary> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
Task<bool> AddAuthorization(); | |||||
Task<bool> AddAuthorization(CreateOrUpDatePlatformAuthorizationDto input); | |||||
/// <summary> | /// <summary> | ||||
/// 修改授权码 | /// 修改授权码 | ||||
/// </summary> | /// </summary> | ||||
/// <param name="id"></param> | /// <param name="id"></param> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
Task<bool> UpdateAuthorization(string id); | |||||
Task<bool> UpdateAuthorization(CreateOrUpDatePlatformAuthorizationDto input); | |||||
#endregion | #endregion | ||||
} | } | ||||
@@ -17,5 +17,11 @@ namespace BPA.SAAS.Manage.Core.DataBase | |||||
public string Key { get; set; } | public string Key { get; set; } | ||||
public string GroupId { get; set; } | public string GroupId { get; set; } | ||||
/// <summary> | |||||
/// 有效期 长期有效为空 | |||||
/// </summary> | |||||
public DateTime? PeriodValidity { get; set; } | |||||
} | } | ||||
} | } |