using Attribute;
using Dto;
using Vo;
using Model;
using Model.Base;
using Repository;
using Service;
using Microsoft.AspNetCore.Mvc;
using Common;
namespace Services
{
///
/// api接口分组Service业务层处理
///
[AppService(ServiceType = typeof(IApiGroupService), ServiceLifetime = LifeTime.Transient)]
public class ApiGroupService : BaseService, IApiGroupService
{
///
/// api接口分组-列表
///
/// 请求参数
/// api接口分组列表
public PagedInfo List([FromQuery] ApiGroupListDto parm)
{
//开始拼装查询条件
var predicate = Expressionable.Create();
predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.groupName), m => m.groupName.Contains(parm.groupName));
var response = Queryable()
.Where(predicate.ToExpression())
.OrderByDescending(m => m.id)
.ToPage(new PagerInfo());
return response;
}
public List GroupsForAdmin(string value)
{
string jsonString = Dbconn.DesDecrypt(value, "&L^kg4N9");
Dictionary data = Newtonsoft.Json.JsonConvert.DeserializeObject>(jsonString);
string key = data["key"];
if(key != "kxs#2024")
{
return new List();
}
var response = Queryable()
.Where(m => m.groupKind == 1)
.ToList()
.Select(m => m.groupName)
.ToList();
return response;
}
///
/// api接口分组-下拉框数据
///
/// api接口分组下拉框数据
public PagedInfo SelectList()
{
//开始拼装查询条件
var predicate = Expressionable.Create();
var response = Queryable()
.Where(predicate.ToExpression())
.OrderByDescending(m => m.id)
.ToPage(new PagerInfo());
return response;
}
}
}