|
@@ -1,6 +1,7 @@
|
|
|
package com.fs.app.controller;
|
|
package com.fs.app.controller;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+import com.fs.common.utils.StringUtils;
|
|
|
import com.fs.his.param.FsAdvUParam;
|
|
import com.fs.his.param.FsAdvUParam;
|
|
|
import com.fs.app.utils.JwtUtils;
|
|
import com.fs.app.utils.JwtUtils;
|
|
|
import com.fs.common.core.domain.R;
|
|
import com.fs.common.core.domain.R;
|
|
@@ -8,18 +9,22 @@ import com.fs.his.domain.FsAdv;
|
|
|
import com.fs.his.service.IFsAdvService;
|
|
import com.fs.his.service.IFsAdvService;
|
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.cache.annotation.Cacheable;
|
|
import org.springframework.cache.annotation.Cacheable;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
|
|
|
@Api("广告位接口")
|
|
@Api("广告位接口")
|
|
|
@RestController
|
|
@RestController
|
|
|
@RequestMapping(value="/app/adv")
|
|
@RequestMapping(value="/app/adv")
|
|
|
|
|
+@Slf4j
|
|
|
public class AdvController {
|
|
public class AdvController {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
JwtUtils jwtUtils;
|
|
JwtUtils jwtUtils;
|
|
@@ -29,8 +34,16 @@ public class AdvController {
|
|
|
// @Cacheable(value="getAdvList", key="#map")
|
|
// @Cacheable(value="getAdvList", key="#map")
|
|
|
@ApiOperation("获取首页广告位")
|
|
@ApiOperation("获取首页广告位")
|
|
|
@GetMapping("/getAdvList")
|
|
@GetMapping("/getAdvList")
|
|
|
- public R getAdvList(FsAdvUParam map){
|
|
|
|
|
|
|
+ public R getAdvList(FsAdvUParam map, HttpServletRequest request){
|
|
|
List<FsAdv> list=advService.selectFsAdvListUVO(map);
|
|
List<FsAdv> list=advService.selectFsAdvListUVO(map);
|
|
|
|
|
+ try {
|
|
|
|
|
+ String sourceType = request.getHeader("sourcetype");
|
|
|
|
|
+ if(StringUtils.isNotBlank(sourceType)){
|
|
|
|
|
+ list = list.stream().filter(item->!item.getAdvTitle().equals("app下载")).collect(Collectors.toList());
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("获取首页广告位,获取header报错:{}",e.getMessage());
|
|
|
|
|
+ }
|
|
|
return R.ok().put("data",list);
|
|
return R.ok().put("data",list);
|
|
|
}
|
|
}
|
|
|
|
|
|