Introduction to the

Tofu Shop is my own learning project, mainly to achieve a shopping mall order, shopping cart, payment and other basic functions, familiar with the back-end development process, because I do Android, and then want to learn some back-end technology, so Android and back-end (Springboot, Mybatis) together written. Android uses the basic MVC pattern, written as simply as possible, because the main thing is to learn from the back end, which uses the popular SpringBoot+Mybatis framework to design a scalable distributed architecture.

Code link

Android code: github.com/luqinmao/st…

Java backend code: github.com/luqinmao/st…

Technology used

StoreClient android end

technology instructions
okgo Excellent network request framework
autosize Screen adaptation solution
rxpermissions Dynamic permission framework
alipaySdk Alipay payment SDK
other Such as: butterknife, gson, oss, eventbus, BaseRecyclerViewAdapterHelper, etc

StoreServer backend

technology instructions
SpringBoot Container +MVC framework
MyBatis ORM framework
MyBatisGenerator Data layer code generation
PageHelper MyBatis physical paging plugin
Redis Distributed cache
Druid Database connection pool
OSS Ali Cloud object storage
Lombok Simplify object encapsulation tools

Project running

This project needs to rely on MySql, Redis, Navicat Intranet penetration and other services to start. Store. SQL script needs to be imported into the database. After installing the dependencies, start the main function of the StoreApplication class.

Project package structure

The SRC ├ ─ ─ commonStore common code and utility classes├ ─ ─config Java configuration in SpringBoot├ ─ ─ the controllerController layer code| ├ ─ ─ backend- Background management interface| └ ─ ─ common-- Generic unclassified interface| └ ─ ─ portal-- Android front-end interface├ ─ ─ the dao-- Data access layer code├ ─ ─ pojos- the entity class├ ─ ─ MBG-- MyBatisGenerator related code└ ─ ─ the service-- Business layer interface code| └ ─ ─ impl-- Business layer interface implementation class code├ ─ ─ a task-- Timer related code├ ─ ─ util- tools├ ─ ─ a task-- Timer related code└ ─ ─ vo-- 
Copy the code

Resource file

├ ─ ─ generatorConfig. XMLMyBatisGenerator generates code rule configuration├ ─ ─ application. Yml-- SpringBoot configuration file├ ─ ─ logback. XML-- logback Log configuration file├ ─ ─ store. The properties-- Parameter files required for Redis and Intranet penetration of the project├ ─ ─ zfbinfo. The properties-- Configuration parameter file required by Alipay└ ─ ─ generatorConfig. XMLMyBatisGenerator generates code rule configuration
Copy the code

instructions

Project related

  • Since I don’t have an enterprise account of Alipay, the project uses the Sandbox payment environment (test environment), so I can only use the Sandbox Alipay APP to pay when I try out the payment function on Android. The Sandbox Alipay APP needs to be installed on my mobile phone. Please download and install it by yourself. Openhome.alipay.com/platform/ap… Buyer test account: [email protected] Password: 111111

  • You need to start Redis before starting the back-end project; otherwise, an error will be reported

  • The database file is placed under the doc folder, the store.sql file

  • Depending on whether you’re running on a phone or an emulator, you need to change the SERVER_ADDRESS request address of the AppConst file in the Base folder

  • The request interface needs to carry the request header login_token. The value is obtained from the login interface. The user test account is admin, and the password is admin

  • In the Controller class of the Portal module, the URI that does not require login interception is configured in the LoginPublicUri class

  • The controller class of the Backend module provides AuthorityInterceptor for login and administrator permissions

Other related

  • The project learning reference: coding.imooc.com/class/chapt…

  • Due to my limited ability, there are still many deficiencies and bad codes in the project code, please forgive me.

Some notes from the study

  • War javax/el/ELManager error: ElAPI 2.2 in Tomcat7 is too low

    Solution 1: Directly download an el-api3.x.jar to replace the el-api2.2.jar in Tomcat

    Solution 2: Download Tomcat8 and install it

  • Filter matching:

    • Match all methods in the com.lqm.controller package @pointcut (“execution(public * com.lqm.controller)..(..) )”
    • Match all methods under the com.lqm.controller package and its subpackages @pointcut (“execution(* com.lqm.controller...(..) )”
  • Jackson config does not take effect: Before AuthorityInterceptorConfig I inherit WebMvcConfigurationSupport, then Jackson config is failed, It is ok to change before AuthorityInterceptorConfig to implements WebMvcConfigurer

  • OrderControler error, under Caused by: Java. Lang. NoClassDefFoundError: Com/alipay/API/AlipayApiException solution: blog.csdn.net/huanjia_h/a… War adds relevant JAR package of Alipay

  • Error Creating bean with name ‘gsonBuilder’ gson 2.6.2

Project screenshots

Android front-end rendering

Project code diagram