package com.huimv.video.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.huimv.video.domain.PublicNetwork;
import com.huimv.video.repo.PublicNetworkRepo;
import com.huimv.video.service.PublicNetworkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Project : huimv.shiwan
 * @Package : com.huimv.video.service.impl
 * @Description : TODO
 * @Author : yuxuexuan
 * @Create : 2021/1/6 0006 14:09
 **/
@Service
public class PublicNetworkServiceImpl implements PublicNetworkService {
    @Autowired
    private PublicNetworkRepo publicNetworkRepo;
    @Override
    @DS("master")
    public void save(PublicNetwork publicNetwork) {
        publicNetworkRepo.save(publicNetwork);
    }

    @Override
    @DS("master")
    public PublicNetwork getNetwork() {
        return publicNetworkRepo.findTopByIdDesc();
    }
}
