1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- package com.fdkankan.ucenter.controller;
- import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
- import com.fdkankan.ucenter.common.Result;
- import com.fdkankan.ucenter.entity.Article;
- import com.fdkankan.ucenter.entity.Case;
- import com.fdkankan.ucenter.service.IArticleService;
- import com.fdkankan.ucenter.service.ICaseService;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.util.ObjectUtils;
- import org.springframework.web.bind.annotation.*;
- import javax.annotation.PostConstruct;
- /**
- * <p>
- * 前端控制器
- * </p>
- *
- * @author
- * @since 2022-10-13
- */
- @RestController
- @RequestMapping("/ucenter/article")
- public class ArticleController {
- @Autowired
- ICaseService caseService;
- /**
- * 行业解决方案-案例展示
- */
- @PostMapping("/detail")
- public Result detail(@RequestBody Case caseEntity) throws Exception {
- if(ObjectUtils.isEmpty(caseEntity.getId())){
- return Result.success();
- }
- 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));
- }
- }
|