82 lines
2.6 KiB
C#
82 lines
2.6 KiB
C#
using Infrastructure;
|
|
using Infrastructure.Attribute;
|
|
using Infrastructure.Enums;
|
|
using Infrastructure.Model;
|
|
using Mapster;
|
|
using Microsoft.AspNetCore.Http;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using ARW.Admin.WebApi.Extensions;
|
|
using ARW.Admin.WebApi.Filters;
|
|
using ARW.Common;
|
|
using ARW.Admin.WebApi.Controllers;
|
|
using ARW.Model.Dto.Api.Settings.PlatformSpecs;
|
|
using ARW.Service.Api.IBusinessService.Settings.PlatformSpecs;
|
|
using ARW.Model.Models.Business.Settings.PlatformSpecs;
|
|
using ARW.Model.Vo.Api.Settings.PlatformSpecs;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Geocoding;
|
|
|
|
namespace ARW.WebApi.Controllers.Api.Settings.PlatformSpecs
|
|
{
|
|
/// <summary>
|
|
/// 平台资质与规范控制器Api
|
|
///
|
|
/// @author lwh
|
|
/// @date 2023-10-22
|
|
/// </summary>
|
|
//[Verify]
|
|
[Route("api/[controller]")]
|
|
public class PlatformSpecApiController : BaseController
|
|
{
|
|
private readonly IPlatformSpecServiceApi _PlatformSpecServiceApi;
|
|
|
|
/// <summary>
|
|
/// 依赖注入
|
|
/// </summary>
|
|
/// <param name="PlatformSpecServiceApi">平台资质与规范平台资质与规范Api服务</param>
|
|
public PlatformSpecApiController(IPlatformSpecServiceApi PlatformSpecServiceApi)
|
|
{
|
|
_PlatformSpecServiceApi = PlatformSpecServiceApi;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 获取平台资质与规范列表(Api)
|
|
/// </summary>
|
|
/// <param name="parm">查询参数</param>
|
|
/// <returns></returns>
|
|
[HttpGet("getPlatformSpecList")]
|
|
public async Task<IActionResult> GetPlatformSpecListApi([FromQuery] PlatformSpecQueryDtoApi parm)
|
|
{
|
|
var res = await _PlatformSpecServiceApi.GetPlatformSpecListApi(parm);
|
|
return SUCCESS(res);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取PlatformSpec详情(Api)
|
|
/// </summary>
|
|
/// <param name="parm">查询参数</param>
|
|
/// <returns></returns>
|
|
[HttpGet("getPlatformSpecDetails")]
|
|
public async Task<IActionResult> GetPlatformSpecDetails([FromQuery] PlatformSpecDtoApi parm)
|
|
{
|
|
//if (parm == null) throw new CustomException("参数错误!");
|
|
|
|
var res = await _PlatformSpecServiceApi.GetPlatformSpecDetails(parm);
|
|
|
|
if (res != "[]")
|
|
{
|
|
res = res.Remove(0, 1);
|
|
res = res.Substring(0, res.Length - 1);
|
|
var data = res.FromJSON<PlatformSpecApiDetailsVo>();
|
|
return SUCCESS(data);
|
|
}
|
|
else
|
|
{
|
|
return SUCCESS(res);
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|