1.创建mongodb数据库
1 | docker exec -it mymongodb mongo |
2.创建项目
2.1.配置application.properties文件
1 | server.address=localhost |
2.2.创建Image实体类
1 | package com.waylanpunch.mongodbfileserver.bean; |
2.3.创建ImageRepository类
1 | package com.waylanpunch.mongodbfileserver.repository; |
2.4.创建ImageService接口
1 | package com.waylanpunch.mongodbfileserver.service; |
2.5.创建ImageServiceImpl类
1 | package com.waylanpunch.mongodbfileserver.service; |
2.6.创建ImageController类
1 | package com.waylanpunch.mongodbfileserver.controller; |
2.7.创建Spring Security配置类
1 | package com.waylanpunch.mongodbfileserver.config; |
2.8.创建MD5工具类
1 | package com.waylanpunch.mongodbfileserver.util; |