mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-05-09 07:08:01 +08:00
107 lines
2.6 KiB
C#
107 lines
2.6 KiB
C#
using System;
|
|
using System.Web.Http;
|
|
using System.Web.Mvc;
|
|
using Infrastructure;
|
|
using OpenAuth.App;
|
|
using OpenAuth.App.Request;
|
|
using OpenAuth.Mvc.Models;
|
|
using OpenAuth.Repository.Domain;
|
|
|
|
namespace OpenAuth.Mvc.Controllers
|
|
{
|
|
public class FlowSchemesController : BaseController
|
|
{
|
|
public FlowSchemeApp App { get; set; }
|
|
|
|
//
|
|
[Authenticate]
|
|
public ActionResult Index()
|
|
{
|
|
return View();
|
|
}
|
|
|
|
public ActionResult Design()
|
|
{
|
|
return View();
|
|
}
|
|
|
|
//流程节点信息
|
|
public ActionResult NodeInfo()
|
|
{
|
|
return View();
|
|
}
|
|
|
|
public string Get(string id)
|
|
{
|
|
try
|
|
{
|
|
var result = new Response<FlowScheme> {Result = App.Get(id)};
|
|
return JsonHelper.Instance.Serialize(result);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Result.Code = 500;
|
|
Result.Message = ex.Message;
|
|
}
|
|
return JsonHelper.Instance.Serialize(Result);
|
|
}
|
|
|
|
//添加或修改
|
|
[System.Web.Mvc.HttpPost]
|
|
public string Add(FlowScheme obj)
|
|
{
|
|
try
|
|
{
|
|
App.Add(obj);
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Result.Code = 500;
|
|
Result.Message = ex.Message;
|
|
}
|
|
return JsonHelper.Instance.Serialize(Result);
|
|
}
|
|
|
|
//添加或修改
|
|
[System.Web.Mvc.HttpPost]
|
|
public string Update(FlowScheme obj)
|
|
{
|
|
try
|
|
{
|
|
App.Update(obj);
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Result.Code = 500;
|
|
Result.Message = ex.Message;
|
|
}
|
|
return JsonHelper.Instance.Serialize(Result);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 加载列表
|
|
/// </summary>
|
|
public string Load([FromUri]QueryFlowSchemeListReq request)
|
|
{
|
|
return JsonHelper.Instance.Serialize(App.Load(request));
|
|
}
|
|
|
|
[System.Web.Mvc.HttpPost]
|
|
public string Delete(string[] ids)
|
|
{
|
|
try
|
|
{
|
|
App.Delete(ids);
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
Result.Code = 500;
|
|
Result.Message = e.Message;
|
|
}
|
|
|
|
return JsonHelper.Instance.Serialize(Result);
|
|
}
|
|
}
|
|
} |