112 lines
3.2 KiB
C#
112 lines
3.2 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
||
using RIZO.Model.YALITEST.Dto;
|
||
using RIZO.Model.YALITEST;
|
||
using RIZO.Service.YALITEST.IService;
|
||
|
||
//创建时间:2026-01-09
|
||
namespace RIZO.Admin.WebApi.Controllers.YALITEST
|
||
{
|
||
/// <summary>
|
||
///
|
||
/// </summary>
|
||
[Route("YALITEST/Test1")]
|
||
[AllowAnonymous]
|
||
public class Test1Controller : BaseController
|
||
{
|
||
/// <summary>
|
||
/// 接口
|
||
/// </summary>
|
||
private readonly ITest1Service _Test1Service;
|
||
|
||
public Test1Controller(ITest1Service Test1Service)
|
||
{
|
||
_Test1Service = Test1Service;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 查询列表
|
||
/// </summary>
|
||
/// <param name="parm"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("list")]
|
||
[ActionPermissionFilter(Permission = "test1:list")]
|
||
public IActionResult QueryTest1([FromQuery] Test1QueryDto parm)
|
||
{
|
||
var response = _Test1Service.GetList(parm);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
|
||
/// <summary>
|
||
/// 查询详情
|
||
/// </summary>
|
||
/// <param name="Id"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("{Id}")]
|
||
[ActionPermissionFilter(Permission = "test1:query")]
|
||
public IActionResult GetTest1(long Id)
|
||
{
|
||
var response = _Test1Service.GetInfo(Id);
|
||
|
||
var info = response.Adapt<Test1Dto>();
|
||
return SUCCESS(info);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 添加
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost]
|
||
[ActionPermissionFilter(Permission = "test1:add")]
|
||
[Log(Title = "", BusinessType = BusinessType.INSERT)]
|
||
public IActionResult AddTest1([FromBody] Test1Dto parm)
|
||
{
|
||
var modal = parm.Adapt<Test1>().ToCreate(HttpContext);
|
||
|
||
var response = _Test1Service.AddTest1(modal);
|
||
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 更新
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPut]
|
||
[ActionPermissionFilter(Permission = "test1:edit")]
|
||
[Log(Title = "", BusinessType = BusinessType.UPDATE)]
|
||
public IActionResult UpdateTest1([FromBody] Test1Dto parm)
|
||
{
|
||
var modal = parm.Adapt<Test1>().ToUpdate(HttpContext);
|
||
var response = _Test1Service.UpdateTest1(modal);
|
||
|
||
return ToResponse(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 删除
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost("delete/{ids}")]
|
||
[ActionPermissionFilter(Permission = "test1:delete")]
|
||
[Log(Title = "", BusinessType = BusinessType.DELETE)]
|
||
public IActionResult DeleteTest1([FromRoute]string ids)
|
||
{
|
||
var idArr = Tools.SplitAndConvert<long>(ids);
|
||
|
||
return ToResponse(_Test1Service.Delete(idArr));
|
||
}
|
||
|
||
[HttpPost("createTest1")]
|
||
[ActionPermissionFilter(Permission = "test1:add")]
|
||
[Log(Title = "", BusinessType = BusinessType.INSERT)]
|
||
public ApiResult CreateTest1([FromBody] Test1Dto parm)
|
||
{
|
||
var modal = parm.Adapt<Test1>().ToCreate(HttpContext);
|
||
|
||
var response = _Test1Service.CreateTest1(modal);
|
||
|
||
return response;
|
||
}
|
||
}
|
||
} |