diff --git a/web/djy.WebApi/Controllers/AMS/AmsController.cs b/web/djy.WebApi/Controllers/AMS/AmsController.cs index 67f4b2f..6183d2a 100644 --- a/web/djy.WebApi/Controllers/AMS/AmsController.cs +++ b/web/djy.WebApi/Controllers/AMS/AmsController.cs @@ -18,7 +18,6 @@ using djy.IService.Ams; namespace djy_AmsApi.Controllers.AMS { - [AllowAnonymous] public class AmsController : ApiBase { IAmsService ser = IOC.AddServer(); @@ -129,218 +128,7 @@ namespace djy_AmsApi.Controllers.AMS } #endregion - #region 下拉接口 - /// - /// 下拉获取国家 - /// - /// - [HttpGet("GetCountry")] - public Response> GetCountry() - { - var result = new Response>(); - try - { - result.Result = ser.GetCountry(); - } - catch (Exception ex) - { - result.Code = 500; - result.Message = ex.InnerException?.Message ?? ex.Message; - } - - return result; - } - - /// - /// 下拉获取船公司 - /// - /// - [HttpGet("GetCARRIER")] - public Response> GetCARRIER() - { - var result = new Response>(); - try - { - result.Result = ser.GetCARRIER(); - } - catch (Exception ex) - { - result.Code = 500; - result.Message = ex.InnerException?.Message ?? ex.Message; - } - - return result; - } - - /// - /// 下拉获取箱型 - /// - /// - [HttpGet("GetCTNALL")] - public Response> GetCTNALL() - { - var result = new Response>(); - try - { - result.Result = ser.GetCTNALL(); - } - catch (Exception ex) - { - result.Code = 500; - result.Message = ex.InnerException?.Message ?? ex.Message; - } - - return result; - } - - - /// - /// 下拉获取包装单位 - /// - /// - [HttpGet("GetPackage")] - public Response> GetPackage() - { - var result = new Response>(); - try - { - result.Result = ser.GetPackage(); - } - catch (Exception ex) - { - result.Code = 500; - result.Message = ex.InnerException?.Message ?? ex.Message; - } - return result; - } - - /// - /// 下拉获取危品等级及 CODE - /// - /// - [HttpGet("GetDangerousGoods")] - public Response> GetDangerousGoods(string strlink="") - { - var result = new Response>(); - try - { - result.Result = ser.GetDangerousGoods(strlink); - } - catch (Exception ex) - { - result.Code = 500; - result.Message = ex.InnerException?.Message ?? ex.Message; - } - return result; - } - - - /// - /// 下拉获取起运港口 - /// - /// - [HttpGet("GetCodePortLoad")] - public Response> GetCodePortLoad() - { - var result = new Response>(); - try - { - result.Result = ser.GetCodePortLoad(); - } - catch (Exception ex) - { - result.Code = 500; - result.Message = ex.InnerException?.Message ?? ex.Message; - } - return result; - } - - - /// - /// 下拉获取港口 - /// - /// - [HttpGet("GetPort")] - public Response> GetPort(string strlink = "") - { - var result = new Response>(); - try - { - result.Result = ser.GetPort(strlink); - } - catch (Exception ex) - { - result.Code = 500; - result.Message = ex.InnerException?.Message ?? ex.Message; - } - return result; - } - - - /// - /// 下拉获取船名 - /// - /// - [HttpGet("GetVessel")] - public Response> GetVessel(string strlink = "") - { - var result = new Response>(); - try - { - result.Result = ser.GetVessel(strlink); - } - catch (Exception ex) - { - result.Code = 500; - result.Message = ex.InnerException?.Message ?? ex.Message; - } - return result; - } - - - - /// - /// 下拉获取省份 - /// - /// - [HttpGet("GetCodeProvince")] - public Response> GetCodeProvince() - { - var result = new Response>(); - try - { - result.Result = ser.GetCodeProvince(); - } - catch (Exception ex) - { - result.Code = 500; - result.Message = ex.InnerException?.Message ?? ex.Message; - } - return result; - } - - - /// - /// 下拉获取城市 邮编 - /// - /// - [HttpGet("GetCodeCity")] - public Response> GetCodeCity(string provinceCode) - { - var result = new Response>(); - try - { - result.Result = ser.GetCodeCity(provinceCode); - } - catch (Exception ex) - { - result.Code = 500; - result.Message = ex.InnerException?.Message ?? ex.Message; - } - return result; - } - - #endregion + #region pdf导出 [HttpGet("ExportPDF")] diff --git a/web/djy.WebApi/Controllers/Common/CommonController.cs b/web/djy.WebApi/Controllers/Common/CommonController.cs new file mode 100644 index 0000000..6becaa9 --- /dev/null +++ b/web/djy.WebApi/Controllers/Common/CommonController.cs @@ -0,0 +1,228 @@ +using Common.Utilities; +using djy.IService.Ams; +using djy.Model.AmsDto; +using djy.Service.Ams; +using Microsoft.AspNetCore.Mvc; +using System; +using System.Collections.Generic; + +namespace djy_AmsApi.Controllers.Common +{ + public class CommonController + { + //AmsService ser = new AmsService(); + + IAmsService ser = IOC.AddServer(); + #region 下拉接口 + /// + /// 下拉获取国家 + /// + /// + [HttpGet("GetCountry")] + public Response> GetCountry() + { + var result = new Response>(); + try + { + result.Result = ser.GetCountry(); + } + catch (Exception ex) + { + result.Code = 500; + result.Message = ex.InnerException?.Message ?? ex.Message; + } + + return result; + } + + /// + /// 下拉获取船公司 + /// + /// + [HttpGet("GetCARRIER")] + public Response> GetCARRIER() + { + var result = new Response>(); + try + { + result.Result = ser.GetCARRIER(); + } + catch (Exception ex) + { + result.Code = 500; + result.Message = ex.InnerException?.Message ?? ex.Message; + } + + return result; + } + + /// + /// 下拉获取箱型 + /// + /// + [HttpGet("GetCTNALL")] + public Response> GetCTNALL() + { + var result = new Response>(); + try + { + result.Result = ser.GetCTNALL(); + } + catch (Exception ex) + { + result.Code = 500; + result.Message = ex.InnerException?.Message ?? ex.Message; + } + + return result; + } + + + /// + /// 下拉获取包装单位 + /// + /// + [HttpGet("GetPackage")] + public Response> GetPackage() + { + var result = new Response>(); + try + { + result.Result = ser.GetPackage(); + } + catch (Exception ex) + { + result.Code = 500; + result.Message = ex.InnerException?.Message ?? ex.Message; + } + return result; + } + + /// + /// 下拉获取危品等级及 CODE + /// + /// + [HttpGet("GetDangerousGoods")] + public Response> GetDangerousGoods(string strlink = "") + { + var result = new Response>(); + try + { + result.Result = ser.GetDangerousGoods(strlink); + } + catch (Exception ex) + { + result.Code = 500; + result.Message = ex.InnerException?.Message ?? ex.Message; + } + return result; + } + + + /// + /// 下拉获取起运港口 + /// + /// + [HttpGet("GetCodePortLoad")] + public Response> GetCodePortLoad() + { + var result = new Response>(); + try + { + result.Result = ser.GetCodePortLoad(); + } + catch (Exception ex) + { + result.Code = 500; + result.Message = ex.InnerException?.Message ?? ex.Message; + } + return result; + } + + + /// + /// 下拉获取港口 + /// + /// + [HttpGet("GetPort")] + public Response> GetPort(string strlink = "") + { + var result = new Response>(); + try + { + result.Result = ser.GetPort(strlink); + } + catch (Exception ex) + { + result.Code = 500; + result.Message = ex.InnerException?.Message ?? ex.Message; + } + return result; + } + + + /// + /// 下拉获取船名 + /// + /// + [HttpGet("GetVessel")] + public Response> GetVessel(string strlink = "") + { + var result = new Response>(); + try + { + result.Result = ser.GetVessel(strlink); + } + catch (Exception ex) + { + result.Code = 500; + result.Message = ex.InnerException?.Message ?? ex.Message; + } + return result; + } + + + + /// + /// 下拉获取省份 + /// + /// + [HttpGet("GetCodeProvince")] + public Response> GetCodeProvince() + { + var result = new Response>(); + try + { + result.Result = ser.GetCodeProvince(); + } + catch (Exception ex) + { + result.Code = 500; + result.Message = ex.InnerException?.Message ?? ex.Message; + } + return result; + } + + + /// + /// 下拉获取城市 邮编 + /// + /// + [HttpGet("GetCodeCity")] + public Response> GetCodeCity(string provinceCode) + { + var result = new Response>(); + try + { + result.Result = ser.GetCodeCity(provinceCode); + } + catch (Exception ex) + { + result.Code = 500; + result.Message = ex.InnerException?.Message ?? ex.Message; + } + return result; + } + #endregion + } +} diff --git a/web/djy.WebApi/Properties/PublishProfiles/FolderProfile1.pubxml b/web/djy.WebApi/Properties/PublishProfiles/FolderProfile1.pubxml new file mode 100644 index 0000000..2cfc6f1 --- /dev/null +++ b/web/djy.WebApi/Properties/PublishProfiles/FolderProfile1.pubxml @@ -0,0 +1,21 @@ + + + + + false + false + true + Release + Any CPU + FileSystem + bin\Release\net5.0\publish\ + FileSystem + + net5.0 + linux-x64 + 84789cc9-b13d-4693-bf4f-6da3e32736a2 + false + + \ No newline at end of file diff --git a/web/djy.WebApi/Properties/PublishProfiles/FolderProfile1.pubxml.user b/web/djy.WebApi/Properties/PublishProfiles/FolderProfile1.pubxml.user new file mode 100644 index 0000000..a3d1b1e --- /dev/null +++ b/web/djy.WebApi/Properties/PublishProfiles/FolderProfile1.pubxml.user @@ -0,0 +1,10 @@ + + + + + <_PublishTargetUrl>C:\Project\DJYAMS\djyweb_ams\web\djy.WebApi\bin\Release\net5.0\publish\ + True|2022-07-05T03:23:47.7031600Z; + + \ No newline at end of file diff --git a/web/djy_IsfApi/Controllers/ISF/CommonController.cs b/web/djy_IsfApi/Controllers/ISF/CommonController.cs new file mode 100644 index 0000000..f02b6e1 --- /dev/null +++ b/web/djy_IsfApi/Controllers/ISF/CommonController.cs @@ -0,0 +1,230 @@ +using Common.Utilities; +using djy.IService.Ams; +using djy.Model.AmsDto; +using djy.Service.Ams; +using djy_IsfApi; +using Microsoft.AspNetCore.Mvc; +using System; +using System.Collections.Generic; + +namespace djy_AmsApi.Controllers.Common +{ + public class CommonController + { + IAmsService ser = IOC.AddServer(); + + + #region 下拉接口 + /// + /// 下拉获取国家 + /// + /// + [HttpGet("GetCountry")] + public Response> GetCountry() + { + var result = new Response>(); + try + { + result.Result = ser.GetCountry(); + } + catch (Exception ex) + { + result.Code = 500; + result.Message = ex.InnerException?.Message ?? ex.Message; + } + + return result; + } + + /// + /// 下拉获取船公司 + /// + /// + [HttpGet("GetCARRIER")] + public Response> GetCARRIER() + { + var result = new Response>(); + try + { + result.Result = ser.GetCARRIER(); + } + catch (Exception ex) + { + result.Code = 500; + result.Message = ex.InnerException?.Message ?? ex.Message; + } + + return result; + } + + /// + /// 下拉获取箱型 + /// + /// + [HttpGet("GetCTNALL")] + public Response> GetCTNALL() + { + var result = new Response>(); + try + { + result.Result = ser.GetCTNALL(); + } + catch (Exception ex) + { + result.Code = 500; + result.Message = ex.InnerException?.Message ?? ex.Message; + } + + return result; + } + + + /// + /// 下拉获取包装单位 + /// + /// + [HttpGet("GetPackage")] + public Response> GetPackage() + { + var result = new Response>(); + try + { + result.Result = ser.GetPackage(); + } + catch (Exception ex) + { + result.Code = 500; + result.Message = ex.InnerException?.Message ?? ex.Message; + } + return result; + } + + /// + /// 下拉获取危品等级及 CODE + /// + /// + [HttpGet("GetDangerousGoods")] + public Response> GetDangerousGoods(string strlink = "") + { + var result = new Response>(); + try + { + result.Result = ser.GetDangerousGoods(strlink); + } + catch (Exception ex) + { + result.Code = 500; + result.Message = ex.InnerException?.Message ?? ex.Message; + } + return result; + } + + + /// + /// 下拉获取起运港口 + /// + /// + [HttpGet("GetCodePortLoad")] + public Response> GetCodePortLoad() + { + var result = new Response>(); + try + { + result.Result = ser.GetCodePortLoad(); + } + catch (Exception ex) + { + result.Code = 500; + result.Message = ex.InnerException?.Message ?? ex.Message; + } + return result; + } + + + /// + /// 下拉获取港口 + /// + /// + [HttpGet("GetPort")] + public Response> GetPort(string strlink = "") + { + var result = new Response>(); + try + { + result.Result = ser.GetPort(strlink); + } + catch (Exception ex) + { + result.Code = 500; + result.Message = ex.InnerException?.Message ?? ex.Message; + } + return result; + } + + + /// + /// 下拉获取船名 + /// + /// + [HttpGet("GetVessel")] + public Response> GetVessel(string strlink = "") + { + var result = new Response>(); + try + { + result.Result = ser.GetVessel(strlink); + } + catch (Exception ex) + { + result.Code = 500; + result.Message = ex.InnerException?.Message ?? ex.Message; + } + return result; + } + + + + /// + /// 下拉获取省份 + /// + /// + [HttpGet("GetCodeProvince")] + public Response> GetCodeProvince() + { + var result = new Response>(); + try + { + result.Result = ser.GetCodeProvince(); + } + catch (Exception ex) + { + result.Code = 500; + result.Message = ex.InnerException?.Message ?? ex.Message; + } + return result; + } + + + /// + /// 下拉获取城市 邮编 + /// + /// + [HttpGet("GetCodeCity")] + public Response> GetCodeCity(string provinceCode) + { + var result = new Response>(); + try + { + result.Result = ser.GetCodeCity(provinceCode); + } + catch (Exception ex) + { + result.Code = 500; + result.Message = ex.InnerException?.Message ?? ex.Message; + } + return result; + } + + #endregion + } +} diff --git a/web/djy_IsfApi/Controllers/ISF/IsfController.cs b/web/djy_IsfApi/Controllers/ISF/IsfController.cs index 1ef0f44..c416f84 100644 --- a/web/djy_IsfApi/Controllers/ISF/IsfController.cs +++ b/web/djy_IsfApi/Controllers/ISF/IsfController.cs @@ -13,7 +13,6 @@ using System.Threading.Tasks; namespace djy_Isfpi.Controllers.ISF { - [AllowAnonymous] public class IsfController : ApiBase { diff --git a/web/djy_IsfApi/Properties/PublishProfiles/FolderProfile1.pubxml b/web/djy_IsfApi/Properties/PublishProfiles/FolderProfile1.pubxml new file mode 100644 index 0000000..700eacd --- /dev/null +++ b/web/djy_IsfApi/Properties/PublishProfiles/FolderProfile1.pubxml @@ -0,0 +1,21 @@ + + + + + false + false + true + Release + Any CPU + FileSystem + bin\Release\net5.0\publish\ + FileSystem + + net5.0 + linux-x64 + b9b3283e-fa06-4b06-88f1-5680ac4e5f26 + false + + \ No newline at end of file diff --git a/web/djy_IsfApi/Properties/PublishProfiles/FolderProfile1.pubxml.user b/web/djy_IsfApi/Properties/PublishProfiles/FolderProfile1.pubxml.user new file mode 100644 index 0000000..5d6f634 --- /dev/null +++ b/web/djy_IsfApi/Properties/PublishProfiles/FolderProfile1.pubxml.user @@ -0,0 +1,10 @@ + + + + + <_PublishTargetUrl>C:\Project\DJYAMS\djyweb_ams\web\djy_IsfApi\bin\Release\net5.0\publish\ + True|2022-07-05T03:48:21.5945057Z;True|2022-07-05T11:21:19.6041212+08:00;True|2022-07-05T11:19:11.9998954+08:00; + + \ No newline at end of file diff --git a/web/djy_IsfApi/djy_IsfApi.csproj.user b/web/djy_IsfApi/djy_IsfApi.csproj.user index b8b75bd..0c0d867 100644 --- a/web/djy_IsfApi/djy_IsfApi.csproj.user +++ b/web/djy_IsfApi/djy_IsfApi.csproj.user @@ -1,6 +1,8 @@  - C:\Project\DJYAMS\djyweb_ams\web\djy_IsfApi\Properties\PublishProfiles\FolderProfile1.pubxml + C:\Project\DJYAMS\djyweb_ams\web\djy_IsfApi\Properties\PublishProfiles\FolderProfile.pubxml + MvcControllerEmptyScaffolder + root/Common/MVC/Controller \ No newline at end of file