Browse Source

提交

master
gwbvipvip 10 months ago
parent
commit
5b3e0c0bdc
5 changed files with 31 additions and 9 deletions
  1. +4
    -4
      BPA.SAAS.Manage.Application/AExternalPlatform/Service/Material/Dtos/MaterialDto.cs
  2. +5
    -3
      BPA.SAAS.Manage.Application/Auth/AuthService.cs
  3. +14
    -0
      BPA.SAAS.Manage.Application/Auth/Dtos/PlatformAuthorizationDto.cs
  4. +2
    -2
      BPA.SAAS.Manage.Application/Auth/IAuthService.cs
  5. +6
    -0
      BPA.SAAS.Manage.Core/DataBase/BPA_PlatformAuthorization.cs

+ 4
- 4
BPA.SAAS.Manage.Application/AExternalPlatform/Service/Material/Dtos/MaterialDto.cs View File

@@ -8,7 +8,7 @@ using System.Threading.Tasks;

namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Material.Dtos
{
public class MaterialPageInputDto: BaseEPDto
public class MaterialPageInputDto
{
/// <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 class MaterialCreateDto : BaseEPDto
public class MaterialCreateDto
{
/// <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; }



+ 5
- 3
BPA.SAAS.Manage.Application/Auth/AuthService.cs View File

@@ -154,7 +154,7 @@ namespace BPA.SAAS.Manage.Application.Auth
/// </summary>
/// <returns></returns>
[HttpPost("/api/authorization/addauthorization")]
public async Task<bool> AddAuthorization()
public async Task<bool> AddAuthorization(CreateOrUpDatePlatformAuthorizationDto input)
{
var data = _db.Queryable<BPA_PlatformAuthorization>().ToList();
if (data.Count > 0)
@@ -165,6 +165,7 @@ namespace BPA.SAAS.Manage.Application.Auth
var res = await _db.Insertable(new BPA_PlatformAuthorization()
{
Key = Guid.NewGuid().ToString(),
PeriodValidity = input.PeriodValidity,

}).CallEntityMethod(t => t.Create()).ExecuteCommandAsync();

@@ -177,14 +178,15 @@ namespace BPA.SAAS.Manage.Application.Auth
/// <param name="id"></param>
/// <returns></returns>
[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)
{
throw Oops.Oh("授权信息不存在");
}
data.Key = Guid.NewGuid().ToString();
data.PeriodValidity = input.PeriodValidity;

return await _db.Updateable(data).ExecuteCommandHasChangeAsync();
}


+ 14
- 0
BPA.SAAS.Manage.Application/Auth/Dtos/PlatformAuthorizationDto.cs View File

@@ -9,5 +9,19 @@ namespace BPA.SAAS.Manage.Application.Auth.Dtos
{
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;}
}
}

+ 2
- 2
BPA.SAAS.Manage.Application/Auth/IAuthService.cs View File

@@ -27,14 +27,14 @@ namespace BPA.SAAS.Manage.Application.Auth
/// 添加授权码
/// </summary>
/// <returns></returns>
Task<bool> AddAuthorization();
Task<bool> AddAuthorization(CreateOrUpDatePlatformAuthorizationDto input);

/// <summary>
/// 修改授权码
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
Task<bool> UpdateAuthorization(string id);
Task<bool> UpdateAuthorization(CreateOrUpDatePlatformAuthorizationDto input);

#endregion
}


+ 6
- 0
BPA.SAAS.Manage.Core/DataBase/BPA_PlatformAuthorization.cs View File

@@ -17,5 +17,11 @@ namespace BPA.SAAS.Manage.Core.DataBase
public string Key { get; set; }

public string GroupId { get; set; }


/// <summary>
/// 有效期 长期有效为空
/// </summary>
public DateTime? PeriodValidity { get; set; }
}
}

Loading…
Cancel
Save