JnpfMessageUtil.java 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package jnpf.message.util;
  2. import jnpf.message.entity.MessageEntity;
  3. import jnpf.message.entity.MessageReceiveEntity;
  4. import jnpf.util.RandomUtil;
  5. import java.util.Date;
  6. /**
  7. * 消息实体类
  8. *
  9. * @版本: V3.2.0
  10. * @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com)
  11. * @作者: JNPF开发平台组
  12. * @日期: 2021/4/22 9:06
  13. */
  14. public class JnpfMessageUtil {
  15. public static MessageEntity setMessageEntity(String userId,String title,String bodyText,Integer recType) {
  16. MessageEntity entity = new MessageEntity();
  17. entity.setTitle(title);
  18. entity.setBodyText(bodyText);
  19. entity.setId(RandomUtil.uuId());
  20. // entity.setType(recType);
  21. entity.setCreatorUserId(userId);
  22. entity.setCreatorTime(new Date());
  23. entity.setLastModifyTime(entity.getCreatorTime());
  24. entity.setLastModifyUserId(entity.getCreatorUserId());
  25. return entity;
  26. }
  27. public static MessageReceiveEntity setMessageReceiveEntity(String toUserId, String title, Integer sendType){
  28. MessageReceiveEntity entity = new MessageReceiveEntity();
  29. entity.setId(RandomUtil.uuId());
  30. entity.setUserId(toUserId);
  31. entity.setIsRead(0);
  32. entity.setType(sendType);
  33. entity.setFlowType(1);
  34. entity.setTitle(title);
  35. return entity;
  36. }
  37. }