init commit

This commit is contained in:
路 范
2022-03-30 17:54:33 +08:00
parent df01841625
commit 904bdd16cd
500 changed files with 217251 additions and 0 deletions

View File

@@ -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);
}
}
}