赞
踩
目录
新建项目时根据提示填好参数;
组件依赖可以选择必要的jpa和redis及辅助插件lombok;
把配置文件改为yml文件
- server:
- port: 9999
- spring:
- profiles:
- active: dev
添加dev环境的配置文件
- server:
- servlet:
- context-path: /demo
去掉数据库的校验(暂时不需要使用数据库)
- package org.demo.springboot;
-
- import org.springframework.boot.SpringApplication;
- import org.springframework.boot.autoconfigure.SpringBootApplication;
- import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
-
- import javax.sql.DataSource;
-
- @SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
- public class SpringbootApplication {
-
- public static void main(String[] args) {
- SpringApplication.run(SpringbootApplication.class, args);
- }
-
- }
![](https://csdnimg.cn/release/blogv2/dist/pc/img/newCodeMoreWhite.png)
- /**
- * Copyright 2020 michelin.com.cn All right reserved. This software is the
- * confidential and proprietary information of michelin.com.cn ("Confidential
- * Information"). You shall not disclose such Confidential Information and shall
- * use it only in accordance with the terms of the license agreement you entered
- * into with michelin.com.cn.
- */
- package org.demo.springboot.order;
-
- import org.springframework.web.bind.annotation.GetMapping;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RestController;
-
- import java.util.ArrayList;
- import java.util.HashMap;
- import java.util.List;
-
- /**
- * 描 述:class description.
- * <p>
- * Copyright: Copyright (c) 2020
- *
- * @author 葛东升
- * @version 1.0 6/29/21
- * @see HISTORY 6/29/21 葛东升 创建文件
- */
- @RestController
- @RequestMapping("/order")
- public class OrderController {
-
- @GetMapping("/queryAll")
- public List<HashMap<String,String>> queryAll(){
- List<HashMap<String, String>> res = new ArrayList<>();
- HashMap<String, String> r = new HashMap<>();
- r.put("1","hello");
- res.add(r);
-
- return res;
- }
- }
![](https://csdnimg.cn/release/blogv2/dist/pc/img/newCodeMoreWhite.png)
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。