gwbvipvip 10 месяцев назад
Родитель
Сommit
5b3e0c0bdc
5 измененных файлов: 31 добавлений и 9 удалений
  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 Просмотреть файл

@@ -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 Просмотреть файл

@@ -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 Просмотреть файл

@@ -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 Просмотреть файл

@@ -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 Просмотреть файл

@@ -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; }
}
}

Загрузка…
Отмена
Сохранить