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; /** *

* 前端控制器 *

* * @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 wrapper = new LambdaQueryWrapper<>(); wrapper.eq(Case::getIsPublic,1); wrapper.orderByAsc(Case::getSort); return Result.success(caseService.list(wrapper)); } }