| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- using Attribute;
- using Model;
- using Model.Base;
- using Repository;
- using Service;
- using Microsoft.AspNetCore.Mvc;
- using Vo.Admin;
- namespace Services
- {
- /// <summary>
- /// 接口分组Service业务层处理
- /// </summary>
- [AppService(ServiceType = typeof(IApiGroupService), ServiceLifetime = LifeTime.Transient)]
- public class ApiGroupService : BaseService<ApiGroup>, IApiGroupService
- {
- /// <summary>
- /// 接口分组-列表
- /// </summary>
- /// <param name="param">参数请求体</param>
- /// <param name="page">分页参数</param>
- /// <returns>列表</returns>
- public PagedInfo<GetApiGroupListVo> getApiGroupList([FromQuery] PagerInfo page, [FromQuery] ApiGroup param)
- {
- //拼装查询条件
- var predicate = Expressionable.Create<ApiGroup>();
- predicate = predicate.AndIF(param.serviceId > 0, m => m.serviceId == param.serviceId);
- predicate = predicate.AndIF(!string.IsNullOrEmpty(param.groupName), m => m.groupName.Contains(param.groupName));
- predicate = predicate.AndIF(param.appId > 0, m => m.appId == param.appId);
- var response = Queryable()
- .Where(predicate.ToExpression())
- .OrderByDescending(m => m.id)
- .ToPage<ApiGroup, GetApiGroupListVo>(page);
- return response;
- }
- /// <summary>
- /// 生成api文档
- /// </summary>
- /// <param name="serviceId">服务id</param>
- public void makeApiDoc(int serviceId)
- {
- var apiGroups = GetList(m => m.serviceId == serviceId);
- foreach (var group in apiGroups)
- {
-
- }
- }
- /// <summary>
- /// 同步api到管理平台
- /// </summary>
- /// <param name="serviceId">服务id</param>
- public void sycnApiToSystem(int serviceId)
- {
-
- }
- }
- }
|