|
@@ -0,0 +1,88 @@
|
|
|
+package com.jpsoft.employment.modules.mobile.controller;
|
|
|
+
|
|
|
+import com.github.pagehelper.Page;
|
|
|
+import com.jpsoft.employment.modules.base.entity.*;
|
|
|
+import com.jpsoft.employment.modules.base.service.*;
|
|
|
+import com.jpsoft.employment.modules.common.dto.MessageResult;
|
|
|
+import com.jpsoft.employment.modules.common.dto.Sort;
|
|
|
+import com.jpsoft.employment.modules.common.utils.PojoUtils;
|
|
|
+import com.jpsoft.employment.modules.sys.service.DataDictionaryService;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiImplicitParam;
|
|
|
+import io.swagger.annotations.ApiImplicitParams;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
+import org.springframework.data.redis.core.ValueOperations;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+@Slf4j
|
|
|
+@RestController
|
|
|
+@RequestMapping("/mobile/banner")
|
|
|
+@Api(description = "幻灯片广告")
|
|
|
+public class BannerApiController {
|
|
|
+ @Value("${jwt.secret}")
|
|
|
+ private String jwtSecret;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ RabbitTemplate rabbitTemplate;
|
|
|
+ @Autowired
|
|
|
+ private DataDictionaryService dataDictionaryService;
|
|
|
+ @Autowired
|
|
|
+ private ValueOperations<String, Object> valueOperations;
|
|
|
+ @Autowired
|
|
|
+ private PersonInfoService personInfoService;
|
|
|
+ @Autowired
|
|
|
+ private RecruitInformationInfoService recruitInformationInfoService;
|
|
|
+ @Autowired
|
|
|
+ private JobInformationInfoService jobInformationInfoService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private MobileBannerInfoService mobileBannerInfoService;
|
|
|
+
|
|
|
+ @PostMapping("bannerList")
|
|
|
+ @ApiOperation(value = " 查询幻灯片广告")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "classify", value = "分类", required = false, paramType = "form"),
|
|
|
+ })
|
|
|
+ public MessageResult<Map> bannerList(
|
|
|
+ @RequestParam(value = "classify", defaultValue = "") String classify,
|
|
|
+ @RequestParam(value = "pageIndex", defaultValue = "1") int pageIndex,
|
|
|
+ @RequestParam(value = "pageSize", defaultValue = "10") int pageSize) {
|
|
|
+ MessageResult<Map> messageResult = new MessageResult<>();
|
|
|
+
|
|
|
+ try {
|
|
|
+ Map<String,Object> searchParams = new HashMap<>();
|
|
|
+
|
|
|
+ List<Sort> sortList = new ArrayList<>();
|
|
|
+ sortList.add(new Sort("sort_no","asc"));
|
|
|
+
|
|
|
+ if(StringUtils.isNotEmpty(classify)) {
|
|
|
+ searchParams.put("classify", classify);
|
|
|
+ }
|
|
|
+ searchParams.put("enabled","1");
|
|
|
+
|
|
|
+ Page<MobileBannerInfo> page = mobileBannerInfoService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
|
|
|
+
|
|
|
+ messageResult.setResult(true);
|
|
|
+ messageResult.setData(PojoUtils.pageWrapper(page));
|
|
|
+ } catch (Exception ex) {
|
|
|
+ log.error(ex.getMessage());
|
|
|
+ messageResult.setResult(false);
|
|
|
+ messageResult.setMessage(ex.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ return messageResult;
|
|
|
+ }
|
|
|
+}
|