| | |
| | | import com.ks.lucky.pojo.DO.LuckySponsorAd; |
| | | import com.ks.lucky.pojo.DO.LuckySponsors; |
| | | import com.ks.lucky.query.ActivitySponsorInfoQuery; |
| | | import com.ks.lucky.util.annotation.RedisCache; |
| | | import com.ks.lucky.util.annotation.RedisCacheEvict; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.validation.annotation.Validated; |
| | | |
| | |
| | | public void addSponsorInfo(LuckyActivitySponsorInfo sponsorInfo) throws LuckyActivitySponsorInfoException { |
| | | ActivitySponsorInfoQuery query = new ActivitySponsorInfoQuery(); |
| | | query.activityId = sponsorInfo.getActivityId(); |
| | | query.start=0; |
| | | query.count=1; |
| | | query.start = 0; |
| | | query.count = 1; |
| | | |
| | | List<LuckyActivitySponsorInfo> list = luckyActivitySponsorInfoMapper.list(query); |
| | | if (list != null && list.size() > 0) { |
| | |
| | | * @param sponsorInfo |
| | | * @throws LuckyActivitySponsorInfoException |
| | | */ |
| | | public void updateSponsorInfo(LuckyActivitySponsorInfo sponsorInfo) throws LuckyActivitySponsorInfoException { |
| | | @RedisCacheEvict(cate = "activity", key = "'activity-detail-'+#activityId") |
| | | @RedisCacheEvict(cate = "activity-sponsorinfo", key = "'getSponsorInfo-'+#activityId") |
| | | @RedisCacheEvict(cate = "activity-sponsorinfo", key = "'getSponsorInfoDetail-'+#sponsorInfo.id") |
| | | public void updateSponsorInfo(LuckyActivitySponsorInfo sponsorInfo, Long activityId) throws LuckyActivitySponsorInfoException { |
| | | luckyActivitySponsorInfoMapper.updateByPrimaryKeySelective(sponsorInfo); |
| | | } |
| | | |
| | |
| | | * @param activityId |
| | | * @return |
| | | */ |
| | | @RedisCache(cate = "activity-sponsorinfo", key = "'getSponsorInfo-'+#activityId") |
| | | public LuckyActivitySponsorInfo getSponsorInfo(Long activityId) { |
| | | ActivitySponsorInfoQuery query = new ActivitySponsorInfoQuery(); |
| | | query.activityId = activityId; |
| | | query.start=0; |
| | | query.count=1; |
| | | query.start = 0; |
| | | query.count = 1; |
| | | List<LuckyActivitySponsorInfo> list = luckyActivitySponsorInfoMapper.list(query); |
| | | if (list != null && list.size() > 0) { |
| | | return list.get(0); |
| | |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @RedisCache(cate = "activity-sponsorinfo", key = "'getSponsorInfoDetail-'+#id") |
| | | public LuckyActivitySponsorInfo getSponsorInfoDetail(Long id) { |
| | | LuckyActivitySponsorInfo info = luckyActivitySponsorInfoMapper.selectByPrimaryKey(id); |
| | | if (info == null) { |
| | |
| | | * |
| | | * @param id |
| | | */ |
| | | |
| | | public void deleteSponsorInfo(Long id) { |
| | | @RedisCacheEvict(cate = "activity", key = "'activity-detail-'+#activityId") |
| | | @RedisCacheEvict(cate = "activity-sponsorinfo", key = "'getSponsorInfo-'+#activityId") |
| | | @RedisCacheEvict(cate = "activity-sponsorinfo", key = "'getSponsorInfoDetail-'+#id") |
| | | public void deleteSponsorInfo(Long id, Long activityId) { |
| | | luckySponsorsMapper.deleteByPrimaryKey(id); |
| | | } |
| | | |