package com.chinacreator.video.restful.service;

import com.chinacreator.video.bean.OrderInfo;
import com.chinacreator.video.restful.dao.ChannelSyncDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.logging.Logger;

/**
 * @author yu.su
 * @date 2021.01.15
 * 渠道同步
 */
@Service
public class ChannelSyncService {

    @Autowired
    private ChannelSyncDao channelSyncDao;

    private static Logger log = Logger.getLogger("muorder");
    /**
     * 保存渠道同步信息
     * @param orderInfo
     */
    public void insertChannelInfo(OrderInfo orderInfo){
        try {
            int count=channelSyncDao.findBySpid(orderInfo);
            if (count>0){
                channelSyncDao.insertChannelInfo(orderInfo);
            }
        } catch (Exception e) {
            log.info(e.getMessage());
            e.printStackTrace();
        }
    }
}
