15 minutes to teach you to use Spring Boot Thymeleaf a custom map of bed management tool!

SpringBoot OSS service custom map bed

Source address: https: //github.com/Snailclimb/springboot-aliyun-oss

Foreword

Under epidemic, every day is lazy ah! Anyway, no matter at home idle, and thus, I spent a day writing this simple project. In fact, I have been ready to continue to improve it, and then deployed to the album as their own cloud server. Later, too lazy, I do not want to write front-end, so leave some agents.

The project is small, but perfectly formed, can be directly used as a tool to use, although the code is written in haste, but should be no big problem in general, it can be directly used for beginners to learn.

Overall, the project is mainly to provide them help you:

  1. Ali cloud oss ​​very commonly used as a drawing-down service, simply look at the package and help you later use;
  2. Use SpringBoot technology stack and thymeleaf template engine, front-end frame using a homemade praise more layui. This project can take you over the front and rear ends of the development process together.

I'll write React and Vue but considering that most of the friends had any contact with the back-end, so the direct use thymeleaf whole, saying layui still the first time! We are following layui official website to find the step by step painted gourd dipper to write the front page.

Show results

Compare ugly pages long, I did not spend much time in the above, will the look.

bilibili watch online: https: //www.bilibili.com/video/av88090586

Upload page

Upload successful

Technology stack

  • Backend: Spring Boot
  • Front-end: thymeleaf template engine framework layui

React and Vue have written before, the first time to develop front-end with thymeleaf plus layai, in general, I still like React little more.

Startup project

1. cloned into local

git clone [email protected]:Snailclimb/springboot-aliyun-oss.git

2. Use the idea to open the project or other development tools

3. Add , reads as follows:application.yml

ps:我在用 git 提交的时候将application.yml 忽略掉了,所以你需要手动添加到你的本地。

spring:
  servlet:
    multipart:
      max-file-size: 10MB
      max-request-size: 10MB
  thymeleaf:
    #关闭thymeleaf的缓存,不然在开发过程中修改页面不会立刻生效需要重启,生产可配置为true
    prefix: classpath:/web/
    cache: false
    suffix: .html
aliyun:
  oss:
    bucket-name: my-blog-to-use
    endpoint: oss-cn-beijing.aliyuncs.com
    access-key-id: 替换为你的key id
    #阿里云主账号AccessKey拥有所有API的访问权限,风险很高。建议创建并使用RAM账号进行API访问或日常运维,请登录 https://ram.console.aliyun.com 创建RAM账号。
    access-key-secret: 替换为你的key secret
    file-host: test

4.运行项目即可!

代办

  • [x] 单个图片的上传和删除(前后端)
  • [x] 查看所有图片(后端)
  • [ ] 查看所有图片(前端)
  • [ ] 查看所有图片的时候可以对图片进行操作比如删除
  • [ ] ......

开源项目推荐

作者的其他开源项目推荐:

  1. JavaGuide:【Java学习 面试指南】 一份涵盖大部分Java程序员所需要掌握的核心知识。
  2. springboot-guide : 适合新手入门以及有经验的开发人员查阅的 Spring Boot 教程(业余时间维护中,欢迎一起维护)。
  3. programmer-advancement : 我觉得技术人员应该有的一些好习惯!
  4. spring-security-jwt-guide :从零入门 !Spring Security With JWT(含权限验证)后端部分代码。

公众号

发布了217 篇原创文章 · 获赞 2269 · 访问量 106万+

Guess you like

Origin blog.csdn.net/qq_34337272/article/details/104274543