Kuaijia Framework v1.6 Update Instructions and User Manual

The Kuaijia framework is a minimal practice of a change-oriented J2EE development model. It modularizes a traditional J2EE single application and divides it into main applications including war, batch processing, etc. and common jars that can be relied on for independent maintenance; this The model is built with maven, and the main application can be deployed and started independently after integrating all the jars it depends on through spring, and provide external services.

The Kuaijia framework separates the code at the database persistence level and the controller level, which are the easiest to change in the iterative process of requirements, as modules, and uses the Kuaijiawang platform to provide code generation services; general developers only need to maintain separate maintenance for database definitions and interfaces pdm file and xml file, you can quickly obtain this part of the module code through the services provided by the Kuaijia.com platform, which can reduce the workload to a certain extent.

The Kuaijia development framework divides a standard J2EE project into basic components (Base), persistence layer components (Persistence-Impl), interface and message definition components (Bundle), interface simulation implementation components (BundleMock), business implementation components ( Service-Impl), batch system (Batch), interface system (Api) and interface test component (SDK) 8 parts are developed and constructed in parallel, among which the basic component (Base), interface and message definition component (Bundle), interface simulation Both the implementation component (BundleMock) and the interface test component (SDK) can be generated by the code generation service provided by the Kuaijia.com platform.

The framework is built based on spring4+mybatis3.3.0, the persistence layer is mysql, and the example demo fully implements the registration, login and automatic login interfaces. For the specific business logic, please refer to the Service-Impl component.

For specific interfaces, please refer to the description of Kuaijia framework interface.

For specific update instructions, see v1.6 update instructions

Install the base environment

mysql, refer to the linux installation mysql5.6.29 record

Prepare the Windows development environment

Download ciHelper1.8 version, install locally

#以下操作需要在git bash中执行
cd d:/workshop
git clone https://gitee.com/fastjrun/ciHelper.git
cd ciHelper
git checkout v1.8
mvn clean install -Pnocheck

Download ciAgent1.2 version, install to local

#以下操作需要在git bash中执行
cd d:/workshop
git clone https://gitee.com/fastjrun/ciagent.git
cd ciagent
git checkout v1.2
#先install本地cidev-api和xercesImpl
cd lib
mvn install:install-file -Dfile=cidev-sdk-1.3-SNAPSHOT.jar -DgroupId=com.fastjrun -DartifactId=cidev-sdk -Dversion=1.3-SNAPSHOT -Dpackaging=jar
mvn install:install-file -Dfile=xercesImpl-2.9.1.jar -DgroupId=xerces -DartifactId=xercesImpl -Dversion=2.9.1 -Dpackaging=jar
cd ..
mvn clean install -Pnocheck,local

In this project, the Base, Bundle, BundleMock, and SDK components are dynamically generated through the services provided by Kuaijia. The ciAgent is a maven plug-in, which interacts with Kuaijia as an agent. How it works can be seen in the ciAgent code. How to use ciAgent can refer to the pom.xml configuration of Base, Bundle, BundleMock and SDK.

download demo

Adjust the parameters of mysql by referring to the configuration information of the profile whose id is local in Api/pom.xml, and import fast_demo.sql and testdata.sql

#以下操作需要在git bash中执行
cd d:/workshop
git clonehttps://gitee.com/fastjrun/demo.git
cd demo
git checkout v1.6
mvn clean install -Pnocheck -pl .,Common,Util,Base,Bundle,BundleMock,SDK,Persistence-Impl,Service-Impl -Dcommongc.skip=false
mvn clean package -pl ApiBuffle,Api,Batch

Note: If you do not configure private server and use maven for the first time, it may be slow and easy to be interrupted. Try a few more times until you see that the above steps are all OK. It is strongly recommended to use private server, so that you can use all the above install commands or deploy (except cidev-api and xercesImpl need to upload to private server), considering that you may be on private server, pom.xml can support both nexus2 and nexus3, the default nexus3

#如切为nexus2,参考命令如下:
nexus2-snapshots:mvn clean deploy -Dmycompany-nexus=http://www.mycompany.com:8081/nexus -Dmycompany-snapshots-url-suffix=/content/repositories/snapshots/
nexus2-releases -Dmycompany-releases-url-suffix=/content/repositories/releases/

deploy

  • After installing tomcat, the tomcat directory is d:/app/server/tomcat8
  • configure
#以下操作需要在git bash中执行
cd d:/workshop
#以下操作需要在git bash中执行
rm -rf /d/app/demo/batch
cp Batch/target/batch.jar /d/app/demo/batch
cp Api/target/demo-api.war /d/server/tomcat8/webapps
cp ApiBuffle/target/demo-buffle.war /d/server/tomcat8/webapps

start up

  • Open the cmd window, switch to the directory d:/app/demo/batch; execute java -jar batch.jar to start the batch process
  • Open the resource browser d:/server/tomcat8/bin; double-click startup.sh to start tomcat.

verify

  • Verify demo-api with postman
{"email":"[email protected]","loginId":"test3","loginpwd":"22222","mobileNo":"199222336453","nickName":"走2","sex":"1"}
  • If there is nothing unexpected, the response message should be as follows
    Enter image description
  • At this point, open d:/app/demo/logs/batch.log, you can see the log as followsEnter image description
  • Indicates that the batch is also successfully verified.

Code Generation Service Capability

  • After demo.pdm is changed, Base will regenerate the source code, mainly the javabean corresponding to the single table and the operation class of adding, deleting, modifying and checking based on the single table.
  • demo_user.xml maintains the interface definition, input parameter definition, return parameter definition, interface business and batch job business definition. The code corresponding to this part will be generated in the Bundle, BundleMock, and SDK modules.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325295248&siteId=291194637