package com.jsowell.pile.service.impl;

import java.util.List;

import com.jsowell.common.util.SecurityUtils;
import com.jsowell.pile.vo.base.ThirdPartyStationRelationVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jsowell.pile.mapper.ThirdPartyStationRelationMapper;
import com.jsowell.pile.domain.ThirdPartyStationRelation;
import com.jsowell.pile.service.IThirdPartyStationRelationService;

/**
 * 站点、第三方推送平台配置对应Service业务层处理
 *
 * @author jsowell
 * @date 2023-06-06
 */
@Service
public class ThirdPartyStationRelationServiceImpl implements IThirdPartyStationRelationService {
    @Autowired
    private ThirdPartyStationRelationMapper thirdPartyStationRelationMapper;

    /**
     * 查询站点、第三方推送平台配置对应
     *
     * @param id 站点、第三方推送平台配置对应主键
     * @return 站点、第三方推送平台配置对应
     */
    @Override
    public ThirdPartyStationRelation selectThirdPartyStationRelationById(Long id) {
        return thirdPartyStationRelationMapper.selectThirdPartyStationRelationById(id);
    }

    /**
     * 查询站点、第三方推送平台配置对应列表
     *
     * @param thirdPartyStationRelation 站点、第三方推送平台配置对应
     * @return 站点、第三方推送平台配置对应
     */
    @Override
    public List<ThirdPartyStationRelation> selectThirdPartyStationRelationList(ThirdPartyStationRelation thirdPartyStationRelation) {
        return thirdPartyStationRelationMapper.selectThirdPartyStationRelationList(thirdPartyStationRelation);
    }

    /**
     * 查询站点、第三方推送平台配置
     * @param thirdPartyStationRelation
     * @return
     */
    @Override
    public ThirdPartyStationRelationVO selectRelationInfo(ThirdPartyStationRelation thirdPartyStationRelation) {
        return thirdPartyStationRelationMapper.selectRelationInfo(thirdPartyStationRelation);
    }

    /**
     * 新增站点、第三方推送平台配置对应
     *
     * @param thirdPartyStationRelation 站点、第三方推送平台配置对应
     * @return 结果
     */
    @Override
    public int insertThirdPartyStationRelation(ThirdPartyStationRelation thirdPartyStationRelation) {
        // stationSettingRelation.setCreateTime(DateUtils.getNowDate());
        thirdPartyStationRelation.setCreateBy(SecurityUtils.getUsername());
        return thirdPartyStationRelationMapper.insertThirdPartyStationRelation(thirdPartyStationRelation);
    }

    /**
     * 修改站点、第三方推送平台配置对应
     *
     * @param thirdPartyStationRelation 站点、第三方推送平台配置对应
     * @return 结果
     */
    @Override
    public int updateThirdPartyStationRelation(ThirdPartyStationRelation thirdPartyStationRelation) {
        // stationSettingRelation.setUpdateTime(DateUtils.getNowDate());
        return thirdPartyStationRelationMapper.updateThirdPartyStationRelation(thirdPartyStationRelation);
    }

    /**
     * 批量删除站点、第三方推送平台配置对应
     *
     * @param ids 需要删除的站点、第三方推送平台配置对应主键
     * @return 结果
     */
    @Override
    public int deleteThirdPartyStationRelationByIds(Long[] ids) {
        return thirdPartyStationRelationMapper.deleteThirdPartyStationRelationByIds(ids);
    }

    /**
     * 删除站点、第三方推送平台配置对应信息
     *
     * @param id 站点、第三方推送平台配置对应主键
     * @return 结果
     */
    @Override
    public int deleteThirdPartyStationRelationById(Long id) {
        return thirdPartyStationRelationMapper.deleteThirdPartyStationRelationById(id);
    }
}
