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.
 
 
 
 

61 lines
1.4 KiB

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