package com.gic.haoban.manage.service.service.out.impl;

import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.UniqueIdUtils;
import com.gic.haoban.manage.api.dto.HaobanTaskNoticeDTO;
import com.gic.haoban.manage.api.service.HaobanTaskNoticeApiService;
import com.gic.haoban.manage.service.dao.mapper.HaobanTaskNoticeMapper;
import com.gic.haoban.manage.service.entity.TabHaobanTaskNotice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("haobanTaskNoticeApiService")
public class HaobanTaskNoticeApiServiceImpl implements HaobanTaskNoticeApiService {

    @Autowired
    private HaobanTaskNoticeMapper haobanTaskNoticeMapper;
    @Override
    public ServiceResponse<Void> save(HaobanTaskNoticeDTO notice) {
        TabHaobanTaskNotice entity = EntityUtil.changeEntityByJSON(TabHaobanTaskNotice.class, notice) ;
        entity.setId(UniqueIdUtils.uniqueLong());
        this.haobanTaskNoticeMapper.save(entity) ;
        return ServiceResponse.success();
    }

    @Override
    public ServiceResponse<Void> sendTimer(String params) {
        List<TabHaobanTaskNotice> list =  this.haobanTaskNoticeMapper.listForTimer() ;
        return null;
    }
}
