102 lines
3.5 KiB
C#
102 lines
3.5 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
||
using DOAN.Model.huate_group.MasterDataManagement.Dto;
|
||
using DOAN.Model.huate_group.MasterDataManagement;
|
||
using DOAN.Service.huate_group.MasterDataManagement.IService;
|
||
using DOAN.Admin.WebApi.Filters;
|
||
|
||
//创建时间:2024-08-19
|
||
namespace DOAN.Admin.WebApi.Controllers.huate_group.MasterDataManagement
|
||
{
|
||
/// <summary>
|
||
/// 参数配置
|
||
/// </summary>
|
||
[Verify]
|
||
[Route("huate_group/MasterDataManagement/BaseParameterConfig")]
|
||
public class BaseParameterConfigController : BaseController
|
||
{
|
||
/// <summary>
|
||
/// 参数配置接口
|
||
/// </summary>
|
||
private readonly IBaseParameterConfigService _BaseParameterConfigService;
|
||
|
||
public BaseParameterConfigController(IBaseParameterConfigService BaseParameterConfigService)
|
||
{
|
||
_BaseParameterConfigService = BaseParameterConfigService;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 查询参数配置列表
|
||
/// </summary>
|
||
/// <param name="parm"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("list")]
|
||
[ActionPermissionFilter(Permission = "baseparameterconfig:list")]
|
||
public IActionResult QueryBaseParameterConfig([FromQuery] BaseParameterConfigQueryDto parm)
|
||
{
|
||
var response = _BaseParameterConfigService.GetList(parm);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
|
||
/// <summary>
|
||
/// 查询参数配置详情
|
||
/// </summary>
|
||
/// <param name="Id"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("{Id}")]
|
||
[ActionPermissionFilter(Permission = "baseparameterconfig:query")]
|
||
public IActionResult GetBaseParameterConfig(int Id)
|
||
{
|
||
var response = _BaseParameterConfigService.GetInfo(Id);
|
||
|
||
var info = response.Adapt<BaseParameterConfigDto>();
|
||
return SUCCESS(info);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 添加参数配置
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost]
|
||
[ActionPermissionFilter(Permission = "baseparameterconfig:add")]
|
||
[Log(Title = "参数配置", BusinessType = BusinessType.INSERT)]
|
||
public IActionResult AddBaseParameterConfig([FromBody] BaseParameterConfigDto parm)
|
||
{
|
||
var modal = parm.Adapt<BaseParameterConfig>().ToCreate(HttpContext);
|
||
|
||
var response = _BaseParameterConfigService.AddBaseParameterConfig(modal);
|
||
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 更新参数配置
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPut]
|
||
[ActionPermissionFilter(Permission = "baseparameterconfig:edit")]
|
||
[Log(Title = "参数配置", BusinessType = BusinessType.UPDATE)]
|
||
public IActionResult UpdateBaseParameterConfig([FromBody] BaseParameterConfigDto parm)
|
||
{
|
||
var modal = parm.Adapt<BaseParameterConfig>().ToUpdate(HttpContext);
|
||
var response = _BaseParameterConfigService.UpdateBaseParameterConfig(modal);
|
||
|
||
return ToResponse(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 删除参数配置
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost("delete/{ids}")]
|
||
[ActionPermissionFilter(Permission = "baseparameterconfig:delete")]
|
||
[Log(Title = "参数配置", BusinessType = BusinessType.DELETE)]
|
||
public IActionResult DeleteBaseParameterConfig([FromRoute]string ids)
|
||
{
|
||
var idArr = Tools.SplitAndConvert<int>(ids);
|
||
|
||
return ToResponse(_BaseParameterConfigService.Delete(idArr));
|
||
}
|
||
|
||
}
|
||
} |