package com.shining.cloud.serviceImpl.information;

import com.github.pagehelper.PageHelper;
import com.shining.cloud.mapper.information.DevMsgMapper;
import com.shining.cloud.pojo.information.DevMsgDetail;
import com.shining.cloud.service.information.DevMsgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @description: 终端消息ServiceImpl
 * @author: denghuajun
 * @time: 2019-10-17 14:11:21
 **/
@Service
public class DevMsgServiceImpl implements DevMsgService {

    @Resource
    private DevMsgMapper devMsgMapper;

    @Override
    public List<DevMsgDetail> deviceMsgList(String userIndex, int page, int num) {
        PageHelper.offsetPage((page-1)*num, num);
        List<DevMsgDetail> devMsgDetails = devMsgMapper.deviceMsgList(userIndex);
        return devMsgDetails;
    }

    @Override
    public int unState(String userIndex) {
        return devMsgMapper.unState(userIndex);
    }
}
