admin
2021-01-15 5405154d6979f1b50ce2d881bb164b1acca80b6d
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
49
50
51
52
53
54
55
56
package com.ks.lucky.service.impl.remote;
 
import com.ks.lib.common.exception.ParamsException;
import com.ks.lucky.exception.LuckyActivitySponsorInfoException;
import com.ks.lucky.exception.LuckySponsorAdException;
import com.ks.lucky.pojo.DO.LuckyActivitySponsorInfo;
import com.ks.lucky.remote.service.LuckyActivitySponsorInfoService;
import com.ks.lucky.service.impl.LuckyActivitySponsorInfoManager;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.validation.annotation.Validated;
 
import javax.annotation.Resource;
 
@Service(version = "1.0.0")
public class LuckyActivitySponsorInfoServiceImpl implements LuckyActivitySponsorInfoService {
 
    @Resource
    private LuckyActivitySponsorInfoManager luckyActivitySponsorInfoManager;
 
 
    @Validated
    @Override
    public Long addSponsorInfo(LuckyActivitySponsorInfo sponsorInfo) throws ParamsException, LuckyActivitySponsorInfoException, LuckySponsorAdException {
        luckyActivitySponsorInfoManager.addSponsorInfo(sponsorInfo);
        return sponsorInfo.getId();
    }
 
    @Override
    public void updateSponsorInfo(LuckyActivitySponsorInfo sponsorInfo) throws LuckyActivitySponsorInfoException {
        LuckyActivitySponsorInfo old = luckyActivitySponsorInfoManager.getSponsorInfoDetail(sponsorInfo.getId());
        if (old == null) {
            return;
        }
 
        luckyActivitySponsorInfoManager.updateSponsorInfo(sponsorInfo, old.getActivityId());
    }
 
    @Override
    public LuckyActivitySponsorInfo getSponsorInfo(Long activityId) {
        return luckyActivitySponsorInfoManager.getSponsorInfo(activityId);
    }
 
    @Override
    public LuckyActivitySponsorInfo getSponsorInfoDetail(Long id) {
        return luckyActivitySponsorInfoManager.getSponsorInfoDetail(id);
    }
 
    @Override
    public void deleteSponsorInfo(Long id) {
        LuckyActivitySponsorInfo old = luckyActivitySponsorInfoManager.getSponsorInfoDetail(id);
        if (old == null) {
            return;
        }
        luckyActivitySponsorInfoManager.deleteSponsorInfo(id, old.getActivityId());
    }
}