package net.northking.cctp.dw.db.impl;

import net.northking.cctp.common.db.BasicDao;
import net.northking.cctp.common.db.PaginationService;
import net.northking.cctp.common.feign.ApiAtsEnviromentFeign;
import net.northking.cctp.dw.db.dao.DwAtuPlanEnvLinkDao;
import net.northking.cctp.dw.db.entity.DwAtuPlanEnvLink;
import net.northking.cctp.dw.db.service.DwAtuPlanEnvLinkService;
import net.northking.cctp.dw.feign.PlatformFeignClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.stereotype.Service;

@Service
@ConditionalOnMissingBean(name = "DwAtuPlanEnvLinkServiceImpl")
public class DwAtuPlanEnvLinkServiceImpl extends PaginationService<DwAtuPlanEnvLink> implements DwAtuPlanEnvLinkService {

    private static final Logger logger = LoggerFactory.getLogger(DwAtuPlanEnvLinkServiceImpl.class);

    private final DwAtuPlanEnvLinkDao dwAtuPlanEnvLinkDao;
    @Autowired
    private PlatformFeignClient platformFeignClient;

    @Autowired
    private ApiAtsEnviromentFeign apiAtsEnviromentFeign;

    public DwAtuPlanEnvLinkServiceImpl(DwAtuPlanEnvLinkDao dwAtuPlanEnvLinkDao) {
        this.dwAtuPlanEnvLinkDao = dwAtuPlanEnvLinkDao;
    }

    @Override
    protected void beforeInsert(DwAtuPlanEnvLink dwAtuPlanEnvLink) {

    }

    @Override
    protected void beforeUpdate(DwAtuPlanEnvLink dwAtuPlanEnvLink) {

    }

    @Override
    public DwAtuPlanEnvLink createEntity() {
        return new DwAtuPlanEnvLink();
    }

    @Override
    public BasicDao<DwAtuPlanEnvLink> getDao() {
        return dwAtuPlanEnvLinkDao;
    }

    @Override
    public Integer deleteByPlanIdAndEnvId(String planId, String envId) {
        return dwAtuPlanEnvLinkDao.deleteByPlanIdAndEnvId(planId,envId);
    }
}
