package org.springblade.modules.nh.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.AllArgsConstructor;

import org.springblade.modules.nh.mapper.DeviceMsgMapper;
import org.springblade.modules.nh.pojo.entity.DeviceMsgEntity;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
@AllArgsConstructor
public class DeviceMsgService extends ServiceImpl<DeviceMsgMapper, DeviceMsgEntity> {

	public void saveMsg(Long stationId,Long deviceId,String msgContent,String userName){
		DeviceMsgEntity msgEntity=new DeviceMsgEntity();
		msgEntity.setStationId(stationId);
		msgEntity.setDeviceId(deviceId);
		msgEntity.setMsgContent(msgContent);
		msgEntity.setUpdateName(userName);
		msgEntity.setUpdateTime(new Date());
		save(msgEntity);
	}
}
