Infrastructure/OpenAuth.WebApi/Controllers/ServiceControllers/IdleLandController.cs

74 lines
1.9 KiB
C#
Raw Normal View History

2025-04-17 14:44:33 +08:00
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using OpenAuth.App.Request;
using OpenAuth.App;
using Infrastructure;
2025-04-18 13:23:18 +08:00
using OpenAuth.Repository.Domain;
2025-04-17 14:44:33 +08:00
namespace OpenAuth.WebApi.Controllers
{
2025-04-18 13:23:18 +08:00
/// <summary>
/// 土地
/// </summary>
2025-04-17 14:44:33 +08:00
[Route("api/[controller]/[action]")]
[ApiController]
public class IdleLandController : ControllerBase
{
private IdleLandApp app;
public IdleLandController(IdleLandApp _app)
{
app = _app;
}
2025-04-18 13:23:18 +08:00
#region 分页
/// <summary>
/// 分页
/// </summary>
[HttpGet]
public async Task<Response<PageInfo<List<IdleLand>>>> LoadPage([FromQuery] PageReq request)
{
return await app.LoadPage(request);
}
2025-04-21 10:06:34 +08:00
/// <summary>
/// 详情
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpGet]
public async Task<Response<IdleLand>> Detail(string id)
{
var result = new Response<IdleLand>();
try
{
result.Result = await app.Detail(id);
}
catch (Exception ex)
{
result.Code = 500;
result.Message = ex.InnerException?.Message ?? ex.Message;
}
return result;
}
2025-04-18 13:23:18 +08:00
#endregion
2025-04-17 14:44:33 +08:00
/// <summary>
/// 查图层
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpGet]
[AllowAnonymous]
public IActionResult QueryVectorTileByTable([FromQuery] QueryVectorTileByTableReq req)
{
var model = req.MapTo<VectorTileSearchModel>();
var result = app.VectorTile(model);
return File(result, "application/octet-stream");
}
}
}