using Common.Utilities;
using djy.IService.Afr;
using djy.Model.AmsDto;
using djy_AfrApi.Attributes;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
namespace djy_AfrApi.Controllers.Common
{
[Route("api/[controller]")]
[ApiController]
[Authorize]
public class CommonController
{
private readonly IAfrService ser;
public CommonController(IAfrService service)
{
this.ser = service;
}
#region 下拉接口
///
/// 下拉获取国家
///
///
[HttpGet("GetCountry")]
[RedisCaching]
public Response> GetCountry()
{
var result = new Response>();
try
{
result.Result = ser.GetCountry("", 0, 0);
}
catch (Exception ex)
{
result.Code = 500;
result.Message = ex.InnerException?.Message ?? ex.Message;
}
return result;
}
///
/// 下拉获取船公司
///
///
[HttpGet("GetCARRIER")]
[RedisCaching]
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")]
[RedisCaching]
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")]
[RedisCaching]
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")]
[RedisCaching]
public Response> GetDangerousGoods()
{
var result = new Response>();
try
{
result.Result = ser.GetDangerousGoods("");
}
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")]
[RedisCaching]
public Response> GetPort()
{
var result = new Response>();
try
{
result.Result = ser.GetPort("", 0, 0);
}
catch (Exception ex)
{
result.Code = 500;
result.Message = ex.InnerException?.Message ?? ex.Message;
}
return result;
}
///
/// 下拉获取船名
///
///
[HttpGet("GetVessel")]
[RedisCaching]
public Response> GetVessel()
{
var result = new Response>();
try
{
result.Result = ser.GetVessel("", 0, 0);
}
catch (Exception ex)
{
result.Code = 500;
result.Message = ex.InnerException?.Message ?? ex.Message;
}
return result;
}
/////
///// 下拉获取省份
/////
/////
//[HttpGet("GetCodeProvince")]
//public Response> GetCodeProvince(string code)
//{
// var result = new Response>();
// try
// {
// result.Result = ser.GetCodeProvince(code);
// }
// 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
}
}