101 lines
2.8 KiB
C#
101 lines
2.8 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/Test2")]
|
||
[AllowAnonymous]
|
||
public class Test2Controller : BaseController
|
||
{
|
||
/// <summary>
|
||
/// 接口
|
||
/// </summary>
|
||
private readonly ITest2Service _Test2Service;
|
||
|
||
public Test2Controller(ITest2Service Test2Service)
|
||
{
|
||
_Test2Service = Test2Service;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 查询列表
|
||
/// </summary>
|
||
/// <param name="parm"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("list")]
|
||
[ActionPermissionFilter(Permission = "test2:list")]
|
||
public IActionResult QueryTest2([FromQuery] Test2QueryDto parm)
|
||
{
|
||
var response = _Test2Service.GetList(parm);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
|
||
/// <summary>
|
||
/// 查询详情
|
||
/// </summary>
|
||
/// <param name="Id"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("{Id}")]
|
||
[ActionPermissionFilter(Permission = "test2:query")]
|
||
public IActionResult GetTest2(long Id)
|
||
{
|
||
var response = _Test2Service.GetInfo(Id);
|
||
|
||
var info = response.Adapt<Test2Dto>();
|
||
return SUCCESS(info);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 添加
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost]
|
||
[ActionPermissionFilter(Permission = "test2:add")]
|
||
[Log(Title = "", BusinessType = BusinessType.INSERT)]
|
||
public IActionResult AddTest2([FromBody] Test2Dto parm)
|
||
{
|
||
var modal = parm.Adapt<Test2>().ToCreate(HttpContext);
|
||
|
||
var response = _Test2Service.AddTest2(modal);
|
||
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 更新
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPut]
|
||
[ActionPermissionFilter(Permission = "test2:edit")]
|
||
[Log(Title = "", BusinessType = BusinessType.UPDATE)]
|
||
public IActionResult UpdateTest2([FromBody] Test2Dto parm)
|
||
{
|
||
var modal = parm.Adapt<Test2>().ToUpdate(HttpContext);
|
||
var response = _Test2Service.UpdateTest2(modal);
|
||
|
||
return ToResponse(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 删除
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost("delete/{ids}")]
|
||
[ActionPermissionFilter(Permission = "test2:delete")]
|
||
[Log(Title = "", BusinessType = BusinessType.DELETE)]
|
||
public IActionResult DeleteTest2([FromRoute]string ids)
|
||
{
|
||
var idArr = Tools.SplitAndConvert<long>(ids);
|
||
|
||
return ToResponse(_Test2Service.Delete(idArr));
|
||
}
|
||
|
||
}
|
||
} |