package com.test.controller;
import com.test.bean.Result;
import com.test.entity.Menu;
import com.test.services.TestService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 测试
*/
@RestController
@RequestMapping("/test")
@Api(tags = "测试")
public class TestController {
@Autowired
private TestService testService;
@RequestMapping(value = "getMenu", method = RequestMethod.GET)
@ApiOperation(value = "获取菜单信息-关联方式")
public Result getMenu() {
List<Menu> menus = testService.selectMenu();
Result result = new Result();
result.setData(menus);
result.setSuccess(true);
return result;
}
@RequestMapping(value = "getNestedMenu", method = RequestMethod.GET)
@ApiOperation(value = "获取菜单信息-嵌套方式")
public Result getNestedMenu() {
List<Menu> menus = testService.selectNestedMenu();
Result result = new Result();
result.setData(menus);
result.setSuccess(true);
return result;
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
Spring+MyBatis使用collection标签的两种使用方法
共15个文件
java:8个
xml:3个
properties:2个
需积分: 0 1 下载量 94 浏览量
2023-09-06
11:07:39
上传
评论
收藏 19KB ZIP 举报
温馨提示
Spring Boot+MyBatis使用collection标签的两种使用方法 1. 方法一: 关联查询 2. 方法二: 嵌套select查询 博客地址:https://blog.csdn.net/u011974797/article/details/132709944
资源推荐
资源详情
资源评论
收起资源包目录
spring-mybatis-collection.zip (15个子文件)
spring-mybatis-collection
pom.xml 3KB
src
main
resources
application-test.properties 443B
application.properties 69B
mappers
TestMapper.xml 2KB
logback-spring.xml 3KB
java
com
test
ApplicationMain.java 399B
services
TestService.java 545B
controller
TestController.java 1KB
dao
TestMapper.java 170B
entity
Menu.java 250B
config
SwaggerConfig.java 1KB
WebMvcConfig.java 1KB
bean
Result.java 174B
db
menu.sql 918B
截取图片_20230906102125.jpg 8KB
共 15 条
- 1
资源评论
涛哥是个大帅比
- 粉丝: 299
- 资源: 32
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功