using Attribute; using Common; using Dto; using Vo; using Enums; using Filters; using Infrastructure; using Infrastructure.Model; using Mapster; using Microsoft.AspNetCore.Mvc; using Middleware; using Model; using Services; using Model.Base; namespace Controllers { /// /// PageUpdateInfo)Controller /// // [Route("PageUpdateInfo")] // [ApiExplorerSettings(GroupName = "PageUpdateInfo")] public class PageUpdateInfoController : BaseController { /// /// api分组接口 /// private readonly IPageUpdateInfoService _PageUpdateInfoService; public PageUpdateInfoController(IPageUpdateInfoService PageUpdateInfoService) { _PageUpdateInfoService = PageUpdateInfoService; } /// /// 页面模板更新信息列表 /// /// 请求参数 /// 页面模板更新信息列表 [HttpGet] [Route("/v1/api/PageUpdateInfo/list")] public IActionResult List([FromQuery] PageUpdateInfoListDto parm) { var response = _PageUpdateInfoService.List(parm); return SUCCESS(response); } /// /// 页面模板更新信息详情 /// /// 请求参数 /// 页面模板更新信息详情 [HttpGet] [Route("/v1/api/PageUpdateInfo/query")] public IActionResult Query([FromQuery] PageUpdateInfoQueryDto parm) { var response = _PageUpdateInfoService.Queryable() .First(x => x.id == parm.id) .Adapt() ?? new PageUpdateInfoQueryVo(); return SUCCESS(response); } /// /// 页面模板更新信息添加 /// /// 请求参数 /// 页面模板更新信息添加 [HttpPost] [Route("/v1/api/PageUpdateInfo/add")] public IActionResult Add([FromBody] PageUpdateInfoAddDto parm) { var modal = parm.Adapt().ToCreate(HttpContext); var response = _PageUpdateInfoService.Add(modal); return SUCCESS(response); } /// /// 页面模板更新信息修改 /// /// 请求参数 /// 页面模板更新信息修改 [HttpPut] [Route("/v1/api/PageUpdateInfo/update")] public IActionResult Update([FromBody] PageUpdateInfoUpdateDto parm) { var modal = parm.Adapt().ToUpdate(HttpContext); var response = _PageUpdateInfoService.Update(modal, true); return SUCCESS(response); } /// /// 页面模板更新信息删除 /// /// ID /// 页面模板更新信息删除 [HttpDelete] [Route("/v1/api/PageUpdateInfo/delete/{id}")] public IActionResult Delete(int id) { var response = _PageUpdateInfoService.Delete(id); return SUCCESS(response); } /// /// 页面模板更新信息刷新文件 /// /// 请求参数 /// 页面模板更新信息刷新文件 [HttpGet] [Route("/v1/api/PageUpdateInfo/updateTemplate")] public IActionResult UpdateTemplate([FromQuery] PageUpdateInfoUpdateTemplateDto parm) { _PageUpdateInfoService.UpdateTemplate(parm); return SUCCESS("ok"); } /// /// 页面模板更新信息更新版本号码 /// /// 请求参数 /// 页面模板更新信息更新版本号码 [HttpPut] [Route("/v1/api/PageUpdateInfo/upVersion")] public IActionResult UpVersion([FromBody] PageUpdateInfoUpVersionDto parm) { var modal = _PageUpdateInfoService.GetFirst(m => m.id == parm.id); modal.moduleVersion += 1; var response = _PageUpdateInfoService.Update(modal, true); return SUCCESS(response); } } }