You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
2.5 KiB

6 months ago
using Entity.Base;
6 months ago
using Entity.DbModel.System.SysBaseObject;
using Entity.Dto.Req;
using Microsoft.AspNetCore.Mvc;
6 months ago
using Service.Init;
6 months ago
using Service.System;
namespace WebStarter.Controllers.System
{
[Produces("application/json")]
[ApiController]
public class SysConfigController
{
private readonly SysConfigService _sysConfigService;
public SysConfigController(SysConfigService sysConfigService)
{
_sysConfigService = sysConfigService;
}
[HttpPost]
[Route("/api/sysConfig/page")]
public async Task<SqlSugarPagedList<SysConfig>> Page(PageConfigReq input)
{
return await _sysConfigService.Page(input);
}
[HttpGet]
[Route("/api/sysConfig/list")]
public async Task<List<SysConfig>> GetList()
{
return await _sysConfigService.GetList();
}
[HttpGet]
[Route("/api/sysConfig/detail")]
public async Task<SysConfig> GetDetail([FromQuery] ConfigReq input)
{
return await _sysConfigService.GetDetail(input);
}
[HttpGet]
[Route("/api/sysConfig/groupList")]
public async Task<List<string>> GetGroupList()
{
return await _sysConfigService.GetGroupList();
}
[HttpPost]
[Route("/api/sysConfig/add")]
public async Task Add(AddConfigReq input)
{
await _sysConfigService.AddConfig(input);
}
[HttpPost]
[Route("/api/sysConfig/update")]
public async Task Update(UpdateConfigReq input)
{
await _sysConfigService.UpdateConfig(input);
}
[HttpPost]
[Route("/api/sysConfig/delete")]
public async Task Delete(DeleteConfigReq input)
{
await _sysConfigService.DeleteConfig(input);
}
[HttpPost]
[Route("/api/sysConfig/batchDelete")]
public async Task BatchDelete(List<long> input)
{
await _sysConfigService.BatchDeleteConfig(input);
}
6 months ago
[HttpGet]
[Route("/api/sysConfig/GetStationNo")]
public string GetStationNo()
{
return StaticStationInfo.StationName;
}
[HttpGet]
[Route("/api/sysConfig/SetStationNo/{stationNo}")]
public bool SetStationNo(string stationNo)
{
StaticStationInfo.StationName = stationNo;
return true;
}
6 months ago
}
}