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