Camera Information System
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.4 KiB

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;
}
public async Task<CmMarkLabel> Get(long id)
{
CmMarkLabel entity = await _cmMarkLabelRep.GetByIdAsync(id);
return entity;
}
public async Task<List<CmMarkLabel>> GetList(string queryJson = "")
{
JObject queryObj = queryJson.ToJObject();
List<CmMarkLabel> list = await _cmMarkLabelRep.AsQueryable()
.ToListAsync();
return list;
}
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;
}
public async Task Add(CmMarkLabel entity)
{
await _cmMarkLabelRep.InsertAsync(entity);
}
public async Task Update(CmMarkLabel entity)
{
await _cmMarkLabelRep.UpdateAsync(entity);
}
public async Task Delete(CmMarkLabel entity)
{
await _cmMarkLabelRep.DeleteAsync(entity);
}
}