admin
2021-09-24 f788607ff771a47bc60d6a86e00b3433c40f3d2c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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);
    }
}