DataModel.java 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. package com.yihu.ehr.analysis.model;
  2. import com.alibaba.fastjson.annotation.JSONField;
  3. import com.fasterxml.jackson.annotation.JsonFormat;
  4. import com.yihu.ehr.util.datetime.DateUtil;
  5. import io.searchbox.annotations.JestId;
  6. import org.springframework.data.annotation.CreatedDate;
  7. import org.springframework.data.annotation.Id;
  8. import java.util.Date;
  9. /**
  10. * Created by Administrator on 2017/2/9.
  11. * 数据对象的公工接口
  12. * // 业务日志
  13. * 0 consult // 咨询
  14. * 1 guidance // 指导
  15. * 2 article // 健康教育
  16. * 3 followup // 随访
  17. * 4 appointment // 预约
  18. * 5 label // 标签
  19. * 6 register // 注册
  20. * 7 archive // 健康档案
  21. * {
  22. * time:"" 时间
  23. * ,logType:2 日志类型
  24. * ,caller:"" 调用者
  25. * ,data:{
  26. * ,businessType:"" 业务类型
  27. * ,patient:"" 居民
  28. * ,data:{} 业务数据
  29. * } 数据
  30. * }
  31. * <p>
  32. * // 接口调用日志
  33. * {
  34. * time:"" 时间
  35. * ,logType:1 日志类型
  36. * ,caller:"" 调用者
  37. * ,data:{
  38. * responseTime:"" 响应时间
  39. * ,url:"" 接口URL
  40. * ,params:{} 参数
  41. * } 数据
  42. * }
  43. */
  44. public class DataModel {
  45. @JestId
  46. protected String id;
  47. @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ssXX")
  48. @CreatedDate
  49. @JSONField(format = "yyyy-MM-dd'T'HH:mm:ssXX")
  50. protected Date time;//时间
  51. protected String caller; //调用者
  52. protected String logType;//日志类型 1接口 2业务
  53. public String getId() {
  54. return id;
  55. }
  56. public void setId(String id) {
  57. this.id = id;
  58. }
  59. public String getLogType() {
  60. return logType;
  61. }
  62. public void setLogType(String logType) {
  63. this.logType = logType;
  64. }
  65. public Date getTime() {
  66. return time;
  67. }
  68. public void setTime(Date time) {
  69. this.time = time;
  70. }
  71. public String getCaller() {
  72. return caller;
  73. }
  74. public void setCaller(String caller) {
  75. this.caller = caller;
  76. }
  77. protected Date changeTime(String time) {
  78. return DateUtil.strToDate(time);
  79. }
  80. }