Spring Boot + MyBatis micro-channel structures applet

Copyright: LeifChen original, please indicate the source, thank you ~ https://blog.csdn.net/leifchen90/article/details/86646122

Spring Boot + MyBatis micro-channel structures applet

Use Spring Boot + MyBatis development background API interfaces, micro-channel small program as a front-end display page.

Database -sql

Use MySQL database db_wechat, tabledept

CREATE DATABASE IF NOT EXISTS `db_wechat` CHARSET utf8mb4 COLLATE utf8mb4_general_ci;

USE `db_wechat`;

-- ----------------------------
-- Table structure for dept
-- ----------------------------
DROP TABLE IF EXISTS `dept`;
CREATE TABLE `dept` (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
  `seq` int(2) NOT NULL DEFAULT 0,
  `gmt_create` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
  `gmt_modified` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0),
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci;

Backend -backend

  • Code directory structure
    Code directory structure
    to establish a Spring Boot as the core framework of Gradle project.
    Configuration MyBatis-Generator , automatically generating code correspondence table based on the database, and integrates common Mapper and paging plug PageHelper .
    Provided Restful style API, to department information, for example:
description HTTP request method URL
New department POST /api/depts
Delete department DELETE /api/depts/{id}
Updated department PUT /api/depts/{id}
Queries single department GET /api/depts/{id}
Paging query list of departments GET /api/depts

The front -frontend

  • Code directory structure
    Code directory structure
  • Department list page
    Department list page
  • Sector Information Page
    Sector Information Page

reference

GitHub Code
SpringBoot + MyBatis build a mini program

Guess you like

Origin blog.csdn.net/leifchen90/article/details/86646122