基于springboot和mybatis的RealWorld后端项目实战一之hello-springboot

新建Maven项目

注意archetype选择quickstart
在这里插入图片描述

pom.xml

在这里插入图片描述
在这里插入图片描述

修改App.java

在这里插入图片描述

App.java同级目录新增controller包

在这里插入图片描述

HelloController.java

package org.example.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("hello")
public class HelloController {

    @GetMapping("/show")
    public String sayHello(){
        return "helloworld";
    }
}

启动服务

浏览器输入

http://localhost:8080/hello/show

在这里插入图片描述

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-18 00:10:05       67 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-18 00:10:05       72 阅读
  3. 在Django里面运行非项目文件

    2024-07-18 00:10:05       58 阅读
  4. Python语言-面向对象

    2024-07-18 00:10:05       69 阅读

热门阅读

  1. Windows 点云生成二维栅格图 [附C++完整代码实现]

    2024-07-18 00:10:05       20 阅读
  2. go recover

    2024-07-18 00:10:05       23 阅读
  3. docker从0到1 部署gitlab 纯干货

    2024-07-18 00:10:05       22 阅读
  4. C# —— var

    2024-07-18 00:10:05       23 阅读
  5. 【VUE】10、VUE项目中多环境管理使用

    2024-07-18 00:10:05       24 阅读
  6. React学习记录 ---第六章

    2024-07-18 00:10:05       21 阅读
  7. python 读取 hdfs 数据

    2024-07-18 00:10:05       20 阅读
  8. 营销策划方案模板

    2024-07-18 00:10:05       22 阅读
  9. C#模式匹配 关系模式,多个输入

    2024-07-18 00:10:05       22 阅读
  10. NumPy中np.clip()的用法

    2024-07-18 00:10:05       21 阅读