package com.jzdsh.auto.biz;

import com.jzdsh.auto.model.Message;
import com.jzdsh.util.CommonCons;
import lombok.extern.log4j.Log4j2;

import java.util.Date;

/**
 * @ProjectName: auto
 * @Package: com.jzdsh.auto.biz
 * @ClassName: MessageService
 * @Author: Jzdsh
 * @Description: 系统消息
 * @Date: 2020/3/23 12:53
 * @Version: 1.0
 */
@Log4j2
public class MessageService {


    public boolean save(int userId, String msg) {
        try {
            Message message = new Message( );
            message.setUserId(userId);
            message.setTitle("系统消息");
            message.setContent(msg);
            message.setIsRead(CommonCons.ZERO);
            message.setCreateTime(new Date( ));
            return message.save( );
        } catch (Exception e) {
            log.info("", e);
        }
        return false;
    }

}
