You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

47 lines
1.4 KiB

  1. using Learun.Application.Organization;
  2. using Learun.Util;
  3. using Nancy;
  4. namespace Learun.Application.WebApi.Modules
  5. {
  6. /// <summary>
  7. /// 版 本 Learun-ADMS V7.0.0 数字化智慧校园
  8. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  9. /// 创建人:数字化智慧校园-框架开发组
  10. /// 日 期:2018.01.04
  11. /// 描 述:部门管理
  12. /// </summary>
  13. public class DepartmentApi: BaseApi
  14. {
  15. public DepartmentApi()
  16. : base("/learun/adms/department")
  17. {
  18. Get["/map"] = GetMap;// 获取组织机构数据映射表
  19. }
  20. private DepartmentIBLL departmentIBLL = new DepartmentBLL();
  21. /// <summary>
  22. /// 获取部门映射表
  23. /// </summary>
  24. /// <param name="_"></param>
  25. /// <returns></returns>
  26. public Response GetMap(dynamic _)
  27. {
  28. string ver = this.GetReqData();// 获取模板请求数据
  29. var data = departmentIBLL.GetModelMap();
  30. string md5 = Md5Helper.Encrypt(data.ToJson(), 32);
  31. if (md5 == ver)
  32. {
  33. return Success("no update");
  34. }
  35. else
  36. {
  37. var jsondata = new
  38. {
  39. data = data,
  40. ver = md5
  41. };
  42. return Success(jsondata);
  43. }
  44. }
  45. }
  46. }