13. Merchant List and Detail
Contents
Merchants can sell their own products on the platform for consumers to buy.
Add More Merchant Type Users into Database
Run the following SQL inside the database:
|
|
Update merchant.xml
Copy and paste the following content into merchant.xml under the service/src/main/resources/mapper directory:
|
|
Update MerchantMapper
Copy and paste the following content into MerchantMapper.java under the service/src/main/java/co.dongchen.shop/mapper directory:
|
|
Update MerchantService
Copy and paste the following content into MerchantService.java under the service/src/main/java/co.dongchen.shop/service directory:
|
|
Create MerchantController
- Right click controller/src/main/java/co.dongchen.shop/controller directory: New > Java Class
- Fill in “MerchantController”
- Click “OK” button
Copy and paste the following content into MerchantController.java:
|
|
Create pagination.ftl
- Right click controller/src/main/resources/templates/user directory: New > Directory
- Fill in “merchant”
- Click “OK” button
- Right click controller/src/main/resources/templates/user/merchant directory: New > File
- Fill in “pagination.ftl”
- Click “OK” button
Copy and paste the following content into pagination.ftl:
|
|
Create info.ftl
- Right click controller/src/main/resources/templates/user/merchant directory: New > File
- Fill in “info.ftl”
- Click “OK” button
Copy and paste the following content into info.ftl:
|
|
Verify
Run the App
|
|
Choose the correspondent option and press enter.
View Merchant List Page in the Browser
|
|
Click linkage number 2 to the second page:
Click the third Dong Chen linkage to the merchant info page:
Author Dong Chen
LastMod Mon May 6 2019