|
|
|
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> _baseRep;
|
|
|
|
|
|
|
|
public CmMarkGroupService(SqlSugarRepository<CmMarkGroup> baseRep)
|
|
|
|
{
|
|
|
|
_baseRep = baseRep;
|
|
|
|
}
|
|
|
|
|
|
|
|
[HttpPost]
|
|
|
|
public async Task<bool> Add([FromForm] CmMarkGroup entity)
|
|
|
|
{
|
|
|
|
return await _baseRep.InsertAsync(entity);
|
|
|
|
}
|
|
|
|
|
|
|
|
[HttpPost]
|
|
|
|
public async Task<bool> Update([FromForm] CmMarkGroup entity)
|
|
|
|
{
|
|
|
|
return await _baseRep.UpdateAsync(entity);
|
|
|
|
}
|
|
|
|
|
|
|
|
[HttpPost]
|
|
|
|
public async Task<bool> Delete([FromForm] CmMarkGroup entity)
|
|
|
|
{
|
|
|
|
return await _baseRep.DeleteAsync(entity);
|
|
|
|
}
|
|
|
|
|
|
|
|
[HttpGet]
|
|
|
|
public async Task<CmMarkGroup> Get(long id)
|
|
|
|
{
|
|
|
|
CmMarkGroup entity = await _baseRep.GetByIdAsync(id);
|
|
|
|
return entity;
|
|
|
|
}
|
|
|
|
|
|
|
|
[HttpGet]
|
|
|
|
public async Task<List<CmMarkGroup>> GetList(string queryJson)
|
|
|
|
{
|
|
|
|
JObject queryObj = queryJson.ToJObject();
|
|
|
|
List<CmMarkGroup> list = await _baseRep.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 _baseRep.AsQueryable()
|
|
|
|
.ToPageListAsync(pageObj.Index, pageObj.Size);
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
}
|