不明白这样改的意思

来源:7-4 分类表格显示优化

qq_蓝骏毅_04076633

2021-07-04

输入正文

@GetMapping("/all")
//模糊匹配:like
public CommonResp all(){
    CommonResp<List<CategoryQueryResp>> resp = new CommonResp<>();
    List<CategoryQueryResp> list = categoryService.all();
    resp.setContent(list);
    return resp;
}
public List<CategoryQueryResp> all() {
    CategoryExample categoryExample = new CategoryExample();

    categoryExample.setOrderByClause("sort asc");

    List<Category> categoryList = categoryMapper.selectByExample(categoryExample);

    // 列表复制
    List<CategoryQueryResp> list = CopyUtil.copyList(categoryList, CategoryQueryResp.class);

    return list;
}

清空

handleQuery()方法


写回答

1回答

甲蛙

2021-07-07

没明白你的问题在哪?这段就是查所有的分类,按sort排序

0
0

Spring Boot+Vue3前后端分离,实战wiki知识库系统

一课掌握前后端最火框架,更有职场竞争力

2524 学习 · 1672 问题

查看课程