using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Yi.Framework.Common.Models; using Yi.Framework.Interface; using Yi.Framework.Model.Models; namespace Yi.Framework.ApiMicroservice.Controllers { [Route("api/[controller]/[action]")] [ApiController] [Authorize] public class MouldController : ControllerBase { private IMouldService _mouldService; public MouldController(IMouldService mouldService) { _mouldService = mouldService; } [HttpGet] public async Task GetMould() { return Result.Success().SetData(await _mouldService.GetAllEntitiesTrueAsync()); } /// /// 更 /// /// /// [HttpPut] public async Task UpdateMould(mould _mould) { await _mouldService.UpdateAsync(_mould); return Result.Success(); } /// /// 删 /// /// /// [HttpDelete] public async Task DelListMould(List _ids) { await _mouldService.DelListByUpdateAsync(_ids); return Result.Success(); } /// /// 增 /// /// /// [HttpPost] public async Task AddMould(mould _mould) { await _mouldService.AddAsync(_mould); return Result.Success(); } } }