94 lines
2.5 KiB
C#
94 lines
2.5 KiB
C#
using Dlhis.Basic.Map.Request;
|
|
using Dlhis.Basic.Map.Response;
|
|
using Dlhis.Basic.Map.Services;
|
|
using Kurisu.AspNetCore.DataAccess.Dto;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace Dlhis.Basic.Map.Controllers;
|
|
|
|
/// <summary>
|
|
/// 点位图
|
|
/// </summary>
|
|
[Authorize]
|
|
[Route("api/[controller]")]
|
|
[ApiController]
|
|
public class PointMapsController : ControllerBase
|
|
{
|
|
private readonly IPointMapService _pointMapService;
|
|
private readonly IPointMapDetailService _pointMapDetailService;
|
|
|
|
public PointMapsController(IPointMapService pointMapService,
|
|
IPointMapDetailService pointMapDetailService)
|
|
{
|
|
_pointMapService = pointMapService;
|
|
_pointMapDetailService = pointMapDetailService;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 点位图分页
|
|
/// </summary>
|
|
/// <param name="request"></param>
|
|
/// <returns></returns>
|
|
[HttpGet("page")]
|
|
public async Task<Pagination<PointMapResponse>> GetPointMapPageAsync([FromQuery] PageDto request)
|
|
{
|
|
return await _pointMapService.GetPageAsync(request);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 保存点位图
|
|
/// </summary>
|
|
/// <param name="request"></param>
|
|
/// <returns></returns>
|
|
[HttpPost("save")]
|
|
public async Task SavePointMapAsync(SavePointMapRequest request)
|
|
{
|
|
await _pointMapService.SaveAsync(request);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 删除点位图
|
|
/// </summary>
|
|
/// <param name="id"></param>
|
|
/// <returns></returns>
|
|
[HttpDelete("{id}")]
|
|
public async Task DeletePointMapAsync(long id)
|
|
{
|
|
await _pointMapService.DeleteAsync(id);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 点位数据明细保存
|
|
/// </summary>
|
|
/// <param name="request"></param>
|
|
/// <returns></returns>
|
|
[HttpPost("detail/save")]
|
|
public async Task SaveDetailAsync(SavePointMapDetailRequest request)
|
|
{
|
|
await _pointMapDetailService.SaveAsync(request);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 点位数据明细
|
|
/// </summary>
|
|
/// <param name="pointMapCode"></param>
|
|
/// <returns></returns>
|
|
[HttpGet("detail/list")]
|
|
public async Task<List<PointMapDetailResponse>> GetDetailListByPointMapCodeAsync([FromQuery] Guid pointMapCode)
|
|
{
|
|
return await _pointMapDetailService.GetListByPointMapCodeAsync(pointMapCode);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 删除点位数据明细
|
|
/// </summary>
|
|
/// <param name="id"></param>
|
|
/// <returns></returns>
|
|
[HttpDelete("detail/{id}")]
|
|
public async Task DeleteDetailAsync(long id)
|
|
{
|
|
await _pointMapDetailService.DeleteAsync(id);
|
|
}
|
|
}
|