Initial commit

This commit is contained in:
2023-03-22 11:49:15 +08:00
committed by yovinchen
parent f53fd046d0
commit a6af184b42
253 changed files with 16724 additions and 3099 deletions

View File

@@ -1,11 +1,14 @@
package com.yv.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yv.admain.Book;
import com.yv.controller.utils.R;
import com.yv.service.IBookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.io.IOException;
/**
* @author YoVinchen
* @date 2023/3/17 下午 8:00
@@ -23,13 +26,15 @@ public class BookController {
}
@PostMapping
public R save(@RequestBody Book book) {
return new R(bookService.save(book));
public R save(@RequestBody Book book) throws IOException {
boolean flag = bookService.save(book);
return new R(flag, flag ? "添加成功^_^" : "添加失败-_-!");
}
@PutMapping
public R update(@RequestBody Book book) {
return new R(bookService.modify(book));
public R update(@RequestBody Book book) throws IOException {
boolean flag = bookService.modify(book);
return new R(flag, flag ? "修改成功^_^" : "修改失败-_-!");
}
@DeleteMapping("{id}")
@@ -43,9 +48,14 @@ public class BookController {
}
@GetMapping("{currentPage}/{pageSize}")
public R getPage(@PathVariable int currentPage, @PathVariable int pageSize) {
return new R(true, bookService.getPage(currentPage, pageSize));
public R getPage(@PathVariable int currentPage, @PathVariable int pageSize, Book book) {
IPage<Book> page = bookService.getPage(currentPage, pageSize, book);
//如果当前页码值大于总页码值,那么重新执行查询操作,使用最大页码值作为当前页码值
if (currentPage > page.getPages()) {
page = bookService.getPage((int) page.getPages(), pageSize, book);
}
return new R(true, page);
}
}

View File

@@ -0,0 +1,29 @@
package com.yv.controller.utils;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
/**
* springMVC的异常处理器
*
* @author YoVinchen
* @date 2023/3/22 上午 11:22
*/
@RestControllerAdvice
public class ProjectExceptionAdvice {
/**
* 拦截所有异常
*/
@ExceptionHandler
public R doException(Exception ex) {
//记录日志
// 通知运营
// 通知开发
ex.printStackTrace();
return new R("服务器故障,请稍后再试!");
}
}

View File

@@ -10,15 +10,26 @@ import lombok.Data;
public class R {
private Boolean flag;
private Object data;
private String msg;
public R(){};
public R() {
}
public R(Boolean flag) {
this.flag = flag;
}
public R(Boolean flag,Object data){
public R(Boolean flag, Object data) {
this.flag = flag;
this.data = data;
}
public R(Boolean flag, String msg) {
this.flag = flag;
this.msg = msg;
}
public R( String msg) {
this.flag = false;
this.msg = msg;
}
}

View File

@@ -3,9 +3,9 @@ spring:
datasource:
druid:
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://localhost:3306/ssm_db?useSSL=false&useUnicode=true&characterEncoding=utf8
url: jdbc:mysql://127.0.0.1:3306/ssm_db?useSSL=false&useUnicode=true&characterEncoding=utf8
username: root
password: 8520
password: root
#配置Mp相关配置
mybatis-plus:

View File

@@ -0,0 +1,59 @@
/*
Navicat Premium Data Transfer
Source Server : mysql
Source Server Type : MySQL
Source Server Version : 80033 (8.0.33)
Source Host : localhost:3306
Source Schema : ssm_db
Target Server Type : MySQL
Target Server Version : 80033 (8.0.33)
File Encoding : 65001
Date: 10/05/2023 14:22:37
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for tbl_book
-- ----------------------------
DROP TABLE IF EXISTS `tbl_book`;
CREATE TABLE `tbl_book` (
`id` int NOT NULL AUTO_INCREMENT,
`type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
`description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;
-- ----------------------------
-- Records of tbl_book
-- ----------------------------
BEGIN;
INSERT INTO `tbl_book` (`id`, `type`, `name`, `description`) VALUES (1, '计算机理论', 'Spring实战 第五版', 'SpringBoot入门经典教程深入理解Spring原理技术内幕');
INSERT INTO `tbl_book` (`id`, `type`, `name`, `description`) VALUES (2, '计算机理论', 'Spring 5核心原理与30个类手写实战', '十年沉淀之作手写Spring精华思想');
INSERT INTO `tbl_book` (`id`, `type`, `name`, `description`) VALUES (3, '计算机理论', 'Spring 5 设计模式', '深入Spring孕妈剖析Spring源码中蕴含的10大设计模式');
INSERT INTO `tbl_book` (`id`, `type`, `name`, `description`) VALUES (4, '计算机理论', 'Spring MVC+MyBatis开发从入门到项目实战', '全方位解析面向Web应用的轻量级框架带你成为Spring MVC开发高手');
INSERT INTO `tbl_book` (`id`, `type`, `name`, `description`) VALUES (5, '计算机理论', '轻量级Java Web企业应用实战', '源码级剖析Spring框架适合已掌握Java基础的读者');
INSERT INTO `tbl_book` (`id`, `type`, `name`, `description`) VALUES (6, '计算机理论', 'Java核心技术 卷Ⅰ 基础知识原书第11版', 'Core Java第11版Jolt大奖获奖作品针对Java SE9、10、11全面更新');
INSERT INTO `tbl_book` (`id`, `type`, `name`, `description`) VALUES (7, '计算机理论', '深入理解Java虚拟机', '5个维度全面剖析JVM大厂面视知识点全覆盖');
INSERT INTO `tbl_book` (`id`, `type`, `name`, `description`) VALUES (8, '计算机理论', 'Java编程思想第4版', 'Java学习必读经典殿堂级著作赢得了全球程序员的广泛赞誉');
INSERT INTO `tbl_book` (`id`, `type`, `name`, `description`) VALUES (9, '计算机理论', '零基础学Java全彩版', '零基础自学编程的入门图书由浅入深详解Java语言的编程思想和核心技术');
INSERT INTO `tbl_book` (`id`, `type`, `name`, `description`) VALUES (10, '市场营销', '直播就该这么做:主播高效沟通实战指南', '李子柒、李佳琦、薇娅成长为网红的秘密都在书中');
INSERT INTO `tbl_book` (`id`, `type`, `name`, `description`) VALUES (11, '市场营销', '直播销讲实战一本通', '和秋叶一起学系列网络营销书籍');
INSERT INTO `tbl_book` (`id`, `type`, `name`, `description`) VALUES (12, '市场营销', '直播带货:淘宝、天猫直播从新手到高手', '一本教你如何玩转直播的书10堂课轻松实现带货月入3W+');
INSERT INTO `tbl_book` (`id`, `type`, `name`, `description`) VALUES (16, 'test1', 'test1', 'test1');
INSERT INTO `tbl_book` (`id`, `type`, `name`, `description`) VALUES (17, '测试数据123', '测试数据123', '测试数据123');
INSERT INTO `tbl_book` (`id`, `type`, `name`, `description`) VALUES (18, '测试数据123', '测试数据123', '测试数据123');
INSERT INTO `tbl_book` (`id`, `type`, `name`, `description`) VALUES (19, '测试数据123', '测试数', '测试数据123');
INSERT INTO `tbl_book` (`id`, `type`, `name`, `description`) VALUES (21, '测试数据123', '测试数据123', '测试数据123');
INSERT INTO `tbl_book` (`id`, `type`, `name`, `description`) VALUES (22, '测试数据123', '测试数据123', '测试数据123');
INSERT INTO `tbl_book` (`id`, `type`, `name`, `description`) VALUES (23, '测试数据123', '测试数据123', '测试数据123');
INSERT INTO `tbl_book` (`id`, `type`, `name`, `description`) VALUES (24, '测试数据123', '测试数据123', '测试数据123');
INSERT INTO `tbl_book` (`id`, `type`, `name`, `description`) VALUES (25, '测试数据123', '测试数据123', '测试数据123');
COMMIT;
SET FOREIGN_KEY_CHECKS = 1;

View File

@@ -0,0 +1,582 @@
html,body {
/* overflow-y: scroll; */
margin: 0;
}
a {
color: #3c8dbc;
text-decoration:none;
}
/* new style */
.skin-purple .main-sidebar {
background: #fff;
}
.skin-purple .main-header .logo:hover {
background: #0abdfe;
}
.skin-purple .main-header .navbar .sidebar-toggle:hover {
/* background: #0abdfe; */
}
.skin-purple .main-header {
min-height: 70px;
padding: 0;
}
.skin-purple .main-header .logo {
height: 50px;
/* background: #0abdfe; */
float: left;
padding: 20px 0 0 15px;
/* width: 230px; */
}
.skin-purple .main-header .navbar {
height: 70px;
background: linear-gradient(to right, #0abdfe, #67f0e0);
/* margin-left: 230px; */
}
.winfo{margin-left: 230px;}
.skin-purple .main-header .sidebar-toggle {
display: inline-block;
padding: 24px 15px;
color: #fff;
}
.skin-purple .main-sidebar {
padding-top: 75px;
}
.sidebar-menu > li {
line-height: 1.8
}
.skin-purple .sidebar-menu > li > a {
font-size: 16px;
color: #666
}
.skin-purple .sidebar-menu>li:hover>a,
.skin-purple .sidebar-menu>li.active>a {
background: transparent;
color: #666;
border-left-color: transparent
}
.skin-purple .treeview-menu>li>a:hover {
color: #fff
}
.skin-purple .sidebar-menu>li>.treeview-menu {
background: #fff;
}
.sidebar-menu .treeview-menu > li > a {
font-size: 16px;
padding-left: 35px;
color: #999
}
.sidebar-menu .treeview-menu > li:hover {
background: #0abdfe;
}
@media (min-width: 768px) {
.skin-purple .navbar-nav>li>a
{
padding-top: 25px;
padding-bottom: 25px;
}
}
.modal-body .nav-tabs>li.active>a, .nav-tabs>li.active>a:focus, .nav-tabs>li.active>a:hover {
color: #0abdfe
}
.modal-body .nav-tabs>li>a {
color: #555
}
.bg-olive {
background-color: #0abdfe !important;
}
.dataTable .btn[class*='bg-']:hover {
box-shadow: none
}
.btn-primary {
background: #0abdfe;
border-color: #0abdfe;
}
.box-body .nav>li>a {
color: #666
}
.box-body .nav>li.active>a {
color: #0abdfe;
}
/* tab 1*/
.double {
line-height: 58px;
}
.title .glyphicon{
padding: 3px;
font-size: 13px;
border-radius: 8px;
color: #fff;
}
.data span.arrowup {
color: #d88918;
}
.data span.arrowdown {
color: #6bb10a;
}
.item-blue .glyphicon{
background-color: #39a9ea;
}
.item-green {
line-height: 58px;
}
.item-green .glyphicon{
background-color: #6bb10a;
line-height: 12px;
}
.item-orange .glyphicon{
background-color:#d88918;
}
.item-red .glyphicon{
background-color: #f14f4f;
}
.chart .chart-box {
margin: 10px;
}
/* 数据表格label */
.content-wrapper .data-type {
/*width: 90%;*/
margin: 10px 5px;
border:1px solid #d4d4d4;
border-radius: 2px;
}
.data-type .title,
.data-type .data {
padding: 3px 12px;
border-top: 1px solid #d4d4d4;
overflow: hidden;
height: 42px;
}
.data-type .title {
line-height: 34px;
border-right: 1px solid #d4d4d4;
}
.data-type .data:last-child{
border-right: 0;
}
.data-type .title{
text-align: center;
background: #ececec;
}
.data-type .data .line{
vertical-align: middle;
overflow: hidden;
padding-bottom: 10px;
padding-top: 10px;
}
/* label行高度 */
.data-type .data > label {
line-height:36px;
}
.data-type .data > .form-group {
line-height:36px;
}
.data-type .data.text {
line-height:36px;
}
/* label行分隔符 */
.data-type .data.border-right {
border-right: 1px solid #d4d4d4;
}
/* 表格双倍高度 */
.data-type .title.rowHeight2x,
.data-type .data.rowHeight2x {
height:84px;
}
.data-type .title.rowHeight2x ,
.data-type .data.rowHeight2x.text {
line-height:78px;
}
/*.data-type .data.rowHeight2x > label {
line-height:78px;
}*/
.data-type .title.editer,
.data-type .data.editer {
height:320px;
}
.data-type .title.editer {
line-height:300px;
}
/*清除parding*/
.padding-clear {
padding-right: 0px;
padding-left: 0px;
}
/* 文件上传 */
/*a upload */
.a-upload {
padding: 4px 10px;
height: 35px;
line-height: 25px;
position: relative;
cursor: pointer;
color: #888;
background: #fafafa;
border: 1px solid #ddd;
border-radius: 4px;
overflow: hidden;
display: inline-block;
*display: inline;
*zoom: 1
}
.a-upload input {
position: absolute;
font-size: 100px;
right: 0;
top: 0;
opacity: 0;
filter: alpha(opacity=0);
cursor: pointer
}
.a-upload:hover {
color: #444;
background: #eee;
border-color: #ccc;
text-decoration: none
}
/* 医疗 */
.search-box {
display: inline-block
}
.input-sm {
height: 32px;
}
.btn-create {
margin-left: 10px;
background-color: #0abdfe;
border-color: #0abdfe;
color: #fff;
}
.btn-create:hover,
.btn-create:active,
.btn-create:focus
{
color: #fff;
}
.pagination {
margin: 0
}
.medical-modal {
position:absolute;
top:0%;
left:0%;
display:none;
background:rgba(0,0,0,0.3);
width:100%;
height:100%;
position:fixed;
z-index:9999
}
.medical-modal .content {
position: absolute;
left: 35%;
top: 25%;
border-radius: 8px;
width: 30%;
height: 40%;
background-color: #fff;
}
.pageitems, .jump {
margin-left: 15px;
display: inline-block;
}
.jumppage {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 434 KiB