|
@@ -31,6 +31,11 @@ public class AdvertisementServiceImpl implements AdvertisementService {
|
|
|
@Autowired
|
|
|
private OssProperties ossProperties;
|
|
|
|
|
|
+ /**
|
|
|
+ * 远程弹窗控制
|
|
|
+ */
|
|
|
+ private static final String POPUP_CONTROL = "popup control";
|
|
|
+
|
|
|
@Override
|
|
|
public List<AdvertisementVo> list(QueryAdvertisementParam param) {
|
|
|
List<AdvertisementVo> result = new ArrayList<>();
|
|
@@ -45,7 +50,7 @@ public class AdvertisementServiceImpl implements AdvertisementService {
|
|
|
if(!StringUtils.isEmpty(slug)) {
|
|
|
criteria.andSlugEqualTo(slug);
|
|
|
}
|
|
|
- if(!StringUtils.isEmpty(slug)) {
|
|
|
+ if(!StringUtils.isEmpty(language)) {
|
|
|
criteria.andLanguageEqualTo(LanguageEnum.getCodeByName(language));
|
|
|
}
|
|
|
//获取访问域名
|
|
@@ -55,9 +60,13 @@ public class AdvertisementServiceImpl implements AdvertisementService {
|
|
|
AdvertisementVo vo = new AdvertisementVo();
|
|
|
Advertisements adv = advertisementList.get(0);
|
|
|
BeanUtils.copyProperties(adv,vo);
|
|
|
- vo.setImageUrl(viewUrl + adv.getImage());
|
|
|
setExtraInfo(vo,adv);
|
|
|
increaseHit(adv);
|
|
|
+ if(POPUP_CONTROL.equals(slug)){
|
|
|
+ vo.setImageUrl("");
|
|
|
+ } else{
|
|
|
+ vo.setImageUrl(viewUrl + adv.getImage());
|
|
|
+ }
|
|
|
result.add(vo);
|
|
|
}else{
|
|
|
for (Advertisements adv : advertisementList) {
|
|
@@ -109,9 +118,14 @@ public class AdvertisementServiceImpl implements AdvertisementService {
|
|
|
Advertisements adv = new Advertisements();
|
|
|
adv.setId(CommonUtils.generateId());
|
|
|
BeanUtils.copyProperties(param, adv);
|
|
|
+ String language = param.getLanguage();
|
|
|
+ if(!StringUtils.isEmpty(language)) {
|
|
|
+ adv.setLanguage(LanguageEnum.getCodeByName(language));
|
|
|
+ }
|
|
|
Date now = new Date();
|
|
|
adv.setCreatedAt(now);
|
|
|
adv.setUpdatedAt(now);
|
|
|
+ adv.setTotalHits(0);
|
|
|
advertisementsMapper.insert(adv);
|
|
|
return "增加广告成功";
|
|
|
}
|