1.hello,world
准备
专业版(教育账户)(已申请)
maven
jdk
idea
gitee:Gitee - 基于 Git 的代码托管和研发协作平台
开始
创建完成后在目录里规范一下
在启动项内实验一下能不能启动和打印
代码
package com.example.demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
// Generated by https://start.springboot.io
// 优质的 spring/boot/data/security/cloud 框架中文文档尽在 => https://springdoc.cn
@SpringBootApplication
public class DemoApplication {
public static void main(String[] args) {
System.out.println("你好springboot");
SpringApplication.run(DemoApplication.class, args);
}
}
成功
新增comtroller(控制器)
代码
package com.example.demo.comtroller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class HelloController {
@RequestMapping(value = "hello", method = {RequestMethod.GET})
public String hello(){
return "hello world";
}
}
成功
推送入gitee仓库
参考CSDN本地springboot项目上传git管理-CSDN博客
步骤:
1.创建仓库
2.复制路径
3.进入项目搜索Git找到安装路径设置它
VCS创建git
提交一下
然后定义远程管理 复制路径登录
找出要推送的地方
点击推送就ok
成功推送