|
@@ -1,8 +1,16 @@
|
|
|
|
|
|
package com.redxun.knowledge.controller;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.redxun.common.annotation.ClassDefine;
|
|
|
import com.redxun.common.base.db.BaseService;
|
|
|
+import com.redxun.common.base.entity.JsonPage;
|
|
|
+import com.redxun.common.base.entity.JsonPageResult;
|
|
|
+import com.redxun.common.base.entity.QueryData;
|
|
|
+import com.redxun.common.base.search.QueryFilter;
|
|
|
+import com.redxun.common.base.search.QueryFilterBuilder;
|
|
|
+import com.redxun.common.utils.ExceptionUtil;
|
|
|
import com.redxun.knowledge.entity.dao.Banner;
|
|
|
import com.redxun.knowledge.service.BannerServiceImpl;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
@@ -10,10 +18,12 @@ import com.redxun.common.base.entity.JsonResult;
|
|
|
import com.redxun.common.tool.StringUtils;
|
|
|
import com.redxun.web.controller.BaseController;
|
|
|
import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiImplicitParam;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
|
|
@@ -21,22 +31,39 @@ import java.util.List;
|
|
|
@RestController
|
|
|
@RequestMapping("/knowledge/banner")
|
|
|
@Api(tags = "业务--首页banner表")
|
|
|
-@ClassDefine(title = "业务--首页banner表",alias = "BannerController",path = "/knowledge/banner",packages = "",packageName = "子系统名称")
|
|
|
+@ClassDefine(title = "业务--首页banner表", alias = "BannerController", path = "/knowledge/banner", packages = "", packageName = "子系统名称")
|
|
|
public class BannerController extends BaseController<Banner> {
|
|
|
|
|
|
-@Autowired
|
|
|
-BannerServiceImpl bannerService;
|
|
|
+ @Autowired
|
|
|
+ BannerServiceImpl bannerService;
|
|
|
|
|
|
|
|
|
-@Override
|
|
|
-public BaseService getBaseService() {
|
|
|
-return bannerService;
|
|
|
-}
|
|
|
+ @Override
|
|
|
+ public BaseService getBaseService() {
|
|
|
+ return bannerService;
|
|
|
+ }
|
|
|
|
|
|
-@Override
|
|
|
-public String getComment() {
|
|
|
-return "业务--首页banner表";
|
|
|
-}
|
|
|
+ @Override
|
|
|
+ public String getComment() {
|
|
|
+ return "业务--首页banner表";
|
|
|
+ }
|
|
|
|
|
|
+ @ApiOperation(value = "Banner列表")
|
|
|
+ @ApiImplicitParam(name = "queryData", value = "查询条件")
|
|
|
+ @PostMapping("findAllBanner")
|
|
|
+ public JsonPageResult findAllBanner(@RequestBody QueryData queryData) {
|
|
|
+ JsonPageResult jsonResult = JsonPageResult.getSuccess("返回数据成功!");
|
|
|
+ try {
|
|
|
+ QueryFilter filter = QueryFilterBuilder.createQueryFilter(queryData);
|
|
|
+ IPage page = bannerService.findAllBanner(filter);
|
|
|
+ this.handlePage(page);
|
|
|
+ jsonResult.setPageData(page);
|
|
|
+ } catch (Exception e) {
|
|
|
+ jsonResult.setSuccess(false);
|
|
|
+ this.logger.error(ExceptionUtil.getExceptionMessage(e));
|
|
|
+ jsonResult.setMessage(ExceptionUtil.getExceptionMessage(e));
|
|
|
+ }
|
|
|
+ return jsonResult;
|
|
|
+ }
|
|
|
}
|
|
|
|