SpringBoot入门案例-阿里云版和纯手工版

简介: SpringBoot入门案例-阿里云版和纯手工版

文章目录

@TOC


前言

阿里云版和纯手工版详细步骤:
在这里插入图片描述

一、阿里云版

1.新增模块

  1. File
  2. Project Structure
  3. Spring Initializr
  4. 更改Initializr Service URL 为:https://start.aliyun.com

在这里插入图片描述

2.springboot联网功能

注意:java version与自己配置的jdk版本保持一致
在这里插入图片描述

3.选择当前模块需要使用的技术集

  • 根据自己的需求选择
  • 选择web
  • 选择SpringWeb

在这里插入图片描述

4.控制类

package com.jkj.controller;

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

@RestController
@RequestMapping("/booksThree")
public class BookController {
    @GetMapping
    public String ById(){
        System.out.println("springboot_03 is running...");
        return "springboot_03 is running...";
    }
}

5.测试

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

二、纯手工版

1.新建模板-Maven

  1. File
  2. Project Structure
  3. Maven

在这里插入图片描述

2.修改模块位置

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

3.配置依赖pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.jkj</groupId>
    <artifactId>springboot_05</artifactId>
    <version>1.0-SNAPSHOT</version>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.7.1</version>
    </parent>
    <description>Demo project for Spring Boot</description>
    <properties>
        <java.version>1.8</java.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>



</project>

4.编写Application入口类

package com.jkj;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class Application {
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}

5.控制类

package com.jkj.controller;

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

@RestController
@RequestMapping("/bookFive")
public class BookController {
    @GetMapping
    public String ById(){
        System.out.println("springboot_05 is running...");
        return "springboot_05 is running...";
    }
}

6.测试

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

相关文章
|
30天前
|
SQL JavaScript Java
springboot+springm vc+mybatis实现增删改查案例!
springboot+springm vc+mybatis实现增删改查案例!
24 0
|
2月前
|
弹性计算 数据可视化 Ubuntu
《Palworld/幻兽帕鲁》阿里云专用服务器搭建部署从入门到精通:2024年最新教程!
随着《幻兽帕鲁》的风靡,越来越多的玩家希望拥有属于自己的游戏服务器,以获得更加稳定和私密的游戏体验。今天,就为大家带来一份详细的新手教程,教您如何在阿里云上轻松搭建《幻兽帕鲁》专用服务器。 首先,您需要一台服务器。在这里,我们推荐使用阿里云服务器。它不仅稳定可靠,而且提供了丰富的幻兽帕鲁服务器搭建模板,让您轻松上手。
61 0
|
2天前
|
Java 关系型数据库 MySQL
一套java+ spring boot与vue+ mysql技术开发的UWB高精度工厂人员定位全套系统源码有应用案例
UWB (ULTRA WIDE BAND, UWB) 技术是一种无线载波通讯技术,它不采用正弦载波,而是利用纳秒级的非正弦波窄脉冲传输数据,因此其所占的频谱范围很宽。一套UWB精确定位系统,最高定位精度可达10cm,具有高精度,高动态,高容量,低功耗的应用。
一套java+ spring boot与vue+ mysql技术开发的UWB高精度工厂人员定位全套系统源码有应用案例
|
12天前
|
存储 缓存 Java
阿里云OSS实战从入门到大神
说起阿里云OSS,那作用和功能都是非常强大的,它可以存放图片,音频,视频等资源文件,这些资源文件,你不必存放到服务器的硬盘里,这样既可以节省服务器硬盘空间,又可以降低服务器的读写压力,非常适合大并发的架构。
52 0
|
18天前
|
存储 Java 定位技术
SpringBoot轻松实现二维码条形码含源码案例
SpringBoot轻松实现二维码条形码含源码案例
16 1
|
24天前
|
存储 对象存储 容器
阿里云OSS对象存储基础入门
阿里云OSS对象存储基础入门
87 0
|
27天前
|
存储 DataWorks Kubernetes
阿里云cam授权案例
以下是内容摘要: 1. 阿里云OSS自定义策略允许全权访问`dc-odsopr`及其所有内容。 2. Dataworks授权文档详情见[此处](https://help.aliyun.com/document_detail/74302.html)。 3. 日志权限策略涵盖多种日志操作,如获取和管理项目、作业、日志存储等,限定于`cn-shenzhen`区域的`k8s`项目。 4. AliKafka权限包括实例、主题的管理,消息操作及部署、ACL、用户管理等。 5. OSS策略允许上传对象至`sz-creative-system-test-public`存储空间。
25 5
|
1月前
使用阿里云智能翻译接口案例—
使用阿里云智能翻译接口案例—
10 0
|
1月前
|
JSON 数据格式
使用阿里云火车票查询接口案例—
使用阿里云火车票查询接口案例—
10 0
|
1月前
使用阿里云身份证扫描识别接口案例—
使用阿里云身份证扫描识别接口案例—
31 0