1、官網地址
- 官網演示地址https://fly.layui.com/
- 模板下載地址:https://www.layui.com/template/fly/
- 詳細開發文檔:https://www.sunnyblog.top/index.html?typeId=1260457825721647104
2、技術棧
- 開發工具 Idea
- 數據庫設計 PowerDesign
- JDK版本 Java8
- 數據庫 MySQL v5.7
- 后端開發語言 SpringBoot2.2.6.RELEASE
- 數據訪問層 Mybatis-Plus 3.3.1
- 前端相關 HTML5、LayUI、jQuery、LayUI_fly社區模板等
- 中間件 Redis緩存、RabbitMQ消息、Nginx等
- 文件服務 FastDFS分布式文件存儲、七牛雲等
- 富文本編輯器 WangEditor、Editor.md
- 三方登錄 QQ、微信、微博、gitee等
- 消息發送 郵件發送、發送釘釘消息、短信發送
- 集成三方api 帖子內容審核(百度審核)、百度推送等
3、表結構設計pd圖
4、框架搭建
4.1.集成MyBatis-Plus操作數據庫
-
引入maven依賴
<dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> </dependency> <dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-boot-starter</artifactId> <version>3.3.1</version> </dependency>
-
application.yml配置數據庫連接 spring: datasource: driver-class-name: com.mysql.cj.jdbc.Driver url: jdbc:mysql://127.0.0.1:3306/sunny-fly?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true&useAffectedRows=true username: root password: admin1009 type: com.zaxxer.hikari.HikariDataSource hikari: maximum-pool-size: 50 # 連接池最大連接數,默認是10 minimum-idle: 5 #最小空閑連接數量 idle-timeout: 18000 #空閑連接存活最大時間,默認600000(10分鍾) pool-name: sunnyHikariCP #連接池名稱 connection-test-query: SELECT 1
-
mybatis-plus基本配置類:MybatisPlusConfig.java @EnableTransactionManagement @Configuration @MapperScan("com.sunny.fly.mapper") public class MybatisPlusConfig { @Bean public PaginationInterceptor paginationInterceptor() { PaginationInterceptor paginationInterceptor = new PaginationInterceptor(); paginationInterceptor.setCountSqlParser(new JsqlParserCountOptimize(true)); return paginationInterceptor; } }
-
測試通過mybatis-plus操作數據庫
-
創建測試腳本
CREATE TABLE `test` ( `NAME` varchar(255) DEFAULT NULL, `AGE` int(11) DEFAULT NULL, `BIRTHDAY` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
創建pojo,mapper,service,controller
@Data @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) @TableName("TEST") public class TestBean implements Serializable { private static final long serialVersionUID = 1L; /** * 姓名 */ private String name; /** * 年齡 */ private int age; /** * 年齡 */ private Date birthday; }
mapper
@Repository
public interface TestMapper extends BaseMapper<TestBean> {
}
service
public List<TestBean> queryAll() {
return testMapper.selectList(null);
}
controller
@GetMapping("queryAll")
@ResponseBody
public ResponseResult<List<TestBean>> queryAll() {
List<TestBean> testList = testService.queryAll();
return ResponseUtil.makeOKRsp(testList);
}
- 頁面訪問
4.2、集成Redis緩存
5.首頁開發
6.詳情頁開發
7、登錄注冊以及個人中心開發文檔
源代碼下載地址
詳細開發技術文檔盡在 點擊這里查看技術文檔 ;更多技術文章: https://www.sunnyblog.top;任何疑問加QQ群咨詢:534073451