100 lines
3.1 KiB
C#
100 lines
3.1 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
||
using ZR.Model.Business.Dto;
|
||
using ZR.Model.Business;
|
||
using ZR.Service.Business.IBusinessService;
|
||
|
||
//创建时间:2025-08-18
|
||
namespace ZR.Admin.WebApi.Controllers.Business
|
||
{
|
||
/// <summary>
|
||
/// 工作人员记录
|
||
/// </summary>
|
||
[Route("business/CamWorker")]
|
||
public class CamWorkerController : BaseController
|
||
{
|
||
/// <summary>
|
||
/// 工作人员记录接口
|
||
/// </summary>
|
||
private readonly ICamWorkerService _CamWorkerService;
|
||
|
||
public CamWorkerController(ICamWorkerService CamWorkerService)
|
||
{
|
||
_CamWorkerService = CamWorkerService;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 查询工作人员记录列表
|
||
/// </summary>
|
||
/// <param name="parm"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("list")]
|
||
[ActionPermissionFilter(Permission = "camworker:list")]
|
||
public IActionResult QueryCamWorker([FromQuery] CamWorkerQueryDto parm)
|
||
{
|
||
var response = _CamWorkerService.GetList(parm);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
|
||
/// <summary>
|
||
/// 查询工作人员记录详情
|
||
/// </summary>
|
||
/// <param name="Id"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("{Id}")]
|
||
[ActionPermissionFilter(Permission = "camworker:query")]
|
||
public IActionResult GetCamWorker(long Id)
|
||
{
|
||
var response = _CamWorkerService.GetInfo(Id);
|
||
|
||
var info = response.Adapt<CamWorkerDto>();
|
||
return SUCCESS(info);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 添加工作人员记录
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost]
|
||
[ActionPermissionFilter(Permission = "camworker:add")]
|
||
[Log(Title = "工作人员记录", BusinessType = BusinessType.INSERT)]
|
||
public IActionResult AddCamWorker([FromBody] CamWorkerDto parm)
|
||
{
|
||
var modal = parm.Adapt<CamWorker>().ToCreate(HttpContext);
|
||
|
||
var response = _CamWorkerService.AddCamWorker(modal);
|
||
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 更新工作人员记录
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPut]
|
||
[ActionPermissionFilter(Permission = "camworker:edit")]
|
||
[Log(Title = "工作人员记录", BusinessType = BusinessType.UPDATE)]
|
||
public IActionResult UpdateCamWorker([FromBody] CamWorkerDto parm)
|
||
{
|
||
var modal = parm.Adapt<CamWorker>().ToUpdate(HttpContext);
|
||
var response = _CamWorkerService.UpdateCamWorker(modal);
|
||
|
||
return ToResponse(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 删除工作人员记录
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost("delete/{ids}")]
|
||
[ActionPermissionFilter(Permission = "camworker:delete")]
|
||
[Log(Title = "工作人员记录", BusinessType = BusinessType.DELETE)]
|
||
public IActionResult DeleteCamWorker([FromRoute]string ids)
|
||
{
|
||
var idArr = Tools.SplitAndConvert<long>(ids);
|
||
|
||
return ToResponse(_CamWorkerService.Delete(idArr));
|
||
}
|
||
|
||
}
|
||
} |