67 lines
1.5 KiB
C#
67 lines
1.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
using Infrastructure;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using OpenAuth.App;
|
|
using OpenAuth.App.Request;
|
|
using OpenAuth.App.Response;
|
|
using OpenAuth.Repository.Domain;
|
|
|
|
namespace OpenAuth.WebApi.Controllers
|
|
{
|
|
/// <summary>
|
|
/// 农机
|
|
/// </summary>
|
|
[Route("api/[controller]/[action]")]
|
|
[ApiController]
|
|
public class IdleNongjiController : ControllerBase
|
|
{
|
|
private readonly IdleNongjiApp _app;
|
|
public IdleNongjiController(IdleNongjiApp app)
|
|
{
|
|
_app = app;
|
|
}
|
|
|
|
#region 查询
|
|
|
|
#region 分页
|
|
/// <summary>
|
|
/// 分页
|
|
/// </summary>
|
|
[HttpGet]
|
|
public async Task<Response<PageInfo<List<IdleNongji>>>> LoadPage([FromQuery] PageReq request)
|
|
{
|
|
return await _app.LoadPage(request);
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 详情
|
|
/// </summary>
|
|
/// <param name="id"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
public async Task<Response<IdleNongji>> Detail(string id)
|
|
{
|
|
var result = new Response<IdleNongji>();
|
|
try
|
|
{
|
|
result.Result = await _app.Detail(id);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
result.Code = 500;
|
|
result.Message = ex.InnerException?.Message ?? ex.Message;
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
}
|
|
} |