package com.palmnest.service.notice.impl;

import com.palmnest.application.bean.AppResultDto;
import com.palmnest.application.bean.Page;
import com.palmnest.application.core.util.AppResultUtil;
import com.palmnest.application.dto.AppNoticeRecordVo;
import com.palmnest.dao.notice.AppNoticeReminderRecordDao;
import com.palmnest.model.notice.AppNoticeRecordModel;
import com.palmnest.model.notice.AppNoticeReminderDetailModel;
import com.palmnest.service.impl.GenericManagerImpl;
import com.palmnest.service.notice.AppNoticeRecordManager;
import com.palmnest.service.notice.AppNoticeReminderRecordManager;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

@Slf4j
@Service("appNoticeReminderRecordManager")
public class AppNoticeReminderRecordManagerImpl extends GenericManagerImpl<AppNoticeReminderDetailModel, Integer> implements AppNoticeReminderRecordManager {
    @Autowired
    AppNoticeReminderRecordDao appNoticeReminderRecordDao;

    @Override
    public Page getReminderRecord(Integer id, int pageNo, int pageSize) {
        return  appNoticeReminderRecordDao.getReminderRecord(id,pageNo,pageSize);
    }

    @Override
    public AppResultDto addReminderRecord(Map<String, Object> params) throws Exception {
        try {
            appNoticeReminderRecordDao.addReminderRecord(params);
            return AppResultUtil.createSuccesDto("成功");

        } catch (Exception e) {
            e.printStackTrace();
            return AppResultUtil.createErrorDto("500", "失败");
        }
    }
}
