|
@@ -2,11 +2,13 @@ package com.fdkankan.ucenter.controller;
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
+import com.fdkankan.ucenter.common.BaseController;
|
|
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.entity.Case;
|
|
import com.fdkankan.ucenter.service.IArticleService;
|
|
import com.fdkankan.ucenter.service.IArticleService;
|
|
import com.fdkankan.ucenter.service.ICaseService;
|
|
import com.fdkankan.ucenter.service.ICaseService;
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
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.*;
|
|
@@ -23,7 +25,7 @@ import javax.annotation.PostConstruct;
|
|
*/
|
|
*/
|
|
@RestController
|
|
@RestController
|
|
@RequestMapping("/ucenter/article")
|
|
@RequestMapping("/ucenter/article")
|
|
-public class ArticleController {
|
|
|
|
|
|
+public class ArticleController extends BaseController {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
ICaseService caseService;
|
|
ICaseService caseService;
|
|
@@ -39,10 +41,19 @@ public class ArticleController {
|
|
}
|
|
}
|
|
|
|
|
|
@PostMapping("/allList")
|
|
@PostMapping("/allList")
|
|
- public Result allList() throws Exception {
|
|
|
|
|
|
+ public Result allList(@RequestBody Case caseEntity) throws Exception {
|
|
|
|
+ String lang = getLang();
|
|
|
|
+ if("zh".equals(lang)){
|
|
|
|
+ lang = "cn";
|
|
|
|
+ }
|
|
LambdaQueryWrapper<Case> wrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<Case> wrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ if(StringUtils.isNotBlank(caseEntity.getTypeId())){
|
|
|
|
+ wrapper.eq(Case::getTypeId,caseEntity.getTypeId());
|
|
|
|
+ }
|
|
|
|
+ wrapper.eq(Case::getLanguage,lang);
|
|
wrapper.eq(Case::getIsPublic,1);
|
|
wrapper.eq(Case::getIsPublic,1);
|
|
wrapper.orderByAsc(Case::getSort);
|
|
wrapper.orderByAsc(Case::getSort);
|
|
|
|
+ wrapper.orderByAsc(Case::getId);
|
|
return Result.success(caseService.list(wrapper));
|
|
return Result.success(caseService.list(wrapper));
|
|
}
|
|
}
|
|
|
|
|