|
@@ -1,13 +1,18 @@
|
|
package com.fdkankan.ucenter.controller;
|
|
package com.fdkankan.ucenter.controller;
|
|
|
|
|
|
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.fdkankan.ucenter.common.Result;
|
|
import com.fdkankan.ucenter.common.Result;
|
|
import com.fdkankan.ucenter.entity.Article;
|
|
import com.fdkankan.ucenter.entity.Article;
|
|
|
|
+import com.fdkankan.ucenter.entity.Case;
|
|
import com.fdkankan.ucenter.service.IArticleService;
|
|
import com.fdkankan.ucenter.service.IArticleService;
|
|
|
|
+import com.fdkankan.ucenter.service.ICaseService;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.util.ObjectUtils;
|
|
import org.springframework.util.ObjectUtils;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
+import javax.annotation.PostConstruct;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* <p>
|
|
* <p>
|
|
* 前端控制器
|
|
* 前端控制器
|
|
@@ -21,16 +26,25 @@ import org.springframework.web.bind.annotation.*;
|
|
public class ArticleController {
|
|
public class ArticleController {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
- IArticleService articleService;
|
|
|
|
|
|
+ ICaseService caseService;
|
|
/**
|
|
/**
|
|
* 行业解决方案-案例展示
|
|
* 行业解决方案-案例展示
|
|
*/
|
|
*/
|
|
@PostMapping("/detail")
|
|
@PostMapping("/detail")
|
|
- public Result detail(@RequestBody Article article) throws Exception {
|
|
|
|
- if(ObjectUtils.isEmpty(article.getId())){
|
|
|
|
|
|
+ public Result detail(@RequestBody Case caseEntity) throws Exception {
|
|
|
|
+ if(ObjectUtils.isEmpty(caseEntity.getId())){
|
|
return Result.success();
|
|
return Result.success();
|
|
}
|
|
}
|
|
- return Result.success(articleService.getById(article.getId()));
|
|
|
|
|
|
+ return Result.success(caseService.getById(caseEntity.getId()));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @PostMapping("/allList")
|
|
|
|
+ public Result allList() throws Exception {
|
|
|
|
+ LambdaQueryWrapper<Case> wrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ wrapper.eq(Case::getIsPublic,1);
|
|
|
|
+ wrapper.orderByAsc(Case::getSort);
|
|
|
|
+ return Result.success(caseService.list(wrapper));
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|