Lamp-boot 3.0.0 released, Java rapid development platform

3.0.0 version update details:

Project structure adjustment

  • Project name changes:

    Original open source project Open source project Former Member Project Current member projects Remarks
    zuihou-admin-boot lamp boat zuihou-boat-plus lamp-boot-plus Single version
    zuihou-commons lamp-util zuihou-commons-more lamp-util-plus Business-independent toolset
    zuihou-generator lamp-generator zuihou-generator-plus lamp-generator-plus Code generator
    zuihou-ui lamp-web zuihou-ui lamp-web-plus Tenant Management Backstage
    zuihou-admin-ui lamp-web zuihou-admin-ui lamp-web-plus Operation management background (after 3.0: zuihou-ui and zuihou-admin-ui merged into lamp-web)
  • The login account and password configured in the configuration file are modified to: lamp/lamp

  • The functions of zuihou-ui and zuihou-admin-ui are merged into lamp-web

  • Abandon lamp-j2cache-starter, and fully use lamp-cache-stater;

  • The lamp-util (formerly zuihou-commons) project adds a lamp-annotation module, which extracts the annotations, models, enumerations, etc. commonly used in the system, and reduces the dependency coupling of the multi-module business system

  • The jobs service is abandoned, and the independent timing service of version 3.0.1 is a separate project. Why is it abandoned?

    1. The code quality of xxl-job is too poor, and a large amount of code does not meet the specifications of the code scanner! ! !
    2. The timing service scheduler is an independent project that has nothing to do with the business, and should not be put together with the business project;
    3. The version of xxl-job used is too low;

Database adjustment

  • Use PDMan to organize the table structure and make a relationship diagram
  • create_user 字段改成 created_by、 update_user 改成 updated_by
  • Rename fields of a large number of tables
  • The data of the data dictionary table is reset; c_common_dictionary + c_common_dictionary_item merge into one table: c_dictionary
  • The state fields are named according to the business meaning: state, status
    • Such as (hide, display), (yes, no), (available, unavailable), (enable, disable) and other fields use state
    • Such as OrderedStatus, ShippingStatus, ReceivedStatus and other fields use status
  • Database table name and table structure are fully reconstructed in accordance with specifications

Code & function adjustment

  • version upgrade:
    spring.boot.version > 2.3.6.RELEASE
    spring-boot-admin.version > 2.3.1
    knife4j.version -> 2.0.8
    springfox.swagger.version -> 2.10.5
    swagger-models.version -> 1.5.22
    druid.version -> 1.2.3
    mysql.version -> 8.0.22
    mybatis.version -> 3.5.6
    mybatis-spring.version -> 2.0.6
    mybatisplus.version -> 3.4.1
    transmittable-thread-local.version -> 2.12.0
    fastjson.version > 1.2.75
    transmittable-thread-local.version > 2.11.5
    commons-io.version > 2.8.0
    lombok.version > 1.18.16
    hutool.version > 5.5.2
    antisamy.version > 1.5.10
    caffeine.version > 2.8.6
    maven-source-plugin.version > 3.2.1
    maven-javadoc-plugin.version > 3.2.0
    
  • The @Autowired injection method in the whole system is discarded and replaced with constructor injection!
  • The default cache in SuperCacheServiceImpl uses CacheOps.
  • swagger automatic configuration supports ;configuring multiple packages by number
  • Fix some problem codes scanned by FindBugs Plugin and Alibaba Java Coding Guidelines plugin
  • PageParams#map changed to PageParams#extra
  • The original zuihou-log-starter module, com.github.lamp.log.logback.zuihou-defaults.xml was renamed: com.tangyh.basic.log.logback.defaults.xml
  • The class originally named My* was renamed Lamp*
  • Class names such as abstract classes and tool classes that do not conform to the specification are reconstructed according to the Ali scanning specifications and FindBugs specifications
  • The default database ID generation method is adjusted to HUTOOL tool class
  • R Delete the getIsError() method (the front-end uses isError to determine it is changed to !isSuccess), and add errorMsg (record the original error message).
  • Obsolete CodeGenerate, AbstractDistributedLock, QueueConstants classes
  • Optimize InjectionCore, ValidatorConfiguration
  • LampMetaObjectHandler logic enhancement, supports entity injection id, creator, creation time, modification person, modification time for entities that do not inherit the base class
  • <relativePath>../</relativePath> Adjusted in pom file  to <relativePath>../pom.xml</relativePath>
  • MsgsReplace all the package names and class names involved in the original zuihou-msgs service withMsg
  • Added fields in user table: salt, password is modified to salt + sha256 algorithm
  • The resource code of the c_resource (formerly c_auth_resource) table is adjusted to level 3: service: function: operation point such as: authority:org:add, authority:org:update
  • Built-in 0000 tenants add 4 built-in roles and 5 accounts
  • Resource coding refers to :*,;wildcards such as shiro implementation support . The colon is used as the permission separator, the asterisk matches any character string, the comma specifies multiple permissions, and the semicolon supports the configuration of multiple codes.
  • Rewrite login, logout, and cache interface logic
  • Fix the bug when the message center sends all users
  • Fix the bug that the data source mode test connection cannot close the data source link
  • The data dictionary table is merged into one, and the front-end and back-end code are rewritten
  • New online user function page in lamp-web
  • The lamp-web front-end project supports global configuration whether the left menu can expand multiple at the same time
  • The VUE_APP_IS_MULTI_TENANT parameter in lamp-web is changed to VUE_APP_IS_MULTI_TENANT_TYPE
  • The e-icon-picker component in lamp-web supports svg icons
  • The back-end adjusts the dictionary query interface ( /dictionary/codes) to facilitate the front-end to control multiple attributes when obtaining dictionary data
  • Files named in uppercase in the front-end project, uniformly changed to lowercase beginning

 

The origin of the lamp project name

Narrative version:

On a dark night with high winds, the children clamored to go out to play, so 程序员老婆they took the children out to let the wind go, and discussed the name of the project on the way. After the names they came up with were rejected one by one, everyone fell into Contemplation. While walking, under a street lamp, the child stared at the street lamp to break the silence, and shouted: Lantern~ My wife and I were stunned, and then stared at each other and said together: Haha, this name is good~

Explained version:

灯灯: It is the first word my child would say when learning to speak. It was also a name my child would break after thinking about a lot of project names. The light symbolizes the light. It brings hope to those in trouble and gives us the night of overtime work. Returned programmers guide the way forward~

灯灯(Abbreviated as lamp, English name: lamp), he is a general term for a project, including the following sub-projects

Lamp project composition

project gitee github Remarks
Toolset https://gitee.com/zuihou111/lamp-util https://github.com/zuihou/lamp-util Business-independent tool set, cloud and boot projects rely on it
Microservice version https://gitee.com/zuihou111/lamp-cloud https://github.com/zuihou/lamp-cloud SpringCloud 版
Single version https://gitee.com/zuihou111/lamp-boot https://github.com/zuihou/lamp-boot SpringBoot version (basically the same as lamp-cloud function)
Tenant background https://gitee.com/zuihou111/lamp-web https://github.com/zuihou/lamp-web PC management system
Code generator https://gitee.com/zuihou111/lamp-generator https://github.com/zuihou/lamp-generator For developers
Timing scheduler https://gitee.com/zuihou111/lamp-job https://github.com/zuihou/lamp-job Not yet developed

Introduction to lamp-boot

lamp-bootThe predecessor of is zuihou-admin-boot, since version 3.0.0, renamed lamp-boot, it is lampone of the members of the project.

lamp-cloud Based on  SpringBoot(2.3.6.RELEASE) a single rapid development platform, the configurable SaaS function is especially shining, with RBAC function, unified gateway authentication, Xss anti-cross-site attack, automatic code generation, multiple storage systems, distributed transactions, distributed timing tasks It supports parallel development of multiple business systems and parallel development of multiple services, and can be used as a development scaffold for back-end services. The code is concise, the comments are complete, and the structure is clear. It is very suitable for learning and enterprises as a basic framework.

The core technology uses SpringBoot, Mybatis, RabbitMQ, FastDFS/MinIO and other main frameworks and middleware. We hope to strive to build a set from  JavaWeb基础框架 -  单体架构 -  持续集成 -  系统监测 solutions.本项目旨在实现基础能力,不涉及具体业务。

 

Introduction to lamp tenant mode

This project can easily switch the tenant mode of the project through configuration  .

Tenant model description advantage Disadvantage
NONE (non-tenant mode) No tenants Simple and suitable for independent systems Lack of the advantages of a tenant system
COLUMN (field mode) Tenants share a database and add fields to the business table to distinguish Simple, uncomplicated, development without perception Poor data isolation, poor security, difficult data backup and recovery,
SCHEMA (independent schema) Each tenant has an independent database (schema). When executing sql, dynamically add the schema before the table name Simple, no perception of development, good data isolation The root account of the database must be configured in the configuration file, and complex SQL and SQL nested custom functions are not supported
DATASOURCE (independent data source) Each tenant has an independent database (data source), and the data source is dynamically switched when the code is executed The database can be deployed independently, with good data isolation, high scalability, and low failure impact Relatively complex, development needs to pay attention to transaction issues when switching data sources, and requires more databases

Lamp member version project demo address 

  • Address:  http://tangyh.top:10000/lamp-web/
  • The following built-in accounts are limited to the built-in 0000 tenants
  • Platform administrator: lamp_pt/lamp (built-in for the company's internal operations staff)
  • Super administrator: lamp/lamp
  • General administrator: general/lamp
  • Ordinary account: normal/lamp

ps: The built-in tenant in the demo environment does not have write permission. If you want to test additions, deletions and changes in the demo environment, please use the lamp_pt account to query the tenant administrator account and log in to the new tenant to test

Highlights of the lamp-boot project:

  1. Service authentication:   Strengthen the authorization verification of scheduling between services through JWT to ensure the security of internal services.

  2. monitor:

    Use Spring Boot Admin to monitor the running status of each independent Service; use turbine to view the running status and call frequency of the interface in real time; use Zipkin to view the call chain between each service.

  3. data permission

    The DataScopeInnerInterceptor interceptor based on Mybatis is used to realize the data permission function

  4. SaaS (multi-tenant) non-sense solution

    This project supports 3 common tenant solutions and no tenant solutions. With the same set of codes, you can modify one configuration to realize the tenant mode only switching.

  5. Cache abstraction

    CacheOps is used to operate the cache, with two built-in implementations: Caffeine and Redis, which can make the project run normally in an emergency without Redis

  6. Elegant bean conversion

    Use Dozer, BeanUtil and other components to optimize the conversion of DTO, DO, PO and other objects

  7. Unified front-end and back-end form validation

    Rigorous form validation usually requires both front-end and back-end verification. However, traditional projects can only be tested once for each front and back. After the rule changes, the front and back ends must be modified at the same time. Therefore hibernate-validator, the lamp-validator-starterinitial dependency is encapsulated on the basis , and a common interface is provided to obtain the rules that need to verify the form, and then the front-end uses the rules returned by the back-end. If the rules change in the future, only the back-end needs to modify.

  8. Anti-cross-site scripting (XSS)

    • Filter the form parameters in all requests through filters
    • Filter all application/json type parameters through Json deserializer
  9. Currently logged in user information injector

    • User identity injection through annotations
  10. Online API

    Because some functions of native swagger-ui are not friendly enough, the domestic open source is adopted knife4jand a statuser is made to facilitate the use of springboot users.

  11. Code generator

    A set of code generator is customized based on Mybatis-plus-generator. By configuring the annotations of the database fields, it automatically generates enumeration classes, data dictionary annotations, SaveDTO, UpdateDTO, form validation rule annotations, Swagger annotations, etc.

  12. Timed task scheduler

  13. Large file/breakpoint/slice resume

    The front-end uses webupload.js and the back-end uses NIO to realize large file breakpoint and fragmented resuming. After starting Eureka, Zuul, and File services, directly open docs/chunkUploadDemo/demo.html to test. After testing, the file service is started with a local limit of 128M of the maximum memory of the stack, and a large file of 4.6G+ can be successfully uploaded within 5 minutes. The time consumption of the official service will be affected by the bandwidth of the user and the server, and the time will be relatively long.

  14. Cross-table, cross-database, and cross-service related data automatic injector

    It is used to solve the pain of inter-table, cross-database, and cross-service paging data attributes or the attributes of a single object to echo associated data. It supports automatic injection of static data attributes (data dictionary) and dynamic primary key data.

Lamp-boot technology stack/version introduction:

  • The related technologies involved are:
    • JSON serialization: Jackson
    • Message queue: RabbitMQ
    • Cache: Redis
    • Database: MySQL 5.7.9 or MySQL 8.0.19
    • Timer
    • Front end: vue + element-ui
    • Persistence layer framework: Mybatis-plus
    • Code generator: customized based on Mybatis-plus-generator
    • Project construction: Maven
    • Monitoring: spring-boot-admin
    • File server: FastDFS 5.0.5/Alibaba Cloud OSS/local storage/MinIO
    • Nginx
  • Deployment aspects:
    • Server: CentOS
    • Jenkins
    • Docker
    • Governors

Project screenshot:

Preview Preview
Preview.png Preview.png
Preview.png Preview.png
Preview.png Preview.png
Preview.png Preview.png

Guess you like

Origin www.oschina.net/news/123146/lamp-boot-3-0-0-released