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