init commit
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
using Furion.DependencyInjection;
|
||||
using Furion.DynamicApiController;
|
||||
using Furion.FriendlyException;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using RoadFlow.Data;
|
||||
using RoadFlow.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ewide.RoadFlowLite.Serivce.Applibrary
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 工作流字典服务
|
||||
/// </summary>
|
||||
[Route("/api/roadflow/Applibrary/")]
|
||||
[ApiDescriptionSettings("RoadFlow")]
|
||||
public class ApplibraryService : IDynamicApiController, ITransient
|
||||
{
|
||||
IApplibrary _appLibrary;
|
||||
public ApplibraryService(IApplibrary applibrary)
|
||||
{
|
||||
_appLibrary = applibrary;
|
||||
}
|
||||
/// <summary>
|
||||
/// 得到一个分类下的应用
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("GetTreeChildsJson")]
|
||||
public dynamic GetTreeChildsJson(string parentId)
|
||||
{
|
||||
|
||||
|
||||
|
||||
if (!parentId.IsGuid(out Guid parentGuid))
|
||||
{
|
||||
return new JArray();
|
||||
// return RoadFlowCommon.Tools.GetReturnJsonString(jArray: new JArray());
|
||||
}
|
||||
var apps = _appLibrary.GetListByType(parentId);
|
||||
string lang = RoadFlow.Utility.Tools.GetCurrentLanguage(Furion.App.HttpContext);
|
||||
JArray jArray = new JArray();
|
||||
foreach (var app in apps)
|
||||
{
|
||||
JObject appJson = new JObject() {
|
||||
{ "value", app.Id },
|
||||
{ "title", _appLibrary.GetLanguageTitle(app, lang) },
|
||||
};
|
||||
jArray.Add(appJson);
|
||||
}
|
||||
return jArray;
|
||||
//RoadFlowCommon.Tools.GetReturnJsonString(jArray: jArray);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user