当前位置:网站首页>2、 Pinda general permission system__ Project construction
2、 Pinda general permission system__ Project construction
2022-07-19 08:56:00 【The best is like water】
One 、 Project structures,
1.1、 Import the initial project
In view of the time relationship , We no longer create projects manually , Initial Engineering pinda-authority Just import .
Import steps :
- The initial works
pinda-authorityCopy to any directory without Chinese and spaces - open idea、 choice open, choice
pinda-authorityThe project directory is sufficient
The imported project structure is as follows :
1.2、 Project module introduction
The overall engineering structure and module functions of Pinda general authority system project are as follows :
pinda-authority # Polymerization Engineering , For polymerization pd-parent、pd-apps、pd-tools Equal module
├── pd-parent # The parent project ,nacos Configuration and dependent package management
├── pd-apps # Application directory
├── pd-auth # Permission service parent project
├── pd-auth-entity # Permission entities
├── pa-auth-server # Rights services
├── pd-gateway # Gateway service
└── pd-tools # Tool engineering
├── pd-tools-common # Basic components : Basic configuration class 、 function 、 Constant 、 Unified exception handling 、undertow The server
├── pd-tools-core # Core components : Basic entities 、 Returns the object 、 Context 、 exception handling 、 Distributed lock 、 function 、 Trees
├── pd-tools-databases # Data source component : Data source configuration 、 Data access 、 Query conditions, etc
├── pd-tools-dozer # Object conversion :dozer To configure 、 Tools
├── pd-tools-j2cache # Cache components :j2cache、redis cache
├── pd-tools-jwt # JWT Components : To configure 、 attribute 、 Tools
├── pd-tools-log # The logging component : Log entities 、 event 、 Interceptor 、 Tools
├── pd-tools-swagger2 # Document component :knife4j file
├── pd-tools-user # User context : User comments 、 Models and tools , Current login user information injection module
├── pd-tools-validator # Form validation : Background form rule validation
├── pd-tools-xss # xss Anti injection components
Project services have two : Gateway service and permission service :
| application | port | explain | Start command |
|---|---|---|---|
| pd-gateway | 8760 | Gateway service | java -jar pd-gateway.jar & |
| pd-auth-server | 8764 | Rights services | java -jar pd-auth-server.jar & |
Because this system is based on the current very popular front and back-end separation development mode , The front-end part is in the charge of special front-end developers .
1.3、 Service registration and configuration center
This project uses Nacos As the registration and configuration center of the service .Nacos Alibaba open source is a support service registered in discovery , Components of configuration management and microservice Management . To replace the previously used registry (zookeeper、eureka wait )、 And the configuration center (spring colud config wait ).Nacos It integrates the functions of registry and configuration center , Two in one .
The installation and configuration process is as follows :
First step : download Nacos Installation package , Address :https://github.com/alibaba/nacos/releases/download/1.1.4/nacos-server-1.1.4.zip
The second step : Will download zip Decompress the compressed file
The third step : Modify the configuration file :NACOS_HOME/conf/application.properties
#*************** Config Module Related Configurations ***************#
### If use MySQL as datasource:
spring.datasource.platform=mysql
### Count of DB:
db.num=1
### Connect URL of DB:
db.url.0=jdbc:mysql://127.0.0.1:3306/nacos?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
db.user.0=root
db.password.0=root
Be careful :Nacos When storing data, you can use the built-in database to store , It can also be stored through a database specified by a third party . We specified above the use of MySQL Database to store Nacos Relevant data , So we need to configure the MySQL Data source information of the database , This can be done according to your own MySQL Adjust the database accordingly , for example :MySQL The address of 、 user name 、 Password etc. .
Step four : Create database
CREATE DATABASE `nacos` CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
Step five : perform NACOS_HOME/conf/nacos-mysql.sql Database script file , After that, you can see that the following table has been created 
Step six : start-up Nacos service , double-click NACOS_HOME/bin/startup.cmd
Nacos Single machine mode and cluster mode startup (java.net.UnknownHostException: jmenv.tbsite.net Exception resolution )
Step seven : visit Nacos Console , Address http://localhost:8848/nacos, Default user name / password :nacos/nacos
Step eight : New namespace pinda-dev
Be careful , Namespace id Need to replace to project file pd-parent/pom.xml Corresponding nacos Namespace id:
Step nine : Import profile , choice nacos The namespace of the configuration center , Click the import configuration button , choice :docs/nacos/nacos_config_export_2020-03-23 17_31_42.zip. After the import is completed, it is as follows :


1.4、redis
In the project development phase, we use windows Version of Redis, Direct decompression redis-win32-win64.zip Compressed files , Then double click. REDIS_HOME/64bit/redis-server.exe start-up Redis Service is ready to use .
1.5、 Introduction to development methods
From the initial project imported earlier, you can see ,pd-tools Each sub module in the project has been developed , These sub modules are the basic components of the project , Provide support for our subsequent development of Gateway Services and permission services , And there are some sub modules that can be reused in other projects .
- pd-tools-swagger2 # Document component :knife4j file
- pd-tools-common # Basic components : Basic configuration class 、 function 、 Constant 、 Unified exception handling 、undertow The server
- pd-tools-core # Core components : Basic entities 、 Returns the object 、 Context 、 exception handling 、 Distributed lock 、 function 、 Trees
- pd-tools-databases # Data source component : Data source configuration 、 Data access 、 Query conditions, etc
- pd-tools-dozer # Object conversion :dozer To configure 、 Tools
- pd-tools-j2cache # Cache components :j2cache、redis cache
- pd-tools-jwt # JWT Components : To configure 、 attribute 、 Tools
- pd-tools-log # The logging component : Log entities 、 event 、 Interceptor 、 Tools
- pd-tools-user # User context : User comments 、 Models and tools , Current login user information injection module
- pd-tools-validator # Form validation : Background form rule validation
- pd-tools-xss # xss Anti injection components
边栏推荐
- Idea debug according to conditional breakpoints
- 不创建临时变量交换数组元素
- Basic steps for creating a static library
- Left connection query of Android database
- 2022年夏令营难忘的一天
- [handwritten numeral recognition] handwritten numeral recognition based on lenet network with matlab code
- Collation of exercises of shallow neural networks in the third week of in-depth study
- 小说里的编程 【连载之十四】元宇宙里月亮弯弯
- Hcip - Comprehensive Experiment of OSPF
- Zero basic C language
猜你喜欢

Softmax regression + loss function + image classification dataset

HCIP --- OSPF的综合实验

Use torch NN builds the simplest neural network framework

数据湖(二十):Flink兼容Iceberg目前不足和Iceberg与Hudi对比

How to set preferences when developing esp8266 and esp32 with Arduino

ARM计算新应用,违规垂钓“一网打尽”

Dynamic memory management

Scratch reverse order output electronic society graphical programming scratch grade examination level 4 true questions and answers analysis June 2022

树状数组

mongodb $符号的神奇用法+mongo数据类型
随机推荐
(鬼火引擎)中多设备的支持
Paddleserving service deployment tensorrt reports an error, shape of TRT subgraph is [-1, -1768],
一文,教你实现单点登录
【回归预测】基于粒子滤波实现锂离子电池寿命预测附matlab代码
Junit5
MySQL索引(一)
Nacos new configuration management
软件测试需要学习多久?
解决接口跨域问题和node操作MySQL
对ogg用户进行加密
What is memory overflow
项目代码训练教程
小说里的编程 【连载之十五】元宇宙里月亮弯弯
Use of datasets in trochvision
【无标题】
QT serial communication
小说里的编程 【连载之十一】元宇宙里月亮弯弯
小说里的编程 【连载之十四】元宇宙里月亮弯弯
Sorting out of neural network basics exercises in the second week of in-depth study
MySQL视图