using Vo; using Microsoft.AspNetCore.Mvc; using Model; using Services; using Model.Base; using Vo.Admin; using Mapster; using Infrastructure; namespace Controllers.Admin { /// /// BackgroundProjectMenu)Controller /// // [Route("${Router}$")] // [ApiExplorerSettings(GroupName = "BackgroundProjectMenu")] public class BackgroundProjectMenuController : BaseController { /// /// api分组接口 /// private readonly IBackgroundProjectMenuService _BackgroundProjectMenuService; public BackgroundProjectMenuController(IBackgroundProjectMenuService BackgroundProjectMenuService) { _BackgroundProjectMenuService = BackgroundProjectMenuService; } /// 分页参数 /// /// 列表 /// /// 分页对象 /// 参数请求体 /// 列表 [HttpGet] [Route("/v1/omega_source/BackgroundProjectMenu/getBackgroundProjectMenuList")] public IActionResult getBackgroundProjectMenuList([FromQuery] PagerInfo page, [FromQuery] BackgroundProjectMenu param) { var response = _BackgroundProjectMenuService.getBackgroundProjectMenuList(page, param); return SUCCESS(response); } /// /// 详情 /// /// 参数请求体 /// 详情 [HttpGet] [Route("/v1/omega_source/BackgroundProjectMenu/getBackgroundProjectMenuQuery")] public IActionResult getBackgroundProjectMenuQuery([FromQuery] BackgroundProjectMenu param) { var response = _BackgroundProjectMenuService.GetFirst(m => m.id == param.id).Adapt(); return SUCCESS(response); } /// /// 添加 /// /// 参数请求体 /// 添加 [HttpPost] [Route("/v1/omega_source/BackgroundProjectMenu/addBackgroundProjectMenu")] public IActionResult addBackgroundProjectMenu([FromBody] BackgroundProjectMenu param) { var modal = param.Adapt().ToCreate(HttpContext); var response = _BackgroundProjectMenuService.InsertReturnIdentity(modal); return SUCCESS(response); } /// /// 修改 /// /// 参数请求体 /// 修改 [HttpPut] [Route("/v1/omega_source/BackgroundProjectMenu/updateBackgroundProjectMenu")] public IActionResult updateBackgroundProjectMenu([FromBody] BackgroundProjectMenu param) { var modal = param.Adapt().ToCreate(HttpContext); var response = _BackgroundProjectMenuService.Update(modal, true); return SUCCESS(response); } /// /// 删除 /// /// ID /// 删除 [HttpDelete] [Route("/v1/omega_source/BackgroundProjectMenu/deleteBackgroundProjectMenu/{id}")] public IActionResult deleteBackgroundProjectMenu(int id) { var response = _BackgroundProjectMenuService.Delete(id); return SUCCESS(response); } } }