admin
2021-04-02 d551bef5e2b09bd98681cf97807988c9863e66fc
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
39
40
41
42
43
44
45
46
47
48
package com.yeshi.buwan.service.imp.push;
 
import com.yeshi.buwan.dao.push.PushDeviceTokenDao;
import com.yeshi.buwan.domain.push.PushDeviceToken;
import com.yeshi.buwan.service.inter.push.PushDeviceTokenService;
import com.yeshi.buwan.util.StringUtil;
import org.springframework.stereotype.Service;
 
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
 
@Service
public class PushDeviceTokenServiceImpl implements PushDeviceTokenService {
 
    @Resource
    private PushDeviceTokenDao pushDeviceTokenDao;
 
 
    @Override
    public void addDeviceToken(PushDeviceToken token) throws Exception {
        if (token == null) {
            throw new Exception("对象不能为空");
        }
 
        if (StringUtil.isNullOrEmpty(token.getDetailSystemId()) || StringUtil.isNullOrEmpty(token.getUtdId()) || StringUtil.isNullOrEmpty(token.getToken()) || token.getType() == null) {
            throw new Exception("参数不能为空");
        }
        token.setId(PushDeviceToken.createId(token.getDetailSystemId(), token.getUtdId()));
        token.setCreateTime(new Date());
        pushDeviceTokenDao.save(token);
    }
 
    @Override
    public List<PushDeviceToken> listByLoginUids(List<String> loginUids) {
        return null;
    }
 
    @Override
    public List<PushDeviceToken> list(String detailSystemId, Integer minVersion, Date minTime, int page, int pageSize) {
        return null;
    }
 
    @Override
    public long count(String detailSystemId, Integer minVersion, Date minTime) {
        return 0;
    }
}