using Newtonsoft.Json.Linq; namespace Cis.Application.Cm; /// /// 标记标签服务 /// [ApiDescriptionSettings(CmInfo.GroupName, Order = CmInfo.GroupOrder)] public class CmMarkLabelService : IDynamicApiController, ITransient { private readonly SqlSugarRepository _cmMarkLabelRep; public CmMarkLabelService(SqlSugarRepository cmMarkLabelRep) { _cmMarkLabelRep = cmMarkLabelRep; } [HttpPost] public async Task Add(CmMarkLabel entity) { await _cmMarkLabelRep.InsertAsync(entity); } [HttpPost] public async Task Update(CmMarkLabel entity) { await _cmMarkLabelRep.UpdateAsync(entity); } [HttpPost] public async Task Delete(CmMarkLabel entity) { await _cmMarkLabelRep.DeleteAsync(entity); } [HttpGet] public async Task Get(long id) { CmMarkLabel entity = await _cmMarkLabelRep.GetByIdAsync(id); return entity; } [HttpGet] public async Task> GetList(string queryJson = "") { JObject queryObj = queryJson.ToJObject(); List list = await _cmMarkLabelRep.AsQueryable() .ToListAsync(); return list; } [HttpGet] public async Task> GetPageList(string queryJson, string pagination) { Pagination pageObj = pagination.ToObject(); JObject queryObj = queryJson.ToJObject(); List list = await _cmMarkLabelRep.AsQueryable() .ToPageListAsync(pageObj.Index, pageObj.Size); return list; } }