123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- 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
- {
- /// <summary>
- /// AppVersion)Controller
- /// </summary>
- // [Route("AppVersion")]
- // [ApiExplorerSettings(GroupName = "AppVersion")]
- public class AppVersionController : BaseController
- {
- /// <summary>
- /// api分组接口
- /// </summary>
- private readonly IAppVersionService _AppVersionService;
- public AppVersionController(IAppVersionService AppVersionService)
- {
- _AppVersionService = AppVersionService;
- }
- /// <summary>
- /// app版本管理列表
- /// </summary>
- /// <param name="parm">请求参数</param>
- /// <returns>app版本管理列表</returns>
- [HttpGet]
- [Route("/v1/api/AppVersion/list")]
- public IActionResult List([FromQuery] AppVersionListDto parm)
- {
- var response = _AppVersionService.List(parm);
- return SUCCESS(response);
- }
- /// <summary>
- /// app版本管理详情
- /// </summary>
- /// <param name="parm">请求参数</param>
- /// <returns>app版本管理详情</returns>
- [HttpGet]
- [Route("/v1/api/AppVersion/query")]
- public IActionResult Query([FromQuery] AppVersionQueryDto parm)
- {
- var response = _AppVersionService.Queryable()
- .First(x => x.id == parm.id)
- .Adapt<AppVersionQueryVo>() ?? new AppVersionQueryVo();
- return SUCCESS(response);
- }
- /// <summary>
- /// app版本管理添加
- /// </summary>
- /// <param name="parm">请求参数</param>
- /// <returns>app版本管理添加</returns>
- [HttpPost]
- [Route("/v1/api/AppVersion/add")]
- public IActionResult Add([FromBody] AppVersionAddDto parm)
- {
- var modal = parm.Adapt<AppVersion>().ToCreate(HttpContext);
- var response = _AppVersionService.Add(modal);
- return SUCCESS(response);
- }
- /// <summary>
- /// app版本管理修改
- /// </summary>
- /// <param name="parm">请求参数</param>
- /// <returns>app版本管理修改</returns>
- [HttpPut]
- [Route("/v1/api/AppVersion/update")]
- public IActionResult Update([FromBody] AppVersionUpdateDto parm)
- {
- var modal = parm.Adapt<AppVersion>().ToUpdate(HttpContext);
- var response = _AppVersionService.Update(modal, true);
- return SUCCESS(response);
- }
- /// <summary>
- /// app版本管理删除
- /// </summary>
- /// <param name="Id">ID</param>
- /// <returns>app版本管理删除</returns>
- [HttpDelete]
- [Route("/v1/api/AppVersion/delete/{id}")]
- public IActionResult Delete(int id)
- {
- var response = _AppVersionService.Delete(id);
- return SUCCESS(response);
- }
- }
- }
|