若依框架----代码生成(详解)
生活随笔
收集整理的這篇文章主要介紹了
若依框架----代码生成(详解)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
若依框架----代碼生成
官方開發手冊:若依后臺開發手冊----代碼生成
具體流程:
1、在若依框架對應的數據庫中新建表sys_product
drop table if exists sys_product; create table sys_product (product_id bigint(20) not null auto_increment comment '產品id',parent_id bigint(20) default 0 comment '父產品id',product_name varchar(30) default '' comment '產品名稱',order_num int(4) default 0 comment '顯示順序',status char(1) default '0' comment '產品狀態(0正常 1停用)',primary key (product_id) ) engine=innodb auto_increment=1 comment = '產品表';
2、建表完成后回到【代碼生成】功能→導入表
3、點擊生成代碼,會得到一個壓縮包
4、壓縮包解壓后具體目錄結構
├── main //控制層、mapper層、service層、實體類以及映射xml文件└── java └── controller //控制層└── domain //實體類└── mapper //mapper層└── service //service層└── resources└── mapper.xml //mapper映射文件├── vue //視圖及所有涉及到的請求└── api └── js //請求└── views└── vue //視圖├── sql文件main文件夾包含java和resources
java文件夾下:控制層、實體類、mapper層、service層
resources文件夾下對應著mapper層的xml文件
vue文件夾下包含api與views兩個文件夾
api // 所有請求 views // view5、去navicat執行productMenu.sql
6、打開若依框架項目目錄
后端結構
com.ruoyi ├── common // 工具類 │ └── annotation // 自定義注解 │ └── config // 全局配置 │ └── constant // 通用常量 │ └── core // 核心控制 │ └── enums // 通用枚舉 │ └── exception // 通用異常 │ └── filter // 過濾器處理 │ └── utils // 通用類處理 ├── framework // 框架核心 │ └── aspectj // 注解實現 │ └── config // 系統配置 │ └── datasource // 數據權限 │ └── interceptor // 攔截器 │ └── manager // 異步處理 │ └── security // 權限控制 │ └── web // 前端控制 ├── ruoyi-generator // 代碼生成(可移除) ├── ruoyi-quartz // 定時任務(可移除) ├── ruoyi-system // 系統代碼 ├── ruoyi-admin // 后臺服務 ├── ruoyi-xxxxxx // 其他模塊前端結構
├── build // 構建相關 ├── bin // 執行腳本 ├── public // 公共文件 │ ├── favicon.ico // favicon圖標 │ └── index.html // html模板 │ └── robots.txt // 反爬蟲 ├── src // 源代碼 │ ├── api // 所有請求 │ ├── assets // 主題 字體等靜態資源 │ ├── components // 全局公用組件 │ ├── directive // 全局指令 │ ├── layout // 布局 │ ├── router // 路由 │ ├── store // 全局 store管理 │ ├── utils // 全局公用方法 │ ├── views // view │ ├── App.vue // 入口頁面 │ ├── main.js // 入口 加載組件 初始化等 │ ├── permission.js // 權限管理 │ └── settings.js // 系統配置 ├── .editorconfig // 編碼格式 ├── .env.development // 開發環境配置 ├── .env.production // 生產環境配置 ├── .env.staging // 測試環境配置 ├── .eslintignore // 忽略語法檢查 ├── .eslintrc.js // eslint 配置項 ├── .gitignore // git 忽略項 ├── babel.config.js // babel.config.js ├── package.json // package.json └── vue.config.js // vue.config.js7、根據項目目錄結構將生成的文件放到對應的項目文件中
注:
菜單管理
總結
以上是生活随笔為你收集整理的若依框架----代码生成(详解)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 微运行库2015_vc++2015运行库
- 下一篇: 7 useLayoutEffect、us