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