0
点赞
收藏
分享

微信扫一扫

springboot第8集:示例代码案例详细解释内容


controller.TestController

@RestController // 将数据以json形式返回
public classTestController {
 @GetMapping("/test")
 public String test() {
  return "hello <https://github.com/webVueBlog/JavaGuideInterview>"
 }
}

集成热部署并配置多环境和sql日志


springboot第8集:示例代码案例详细解释内容_后端

1679721134006.png

springboot第8集:示例代码案例详细解释内容_spring boot_02

1679721175446.png

springboot第8集:示例代码案例详细解释内容_数据库_03

1679721228189.png

springboot第8集:示例代码案例详细解释内容_spring boot_04

1679721268842.png

springboot第8集:示例代码案例详细解释内容_后端_05

1679721332998.png

springboot第8集:示例代码案例详细解释内容_spring_06

1679721419897.png

创建数据库以及表


springboot第8集:示例代码案例详细解释内容_后端_07

1679721895855.png

springboot第8集:示例代码案例详细解释内容_数据库_08

image.png

springboot第8集:示例代码案例详细解释内容_java_09

image.png

springboot第8集:示例代码案例详细解释内容_spring boot_10

image.png

springboot第8集:示例代码案例详细解释内容_spring boot_11

image.png

  • 点击【终端】,登录root帐号,根据系统运行命令安装maven。

apt-get install maven

或者

yum install maven

解压到宝塔面板/www/wwwroot目录。


springboot第8集:示例代码案例详细解释内容_数据库_12

image.png

打开【终端】,运行cd命令进入项目目录的server目录,运行编译命令。首次编译需要下载依赖,时间会比较长。

cd /www/wwwroot/xxx/server
mvn clean install -Dmaven.test.skip=true -f pom.xml


springboot第8集:示例代码案例详细解释内容_spring_13

image.png

springboot第8集:示例代码案例详细解释内容_spring boot_14

image.png

点击【设置】-【伪静态】,填写下面伪静态信息,【保存】。

location / {
  try_files $uri $uri/ /index.html;
}


springboot第8集:示例代码案例详细解释内容_后端_15

image.png

点击【SSL】-【Let's Encrypt】,选择【文件验证】,勾选域名,点击【申请】,等待完成https证书申请。


springboot第8集:示例代码案例详细解释内容_spring boot_16

image.png

springboot第8集:示例代码案例详细解释内容_后端_17

image.png

PC端和手机端

# 请将伪静态规则或自定义NGINX配置填写到此
location /pc {
  try_files $uri $uri/ /pc/index.html;
}

location /mobile {
  try_files $uri $uri/ /mobile/index.html;
}

点击【SSL】-【Let's Encrypt】,选择【文件验证】,勾选域名,点击【申请】,等待完成https证书申请。

如果该产品有PC端网页前台访问:https://添加的前台域名/pc,即可访问PC端。如果该产品有手机网页端前台访问:https://添加的前台域名/mobile,即可访问PC端。默认访问域名,会自动根据访问者使用PC或手机自动跳转。

仓库地址:https://github.com/webVueBlog/JavaGuideInterview

举报

相关推荐

0 条评论