12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- using System.Collections.Generic;
- using System.Threading.Tasks;
- using GxPress.Common.Page;
- using GxPress.Repository.Interface.SpecialLabel;
- using GxPress.Request.SpecialLabel;
- using Microsoft.AspNetCore.Authorization;
- using Microsoft.AspNetCore.Mvc;
- namespace GxPress.Api.AdminControllers
- {
-
-
-
- [Route("api/admin/special-label")]
- [ApiController]
- [Authorize]
- public class AdminSpecialLabelController : Controller
- {
- private readonly ISpecialLabelRepository specialLabelRepository;
- public AdminSpecialLabelController(ISpecialLabelRepository specialLabelRepository)
- {
- this.specialLabelRepository = specialLabelRepository;
- }
-
-
-
-
-
- [HttpPost]
- public async Task<bool> InsertAsync(Entity.SystemLabel.SpecialLabel model)
- {
- return await specialLabelRepository.InsertAsync(model) > 0;
- }
-
-
-
-
-
- [HttpPut]
- public async Task<bool> UpdateAsync(Entity.SystemLabel.SpecialLabel model)
- {
- return await specialLabelRepository.UpdateAsync(model);
- }
-
-
-
-
-
- [HttpGet("{id}")]
- public async Task<Entity.SystemLabel.SpecialLabel> GetAsync(int id)
- {
- return await specialLabelRepository.GetAsync(id);
- }
-
-
-
-
-
- [HttpDelete("{id}")]
- public async Task<bool> DeleteAsync(int id)
- {
- return await specialLabelRepository.DeleteAsync(id);
- }
-
-
-
-
-
- [HttpGet("list/{typeValue}")]
- public async Task<IEnumerable<Entity.SystemLabel.SpecialLabel>> GetAllAsync(int typeValue)
- {
- return await specialLabelRepository.GetAllAsync(typeValue);
- }
-
-
-
-
-
- [HttpPost("list")]
- public async Task<PagedList<Entity.SystemLabel.SpecialLabel>> GetAllAsync(SpecialLabelSearchRequest request)
- {
- return await specialLabelRepository.GetAllAsync(request);
- }
- }
- }
|