using Learun.Application.Organization;
using Learun.Util;
using Nancy;
namespace Learun.Application.WebApi.Modules
{
///
/// 版 本 Learun-ADMS V7.0.0 数字化智慧校园
/// Copyright (c) 2013-2018 北京泉江科技有限公司
/// 创建人:数字化智慧校园-框架开发组
/// 日 期:2018.01.04
/// 描 述:部门管理
///
public class DepartmentApi: BaseApi
{
public DepartmentApi()
: base("/learun/adms/department")
{
Get["/map"] = GetMap;// 获取组织机构数据映射表
}
private DepartmentIBLL departmentIBLL = new DepartmentBLL();
///
/// 获取部门映射表
///
///
///
public Response GetMap(dynamic _)
{
string ver = this.GetReqData();// 获取模板请求数据
var data = departmentIBLL.GetModelMap();
string md5 = Md5Helper.Encrypt(data.ToJson(), 32);
if (md5 == ver)
{
return Success("no update");
}
else
{
var jsondata = new
{
data = data,
ver = md5
};
return Success(jsondata);
}
}
}
}