API授权启用禁用功能

optimize
wanghaomei 2 years ago
parent 83bf6d43ac
commit 8c2221374b

@ -1877,24 +1877,18 @@ namespace Myshipping.Application
return HttpUtility.UrlEncode(fileName, Encoding.GetEncoding("UTF-8"));
}
///// <summary>
///// 下载打印文件(PDF直接预览)
///// </summary>
///// <param name="vid">查看ID</param>
///// <returns></returns>
//[HttpGet("/BookingOrder/ViewPrintPdf/{vid}"), AllowAnonymous]
//public void ViewPrintPdf(string vid)
//[HttpGet("/BookingOrder/TestExcel"), AllowAnonymous]
//public async Task TestExcel()
//{
// if (_cache.Exists(vid))
// {
// var fileFullName = _cache.Get(vid);
// var readMem = new ReadOnlyMemory<byte>(File.ReadAllBytes(fileFullName));
// _httpContextAccessor.HttpContext.Response.BodyWriter.WriteAsync(readMem);
// }
// else
// {
// throw Oops.Bah("下载链接失效,请重新打印");
// }
// var excelwork = new HSSFWorkbook(new FileStream(@"E:\whm\proj_git\BookingHeChuan\Myshipping.Web.Entry\bin\Debug\net6.0\wwwroot\Upload\PrintTemplate\373472276209733.xls", FileMode.Open));
// var sheet = excelwork.GetSheetAt(0);
// sheet.GetRow(0).GetCell(0).SetCellValue(Guid.NewGuid().ToString());
// sheet.GetRow(0).GetCell(1).SetCellValue(DateTime.Now.Ticks);
// var filestream = new FileStream(Path.Combine(@"E:\whm\proj_git\BookingHeChuan\Myshipping.Web.Entry\bin\Debug\net6.0\wwwroot\Upload\PrintTemplate", "result.xls"), FileMode.Create);
// excelwork.Write(filestream);
// filestream.Close();
//}
/// <summary>

@ -9323,6 +9323,14 @@
<param name="id"></param>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.DjyApiAuthService.SetDisable(System.Int64,System.Boolean)">
<summary>
启用禁用
</summary>
<param name="id"></param>
<param name="disable">可用false禁用true</param>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.DjyApiAuthService.GenSecret">
<summary>
生成新秘钥

@ -99,7 +99,7 @@ namespace Myshipping.Core.Service
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpPost("/DjyApiAuth/secretReset")]
[HttpPost("/DjyApiAuth/SecretReset")]
public async Task<string> SecretReset(long id)
{
var entity = _rep.AsQueryable().Filter(null, true).First(x => x.Id == id);
@ -108,6 +108,20 @@ namespace Myshipping.Core.Service
return entity.ApiSecret;
}
/// <summary>
/// 启用禁用
/// </summary>
/// <param name="id"></param>
/// <param name="disable">可用false禁用true</param>
/// <returns></returns>
[HttpPost("/DjyApiAuth/SetDisable")]
public async Task SetDisable(long id, bool disable)
{
var entity = _rep.AsQueryable().Filter(null, true).First(x => x.Id == id);
entity.IsDisable = disable;
await _rep.UpdateAsync(entity);
}
/// <summary>
/// 生成新秘钥
/// </summary>

Loading…
Cancel
Save