package com.yeshi.buwan.service.imp.live;
|
|
import com.yeshi.buwan.dao.live.migu.MiGuLiveListInfoDao;
|
import com.yeshi.buwan.live.migu.MiGuLiveListInfo;
|
import com.yeshi.buwan.service.inter.live.MiGuLiveService;
|
import com.yeshi.buwan.util.StringUtil;
|
import org.springframework.stereotype.Service;
|
|
import javax.annotation.Resource;
|
import java.util.Date;
|
|
@Service
|
public class MiGuLiveServiceImpl implements MiGuLiveService {
|
|
@Resource
|
private MiGuLiveListInfoDao miGuLiveListInfoDao;
|
|
@Override
|
public void saveChannelInfo(MiGuLiveListInfo info) {
|
if (info.getId() == null) {
|
info.setId(StringUtil.Md5(info.getName()));
|
}
|
|
if (info.getCreateTime() == null) {
|
info.setCreateTime(new Date());
|
}
|
|
if (info.getUpdateTime() == null) {
|
info.setUpdateTime(new Date());
|
}
|
miGuLiveListInfoDao.save(info);
|
}
|
|
@Override
|
public MiGuLiveListInfo selectByPrimaryKey(String id) {
|
return miGuLiveListInfoDao.get(id);
|
}
|
}
|