|
|
@@ -166,6 +166,7 @@ namespace BPA.SAAS.Manage.Application.Auth |
|
|
|
{ |
|
|
|
Key = Guid.NewGuid().ToString(), |
|
|
|
PeriodValidity = input.PeriodValidity, |
|
|
|
UpdateAt=DateTime.Now, |
|
|
|
|
|
|
|
}).CallEntityMethod(t => t.Create()).ExecuteCommandAsync(); |
|
|
|
|
|
|
@@ -178,7 +179,27 @@ namespace BPA.SAAS.Manage.Application.Auth |
|
|
|
/// <param name="id"></param> |
|
|
|
/// <returns></returns> |
|
|
|
[HttpPost("/api/authorization/updateauthorization")] |
|
|
|
public async Task<bool> UpdateAuthorization(CreateOrUpDatePlatformAuthorizationDto input) |
|
|
|
public async Task<bool> UpdateAuthorization(string id) |
|
|
|
{ |
|
|
|
var data = await _db.Queryable<BPA_PlatformAuthorization>().FirstAsync(x => x.Id == id); |
|
|
|
if (data == null) |
|
|
|
{ |
|
|
|
throw Oops.Oh("授权信息不存在"); |
|
|
|
} |
|
|
|
data.Key = Guid.NewGuid().ToString(); |
|
|
|
data.UpdateAt = DateTime.Now; |
|
|
|
//data.PeriodValidity = input.PeriodValidity; |
|
|
|
|
|
|
|
return await _db.Updateable(data).ExecuteCommandHasChangeAsync(); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// 修改授权码授权时间 |
|
|
|
/// </summary> |
|
|
|
/// <param name="id"></param> |
|
|
|
/// <returns></returns> |
|
|
|
[HttpPost("/api/authorization/updateauthtime")] |
|
|
|
public async Task<bool> UpdateAuthTime(CreateOrUpDatePlatformAuthorizationDto input) |
|
|
|
{ |
|
|
|
var data = await _db.Queryable<BPA_PlatformAuthorization>().FirstAsync(x => x.Id == input.Id); |
|
|
|
if (data == null) |
|
|
@@ -187,11 +208,11 @@ namespace BPA.SAAS.Manage.Application.Auth |
|
|
|
} |
|
|
|
data.Key = Guid.NewGuid().ToString(); |
|
|
|
data.PeriodValidity = input.PeriodValidity; |
|
|
|
data.UpdateAt = DateTime.Now; |
|
|
|
|
|
|
|
return await _db.Updateable(data).ExecuteCommandHasChangeAsync(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#endregion |
|
|
|
} |
|
|
|
} |