package com.lightinit.hsdataportal.impl;

import com.lightinit.hsdataportal.entity.BaseExample;
import com.lightinit.hsdataportal.entity.Notification;
import com.lightinit.hsdataportal.entity.NotificationExample;
import com.lightinit.hsdataportal.mapper.NotificationMapper;
import com.lightinit.hsdataportal.model.NotificationListModel;
import com.lightinit.hsdataportal.model.ResultState;
import com.lightinit.hsdataportal.model.ResultStateCode;
import com.lightinit.hsdataportal.service.INotificationService;
import com.lightinit.hsdataportal.spring.DynamicDataContextHolder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: sunxiang
 * @Date: 2018/7/11 15:44
 * @Description:
 **/
@Service
public class NotificationServiceImpl implements INotificationService {

    @Autowired
    private NotificationMapper notificationMapper;
    @Override
    public List<NotificationListModel> getNotificationIndex(BaseExample.Page pager,long id) {
        DynamicDataContextHolder.setCustomerType(DynamicDataContextHolder.DEFAULT);
        return notificationMapper.getNotificationIndex(pager,id);
    }

    public long getNotificationCount(long id){
        return notificationMapper.getNotificationCount(id);
    }
}
