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.
 
 
 
 
 
 

66 lines
1.9 KiB

  1. using Learun.Application.Base.SystemModule;
  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 DataItemApi: BaseApi
  14. {
  15. /// <summary>
  16. /// 注册接口
  17. /// </summary>
  18. public DataItemApi()
  19. : base("/learun/adms/dataitem")
  20. {
  21. Get["/details"] = GetDetailList;// 获取数据字典详细列表
  22. Get["/map"] = GetMap;// 获取映射数据
  23. }
  24. private DataItemIBLL dataItemIBLL = new DataItemBLL();
  25. /// <summary>
  26. /// 获取数据字典详细列表
  27. /// </summary>
  28. /// <param name="_"></param>
  29. /// <returns></returns>
  30. private Response GetDetailList(dynamic _)
  31. {
  32. string req = this.GetReqData();// 获取模板请求数据
  33. var data = dataItemIBLL.GetDetailList(req, "");
  34. return Success(data);
  35. }
  36. /// <summary>
  37. /// 获取部门映射表
  38. /// </summary>
  39. /// <param name="_"></param>
  40. /// <returns></returns>
  41. public Response GetMap(dynamic _)
  42. {
  43. string ver = this.GetReqData();// 获取模板请求数据
  44. var data = dataItemIBLL.GetModelMap();
  45. string md5 = Md5Helper.Encrypt(data.ToJson(), 32);
  46. if (md5 == ver)
  47. {
  48. return Success("no update");
  49. }
  50. else
  51. {
  52. var jsondata = new
  53. {
  54. data = data,
  55. ver = md5
  56. };
  57. return Success(jsondata);
  58. }
  59. }
  60. }
  61. }