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