├── README.md ├── SpringbootSchoolShop ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── zhang │ │ │ └── ssmschoolshop │ │ │ ├── SpringbootSchoolShopApplication.java │ │ │ ├── config │ │ │ ├── SwaggerConfig.java │ │ │ └── WebMvcConfig.java │ │ │ ├── controller │ │ │ ├── admin │ │ │ │ ├── ActivityController.java │ │ │ │ ├── AdminOrderController.java │ │ │ │ ├── GoodsController.java │ │ │ │ ├── LoginController.java │ │ │ │ └── UserController.java │ │ │ └── front │ │ │ │ ├── CartController.java │ │ │ │ ├── CustomerController.java │ │ │ │ ├── FrontGoodsController.java │ │ │ │ ├── MainController.java │ │ │ │ ├── OrderController.java │ │ │ │ └── VerificationCodeImgController.java │ │ │ ├── dao │ │ │ ├── ActivityMapper.java │ │ │ ├── AddressMapper.java │ │ │ ├── AdminMapper.java │ │ │ ├── CategoryMapper.java │ │ │ ├── CommentMapper.java │ │ │ ├── FavoriteMapper.java │ │ │ ├── GoodsMapper.java │ │ │ ├── ImagePathMapper.java │ │ │ ├── OrderItemMapper.java │ │ │ ├── OrderMapper.java │ │ │ ├── ShopCartMapper.java │ │ │ └── UserMapper.java │ │ │ ├── entity │ │ │ ├── Activity.java │ │ │ ├── ActivityExample.java │ │ │ ├── Address.java │ │ │ ├── AddressExample.java │ │ │ ├── Admin.java │ │ │ ├── AdminExample.java │ │ │ ├── Category.java │ │ │ ├── CategoryExample.java │ │ │ ├── Comment.java │ │ │ ├── CommentExample.java │ │ │ ├── Favorite.java │ │ │ ├── FavoriteExample.java │ │ │ ├── FavoriteKey.java │ │ │ ├── Goods.java │ │ │ ├── GoodsExample.java │ │ │ ├── GoodsPrice.java │ │ │ ├── ImagePath.java │ │ │ ├── ImagePathExample.java │ │ │ ├── Order.java │ │ │ ├── OrderExample.java │ │ │ ├── OrderItem.java │ │ │ ├── OrderItemExample.java │ │ │ ├── ShopCart.java │ │ │ ├── ShopCartExample.java │ │ │ ├── ShopCartKey.java │ │ │ ├── User.java │ │ │ └── UserExample.java │ │ │ ├── service │ │ │ ├── ActivityService.java │ │ │ ├── AddressService.java │ │ │ ├── AdminService.java │ │ │ ├── CateService.java │ │ │ ├── CommentService.java │ │ │ ├── GoodsService.java │ │ │ ├── OrderService.java │ │ │ ├── ShopCartService.java │ │ │ ├── UserService.java │ │ │ └── impl │ │ │ │ ├── ActivityServiceImpl.java │ │ │ │ ├── AddressServiceImpl.java │ │ │ │ ├── AdminServiceImpl.java │ │ │ │ ├── CateServiceImpl.java │ │ │ │ ├── CommentServiceImpl.java │ │ │ │ ├── GoodsServiceImpl.java │ │ │ │ ├── OrderServiceImpl.java │ │ │ │ ├── ShopCartServiceImpl.java │ │ │ │ └── UserServiceImpl.java │ │ │ └── util │ │ │ ├── ImageUtil.java │ │ │ ├── Md5Util.java │ │ │ ├── Msg.java │ │ │ └── verificate │ │ │ └── Verificate.java │ ├── resources │ │ ├── application.yml │ │ └── mapper │ │ │ ├── ActivityMapper.xml │ │ │ ├── AddressMapper.xml │ │ │ ├── AdminMapper.xml │ │ │ ├── CategoryMapper.xml │ │ │ ├── CommentMapper.xml │ │ │ ├── FavoriteMapper.xml │ │ │ ├── GoodsMapper.xml │ │ │ ├── ImagePathMapper.xml │ │ │ ├── OrderItemMapper.xml │ │ │ ├── OrderMapper.xml │ │ │ ├── ShopCartMapper.xml │ │ │ └── UserMapper.xml │ └── webapp │ │ ├── WEB-INF │ │ └── views │ │ │ ├── activity.jsp │ │ │ ├── addActivity.jsp │ │ │ ├── addCategory.jsp │ │ │ ├── addGoods.jsp │ │ │ ├── address.jsp │ │ │ ├── admin.jsp │ │ │ ├── adminAllGoods.jsp │ │ │ ├── adminLogin.jsp │ │ │ ├── category.jsp │ │ │ ├── chatrobot.jsp │ │ │ ├── detail.jsp │ │ │ ├── favorite.jsp │ │ │ ├── goodsNav.jsp │ │ │ ├── header.jsp │ │ │ ├── information.jsp │ │ │ ├── list.jsp │ │ │ ├── login.jsp │ │ │ ├── main.jsp │ │ │ ├── register.jsp │ │ │ ├── search.jsp │ │ │ ├── sidebar.jsp │ │ │ ├── userManage.jsp │ │ │ └── verificationcodeimg.jsp │ │ ├── css │ │ ├── bootstrap.min.css │ │ ├── bootstrap │ │ │ ├── css │ │ │ │ ├── bootstrap-theme.css │ │ │ │ ├── bootstrap-theme.css.map │ │ │ │ ├── bootstrap-theme.min.css │ │ │ │ ├── bootstrap-theme.min.css.map │ │ │ │ ├── bootstrap.css │ │ │ │ ├── bootstrap.css.map │ │ │ │ ├── bootstrap.min.css │ │ │ │ └── bootstrap.min.css.map │ │ │ ├── fonts │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ └── js │ │ │ │ ├── bootstrap.js │ │ │ │ ├── bootstrap.min.js │ │ │ │ └── npm.js │ │ ├── chat.css │ │ ├── chatrobot.css │ │ ├── favorite.css │ │ ├── font-awesome.min.css │ │ ├── information.css │ │ ├── infostyle.css │ │ ├── login.css │ │ ├── main.css │ │ ├── order.css │ │ ├── release.css │ │ ├── shopcart.css │ │ ├── shopdetail.css │ │ ├── style.css │ │ ├── sweetalert.css │ │ └── templatemo-style.css │ │ ├── fonts │ │ ├── FontAwesome.otf │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.svg │ │ ├── fontawesome-webfont.ttf │ │ ├── fontawesome-webfont.woff │ │ └── fontawesome-webfont.woff2 │ │ ├── image │ │ ├── 3.jpg │ │ ├── 4.jpg │ │ ├── 5.jpg │ │ ├── 6.jpg │ │ ├── checkbox-radio-sheet.png │ │ ├── darkbg.png │ │ ├── head.jpg │ │ ├── img │ │ │ ├── cancel-off.png │ │ │ ├── cancel-on.png │ │ │ ├── star-half.png │ │ │ ├── star-off.png │ │ │ └── star-on.png │ │ ├── img01.png │ │ ├── img02.png │ │ ├── img03.png │ │ ├── img04.png │ │ ├── img05.png │ │ ├── login.png │ │ ├── login0.png │ │ ├── register.png │ │ ├── register0.png │ │ ├── tao.jpg │ │ └── whitebg.png │ │ └── js │ │ ├── address.js │ │ ├── adminchat.js │ │ ├── bootstrap-filestyle.min.js │ │ ├── categery.js │ │ ├── detail.js │ │ ├── distpicker.js │ │ ├── goodsManage.js │ │ ├── googleChart │ │ └── jsapi.js │ │ ├── holder.js │ │ ├── information.js │ │ ├── jquery-1.11.2.min.js │ │ ├── jquery-migrate-1.2.1.min.js │ │ ├── jquery.form.min.js │ │ ├── jquery.js │ │ ├── jquery.raty.js │ │ ├── jquery.validate.min.js │ │ ├── list.js │ │ ├── login.js │ │ ├── mqttws31.js │ │ ├── order.js │ │ ├── send.js │ │ ├── shopcart.js │ │ ├── sort.js │ │ ├── sweetalert.min.js │ │ ├── templatemo-script.js │ │ ├── userManage.js │ │ └── validate.js │ └── test │ └── java │ └── com │ └── zhang │ └── ssmschoolshop │ └── SpringbootSchoolShopApplicationApplicationTests.java ├── mysql数据库 ├── db_shopmaster.sql └── db_springbootshopmaster.sql ├── upload ├── 0f0b西部数据固态硬盘1.jpg ├── 0f0b西部数据固态硬盘2.jpg ├── 0f0b西部数据固态硬盘3.jpg ├── 0f0b西部数据固态硬盘4.jpg ├── 3a25雷柏M217无线鼠标1.jpg ├── 3a25雷柏M217无线鼠标2.jpg ├── 3a6a童装女童连衣裙2.jpg ├── cadf宏想8G内存条1.jpg ├── cadf宏想8G内存条2.jpg ├── cadf宏想8G内存条3.jpg ├── dcf7童装女童连衣裙4.jpg ├── dfwd女童夏装连衣裙2.jpg ├── eeb9童装女童连衣裙3.jpg ├── fb42童装女童连衣裙1.jpg ├── fesc女童夏装连衣裙1.jpg ├── sfca英特尔固态硬盘1.jpg ├── sfca英特尔固态硬盘2.jpg └── sfca英特尔固态硬盘3.jpg └── 关于系统.txt /README.md: -------------------------------------------------------------------------------- 1 | # Springboot_WebShopping 2 | 基于SpringBoot的商城购物网站设计毕业源码案例设计 3 | 4 | ## 开发技术: Java语言,SpringBoot框架,Eclipse/Idea 5 | 6 | 实现一个百货商城购物网站,可以出售各种类别的商品包括数码,日用,书籍,服装,装饰品,学习用品等等!前台用户登录网站后可以查询商品,其中商品详情里面包括了多张商品图片,仿淘宝图片ppt效果还有放大镜效果,加入商品到购物车提交订单;后台管理员可以管理发布商品信息,管理注册用户信息,处理订单发货,发布商场促销活动等,用户收到货后可以确认订单并对商品打星星评价! 7 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | /target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | 5 | ### STS ### 6 | .apt_generated 7 | .classpath 8 | .factorypath 9 | .project 10 | .settings 11 | .springBeans 12 | .sts4-cache 13 | 14 | ### IntelliJ IDEA ### 15 | .idea 16 | *.iws 17 | *.iml 18 | *.ipr 19 | 20 | ### NetBeans ### 21 | /nbproject/private/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ 26 | /build/ 27 | 28 | ### VS Code ### 29 | .vscode/ 30 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/.mvn/wrapper/MavenWrapperDownloader.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to the Apache Software Foundation (ASF) under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. The ASF licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | https://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | */ 19 | 20 | import java.io.File; 21 | import java.io.FileInputStream; 22 | import java.io.FileOutputStream; 23 | import java.io.IOException; 24 | import java.net.URL; 25 | import java.nio.channels.Channels; 26 | import java.nio.channels.ReadableByteChannel; 27 | import java.util.Properties; 28 | 29 | public class MavenWrapperDownloader { 30 | 31 | /** 32 | * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. 33 | */ 34 | private static final String DEFAULT_DOWNLOAD_URL = 35 | "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar"; 36 | 37 | /** 38 | * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to 39 | * use instead of the default one. 40 | */ 41 | private static final String MAVEN_WRAPPER_PROPERTIES_PATH = 42 | ".mvn/wrapper/maven-wrapper.properties"; 43 | 44 | /** 45 | * Path where the maven-wrapper.jar will be saved to. 46 | */ 47 | private static final String MAVEN_WRAPPER_JAR_PATH = 48 | ".mvn/wrapper/maven-wrapper.jar"; 49 | 50 | /** 51 | * Name of the property which should be used to override the default download url for the wrapper. 52 | */ 53 | private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; 54 | 55 | public static void main(String args[]) { 56 | System.out.println("- Downloader started"); 57 | File baseDirectory = new File(args[0]); 58 | System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); 59 | 60 | // If the maven-wrapper.properties exists, read it and check if it contains a custom 61 | // wrapperUrl parameter. 62 | File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); 63 | String url = DEFAULT_DOWNLOAD_URL; 64 | if (mavenWrapperPropertyFile.exists()) { 65 | FileInputStream mavenWrapperPropertyFileInputStream = null; 66 | try { 67 | mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); 68 | Properties mavenWrapperProperties = new Properties(); 69 | mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); 70 | url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); 71 | } catch (IOException e) { 72 | System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); 73 | } finally { 74 | try { 75 | if (mavenWrapperPropertyFileInputStream != null) { 76 | mavenWrapperPropertyFileInputStream.close(); 77 | } 78 | } catch (IOException e) { 79 | // Ignore ... 80 | } 81 | } 82 | } 83 | System.out.println("- Downloading from: : " + url); 84 | 85 | File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); 86 | if (!outputFile.getParentFile().exists()) { 87 | if (!outputFile.getParentFile().mkdirs()) { 88 | System.out.println( 89 | "- ERROR creating output direcrory '" + outputFile.getParentFile().getAbsolutePath() + "'"); 90 | } 91 | } 92 | System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); 93 | try { 94 | downloadFileFromURL(url, outputFile); 95 | System.out.println("Done"); 96 | System.exit(0); 97 | } catch (Throwable e) { 98 | System.out.println("- Error downloading"); 99 | e.printStackTrace(); 100 | System.exit(1); 101 | } 102 | } 103 | 104 | private static void downloadFileFromURL(String urlString, File destination) throws Exception { 105 | URL website = new URL(urlString); 106 | ReadableByteChannel rbc; 107 | rbc = Channels.newChannel(website.openStream()); 108 | FileOutputStream fos = new FileOutputStream(destination); 109 | fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); 110 | fos.close(); 111 | rbc.close(); 112 | } 113 | 114 | } 115 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/SpringbootSchoolShop/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /SpringbootSchoolShop/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip 2 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/mvnw.cmd: -------------------------------------------------------------------------------- 1 | @REM ---------------------------------------------------------------------------- 2 | @REM Licensed to the Apache Software Foundation (ASF) under one 3 | @REM or more contributor license agreements. See the NOTICE file 4 | @REM distributed with this work for additional information 5 | @REM regarding copyright ownership. The ASF licenses this file 6 | @REM to you under the Apache License, Version 2.0 (the 7 | @REM "License"); you may not use this file except in compliance 8 | @REM with the License. You may obtain a copy of the License at 9 | @REM 10 | @REM https://www.apache.org/licenses/LICENSE-2.0 11 | @REM 12 | @REM Unless required by applicable law or agreed to in writing, 13 | @REM software distributed under the License is distributed on an 14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | @REM KIND, either express or implied. See the License for the 16 | @REM specific language governing permissions and limitations 17 | @REM under the License. 18 | @REM ---------------------------------------------------------------------------- 19 | 20 | @REM ---------------------------------------------------------------------------- 21 | @REM Maven2 Start Up Batch script 22 | @REM 23 | @REM Required ENV vars: 24 | @REM JAVA_HOME - location of a JDK home dir 25 | @REM 26 | @REM Optional ENV vars 27 | @REM M2_HOME - location of maven2's installed home dir 28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands 29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending 30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven 31 | @REM e.g. to debug Maven itself, use 32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files 34 | @REM ---------------------------------------------------------------------------- 35 | 36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' 37 | @echo off 38 | @REM set title of command window 39 | title %0 40 | @REM enable echoing my setting MAVEN_BATCH_ECHO to 'on' 41 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% 42 | 43 | @REM set %HOME% to equivalent of $HOME 44 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") 45 | 46 | @REM Execute a user defined script before this one 47 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre 48 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending 49 | if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" 50 | if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" 51 | :skipRcPre 52 | 53 | @setlocal 54 | 55 | set ERROR_CODE=0 56 | 57 | @REM To isolate internal variables from possible post scripts, we use another setlocal 58 | @setlocal 59 | 60 | @REM ==== START VALIDATION ==== 61 | if not "%JAVA_HOME%" == "" goto OkJHome 62 | 63 | echo. 64 | echo Error: JAVA_HOME not found in your environment. >&2 65 | echo Please set the JAVA_HOME variable in your environment to match the >&2 66 | echo location of your Java installation. >&2 67 | echo. 68 | goto error 69 | 70 | :OkJHome 71 | if exist "%JAVA_HOME%\bin\java.exe" goto init 72 | 73 | echo. 74 | echo Error: JAVA_HOME is set to an invalid directory. >&2 75 | echo JAVA_HOME = "%JAVA_HOME%" >&2 76 | echo Please set the JAVA_HOME variable in your environment to match the >&2 77 | echo location of your Java installation. >&2 78 | echo. 79 | goto error 80 | 81 | @REM ==== END VALIDATION ==== 82 | 83 | :init 84 | 85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". 86 | @REM Fallback to current working directory if not found. 87 | 88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% 89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir 90 | 91 | set EXEC_DIR=%CD% 92 | set WDIR=%EXEC_DIR% 93 | :findBaseDir 94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound 95 | cd .. 96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound 97 | set WDIR=%CD% 98 | goto findBaseDir 99 | 100 | :baseDirFound 101 | set MAVEN_PROJECTBASEDIR=%WDIR% 102 | cd "%EXEC_DIR%" 103 | goto endDetectBaseDir 104 | 105 | :baseDirNotFound 106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% 107 | cd "%EXEC_DIR%" 108 | 109 | :endDetectBaseDir 110 | 111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig 112 | 113 | @setlocal EnableExtensions EnableDelayedExpansion 114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a 115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% 116 | 117 | :endReadAdditionalConfig 118 | 119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" 120 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" 121 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 122 | 123 | set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar" 124 | FOR /F "tokens=1,2 delims==" %%A IN (%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties) DO ( 125 | IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B 126 | ) 127 | 128 | @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 129 | @REM This allows using the maven wrapper in projects that prohibit checking in binary data. 130 | if exist %WRAPPER_JAR% ( 131 | echo Found %WRAPPER_JAR% 132 | ) else ( 133 | echo Couldn't find %WRAPPER_JAR%, downloading it ... 134 | echo Downloading from: %DOWNLOAD_URL% 135 | powershell -Command "(New-Object Net.WebClient).DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')" 136 | echo Finished downloading %WRAPPER_JAR% 137 | ) 138 | @REM End of extension 139 | 140 | %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* 141 | if ERRORLEVEL 1 goto error 142 | goto end 143 | 144 | :error 145 | set ERROR_CODE=1 146 | 147 | :end 148 | @endlocal & set ERROR_CODE=%ERROR_CODE% 149 | 150 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost 151 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 152 | if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" 153 | if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" 154 | :skipRcPost 155 | 156 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 157 | if "%MAVEN_BATCH_PAUSE%" == "on" pause 158 | 159 | if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% 160 | 161 | exit /B %ERROR_CODE% 162 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/SpringbootSchoolShopApplication.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.boot.builder.SpringApplicationBuilder; 7 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 8 | import springfox.documentation.swagger2.annotations.EnableSwagger2; 9 | 10 | @SpringBootApplication 11 | @EnableSwagger2 12 | @MapperScan("com.zhang.ssmschoolshop.dao") 13 | public class SpringbootSchoolShopApplication extends SpringBootServletInitializer { 14 | 15 | @Override 16 | protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { 17 | return builder.sources(SpringbootSchoolShopApplication.class); 18 | } 19 | 20 | public static void main(String[] args) { 21 | SpringApplication.run(SpringbootSchoolShopApplication.class, args); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/config/SwaggerConfig.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.config; 2 | import org.springframework.context.annotation.Bean; 3 | import org.springframework.context.annotation.Configuration; 4 | import springfox.documentation.builders.ApiInfoBuilder; 5 | import springfox.documentation.builders.PathSelectors; 6 | import springfox.documentation.builders.RequestHandlerSelectors; 7 | import springfox.documentation.service.ApiInfo; 8 | import springfox.documentation.service.Contact; 9 | import springfox.documentation.spi.DocumentationType; 10 | import springfox.documentation.spring.web.plugins.Docket; 11 | import springfox.documentation.swagger2.annotations.EnableSwagger2; 12 | 13 | @Configuration 14 | @EnableSwagger2 15 | public class SwaggerConfig { 16 | 17 | @Bean 18 | public Docket createRestApi() { 19 | return new Docket(DocumentationType.SWAGGER_2) 20 | .apiInfo(apiInfo()) 21 | .select() 22 | .apis(RequestHandlerSelectors.basePackage("com.zhang.ssmschoolshop")) 23 | .paths(PathSelectors.any()) 24 | .build(); 25 | } 26 | 27 | private ApiInfo apiInfo() { 28 | return new ApiInfoBuilder() 29 | .title("毕设商城系统API") 30 | .contact(new Contact("zhangxin", "http://www.github.com/codingzhangxin", "994683607@qq.com")) 31 | .version("1.0") 32 | .build(); 33 | } 34 | } -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/config/WebMvcConfig.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.config; 2 | 3 | 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; 6 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 7 | 8 | 9 | /** 10 | * @author created by CodingZhangxin 11 | * @version v.0.1 12 | * @Description TODO 13 | * @date 2019/5/10 14 | * @备注 springboot内置tomcat配置虚拟路径 15 | * linux: /usr/upload /pictures 16 | * window: d:/upload /pictures 17 | **/ 18 | 19 | @Configuration 20 | public class WebMvcConfig implements WebMvcConfigurer { 21 | 22 | 23 | 24 | @Override 25 | public void addResourceHandlers(ResourceHandlerRegistry registry) { 26 | String os = System.getProperty("os.name"); 27 | String pathPatterns="/pictures/**"; 28 | String pathAbsolute="file:D:/upload/"; 29 | if (os.toLowerCase().startsWith("linux")){ 30 | pathAbsolute="file:/usr/upload/"; 31 | } 32 | registry.addResourceHandler(pathPatterns).addResourceLocations(pathAbsolute); 33 | 34 | } 35 | 36 | } -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/controller/admin/ActivityController.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.controller.admin; 2 | 3 | 4 | import com.github.pagehelper.PageHelper; 5 | import com.github.pagehelper.PageInfo; 6 | import com.zhang.ssmschoolshop.entity.Activity; 7 | import com.zhang.ssmschoolshop.entity.ActivityExample; 8 | import com.zhang.ssmschoolshop.entity.Admin; 9 | import com.zhang.ssmschoolshop.entity.Goods; 10 | import com.zhang.ssmschoolshop.service.ActivityService; 11 | import com.zhang.ssmschoolshop.service.GoodsService; 12 | import com.zhang.ssmschoolshop.util.Msg; 13 | import io.swagger.annotations.Api; 14 | import org.springframework.beans.factory.annotation.Autowired; 15 | import org.springframework.stereotype.Controller; 16 | import org.springframework.ui.Model; 17 | import org.springframework.web.bind.annotation.RequestMapping; 18 | import org.springframework.web.bind.annotation.RequestParam; 19 | import org.springframework.web.bind.annotation.ResponseBody; 20 | 21 | import javax.servlet.http.HttpSession; 22 | import java.util.List; 23 | 24 | @Controller 25 | @RequestMapping("/admin/activity") 26 | @Api(value="促销活动controller",tags={"促销活动操作接口"}) 27 | public class ActivityController { 28 | 29 | @Autowired(required = false) 30 | ActivityService activityService; 31 | 32 | @Autowired(required = false) 33 | GoodsService goodsService; 34 | 35 | @RequestMapping("/show") 36 | public String showActivity(@RequestParam(value = "page",defaultValue = "1") Integer pn, Model model, HttpSession session) { 37 | 38 | Admin admin = (Admin) session.getAttribute("admin"); 39 | if (admin == null) { 40 | return "redirect:/admin/login"; 41 | } 42 | 43 | //一页显示几个数据 44 | PageHelper.startPage(pn, 10); 45 | 46 | ActivityExample activityExample = new ActivityExample(); 47 | activityExample.or(); 48 | 49 | List activityList = activityService.getAllActivity(activityExample); 50 | 51 | //显示几个页号 52 | PageInfo page = new PageInfo(activityList,5); 53 | model.addAttribute("pageInfo", page); 54 | 55 | return "activity"; 56 | } 57 | 58 | @RequestMapping("/showjson") 59 | @ResponseBody 60 | public Msg showActivityJson(@RequestParam(value = "page",defaultValue = "1") Integer pn, Model model , HttpSession session) { 61 | 62 | Admin admin = (Admin) session.getAttribute("admin"); 63 | if (admin == null) { 64 | return Msg.fail("请先登录"); 65 | } 66 | 67 | ActivityExample activityExample = new ActivityExample(); 68 | activityExample.or(); 69 | 70 | List activityList = activityService.getAllActivity(activityExample); 71 | 72 | return Msg.success("获取活动信息成功").add("activity",activityList); 73 | } 74 | 75 | @RequestMapping("/add") 76 | public String showAddActivity(HttpSession session) { 77 | Admin admin = (Admin) session.getAttribute("admin"); 78 | if (admin == null) { 79 | return "redirect:/admin/login"; 80 | } 81 | return "addActivity"; 82 | } 83 | 84 | @RequestMapping("/addResult") 85 | public String addActivity(Activity activity) { 86 | 87 | activityService.insertActivitySelective(activity); 88 | 89 | return "redirect:/admin/activity/show"; 90 | } 91 | 92 | @RequestMapping("/update") 93 | @ResponseBody 94 | public Msg updateActivity(Integer goodsid, Integer activityid, HttpSession session) { 95 | Admin admin = (Admin) session.getAttribute("admin"); 96 | if (admin == null) { 97 | return Msg.fail("请先登录"); 98 | } 99 | Goods goods = new Goods(); 100 | goods.setActivityid(activityid); 101 | goods.setGoodsid(goodsid); 102 | goodsService.updateGoodsById(goods); 103 | return Msg.success("更新商品活动成功"); 104 | } 105 | 106 | @RequestMapping("delete") 107 | public String deleteActivity(Integer activityid, HttpSession session) { 108 | Admin admin = (Admin) session.getAttribute("admin"); 109 | if (admin == null) { 110 | return "redirect:/admin/login"; 111 | } 112 | 113 | activityService.deleteByActivityId(activityid); 114 | return "redirect:/admin/activity/show"; 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/controller/admin/LoginController.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.controller.admin; 2 | 3 | 4 | import com.zhang.ssmschoolshop.entity.Admin; 5 | import com.zhang.ssmschoolshop.service.AdminService; 6 | import com.zhang.ssmschoolshop.util.Md5Util; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Controller; 9 | import org.springframework.ui.Model; 10 | import org.springframework.web.bind.annotation.RequestMapping; 11 | 12 | import javax.servlet.http.HttpServletRequest; 13 | import javax.servlet.http.HttpSession; 14 | 15 | @Controller 16 | @RequestMapping("/admin") 17 | public class LoginController { 18 | 19 | @Autowired 20 | private AdminService adminService; 21 | 22 | @RequestMapping("/login") 23 | public String adminLogin() { 24 | return "adminLogin"; 25 | } 26 | 27 | @RequestMapping("/confirmLogin") 28 | public String confirmLogin(Admin admin, Model model, HttpServletRequest request) { 29 | admin.setPassword(Md5Util.MD5Encode(admin.getPassword(),"utf-8")); 30 | System.out.println(admin.getPassword()); 31 | Admin selectAdmin = adminService.selectByName(admin); 32 | if (selectAdmin == null) { 33 | model.addAttribute("errorMsg", "用户名或密码错误"); 34 | return "adminLogin"; 35 | } else { 36 | HttpSession session = request.getSession(); 37 | session.setAttribute("admin", selectAdmin); 38 | return "redirect:/admin/user/show"; 39 | } 40 | } 41 | 42 | @RequestMapping("/logout") 43 | public String adminLogout(HttpServletRequest request) { 44 | HttpSession session = request.getSession(); 45 | session.removeAttribute("admin"); 46 | return "redirect:/admin/login"; 47 | } 48 | 49 | /*@RequestMapping("/index") 50 | public String showAdminIndex() { 51 | return "user"; 52 | }*/ 53 | } 54 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/controller/admin/UserController.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.controller.admin; 2 | 3 | import com.github.pagehelper.PageHelper; 4 | import com.github.pagehelper.PageInfo; 5 | 6 | import com.zhang.ssmschoolshop.entity.User; 7 | import com.zhang.ssmschoolshop.entity.UserExample; 8 | import com.zhang.ssmschoolshop.service.UserService; 9 | import com.zhang.ssmschoolshop.util.Msg; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.stereotype.Controller; 12 | import org.springframework.ui.Model; 13 | import org.springframework.web.bind.annotation.*; 14 | 15 | import javax.servlet.http.HttpServletResponse; 16 | import java.util.List; 17 | 18 | 19 | @Controller 20 | @RequestMapping("/admin/user") 21 | public class UserController { 22 | 23 | @Autowired 24 | private UserService userService; 25 | 26 | @RequestMapping("/showjson") 27 | @ResponseBody 28 | public Msg getAllGoods(@RequestParam(value = "page",defaultValue = "1") Integer pn, HttpServletResponse response, Model model) { 29 | //一页显示几个数据 30 | PageHelper.startPage(pn, 10); 31 | List userList = userService.selectByExample(new UserExample()); 32 | //显示几个页号 33 | PageInfo page = new PageInfo(userList,5); 34 | 35 | /* model.addAttribute("pageInfo", page);*/ 36 | 37 | return Msg.success("查询成功!").add("pageInfo", page); 38 | } 39 | 40 | @RequestMapping("/show") 41 | public String userManage() { 42 | return "userManage"; 43 | } 44 | 45 | @RequestMapping(value = "/delete/{userid}", method = RequestMethod.DELETE) 46 | @ResponseBody 47 | public Msg deleteUser(@PathVariable("userid")Integer userid) { 48 | // goodsService.deleteGoodsById(goodsid); 49 | userService.deleteUserById(userid); 50 | return Msg.success("删除成功!"); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/controller/front/CartController.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.controller.front; 2 | 3 | 4 | import com.zhang.ssmschoolshop.entity.*; 5 | import com.zhang.ssmschoolshop.service.GoodsService; 6 | import com.zhang.ssmschoolshop.service.ShopCartService; 7 | import com.zhang.ssmschoolshop.util.Msg; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Controller; 10 | import org.springframework.web.bind.annotation.PathVariable; 11 | import org.springframework.web.bind.annotation.RequestMapping; 12 | import org.springframework.web.bind.annotation.RequestMethod; 13 | import org.springframework.web.bind.annotation.ResponseBody; 14 | 15 | import javax.servlet.http.HttpServletRequest; 16 | import javax.servlet.http.HttpSession; 17 | import java.util.Date; 18 | import java.util.ArrayList; 19 | import java.util.List; 20 | 21 | @Controller 22 | public class CartController { 23 | 24 | @Autowired 25 | private ShopCartService shopCartService; 26 | 27 | @Autowired 28 | private GoodsService goodsService; 29 | 30 | @RequestMapping("/addCart") 31 | public String addCart(ShopCart shopCart, HttpServletRequest request) { 32 | HttpSession session = request.getSession(); 33 | User user = (User) session.getAttribute("user"); 34 | if(user == null) { 35 | return "redirect:/login"; 36 | } 37 | //判断是否已经加入购物车 38 | ShopCart shopCart1 = shopCartService.selectCartByKey(new ShopCartKey(user.getUserid(), shopCart.getGoodsid())); 39 | if (shopCart1 != null) { 40 | return "redirect:/showcart"; 41 | } 42 | 43 | //用户 44 | shopCart.setUserid(user.getUserid()); 45 | 46 | //加入时间 47 | shopCart.setCatedate(new Date()); 48 | 49 | shopCartService.addShopCart(shopCart); 50 | 51 | //返回到购物车页面 52 | return "redirect:/showcart"; 53 | } 54 | 55 | @RequestMapping("/showcart") 56 | public String showCart(HttpSession session) { 57 | User user = (User) session.getAttribute("user"); 58 | if(user == null) { 59 | return "redirect:/login"; 60 | } 61 | return "shopcart"; 62 | } 63 | 64 | @RequestMapping("/cartjson") 65 | @ResponseBody 66 | public Msg getCart(HttpSession session) { 67 | User user = (User) session.getAttribute("user"); 68 | if(user == null) { 69 | return Msg.fail("请先登录"); 70 | } 71 | 72 | //获取当前用户的购物车信息 73 | ShopCartExample shopCartExample = new ShopCartExample(); 74 | shopCartExample.or().andUseridEqualTo(user.getUserid()); 75 | List shopCart = shopCartService.selectByExample(shopCartExample); 76 | 77 | //获取购物车中的商品信息 78 | List goodsAndImage = new ArrayList<>(); 79 | for (ShopCart cart:shopCart) { 80 | Goods goods = goodsService.selectById(cart.getGoodsid()); 81 | List imagePathList = goodsService.findImagePath(goods.getGoodsid()); 82 | goods.setImagePaths(imagePathList); 83 | goods.setNum(cart.getGoodsnum()); 84 | goodsAndImage.add(goods); 85 | } 86 | 87 | return Msg.success("查询成功").add("shopcart",goodsAndImage); 88 | } 89 | 90 | @RequestMapping(value = "/deleteCart/{goodsid}", method = RequestMethod.DELETE) 91 | @ResponseBody 92 | public Msg deleteCart(@PathVariable("goodsid")Integer goodsid, HttpSession session) { 93 | User user = (User) session.getAttribute("user"); 94 | if(user == null) { 95 | return Msg.fail("请先登录"); 96 | } 97 | 98 | shopCartService.deleteByKey(new ShopCartKey(user.getUserid(), goodsid)); 99 | return Msg.success("删除成功"); 100 | } 101 | 102 | @RequestMapping("/update") 103 | @ResponseBody 104 | public Msg updateCart(Integer goodsid,Integer num,HttpSession session) { 105 | User user = (User) session.getAttribute("user"); 106 | if(user == null) { 107 | return Msg.fail("请先登录"); 108 | } 109 | ShopCart shopCart = new ShopCart(); 110 | shopCart.setUserid(user.getUserid()); 111 | shopCart.setGoodsid(goodsid); 112 | shopCart.setGoodsnum(num); 113 | shopCartService.updateCartByKey(shopCart); 114 | return Msg.success("更新购物车成功"); 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/controller/front/MainController.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.controller.front; 2 | 3 | 4 | import com.zhang.ssmschoolshop.entity.*; 5 | import com.zhang.ssmschoolshop.service.CateService; 6 | import com.zhang.ssmschoolshop.service.GoodsService; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Controller; 9 | import org.springframework.ui.Model; 10 | import org.springframework.web.bind.annotation.RequestMapping; 11 | 12 | import javax.servlet.http.HttpSession; 13 | import java.util.ArrayList; 14 | import java.util.List; 15 | 16 | @Controller 17 | public class MainController { 18 | 19 | @Autowired 20 | private CateService cateService; 21 | 22 | @Autowired 23 | private GoodsService goodsService; 24 | 25 | 26 | @RequestMapping("/") 27 | public String showAdmin(Model model, HttpSession session) { 28 | Integer userid; 29 | User user = (User) session.getAttribute("user"); 30 | if (user == null) { 31 | userid = null; 32 | } else { 33 | userid = user.getUserid(); 34 | } 35 | 36 | //数码分类 37 | List digGoods = getCateGoods("数码", userid); 38 | model.addAttribute("digGoods", digGoods); 39 | 40 | //家电 41 | List houseGoods = getCateGoods("家电", userid); 42 | model.addAttribute("houseGoods", houseGoods); 43 | 44 | //服饰 45 | List colGoods = getCateGoods("服饰", userid); 46 | model.addAttribute("colGoods", colGoods); 47 | 48 | //书籍 49 | List bookGoods = getCateGoods("书籍", userid); 50 | model.addAttribute("bookGoods", bookGoods); 51 | 52 | return "main"; 53 | } 54 | 55 | 56 | 57 | 58 | @RequestMapping("/main") 59 | public String showAllGoods(Model model, HttpSession session) { 60 | Integer userid; 61 | User user = (User) session.getAttribute("user"); 62 | if (user == null) { 63 | userid = null; 64 | } else { 65 | userid = user.getUserid(); 66 | } 67 | //数码分类 68 | List digGoods = getCateGoods("数码", userid); 69 | model.addAttribute("digGoods", digGoods); 70 | //家电 71 | List houseGoods = getCateGoods("家电", userid); 72 | model.addAttribute("houseGoods", houseGoods); 73 | //服饰 74 | List colGoods = getCateGoods("服饰", userid); 75 | model.addAttribute("colGoods", colGoods); 76 | //书籍 77 | List bookGoods = getCateGoods("书籍", userid); 78 | model.addAttribute("bookGoods", bookGoods); 79 | 80 | return "main"; 81 | } 82 | 83 | public List getCateGoods(String cate, Integer userid) { 84 | //查询分类 85 | CategoryExample digCategoryExample = new CategoryExample(); 86 | digCategoryExample.or().andCatenameLike(cate); 87 | List digCategoryList = cateService.selectByExample(digCategoryExample); 88 | 89 | if (digCategoryList.size() == 0) { 90 | return null; 91 | } 92 | 93 | //查询属于刚查到的分类的商品 94 | GoodsExample digGoodsExample = new GoodsExample(); 95 | List digCateId = new ArrayList(); 96 | for (Category tmp:digCategoryList) { 97 | digCateId.add(tmp.getCateid()); 98 | } 99 | digGoodsExample.or().andCategoryIn(digCateId); 100 | 101 | List goodsList = goodsService.selectByExampleLimit(digGoodsExample); 102 | 103 | List goodsAndImage = new ArrayList<>(); 104 | //获取每个商品的图片 105 | for (Goods goods:goodsList) { 106 | //判断是否为登录状态 107 | if (userid == null) { 108 | goods.setFav(false); 109 | } else { 110 | Favorite favorite = goodsService.selectFavByKey(new FavoriteKey(userid, goods.getGoodsid())); 111 | if (favorite == null) { 112 | goods.setFav(false); 113 | } else { 114 | goods.setFav(true); 115 | } 116 | } 117 | 118 | List imagePathList = goodsService.findImagePath(goods.getGoodsid()); 119 | goods.setImagePaths(imagePathList); 120 | goodsAndImage.add(goods); 121 | } 122 | return goodsAndImage; 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/controller/front/OrderController.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.controller.front; 2 | 3 | 4 | import com.zhang.ssmschoolshop.entity.*; 5 | import com.zhang.ssmschoolshop.service.*; 6 | import com.zhang.ssmschoolshop.util.Msg; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Controller; 9 | import org.springframework.ui.Model; 10 | import org.springframework.web.bind.annotation.RequestMapping; 11 | import org.springframework.web.bind.annotation.ResponseBody; 12 | 13 | import javax.servlet.http.HttpSession; 14 | import java.util.ArrayList; 15 | import java.util.Date; 16 | import java.util.List; 17 | 18 | 19 | @Controller 20 | public class OrderController { 21 | 22 | /*@Value("#{addressService}")*/ 23 | @Autowired 24 | private AddressService addressService; 25 | 26 | @Autowired 27 | private ShopCartService shopCartService; 28 | 29 | @Autowired 30 | private GoodsService goodsService; 31 | 32 | @Autowired 33 | private OrderService orderService; 34 | 35 | @Autowired 36 | private ActivityService activityService; 37 | 38 | @RequestMapping("/order") 39 | public String showOrder(HttpSession session, Model model) { 40 | 41 | User user = (User) session.getAttribute("user"); 42 | if (user == null) { 43 | return "redirect:/login"; 44 | } 45 | 46 | //查询当前用户的收货地址 47 | AddressExample addressExample = new AddressExample(); 48 | addressExample.or().andUseridEqualTo(user.getUserid()); 49 | List
addressList = addressService.getAllAddressByExample(addressExample); 50 | 51 | model.addAttribute("address", addressList); 52 | 53 | //订单信息 54 | //获取当前用户的购物车信息 55 | ShopCartExample shopCartExample = new ShopCartExample(); 56 | shopCartExample.or().andUseridEqualTo(user.getUserid()); 57 | List shopCart = shopCartService.selectByExample(shopCartExample); 58 | 59 | //获取购物车中的商品信息 60 | List goodsAndImage = new ArrayList<>(); 61 | 62 | Float totalPrice = new Float(0); 63 | Integer oldTotalPrice = 0; 64 | 65 | for (ShopCart cart : shopCart) { 66 | //分别从购物车列表中获取每个商品 67 | Goods goods = goodsService.selectById(cart.getGoodsid()); 68 | 69 | List imagePathList = goodsService.findImagePath(goods.getGoodsid()); 70 | goods.setImagePaths(imagePathList); 71 | goods.setNum(cart.getGoodsnum()); 72 | 73 | //活动信息 74 | Activity activity = activityService.selectByKey(goods.getActivityid()); 75 | goods.setActivity(activity); 76 | 77 | //处理折扣信息 78 | //如果商品折扣不为1 79 | if (activity.getDiscount() != 1) { 80 | goods.setNewPrice(goods.getPrice() * goods.getNum() * activity.getDiscount()); 81 | System.out.println("价格为:" + goods.getPrice() * goods.getNum() * activity.getDiscount()); 82 | } else if (activity.getFullnum() != null) { 83 | System.out.println("进入第二层方法"); 84 | if (goods.getNum() >= activity.getFullnum()) { 85 | goods.setNewPrice((float) (goods.getPrice() * (goods.getNum() - activity.getReducenum()))); 86 | } else { 87 | goods.setNewPrice((float) (goods.getPrice() * goods.getNum())); 88 | } 89 | } else if (activity.getFullprice() != null && activity.getReducenum() != null) { 90 | if ((goods.getNum() * goods.getNum()) > activity.getFullprice()) { 91 | goods.setNewPrice((float) (goods.getPrice() * goods.getNum() - activity.getReducenum())); 92 | } else { 93 | goods.setNewPrice((float) (goods.getPrice() * goods.getNum())); 94 | 95 | } 96 | 97 | } else { 98 | goods.setNewPrice((float) (goods.getPrice() * goods.getNum())); 99 | } 100 | totalPrice = totalPrice + goods.getNewPrice(); 101 | oldTotalPrice = oldTotalPrice + goods.getNum() * goods.getPrice(); 102 | goodsAndImage.add(goods); 103 | } 104 | 105 | model.addAttribute("totalPrice", totalPrice); 106 | model.addAttribute("oldTotalPrice", oldTotalPrice); 107 | model.addAttribute("goodsAndImage", goodsAndImage); 108 | 109 | return "orderConfirm"; 110 | } 111 | 112 | @RequestMapping("/orderFinish") 113 | @ResponseBody 114 | public Msg orderFinish(Float oldPrice, Float newPrice, Boolean isPay, Integer addressid, HttpSession session) { 115 | User user = (User) session.getAttribute("user"); 116 | 117 | //获取订单信息 118 | ShopCartExample shopCartExample = new ShopCartExample(); 119 | shopCartExample.or().andUseridEqualTo(user.getUserid()); 120 | List shopCart = shopCartService.selectByExample(shopCartExample); 121 | 122 | //删除购物车 123 | for (ShopCart cart : shopCart) { 124 | shopCartService.deleteByKey(new ShopCartKey(cart.getUserid(), cart.getGoodsid())); 125 | } 126 | 127 | //把订单信息写入数据库 128 | Order order = new Order(null, user.getUserid(), new Date(), oldPrice, newPrice, isPay, false, false, false, addressid, null, null); 129 | orderService.insertOrder(order); 130 | //插入的订单号 131 | Integer orderId = order.getOrderid(); 132 | 133 | //把订单项写入orderitem表中 134 | for (ShopCart cart : shopCart) { 135 | orderService.insertOrderItem(new OrderItem(null, orderId, cart.getGoodsid(), cart.getGoodsnum())); 136 | } 137 | 138 | return Msg.success("购买成功"); 139 | } 140 | 141 | } 142 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/controller/front/VerificationCodeImgController.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.controller.front; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.servlet.ModelAndView; 6 | 7 | 8 | @Controller 9 | public class VerificationCodeImgController { 10 | @RequestMapping("/verificationcodeimg") 11 | public ModelAndView verificationcodeimg(){ 12 | ModelAndView verificationcodeimg=new ModelAndView(); 13 | verificationcodeimg.setViewName("verificationcodeimg"); 14 | return verificationcodeimg; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/dao/ActivityMapper.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.dao; 2 | 3 | 4 | import com.zhang.ssmschoolshop.entity.Activity; 5 | import com.zhang.ssmschoolshop.entity.ActivityExample; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | import java.util.List; 9 | 10 | public interface ActivityMapper { 11 | long countByExample(ActivityExample example); 12 | 13 | int deleteByExample(ActivityExample example); 14 | 15 | int deleteByPrimaryKey(Integer activityid); 16 | 17 | int insert(Activity record); 18 | 19 | int insertSelective(Activity record); 20 | 21 | List selectByExample(ActivityExample example); 22 | 23 | Activity selectByPrimaryKey(Integer activityid); 24 | 25 | int updateByExampleSelective(@Param("record") Activity record, @Param("example") ActivityExample example); 26 | 27 | int updateByExample(@Param("record") Activity record, @Param("example") ActivityExample example); 28 | 29 | int updateByPrimaryKeySelective(Activity record); 30 | 31 | int updateByPrimaryKey(Activity record); 32 | } -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/dao/AddressMapper.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.dao; 2 | 3 | 4 | import com.zhang.ssmschoolshop.entity.Address; 5 | import com.zhang.ssmschoolshop.entity.AddressExample; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | import java.util.List; 9 | 10 | public interface AddressMapper { 11 | long countByExample(AddressExample example); 12 | 13 | int deleteByExample(AddressExample example); 14 | 15 | int deleteByPrimaryKey(Integer addressid); 16 | 17 | int insert(Address record); 18 | 19 | int insertSelective(Address record); 20 | 21 | List
selectByExample(AddressExample example); 22 | 23 | Address selectByPrimaryKey(Integer addressid); 24 | 25 | int updateByExampleSelective(@Param("record") Address record, @Param("example") AddressExample example); 26 | 27 | int updateByExample(@Param("record") Address record, @Param("example") AddressExample example); 28 | 29 | int updateByPrimaryKeySelective(Address record); 30 | 31 | int updateByPrimaryKey(Address record); 32 | } -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/dao/AdminMapper.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.dao; 2 | 3 | import org.apache.ibatis.annotations.Param; 4 | import com.zhang.ssmschoolshop.entity.Admin; 5 | import com.zhang.ssmschoolshop.entity.AdminExample; 6 | 7 | import java.util.List; 8 | 9 | public interface AdminMapper { 10 | long countByExample(AdminExample example); 11 | 12 | int deleteByExample(AdminExample example); 13 | 14 | int deleteByPrimaryKey(Integer adminid); 15 | 16 | int insert(Admin record); 17 | 18 | int insertSelective(Admin record); 19 | 20 | List selectByExample(AdminExample example); 21 | 22 | Admin selectByPrimaryKey(Integer adminid); 23 | 24 | Admin selectByName(Admin admin); 25 | 26 | int updateByExampleSelective(@Param("record") Admin record, @Param("example") AdminExample example); 27 | 28 | int updateByExample(@Param("record") Admin record, @Param("example") AdminExample example); 29 | 30 | int updateByPrimaryKeySelective(Admin record); 31 | 32 | int updateByPrimaryKey(Admin record); 33 | } -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/dao/CategoryMapper.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.dao; 2 | 3 | 4 | import com.zhang.ssmschoolshop.entity.Category; 5 | import com.zhang.ssmschoolshop.entity.CategoryExample; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | import java.util.List; 9 | 10 | public interface CategoryMapper { 11 | long countByExample(CategoryExample example); 12 | 13 | int deleteByExample(CategoryExample example); 14 | 15 | int deleteByPrimaryKey(Integer cateid); 16 | 17 | int insert(Category record); 18 | 19 | int insertSelective(Category record); 20 | 21 | List selectByExample(CategoryExample example); 22 | 23 | List selectByExampleLimit(CategoryExample example); 24 | 25 | Category selectByPrimaryKey(Integer cateid); 26 | 27 | int updateByExampleSelective(@Param("record") Category record, @Param("example") CategoryExample example); 28 | 29 | int updateByExample(@Param("record") Category record, @Param("example") CategoryExample example); 30 | 31 | int updateByPrimaryKeySelective(Category record); 32 | 33 | int updateByPrimaryKey(Category record); 34 | } -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/dao/CommentMapper.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.dao; 2 | 3 | 4 | import com.zhang.ssmschoolshop.entity.Comment; 5 | import com.zhang.ssmschoolshop.entity.CommentExample; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | import java.util.List; 9 | 10 | public interface CommentMapper { 11 | long countByExample(CommentExample example); 12 | 13 | int deleteByExample(CommentExample example); 14 | 15 | int deleteByPrimaryKey(Integer commentid); 16 | 17 | int insert(Comment record); 18 | 19 | int insertSelective(Comment record); 20 | 21 | List selectByExample(CommentExample example); 22 | 23 | Comment selectByPrimaryKey(Integer commentid); 24 | 25 | int updateByExampleSelective(@Param("record") Comment record, @Param("example") CommentExample example); 26 | 27 | int updateByExample(@Param("record") Comment record, @Param("example") CommentExample example); 28 | 29 | int updateByPrimaryKeySelective(Comment record); 30 | 31 | int updateByPrimaryKey(Comment record); 32 | } -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/dao/FavoriteMapper.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.dao; 2 | 3 | 4 | import com.zhang.ssmschoolshop.entity.Favorite; 5 | import com.zhang.ssmschoolshop.entity.FavoriteExample; 6 | import com.zhang.ssmschoolshop.entity.FavoriteKey; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import java.util.List; 10 | 11 | public interface FavoriteMapper { 12 | long countByExample(FavoriteExample example); 13 | 14 | int deleteByExample(FavoriteExample example); 15 | 16 | int deleteByPrimaryKey(FavoriteKey key); 17 | 18 | int insert(Favorite record); 19 | 20 | int insertSelective(Favorite record); 21 | 22 | List selectByExample(FavoriteExample example); 23 | 24 | Favorite selectByPrimaryKey(FavoriteKey key); 25 | 26 | int updateByExampleSelective(@Param("record") Favorite record, @Param("example") FavoriteExample example); 27 | 28 | int updateByExample(@Param("record") Favorite record, @Param("example") FavoriteExample example); 29 | 30 | int updateByPrimaryKeySelective(Favorite record); 31 | 32 | int updateByPrimaryKey(Favorite record); 33 | } -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/dao/GoodsMapper.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.dao; 2 | 3 | import org.apache.ibatis.annotations.Param; 4 | import com.zhang.ssmschoolshop.entity.Goods; 5 | import com.zhang.ssmschoolshop.entity.GoodsExample; 6 | 7 | import java.util.List; 8 | 9 | public interface GoodsMapper { 10 | long countByExample(GoodsExample example); 11 | 12 | int deleteByExample(GoodsExample example); 13 | 14 | int deleteByPrimaryKey(Integer goodsid); 15 | 16 | int insert(Goods record); 17 | 18 | int insertSelective(Goods record); 19 | 20 | List selectByExampleWithBLOBs(GoodsExample example); 21 | 22 | List selectByExample(GoodsExample example); 23 | 24 | Goods selectByPrimaryKey(Integer goodsid); 25 | 26 | int updateByExampleSelective(@Param("record") Goods record, @Param("example") GoodsExample example); 27 | 28 | int updateByExampleWithBLOBs(@Param("record") Goods record, @Param("example") GoodsExample example); 29 | 30 | int updateByExample(@Param("record") Goods record, @Param("example") GoodsExample example); 31 | 32 | int updateByPrimaryKeySelective(Goods record); 33 | 34 | int updateByPrimaryKeyWithBLOBs(Goods record); 35 | 36 | int updateByPrimaryKey(Goods record); 37 | 38 | List selectByExampleWithBLOBsLimit(GoodsExample digGoodsExample); 39 | } -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/dao/ImagePathMapper.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.dao; 2 | 3 | 4 | import com.zhang.ssmschoolshop.entity.ImagePath; 5 | import com.zhang.ssmschoolshop.entity.ImagePathExample; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | import java.util.List; 9 | 10 | public interface ImagePathMapper { 11 | long countByExample(ImagePathExample example); 12 | 13 | int deleteByExample(ImagePathExample example); 14 | 15 | int deleteByPrimaryKey(Integer pathid); 16 | 17 | int insert(ImagePath record); 18 | 19 | int insertSelective(ImagePath record); 20 | 21 | List selectByExample(ImagePathExample example); 22 | 23 | ImagePath selectByPrimaryKey(Integer pathid); 24 | 25 | int updateByExampleSelective(@Param("record") ImagePath record, @Param("example") ImagePathExample example); 26 | 27 | int updateByExample(@Param("record") ImagePath record, @Param("example") ImagePathExample example); 28 | 29 | int updateByPrimaryKeySelective(ImagePath record); 30 | 31 | int updateByPrimaryKey(ImagePath record); 32 | } -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/dao/OrderItemMapper.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.dao; 2 | 3 | 4 | import com.zhang.ssmschoolshop.entity.OrderItem; 5 | import com.zhang.ssmschoolshop.entity.OrderItemExample; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | import java.util.List; 9 | 10 | public interface OrderItemMapper { 11 | long countByExample(OrderItemExample example); 12 | 13 | int deleteByExample(OrderItemExample example); 14 | 15 | int deleteByPrimaryKey(Integer itemid); 16 | 17 | int insert(OrderItem record); 18 | 19 | int insertSelective(OrderItem record); 20 | 21 | List selectByExample(OrderItemExample example); 22 | 23 | OrderItem selectByPrimaryKey(Integer itemid); 24 | 25 | int updateByExampleSelective(@Param("record") OrderItem record, @Param("example") OrderItemExample example); 26 | 27 | int updateByExample(@Param("record") OrderItem record, @Param("example") OrderItemExample example); 28 | 29 | int updateByPrimaryKeySelective(OrderItem record); 30 | 31 | int updateByPrimaryKey(OrderItem record); 32 | } -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/dao/OrderMapper.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.dao; 2 | 3 | 4 | import com.zhang.ssmschoolshop.entity.Order; 5 | import com.zhang.ssmschoolshop.entity.OrderExample; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | import java.util.List; 9 | 10 | public interface OrderMapper { 11 | long countByExample(OrderExample example); 12 | 13 | int deleteByExample(OrderExample example); 14 | 15 | int deleteByPrimaryKey(Integer orderid); 16 | 17 | int insert(Order record); 18 | 19 | int insertSelective(Order record); 20 | 21 | List selectByExample(OrderExample example); 22 | 23 | Order selectByPrimaryKey(Integer orderid); 24 | 25 | int updateByExampleSelective(@Param("record") Order record, @Param("example") OrderExample example); 26 | 27 | int updateByExample(@Param("record") Order record, @Param("example") OrderExample example); 28 | 29 | int updateByPrimaryKeySelective(Order record); 30 | 31 | int updateByPrimaryKey(Order record); 32 | } -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/dao/ShopCartMapper.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.dao; 2 | 3 | 4 | import com.zhang.ssmschoolshop.entity.ShopCart; 5 | import com.zhang.ssmschoolshop.entity.ShopCartExample; 6 | import com.zhang.ssmschoolshop.entity.ShopCartKey; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import java.util.List; 10 | 11 | public interface ShopCartMapper { 12 | long countByExample(ShopCartExample example); 13 | 14 | int deleteByExample(ShopCartExample example); 15 | 16 | int deleteByPrimaryKey(ShopCartKey key); 17 | 18 | int insert(ShopCart record); 19 | 20 | int insertSelective(ShopCart record); 21 | 22 | List selectByExample(ShopCartExample example); 23 | 24 | ShopCart selectByPrimaryKey(ShopCartKey key); 25 | 26 | int updateByExampleSelective(@Param("record") ShopCart record, @Param("example") ShopCartExample example); 27 | 28 | int updateByExample(@Param("record") ShopCart record, @Param("example") ShopCartExample example); 29 | 30 | int updateByPrimaryKeySelective(ShopCart record); 31 | 32 | int updateByPrimaryKey(ShopCart record); 33 | } -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/dao/UserMapper.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.dao; 2 | 3 | 4 | import com.zhang.ssmschoolshop.entity.User; 5 | import com.zhang.ssmschoolshop.entity.UserExample; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | import java.util.List; 9 | 10 | public interface UserMapper { 11 | long countByExample(UserExample example); 12 | 13 | int deleteByExample(UserExample example); 14 | 15 | int deleteByPrimaryKey(Integer userid); 16 | 17 | int insert(User record); 18 | 19 | int insertSelective(User record); 20 | 21 | List selectByExample(UserExample example); 22 | 23 | User selectByPrimaryKey(Integer userid); 24 | 25 | int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example); 26 | 27 | int updateByExample(@Param("record") User record, @Param("example") UserExample example); 28 | 29 | int updateByPrimaryKeySelective(User record); 30 | 31 | int updateByPrimaryKey(User record); 32 | } -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/entity/Activity.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.entity; 2 | 3 | /** 4 | * 促销活动 5 | */ 6 | public class Activity { 7 | 8 | private Integer activityid; //活动id 9 | 10 | private String activityname; //活动名 11 | 12 | private String activitydes; //活动地址 13 | 14 | private Float discount; //满减 15 | 16 | private Integer fullprice; 17 | 18 | private Integer reduceprice; 19 | 20 | private Integer fullnum; 21 | 22 | private Integer reducenum; 23 | 24 | public Integer getActivityid() { 25 | return activityid; 26 | } 27 | 28 | public void setActivityid(Integer activityid) { 29 | this.activityid = activityid; 30 | } 31 | 32 | public String getActivityname() { 33 | return activityname; 34 | } 35 | 36 | public void setActivityname(String activityname) { 37 | this.activityname = activityname == null ? null : activityname.trim(); 38 | } 39 | 40 | public String getActivitydes() { 41 | return activitydes; 42 | } 43 | 44 | public void setActivitydes(String activitydes) { 45 | this.activitydes = activitydes == null ? null : activitydes.trim(); 46 | } 47 | 48 | public Float getDiscount() { 49 | return discount; 50 | } 51 | 52 | public void setDiscount(Float discount) { 53 | this.discount = discount; 54 | } 55 | 56 | public Integer getFullprice() { 57 | return fullprice; 58 | } 59 | 60 | public void setFullprice(Integer fullprice) { 61 | this.fullprice = fullprice; 62 | } 63 | 64 | public Integer getReduceprice() { 65 | return reduceprice; 66 | } 67 | 68 | public void setReduceprice(Integer reduceprice) { 69 | this.reduceprice = reduceprice; 70 | } 71 | 72 | public Integer getFullnum() { 73 | return fullnum; 74 | } 75 | 76 | public void setFullnum(Integer fullnum) { 77 | this.fullnum = fullnum; 78 | } 79 | 80 | public Integer getReducenum() { 81 | return reducenum; 82 | } 83 | 84 | public void setReducenum(Integer reducenum) { 85 | this.reducenum = reducenum; 86 | } 87 | } -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/entity/Address.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.entity; 2 | 3 | public class Address { 4 | private Integer addressid; 5 | 6 | private Integer userid; 7 | 8 | private String province; 9 | 10 | private String city; 11 | 12 | private String county; 13 | 14 | private String detailaddr; 15 | 16 | private String conname; 17 | 18 | private String contel; 19 | 20 | public Integer getAddressid() { 21 | return addressid; 22 | } 23 | 24 | public void setAddressid(Integer addressid) { 25 | this.addressid = addressid; 26 | } 27 | 28 | public Integer getUserid() { 29 | return userid; 30 | } 31 | 32 | public void setUserid(Integer userid) { 33 | this.userid = userid; 34 | } 35 | 36 | public String getProvince() { 37 | return province; 38 | } 39 | 40 | public void setProvince(String province) { 41 | this.province = province == null ? null : province.trim(); 42 | } 43 | 44 | public String getCity() { 45 | return city; 46 | } 47 | 48 | public void setCity(String city) { 49 | this.city = city == null ? null : city.trim(); 50 | } 51 | 52 | public String getCounty() { 53 | return county; 54 | } 55 | 56 | public void setCounty(String county) { 57 | this.county = county == null ? null : county.trim(); 58 | } 59 | 60 | public String getDetailaddr() { 61 | return detailaddr; 62 | } 63 | 64 | public void setDetailaddr(String detailaddr) { 65 | this.detailaddr = detailaddr == null ? null : detailaddr.trim(); 66 | } 67 | 68 | public String getConname() { 69 | return conname; 70 | } 71 | 72 | public void setConname(String conname) { 73 | this.conname = conname == null ? null : conname.trim(); 74 | } 75 | 76 | public String getContel() { 77 | return contel; 78 | } 79 | 80 | public void setContel(String contel) { 81 | this.contel = contel == null ? null : contel.trim(); 82 | } 83 | } -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/entity/Admin.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.entity; 2 | 3 | public class Admin { 4 | private Integer adminid; 5 | 6 | private String adminname; 7 | 8 | private String password; 9 | 10 | public Admin(Integer adminid, String adminname, String password) { 11 | this.adminid = adminid; 12 | this.adminname = adminname; 13 | this.password = password; 14 | } 15 | 16 | public Admin() { 17 | } 18 | 19 | public Integer getAdminid() { 20 | return adminid; 21 | } 22 | 23 | public void setAdminid(Integer adminid) { 24 | this.adminid = adminid; 25 | } 26 | 27 | public String getAdminname() { 28 | return adminname; 29 | } 30 | 31 | public void setAdminname(String adminname) { 32 | this.adminname = adminname == null ? null : adminname.trim(); 33 | } 34 | 35 | public String getPassword() { 36 | return password; 37 | } 38 | 39 | public void setPassword(String password) { 40 | this.password = password == null ? null : password.trim(); 41 | } 42 | } -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/entity/Category.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.entity; 2 | 3 | public class Category { 4 | private Integer cateid; 5 | 6 | private String catename; 7 | 8 | public Integer getCateid() { 9 | return cateid; 10 | } 11 | 12 | public void setCateid(Integer cateid) { 13 | this.cateid = cateid; 14 | } 15 | 16 | public String getCatename() { 17 | return catename; 18 | } 19 | 20 | public void setCatename(String catename) { 21 | this.catename = catename == null ? null : catename.trim(); 22 | } 23 | } -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/entity/Comment.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.entity; 2 | 3 | import java.util.Date; 4 | 5 | public class Comment { 6 | private Integer commentid; 7 | 8 | private Integer userid; 9 | 10 | private Integer goodsid; 11 | 12 | private Integer point; 13 | 14 | private String content; 15 | 16 | private Date commenttime; 17 | 18 | private String username; 19 | 20 | public Integer getCommentid() { 21 | return commentid; 22 | } 23 | 24 | public void setCommentid(Integer commentid) { 25 | this.commentid = commentid; 26 | } 27 | 28 | public Integer getUserid() { 29 | return userid; 30 | } 31 | 32 | public void setUserid(Integer userid) { 33 | this.userid = userid; 34 | } 35 | 36 | public Integer getGoodsid() { 37 | return goodsid; 38 | } 39 | 40 | public void setGoodsid(Integer goodsid) { 41 | this.goodsid = goodsid; 42 | } 43 | 44 | public Integer getPoint() { 45 | return point; 46 | } 47 | 48 | public void setPoint(Integer point) { 49 | this.point = point; 50 | } 51 | 52 | public String getContent() { 53 | return content; 54 | } 55 | 56 | public void setContent(String content) { 57 | this.content = content == null ? null : content.trim(); 58 | } 59 | 60 | public Date getCommenttime() { 61 | return commenttime; 62 | } 63 | 64 | public void setCommenttime(Date commenttime) { 65 | this.commenttime = commenttime; 66 | } 67 | 68 | public void setUserName(String userName) {this.username=userName;} 69 | 70 | public String getUsername() {return username;} 71 | } -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/entity/Favorite.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.entity; 2 | 3 | import java.util.Date; 4 | 5 | public class Favorite extends FavoriteKey { 6 | private Date collecttime; 7 | 8 | public Date getCollecttime() { 9 | return collecttime; 10 | } 11 | 12 | public void setCollecttime(Date collecttime) { 13 | this.collecttime = collecttime; 14 | } 15 | } -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/entity/FavoriteKey.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.entity; 2 | 3 | public class FavoriteKey { 4 | private Integer userid; 5 | 6 | private Integer goodsid; 7 | 8 | public FavoriteKey() { 9 | } 10 | 11 | public FavoriteKey(Integer userid, Integer goodsid) { 12 | 13 | this.userid = userid; 14 | this.goodsid = goodsid; 15 | } 16 | 17 | public Integer getUserid() { 18 | return userid; 19 | } 20 | 21 | public void setUserid(Integer userid) { 22 | this.userid = userid; 23 | } 24 | 25 | public Integer getGoodsid() { 26 | return goodsid; 27 | } 28 | 29 | public void setGoodsid(Integer goodsid) { 30 | this.goodsid = goodsid; 31 | } 32 | } -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/entity/Goods.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.entity; 2 | 3 | import java.util.Date; 4 | import java.util.List; 5 | 6 | public class Goods { 7 | private Integer goodsid; 8 | 9 | private String goodsname; 10 | 11 | private Integer price; 12 | 13 | private Integer num; 14 | 15 | private Date uptime; 16 | 17 | private Integer category; 18 | 19 | private String detailcate; 20 | 21 | private Integer activityid; 22 | 23 | private String description; 24 | 25 | private List imagePaths; 26 | 27 | private boolean fav; 28 | 29 | private Activity activity; 30 | 31 | private Float newPrice; 32 | 33 | public Integer getGoodsid() { 34 | return goodsid; 35 | } 36 | 37 | public void setGoodsid(Integer goodsid) { 38 | this.goodsid = goodsid; 39 | } 40 | 41 | public String getGoodsname() { 42 | return goodsname; 43 | } 44 | 45 | public void setGoodsname(String goodsname) { 46 | this.goodsname = goodsname == null ? null : goodsname.trim(); 47 | } 48 | 49 | public Integer getPrice() { 50 | return price; 51 | } 52 | 53 | public void setPrice(Integer price) { 54 | this.price = price; 55 | } 56 | 57 | public Integer getNum() { 58 | return num; 59 | } 60 | 61 | public void setNum(Integer num) { 62 | this.num = num; 63 | } 64 | 65 | public Date getUptime() { 66 | return uptime; 67 | } 68 | 69 | public void setUptime(Date uptime) { 70 | this.uptime = uptime; 71 | } 72 | 73 | public Integer getCategory() { 74 | return category; 75 | } 76 | 77 | public void setCategory(Integer category) { 78 | this.category = category; 79 | } 80 | 81 | public String getDetailcate() { 82 | return detailcate; 83 | } 84 | 85 | public void setDetailcate(String detailcate) { 86 | this.detailcate = detailcate == null ? null : detailcate.trim(); 87 | } 88 | 89 | public Integer getActivityid() { 90 | return activityid; 91 | } 92 | 93 | public void setActivityid(Integer activityid) { 94 | this.activityid = activityid; 95 | } 96 | 97 | public String getDescription() { 98 | return description; 99 | } 100 | 101 | public void setDescription(String description) { 102 | this.description = description == null ? null : description.trim(); 103 | } 104 | 105 | public List getImagePaths() { 106 | return imagePaths; 107 | } 108 | 109 | public void setImagePaths(List imagePaths) { 110 | this.imagePaths = imagePaths; 111 | } 112 | 113 | 114 | public boolean isFav() { 115 | return fav; 116 | } 117 | 118 | public void setFav(boolean fav) { 119 | this.fav = fav; 120 | } 121 | 122 | public Activity getActivity() { 123 | return activity; 124 | } 125 | 126 | public void setActivity(Activity activity) { 127 | this.activity = activity; 128 | } 129 | 130 | public Float getNewPrice() { 131 | return newPrice; 132 | } 133 | 134 | public void setNewPrice(Float newPrice) { 135 | this.newPrice = newPrice; 136 | } 137 | 138 | @Override 139 | public String toString() { 140 | return "Goods{" + 141 | "goodsid=" + goodsid + 142 | ", goodsname='" + goodsname + '\'' + 143 | ", price=" + price + 144 | ", num=" + num + 145 | ", uptime=" + uptime + 146 | ", category=" + category + 147 | ", detailcate='" + detailcate + '\'' + 148 | ", activityid=" + activityid + 149 | ", description='" + description + '\'' + 150 | ", imagePaths=" + imagePaths + 151 | ", fav=" + fav + 152 | ", activity=" + activity + 153 | ", newPrice=" + newPrice + 154 | '}'; 155 | } 156 | } -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/entity/GoodsPrice.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.entity; 2 | 3 | public class GoodsPrice { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/entity/ImagePath.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.entity; 2 | 3 | public class ImagePath { 4 | private Integer pathid; 5 | 6 | private Integer goodid; 7 | 8 | private String path; 9 | 10 | public ImagePath() { 11 | } 12 | 13 | public ImagePath(Integer pathid, Integer goodid, String path) { 14 | 15 | this.pathid = pathid; 16 | this.goodid = goodid; 17 | this.path = path; 18 | } 19 | 20 | public Integer getPathid() { 21 | return pathid; 22 | } 23 | 24 | public void setPathid(Integer pathid) { 25 | this.pathid = pathid; 26 | } 27 | 28 | public Integer getGoodid() { 29 | return goodid; 30 | } 31 | 32 | public void setGoodid(Integer goodid) { 33 | this.goodid = goodid; 34 | } 35 | 36 | public String getPath() { 37 | return path; 38 | } 39 | 40 | public void setPath(String path) { 41 | this.path = path == null ? null : path.trim(); 42 | } 43 | } -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/entity/Order.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.entity; 2 | 3 | import java.util.Date; 4 | import java.util.List; 5 | 6 | public class Order { 7 | private Integer orderid; 8 | 9 | private Integer userid; 10 | 11 | private Date ordertime; 12 | 13 | private Float oldprice; 14 | 15 | private Float newprice; 16 | 17 | private Boolean ispay; 18 | 19 | private Boolean issend; 20 | 21 | private Boolean isreceive; 22 | 23 | private Boolean iscomplete; 24 | 25 | private Integer addressid; 26 | 27 | private List goodsInfo; 28 | 29 | public Order() { 30 | } 31 | 32 | private Address address; 33 | 34 | public Order(Integer orderid, Integer userid, Date ordertime, Float oldprice, Float newprice, Boolean ispay, Boolean issend, Boolean isreceive, Boolean iscomplete, Integer addressid, List goodsInfo, Address address) { 35 | this.orderid = orderid; 36 | this.userid = userid; 37 | this.ordertime = ordertime; 38 | this.oldprice = oldprice; 39 | this.newprice = newprice; 40 | this.ispay = ispay; 41 | this.issend = issend; 42 | this.isreceive = isreceive; 43 | this.iscomplete = iscomplete; 44 | this.addressid = addressid; 45 | this.goodsInfo = goodsInfo; 46 | this.address = address; 47 | } 48 | 49 | public Integer getOrderid() { 50 | return orderid; 51 | } 52 | 53 | public void setOrderid(Integer orderid) { 54 | this.orderid = orderid; 55 | } 56 | 57 | public Integer getUserid() { 58 | return userid; 59 | } 60 | 61 | public void setUserid(Integer userid) { 62 | this.userid = userid; 63 | } 64 | 65 | public Date getOrdertime() { 66 | return ordertime; 67 | } 68 | 69 | public void setOrdertime(Date ordertime) { 70 | this.ordertime = ordertime; 71 | } 72 | 73 | public Float getOldprice() { 74 | return oldprice; 75 | } 76 | 77 | public void setOldprice(Float oldprice) { 78 | this.oldprice = oldprice; 79 | } 80 | 81 | public Float getNewprice() { 82 | return newprice; 83 | } 84 | 85 | public void setNewprice(Float newprice) { 86 | this.newprice = newprice; 87 | } 88 | 89 | public Boolean getIspay() { 90 | return ispay; 91 | } 92 | 93 | public void setIspay(Boolean ispay) { 94 | this.ispay = ispay; 95 | } 96 | 97 | public Boolean getIssend() { 98 | return issend; 99 | } 100 | 101 | public void setIssend(Boolean issend) { 102 | this.issend = issend; 103 | } 104 | 105 | public Boolean getIsreceive() { 106 | return isreceive; 107 | } 108 | 109 | public void setIsreceive(Boolean isreceive) { 110 | this.isreceive = isreceive; 111 | } 112 | 113 | public Boolean getIscomplete() { 114 | return iscomplete; 115 | } 116 | 117 | public void setIscomplete(Boolean iscomplete) { 118 | this.iscomplete = iscomplete; 119 | } 120 | 121 | public Integer getAddressid() { 122 | return addressid; 123 | } 124 | 125 | public void setAddressid(Integer addressid) { 126 | this.addressid = addressid; 127 | } 128 | 129 | public List getGoodsInfo() { 130 | return goodsInfo; 131 | } 132 | 133 | public void setGoodsInfo(List goodsInfo) { 134 | this.goodsInfo = goodsInfo; 135 | } 136 | 137 | public Address getAddress() { 138 | return address; 139 | } 140 | 141 | public void setAddress(Address address) { 142 | this.address = address; 143 | } 144 | } -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/entity/OrderItem.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.entity; 2 | 3 | public class OrderItem { 4 | private Integer itemid; 5 | 6 | private Integer orderid; 7 | 8 | private Integer goodsid; 9 | 10 | private Integer num; 11 | 12 | public OrderItem() { 13 | } 14 | 15 | public OrderItem(Integer itemid, Integer orderid, Integer goodsid, Integer num) { 16 | 17 | this.itemid = itemid; 18 | this.orderid = orderid; 19 | this.goodsid = goodsid; 20 | this.num = num; 21 | } 22 | 23 | public Integer getItemid() { 24 | return itemid; 25 | } 26 | 27 | public void setItemid(Integer itemid) { 28 | this.itemid = itemid; 29 | } 30 | 31 | public Integer getOrderid() { 32 | return orderid; 33 | } 34 | 35 | public void setOrderid(Integer orderid) { 36 | this.orderid = orderid; 37 | } 38 | 39 | public Integer getGoodsid() { 40 | return goodsid; 41 | } 42 | 43 | public void setGoodsid(Integer goodsid) { 44 | this.goodsid = goodsid; 45 | } 46 | 47 | public Integer getNum() { 48 | return num; 49 | } 50 | 51 | public void setNum(Integer num) { 52 | this.num = num; 53 | } 54 | } -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/entity/ShopCart.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.entity; 2 | 3 | import java.util.Date; 4 | 5 | public class ShopCart extends ShopCartKey { 6 | private Date catedate; 7 | 8 | private Integer goodsnum; 9 | 10 | public Date getCatedate() { 11 | return catedate; 12 | } 13 | 14 | public void setCatedate(Date catedate) { 15 | this.catedate = catedate; 16 | } 17 | 18 | public Integer getGoodsnum() { 19 | return goodsnum; 20 | } 21 | 22 | public void setGoodsnum(Integer goodsnum) { 23 | this.goodsnum = goodsnum; 24 | } 25 | } -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/entity/ShopCartKey.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.entity; 2 | 3 | public class ShopCartKey { 4 | private Integer userid; 5 | 6 | private Integer goodsid; 7 | 8 | public ShopCartKey() { 9 | } 10 | 11 | public ShopCartKey(Integer userid, Integer goodsid) { 12 | 13 | this.userid = userid; 14 | this.goodsid = goodsid; 15 | } 16 | 17 | public Integer getUserid() { 18 | return userid; 19 | } 20 | 21 | public void setUserid(Integer userid) { 22 | this.userid = userid; 23 | } 24 | 25 | public Integer getGoodsid() { 26 | return goodsid; 27 | } 28 | 29 | public void setGoodsid(Integer goodsid) { 30 | this.goodsid = goodsid; 31 | } 32 | } -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.entity; 2 | 3 | import java.util.Date; 4 | 5 | public class User { 6 | private Integer userid; 7 | 8 | private String username; 9 | 10 | private String password; 11 | 12 | private Date regtime; 13 | 14 | private String email; 15 | 16 | private String telephone; 17 | 18 | public Integer getUserid() { 19 | return userid; 20 | } 21 | 22 | public void setUserid(Integer userid) { 23 | this.userid = userid; 24 | } 25 | 26 | public String getUsername() { 27 | return username; 28 | } 29 | 30 | public void setUsername(String username) { 31 | this.username = username == null ? null : username.trim(); 32 | } 33 | 34 | public String getPassword() { 35 | return password; 36 | } 37 | 38 | public void setPassword(String password) { 39 | this.password = password == null ? null : password.trim(); 40 | } 41 | 42 | public Date getRegtime() { 43 | return regtime; 44 | } 45 | 46 | public void setRegtime(Date regtime) { 47 | this.regtime = regtime; 48 | } 49 | 50 | public String getEmail() { 51 | return email; 52 | } 53 | 54 | public void setEmail(String email) { 55 | this.email = email == null ? null : email.trim(); 56 | } 57 | 58 | public String getTelephone() { 59 | return telephone; 60 | } 61 | 62 | public void setTelephone(String telephone) { 63 | this.telephone = telephone == null ? null : telephone.trim(); 64 | } 65 | 66 | @Override 67 | public String toString() { 68 | return "User{" + 69 | "userid=" + userid + 70 | ", username='" + username + '\'' + 71 | ", password='" + password + '\'' + 72 | ", regtime=" + regtime + 73 | ", email='" + email + '\'' + 74 | ", telephone='" + telephone + '\'' + 75 | '}'; 76 | } 77 | } -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/service/ActivityService.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.service; 2 | 3 | 4 | import com.zhang.ssmschoolshop.entity.Activity; 5 | import com.zhang.ssmschoolshop.entity.ActivityExample; 6 | 7 | import java.util.List; 8 | 9 | public interface ActivityService { 10 | List getAllActivity(ActivityExample activityExample); 11 | 12 | void insertActivitySelective(Activity activity); 13 | 14 | Activity selectByKey(Integer activityid); 15 | 16 | void deleteByActivityId(Integer activityid); 17 | 18 | // void updateGoodsActSelective(Goods goods); 19 | } 20 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/service/AddressService.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.service; 2 | 3 | import com.zhang.ssmschoolshop.entity.Address; 4 | import com.zhang.ssmschoolshop.entity.AddressExample; 5 | 6 | import java.util.List; 7 | 8 | public interface AddressService { 9 | public List
getAllAddressByExample(AddressExample addressExample); 10 | 11 | public void updateByPrimaryKeySelective(Address address); 12 | 13 | public void deleteByPrimaryKey(Integer addressid); 14 | 15 | public void insert(Address address); 16 | 17 | public void insertSelective(Address address); 18 | 19 | public Address selectByPrimaryKey(Integer addressid); 20 | } 21 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/service/AdminService.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.service; 2 | 3 | 4 | import com.zhang.ssmschoolshop.entity.Admin; 5 | 6 | public interface AdminService { 7 | public Admin selectByName(Admin admin); 8 | } 9 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/service/CateService.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.service; 2 | 3 | 4 | import com.zhang.ssmschoolshop.entity.Category; 5 | import com.zhang.ssmschoolshop.entity.CategoryExample; 6 | import org.springframework.stereotype.Service; 7 | 8 | import java.util.List; 9 | 10 | @Service("CateService") 11 | public interface CateService { 12 | public List selectByExample(CategoryExample example); 13 | public void insertSelective(Category category); 14 | 15 | public List selectByExampleLimit(CategoryExample digCategoryExample); 16 | 17 | public Category selectById(Integer category); 18 | 19 | public void updateByPrimaryKeySelective(Category category); 20 | 21 | public void deleteByPrimaryKey(Integer cateid); 22 | } 23 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/service/CommentService.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.service; 2 | 3 | 4 | import com.zhang.ssmschoolshop.entity.Comment; 5 | import com.zhang.ssmschoolshop.entity.CommentExample; 6 | 7 | import java.util.List; 8 | 9 | public interface CommentService { 10 | public void insertSelective(Comment comment); 11 | 12 | public List selectByExample(CommentExample commentExample); 13 | } 14 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/service/GoodsService.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.service; 2 | 3 | 4 | import com.zhang.ssmschoolshop.entity.*; 5 | 6 | import java.util.List; 7 | 8 | public interface GoodsService { 9 | public Integer addGoods(Goods goods); 10 | 11 | public void addImagePath(ImagePath imagePath); 12 | 13 | public List selectByExample(GoodsExample example); 14 | 15 | public void deleteGoodsById(Integer goodsid); 16 | 17 | public void updateGoodsById(Goods goods); 18 | 19 | public List findImagePath(Integer goodsid); 20 | 21 | public Goods selectById(Integer goodsid); 22 | 23 | public List selectByExampleLimit(GoodsExample digGoodsExample); 24 | 25 | public void addFavorite(Favorite favorite); 26 | 27 | public Favorite selectFavByKey(FavoriteKey favoriteKey); 28 | 29 | public void deleteFavByKey(FavoriteKey favoriteKey); 30 | 31 | public List selectFavByExample(FavoriteExample favoriteExample); 32 | } 33 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/service/OrderService.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.service; 2 | 3 | 4 | 5 | import com.zhang.ssmschoolshop.entity.*; 6 | 7 | import java.util.List; 8 | 9 | 10 | public interface OrderService { 11 | public void insertOrder(Order order); 12 | 13 | public void deleteById(Integer orderid); 14 | 15 | 16 | public List selectOrderByExample(OrderExample orderExample); 17 | 18 | public List getOrderItemByExample(OrderItemExample orderItemExample); 19 | 20 | public Address getAddressByKey(Integer addressid); 21 | 22 | public void updateOrderByKey(Order order); 23 | 24 | public Order selectByPrimaryKey(Integer orderid); 25 | 26 | void insertOrderItem(OrderItem orderItem); 27 | } 28 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/service/ShopCartService.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.service; 2 | 3 | 4 | import com.zhang.ssmschoolshop.entity.ShopCart; 5 | import com.zhang.ssmschoolshop.entity.ShopCartExample; 6 | import com.zhang.ssmschoolshop.entity.ShopCartKey; 7 | 8 | import java.util.List; 9 | 10 | public interface ShopCartService { 11 | public void addShopCart(ShopCart shopCart); 12 | 13 | public List selectByExample(ShopCartExample shopCartExample); 14 | 15 | public void deleteByKey(ShopCartKey shopCartKey); 16 | 17 | public void updateCartByKey(ShopCart shopCart); 18 | 19 | public ShopCart selectCartByKey(ShopCartKey shopCartKey); 20 | } 21 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.service; 2 | 3 | 4 | import com.zhang.ssmschoolshop.entity.User; 5 | import com.zhang.ssmschoolshop.entity.UserExample; 6 | 7 | import java.util.List; 8 | 9 | public interface UserService { 10 | public User selectByPrimaryKey(int userId); 11 | /*public User selectByPrimaryKeyAndPassword(int userId,String password);*/ 12 | public List selectByExample(UserExample userExample); 13 | 14 | public void insertSelective(User user); 15 | 16 | public void deleteUserById(Integer userid); 17 | 18 | public void updateByPrimaryKeySelective(User user); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/service/impl/ActivityServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.service.impl; 2 | 3 | 4 | import com.zhang.ssmschoolshop.dao.ActivityMapper; 5 | import com.zhang.ssmschoolshop.entity.Activity; 6 | import com.zhang.ssmschoolshop.entity.ActivityExample; 7 | import com.zhang.ssmschoolshop.service.ActivityService; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Service; 10 | 11 | import java.util.List; 12 | 13 | @Service("activityService") 14 | public class ActivityServiceImpl implements ActivityService { 15 | 16 | @Autowired(required = false) 17 | ActivityMapper activityMapper; 18 | 19 | public List getAllActivity(ActivityExample activityExample) { 20 | return activityMapper.selectByExample(activityExample); 21 | } 22 | 23 | @Override 24 | public void insertActivitySelective(Activity activity) { 25 | activityMapper.insertSelective(activity); 26 | } 27 | 28 | @Override 29 | public Activity selectByKey(Integer activityid) { 30 | return activityMapper.selectByPrimaryKey(activityid); 31 | } 32 | 33 | @Override 34 | public void deleteByActivityId(Integer activityid) { 35 | activityMapper.deleteByPrimaryKey(activityid); 36 | } 37 | 38 | /*@Override 39 | public void updateGoodsActSelective(Goods goods) { 40 | 41 | }*/ 42 | } 43 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/service/impl/AddressServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.service.impl; 2 | 3 | 4 | import com.zhang.ssmschoolshop.dao.AddressMapper; 5 | import com.zhang.ssmschoolshop.entity.Address; 6 | import com.zhang.ssmschoolshop.entity.AddressExample; 7 | import com.zhang.ssmschoolshop.service.AddressService; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Service; 10 | 11 | import java.util.List; 12 | 13 | @Service("addressService") 14 | public class AddressServiceImpl implements AddressService { 15 | 16 | @Autowired(required = false) 17 | private AddressMapper addressMapper; 18 | 19 | @Override 20 | public List
getAllAddressByExample(AddressExample addressExample) { 21 | return addressMapper.selectByExample(addressExample); 22 | } 23 | 24 | @Override 25 | public void updateByPrimaryKeySelective(Address address) { 26 | addressMapper.updateByPrimaryKeySelective(address); 27 | } 28 | 29 | @Override 30 | public void deleteByPrimaryKey(Integer addressid) { 31 | addressMapper.deleteByPrimaryKey(addressid); 32 | } 33 | 34 | @Override 35 | public void insert(Address address) { 36 | addressMapper.insert(address); 37 | } 38 | 39 | @Override 40 | public void insertSelective(Address address) { 41 | addressMapper.insertSelective(address); 42 | } 43 | 44 | @Override 45 | public Address selectByPrimaryKey(Integer addressid) { 46 | return addressMapper.selectByPrimaryKey(addressid); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/service/impl/AdminServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.service.impl; 2 | 3 | 4 | import com.zhang.ssmschoolshop.dao.AdminMapper; 5 | import com.zhang.ssmschoolshop.entity.Admin; 6 | import com.zhang.ssmschoolshop.service.AdminService; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | 10 | @Service("adminService") 11 | public class AdminServiceImpl implements AdminService { 12 | 13 | @Autowired(required = false) 14 | private AdminMapper adminMapper; 15 | 16 | @Override 17 | public Admin selectByName(Admin admin) { 18 | return adminMapper.selectByName(admin); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/service/impl/CateServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.service.impl; 2 | 3 | 4 | import com.zhang.ssmschoolshop.dao.CategoryMapper; 5 | import com.zhang.ssmschoolshop.entity.Category; 6 | import com.zhang.ssmschoolshop.entity.CategoryExample; 7 | import com.zhang.ssmschoolshop.service.CateService; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Service; 10 | 11 | import java.util.List; 12 | 13 | @Service("cateService") 14 | public class CateServiceImpl implements CateService { 15 | 16 | @Autowired(required = false) 17 | CategoryMapper categoryMapper; 18 | 19 | @Override 20 | public List selectByExample(CategoryExample example) { 21 | return categoryMapper.selectByExample(example); 22 | } 23 | 24 | @Override 25 | public void insertSelective(Category category) { 26 | categoryMapper.insertSelective(category); 27 | } 28 | 29 | @Override 30 | public List selectByExampleLimit(CategoryExample digCategoryExample) { 31 | return categoryMapper.selectByExampleLimit(digCategoryExample); 32 | } 33 | 34 | @Override 35 | public Category selectById(Integer category) { 36 | return categoryMapper.selectByPrimaryKey(category); 37 | } 38 | 39 | @Override 40 | public void updateByPrimaryKeySelective(Category category) { 41 | categoryMapper.updateByPrimaryKeySelective(category); 42 | } 43 | 44 | @Override 45 | public void deleteByPrimaryKey(Integer cateid) { 46 | categoryMapper.deleteByPrimaryKey(cateid); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/service/impl/CommentServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.service.impl; 2 | 3 | 4 | import com.zhang.ssmschoolshop.dao.CommentMapper; 5 | import com.zhang.ssmschoolshop.entity.Comment; 6 | import com.zhang.ssmschoolshop.entity.CommentExample; 7 | import com.zhang.ssmschoolshop.service.CommentService; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Service; 10 | 11 | import java.util.List; 12 | 13 | @Service("commentService") 14 | public class CommentServiceImpl implements CommentService { 15 | 16 | @Autowired(required = false) 17 | private CommentMapper commentMapper; 18 | 19 | @Override 20 | public void insertSelective(Comment comment){ 21 | commentMapper.insertSelective(comment); 22 | } 23 | 24 | @Override 25 | public List selectByExample(CommentExample commentExample) { 26 | return commentMapper.selectByExample(commentExample); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/service/impl/GoodsServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.service.impl; 2 | 3 | 4 | import com.zhang.ssmschoolshop.dao.FavoriteMapper; 5 | import com.zhang.ssmschoolshop.dao.GoodsMapper; 6 | import com.zhang.ssmschoolshop.dao.ImagePathMapper; 7 | import com.zhang.ssmschoolshop.entity.*; 8 | import com.zhang.ssmschoolshop.service.GoodsService; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Service; 11 | 12 | import java.util.List; 13 | 14 | @Service("goodsService") 15 | public class GoodsServiceImpl implements GoodsService { 16 | 17 | @Autowired(required = false) 18 | GoodsMapper goodsMapper; 19 | 20 | @Autowired(required = false) 21 | ImagePathMapper imagePathMapper; 22 | 23 | @Autowired(required = false) 24 | FavoriteMapper favoriteMapper; 25 | 26 | @Override 27 | public Integer addGoods(Goods goods) { 28 | goodsMapper.insertSelective(goods); 29 | return goods.getGoodsid(); 30 | } 31 | 32 | @Override 33 | public void addImagePath(ImagePath imagePath) { 34 | imagePathMapper.insertSelective(imagePath); 35 | } 36 | 37 | @Override 38 | public List selectByExample(GoodsExample example) { 39 | return goodsMapper.selectByExampleWithBLOBs(example); 40 | } 41 | 42 | @Override 43 | public void deleteGoodsById(Integer goodsid) { 44 | 45 | goodsMapper.deleteByPrimaryKey(goodsid); 46 | } 47 | 48 | @Override 49 | public void updateGoodsById(Goods goods) { 50 | goodsMapper.updateByPrimaryKeySelective(goods); 51 | } 52 | 53 | @Override 54 | public List findImagePath(Integer goodsid) { 55 | ImagePathExample imagePathExample = new ImagePathExample(); 56 | imagePathExample.or().andGoodidEqualTo(goodsid); 57 | 58 | return imagePathMapper.selectByExample(imagePathExample); 59 | } 60 | 61 | @Override 62 | public Goods selectById(Integer goodsid) { 63 | return goodsMapper.selectByPrimaryKey(goodsid); 64 | } 65 | 66 | @Override 67 | public List selectByExampleLimit(GoodsExample digGoodsExample) { 68 | return goodsMapper.selectByExampleWithBLOBsLimit(digGoodsExample); 69 | } 70 | 71 | @Override 72 | public void addFavorite(Favorite favorite) { 73 | favoriteMapper.insertSelective(favorite); 74 | } 75 | 76 | @Override 77 | public Favorite selectFavByKey(FavoriteKey favoriteKey) { 78 | return favoriteMapper.selectByPrimaryKey(favoriteKey); 79 | } 80 | 81 | @Override 82 | public void deleteFavByKey(FavoriteKey favoriteKey) { 83 | favoriteMapper.deleteByPrimaryKey(favoriteKey); 84 | } 85 | 86 | @Override 87 | public List selectFavByExample(FavoriteExample favoriteExample) { 88 | return favoriteMapper.selectByExample(favoriteExample); 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/service/impl/OrderServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.service.impl; 2 | 3 | 4 | import com.zhang.ssmschoolshop.dao.AddressMapper; 5 | import com.zhang.ssmschoolshop.dao.OrderItemMapper; 6 | import com.zhang.ssmschoolshop.dao.OrderMapper; 7 | import com.zhang.ssmschoolshop.entity.*; 8 | import com.zhang.ssmschoolshop.service.OrderService; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Service; 11 | 12 | import java.util.List; 13 | 14 | @Service("orderService") 15 | public class OrderServiceImpl implements OrderService { 16 | 17 | @Autowired(required = false) 18 | private OrderMapper orderMapper; 19 | 20 | @Autowired(required = false) 21 | private OrderItemMapper orderItemMapper; 22 | 23 | @Autowired(required = false) 24 | private AddressMapper addressMapper; 25 | 26 | @Override 27 | public void insertOrder(Order order) { 28 | orderMapper.insertSelective(order); 29 | } 30 | 31 | @Override 32 | public void deleteById(Integer orderid) { 33 | orderMapper.deleteByPrimaryKey(orderid); 34 | } 35 | 36 | 37 | @Override 38 | public List selectOrderByExample(OrderExample orderExample) { 39 | return orderMapper.selectByExample(orderExample); 40 | } 41 | 42 | @Override 43 | public List getOrderItemByExample(OrderItemExample orderItemExample) { 44 | return orderItemMapper.selectByExample(orderItemExample); 45 | } 46 | 47 | @Override 48 | public Address getAddressByKey(Integer addressid) { 49 | return addressMapper.selectByPrimaryKey(addressid); 50 | } 51 | 52 | @Override 53 | public void updateOrderByKey(Order order) { 54 | orderMapper.updateByPrimaryKeySelective(order); 55 | } 56 | 57 | @Override 58 | public Order selectByPrimaryKey(Integer orderid) { 59 | return orderMapper.selectByPrimaryKey(orderid); 60 | } 61 | 62 | @Override 63 | public void insertOrderItem(OrderItem orderItem) { 64 | orderItemMapper.insertSelective(orderItem); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/service/impl/ShopCartServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.service.impl; 2 | 3 | 4 | import com.zhang.ssmschoolshop.dao.ShopCartMapper; 5 | import com.zhang.ssmschoolshop.entity.ShopCart; 6 | import com.zhang.ssmschoolshop.entity.ShopCartExample; 7 | import com.zhang.ssmschoolshop.entity.ShopCartKey; 8 | import com.zhang.ssmschoolshop.service.ShopCartService; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Service; 11 | 12 | import java.util.List; 13 | 14 | @Service("addShopCart") 15 | public class ShopCartServiceImpl implements ShopCartService { 16 | 17 | @Autowired(required = false) 18 | ShopCartMapper shopCartMapper; 19 | 20 | @Override 21 | public void addShopCart(ShopCart shopCart) { 22 | shopCartMapper.insertSelective(shopCart); 23 | } 24 | 25 | @Override 26 | public List selectByExample(ShopCartExample shopCartExample) { 27 | return shopCartMapper.selectByExample(shopCartExample); 28 | } 29 | 30 | @Override 31 | public void deleteByKey(ShopCartKey shopCartKey) { 32 | shopCartMapper.deleteByPrimaryKey(shopCartKey); 33 | } 34 | 35 | @Override 36 | public void updateCartByKey(ShopCart shopCart) { 37 | shopCartMapper.updateByPrimaryKeySelective(shopCart); 38 | } 39 | 40 | @Override 41 | public ShopCart selectCartByKey(ShopCartKey shopCartKey) { 42 | return shopCartMapper.selectByPrimaryKey(shopCartKey); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/service/impl/UserServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.service.impl; 2 | 3 | 4 | import com.zhang.ssmschoolshop.dao.UserMapper; 5 | import com.zhang.ssmschoolshop.entity.User; 6 | import com.zhang.ssmschoolshop.entity.UserExample; 7 | import com.zhang.ssmschoolshop.service.UserService; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Service; 10 | 11 | import java.util.List; 12 | 13 | @Service("userService") 14 | public class UserServiceImpl implements UserService { 15 | 16 | @Autowired(required = false) 17 | private UserMapper userMapper; 18 | 19 | @Override 20 | public User selectByPrimaryKey(int userId) { 21 | return userMapper.selectByPrimaryKey(userId); 22 | } 23 | 24 | @Override 25 | public List selectByExample(UserExample userExample) { 26 | return userMapper.selectByExample(userExample); 27 | } 28 | 29 | @Override 30 | public void insertSelective(User user) { 31 | userMapper.insertSelective(user); 32 | } 33 | 34 | @Override 35 | public void deleteUserById(Integer userid) { 36 | userMapper.deleteByPrimaryKey(userid); 37 | } 38 | 39 | @Override 40 | public void updateByPrimaryKeySelective(User user) { 41 | userMapper.updateByPrimaryKeySelective(user); 42 | } 43 | 44 | 45 | 46 | } 47 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/util/ImageUtil.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.util; 2 | 3 | import org.springframework.web.multipart.MultipartFile; 4 | 5 | import java.io.File; 6 | import java.io.IOException; 7 | import java.util.UUID; 8 | 9 | /** 10 | * @author created by Zhangdazhuang 11 | * @version v.0.1 12 | * @Description TODO 13 | * @date 2019/4/30 14 | * @备注 15 | **/ 16 | public class ImageUtil { 17 | 18 | public static String imagePath(MultipartFile file, String shopName) { 19 | if (file.isEmpty()) { 20 | return "false"; 21 | } 22 | int size = (int) file.getSize(); 23 | String path = "D:/upload"; 24 | String os = System.getProperty("os.name"); 25 | if(os.toLowerCase().startsWith("linux")){ 26 | path="/usr/upload"; 27 | } 28 | String fileName=UUID.randomUUID().toString().substring(0,4)+shopName; 29 | File dest = new File(path + "/" +fileName); 30 | System.out.println("保存的绝对路径为:"+dest); 31 | if (!dest.getParentFile().exists()) { //判断文件父目录是否存在 32 | dest.getParentFile().mkdir(); 33 | } 34 | try { 35 | //根据系统的不同,保存到不同的路径 36 | file.transferTo(dest); 37 | return fileName; 38 | } catch (IllegalStateException e) { 39 | // TODO Auto-generated catch block 40 | e.printStackTrace(); 41 | return "false"; 42 | } catch (IOException e) { 43 | // TODO Auto-generated catch block 44 | e.printStackTrace(); 45 | return "false"; 46 | } 47 | 48 | 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/util/Md5Util.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.util; 2 | 3 | import java.security.MessageDigest; 4 | 5 | /** 6 | * @author created by Zhangdazhuang 7 | * @version v.0.1 8 | * @Description TODO 9 | * @date 2019/4/26 10 | * @备注 11 | **/ 12 | public class Md5Util { 13 | 14 | private static final String hexDigIts[] = {"0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"}; 15 | 16 | /** 17 | * MD5加密 18 | * @param origin 字符 19 | * @param charsetname 编码 20 | * @return 21 | */ 22 | public static String MD5Encode(String origin, String charsetname){ 23 | String resultString = null; 24 | try{ 25 | resultString = new String(origin); 26 | MessageDigest md = MessageDigest.getInstance("MD5"); 27 | resultString = byteArrayToHexString(md.digest(resultString.getBytes(charsetname))); 28 | }catch (Exception e){ 29 | } 30 | return resultString; 31 | } 32 | 33 | 34 | public static String byteArrayToHexString(byte b[]){ 35 | StringBuffer resultSb = new StringBuffer(); 36 | for(int i = 0; i < b.length; i++){ 37 | resultSb.append(byteToHexString(b[i])); 38 | } 39 | return resultSb.toString(); 40 | } 41 | 42 | public static String byteToHexString(byte b){ 43 | int n = b; 44 | if(n < 0){ 45 | n += 256; 46 | } 47 | int d1 = n / 16; 48 | int d2 = n % 16; 49 | return hexDigIts[d1] + hexDigIts[d2]; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/util/Msg.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.util; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | public class Msg { 7 | //100-success,200-fail 8 | private int code; 9 | 10 | //提示信息 11 | private String msg; 12 | 13 | //数据 14 | private Map info = new HashMap(); 15 | 16 | public static Msg success(String msg) { 17 | Msg result = new Msg(); 18 | result.setCode(100); 19 | result.setMsg(msg); 20 | return result; 21 | } 22 | 23 | public static Msg fail(String msg) { 24 | Msg result = new Msg(); 25 | result.setCode(200); 26 | result.setMsg(msg); 27 | return result; 28 | } 29 | 30 | public Msg add(String key, Object value) { 31 | this.getInfo().put(key, value); 32 | return this; 33 | } 34 | 35 | public int getCode() { 36 | return code; 37 | } 38 | 39 | public void setCode(int code) { 40 | this.code = code; 41 | } 42 | 43 | public String getMsg() { 44 | return msg; 45 | } 46 | 47 | public void setMsg(String msg) { 48 | this.msg = msg; 49 | } 50 | 51 | public Map getInfo() { 52 | return info; 53 | } 54 | 55 | public void setInfo(Map info) { 56 | this.info = info; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/java/com/zhang/ssmschoolshop/util/verificate/Verificate.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop.util.verificate; 2 | 3 | import javax.imageio.ImageIO; 4 | import java.awt.*; 5 | import java.awt.image.BufferedImage; 6 | import java.io.IOException; 7 | import java.io.OutputStream; 8 | import java.util.Random; 9 | 10 | 11 | public class Verificate { 12 | 13 | // 验证码图片中可以出现的字符集,可根据需要修改 14 | private char mapTable[] = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 15 | 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' }; 16 | 17 | /** 18 | * 功能:生成彩色验证码图片 参数width为生成图片的宽度,参数height为生成图片的高度,参数为页面的输出流 19 | */ 20 | public String getCertPic(int width, int height,OutputStream os) { 21 | if (width <= 0) 22 | width = 60; 23 | if (height <= 0) 24 | height = 20; 25 | BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); 26 | // 获取图形上下文 27 | Graphics g = image.getGraphics(); 28 | // 设定背景色 29 | g.setColor(new Color(0x9FDCB1)); 30 | g.fillRect(0, 0, width, height); 31 | // 画边框 32 | g.setColor(new Color(0x9FDCB1)); 33 | g.drawRect(0, 0, width - 1, height - 1); 34 | // 取随机产生的认证码 35 | String strEnsure = ""; 36 | // 4代表4位验证码,如果要生成更多位的认证码,则加大数值 37 | for (int i = 0; i < 4; ++i) { 38 | strEnsure += mapTable[(int) (mapTable.length * Math.random())]; 39 | } 40 | // 将认证码显示到图像中,如果要生成更多位的认证码,增加drawString语句 41 | g.setColor(new Color(0x172D44)); 42 | g.setFont(new Font("Atlantic Inline", Font.PLAIN, 18)); 43 | String str = strEnsure.substring(0, 1); 44 | g.drawString(str, 8, 17); 45 | str = strEnsure.substring(1, 2); 46 | g.drawString(str, 20, 15); 47 | str = strEnsure.substring(2, 3); 48 | g.drawString(str, 35, 18); 49 | str = strEnsure.substring(3, 4); 50 | g.drawString(str, 45, 15); 51 | // 随机产生10个干扰点 52 | Random rand = new Random(); 53 | for (int i = 0; i < 10; i++) { 54 | int x = rand.nextInt(width); 55 | int y = rand.nextInt(height); 56 | g.drawOval(x, y, 1, 1); 57 | } 58 | // 释放图形上下文 59 | g.dispose(); 60 | try { 61 | // 输出图像到页面 62 | ImageIO.write(image, "JPEG", os); 63 | } catch (IOException e) { 64 | return ""; 65 | } 66 | return strEnsure; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8081 3 | servlet: 4 | context-path: /shop 5 | multipart: 6 | max-file-size: 10MB #单个文件 7 | max-request-size: 100MB #总文件大小 8 | 9 | spring: 10 | datasource: 11 | driver-class-name: com.mysql.jdbc.Driver #com.mysql.cj.jdbc.Driver 12 | url: jdbc:mysql://127.0.0.1:3306/db_shopmaster?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8 13 | username: root 14 | password: 123456 15 | jpa: 16 | show-sql: true 17 | mvc: 18 | view: 19 | prefix: /WEB-INF/views/ 20 | suffix: .jsp 21 | 22 | 23 | mybatis: 24 | mapper-locations: classpath:mapper/*.xml 25 | type-aliases-package: com.zhang.ssmschoolshop.entity 26 | #devtools插件 27 | devtools: 28 | restart: 29 | enabled: true #是否支持热部署 30 | #mybaatis分页插件pagehelper设置 31 | pagehelper: 32 | pagehelperDialect: mysql 33 | reasonable: true 34 | support-methods-arguments: true 35 | 36 | # 打印sql 37 | logging: 38 | level: 39 | com.zhang.ssmschoolshop.dao: DEBUG 40 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/WEB-INF/views/addCategory.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: zhangxin 4 | Date: 2019/5/13 5 | Time: 15:45 6 | --%> 7 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 8 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 9 | 10 | 11 | 12 | 13 | 14 | 15 | 后台管理 16 | 17 | 18 | 19 | <%-- --%> 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 33 | 34 | 35 | 36 | 37 | 38 | <%-- 39 | 42 | --%> 43 | 44 | 45 | 46 | <%--修改商品信息模态框--%> 47 | 48 | 72 | 73 |
74 | 75 | 76 |
77 | 78 |
79 | 80 |
81 |
82 |
83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 |
分类名编辑删除
${category.catename}
101 |
102 |
103 | 104 |
105 |
106 |
107 | 108 |
109 |
110 | 111 |
112 |
113 |
114 |
115 | 116 |
117 |
118 |
119 | 120 | 121 | 122 | 123 | 128 | 129 | 130 | 131 | 132 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/WEB-INF/views/addGoods.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: zhangxin 4 | Date: 2019/5/13 5 | Time: 15:45 6 | --%> 7 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 8 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 9 | 10 | 11 | 12 | 13 | 14 | 15 | 后台管理 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 29 | 30 | 31 | 32 | 33 | <%-- 34 | 37 | --%> 38 | 39 | 40 | 41 |
42 | 43 | 44 |
45 | 46 |
47 |
48 |

添加商品

49 |

商品的一些基本信息

50 | 100 |
101 |
102 |
103 |
104 | 105 | 106 | 107 | 108 | 109 | 110 | 115 | 116 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/WEB-INF/views/adminLogin.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: zhangxin 4 | Date: 2019/5/13 5 | Time: 15:45 6 | --%> 7 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 8 | 9 | 10 | 11 | 12 | 13 | 14 | 管理员登录 15 | 16 | 17 | 18 | 19 | 42 | 43 | 44 | 74 | 75 |
XX大学作品设计
76 | 77 | 78 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/WEB-INF/views/chatrobot.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: zhangxin 4 | Date: 2019/5/13 5 | Time: 15:45 6 | --%> 7 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 8 | 9 | 10 | 11 | 12 | 13 | 14 | 百货商城-小淘 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 | 38 |
39 |
40 | 41 |
42 |
43 |
44 |
45 |
46 | 47 |
48 |
49 | 50 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/WEB-INF/views/goodsNav.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: zhangxin 4 | Date: 2019/5/13 5 | Time: 15:45 6 | --%> 7 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 8 |
9 |
10 | 18 |
19 |
20 | 21 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/WEB-INF/views/header.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: zhangxin 4 | Date: 2019/5/13 5 | Time: 15:45 6 | --%> 7 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 8 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 9 | 10 |
11 | 36 | 47 |
48 |
49 | 94 |
95 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/WEB-INF/views/login.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="java.security.interfaces.RSAKey"%> 2 | <%@ page language="java" pageEncoding="UTF-8"%> 3 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 4 | 5 | 6 | 7 | 8 | 9 | 百货商城-欢迎登录 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | <%----%> 42 | 43 | 49 | 50 | 51 | 52 |
53 | 56 | 107 |
108 | 109 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/WEB-INF/views/register.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: zhangxin 4 | Date: 2019/5/13 5 | Time: 15:45 6 | --%> 7 | <%@page import="java.security.interfaces.RSAKey"%> 8 | <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 9 | <%request.setCharacterEncoding("utf-8");%> 10 | <%@ page import="java.sql.*"%> 11 | <%@ page import="java.text.*"%> 12 | 13 | 14 | 15 | 16 | 17 | 18 | 百货商城-个人注册 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
32 | 35 | 96 |
97 | 98 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/WEB-INF/views/sidebar.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: zhangxin 4 | Date: 2019/5/13 5 | Time: 15:45 6 | --%> 7 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 8 |
9 |
10 |
11 |

后台管理

12 |
13 |
14 | 15 |
16 | 25 |
26 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/WEB-INF/views/verificationcodeimg.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: zhangxin 4 | Date: 2019/5/13 5 | Time: 15:45 6 | --%> 7 | <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 8 | <%--<%@ page contentType="text/html;charset=UTF-8" language="java" %>--%> 9 | <%@page import="com.zhang.ssmschoolshop.util.verificate.Verificate" %> 10 | <%--<% 11 | String path = request.getContextPath(); 12 | String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 13 | %>--%> 14 | <%@page contentType="image/jpeg"%> 15 | 16 | <% 17 | String str = image.getCertPic(0, 0, response.getOutputStream()); 18 | // 将认证码存入SESSION 19 | session.setAttribute("certCode", str); 20 | out.clear(); 21 | out = pageContext.pushBody(); 22 | %> 23 | 24 | 25 | 26 | Title 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/css/bootstrap/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/SpringbootSchoolShop/src/main/webapp/css/bootstrap/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/css/bootstrap/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/SpringbootSchoolShop/src/main/webapp/css/bootstrap/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/css/bootstrap/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/SpringbootSchoolShop/src/main/webapp/css/bootstrap/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/css/bootstrap/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/SpringbootSchoolShop/src/main/webapp/css/bootstrap/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/css/bootstrap/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/css/chat.css: -------------------------------------------------------------------------------- 1 | .chat-div { 2 | width: 100%; 3 | margin: 40px auto 0px auto; 4 | } 5 | 6 | .chat { 7 | /*margin: 30px;*/ 8 | width: 73%; 9 | display: inline-block; 10 | /*margin-top: 0;*/ 11 | margin-left: 0%; 12 | position: relative; 13 | top: -45px; 14 | } 15 | 16 | .chat-content { 17 | padding: 20px; 18 | background: #F8F8F8; 19 | width: 100%; 20 | height: 500px; 21 | overflow-x: hidden; 22 | overflow-y: auto; 23 | } 24 | 25 | .chat-message { 26 | margin-top: 8px; 27 | margin-bottom: 8px; 28 | } 29 | 30 | .message-icon-left { 31 | position: absolute; 32 | right: auto; 33 | left: -21px; 34 | color: #FFF; 35 | } 36 | 37 | .message-icon-right { 38 | position: absolute; 39 | /*left: 5px;*/ 40 | right: -280px; 41 | color: #DDD; 42 | } 43 | 44 | .info-content { 45 | display: inline-block !important; 46 | display: inline; 47 | width: auto; 48 | } 49 | 50 | .chat-message-content1 { 51 | position: relative; 52 | float: left; 53 | background: #FFFFFF; 54 | margin-right: 20%; 55 | width: auto; 56 | box-shadow: none; 57 | padding: 11px; 58 | border: 1px solid #DDD; 59 | border-radius: 4px; 60 | } 61 | 62 | 63 | .chat-message-content2 { 64 | position: relative; 65 | float: right; 66 | background: #34BBF9; 67 | margin-left: 20%; 68 | width: auto; 69 | box-shadow: none; 70 | padding: 11px; 71 | border: 1px solid #34BBF9; 72 | border-radius: 4px; 73 | } 74 | 75 | /*.form-group { 76 | width: 100%; 77 | height: 100%; 78 | }*/ 79 | 80 | .form-div { 81 | /*padding: 1%;*/ 82 | } 83 | 84 | .input-div { 85 | width: 86%; 86 | margin: 2% 0.8% 2% 0.9%; 87 | } 88 | 89 | .send-div { 90 | width: 11%; 91 | height: 53px; 92 | margin-top: 2%; 93 | } 94 | 95 | #input-message { 96 | width: 100%; 97 | } 98 | 99 | .send-div>input { 100 | height: 100%; 101 | } 102 | 103 | .chat-list { 104 | width: 20%; 105 | height: 565px; 106 | display: inline-block; 107 | overflow-x: hidden; 108 | overflow-y: hidden; 109 | margin-left: 2%; 110 | position: relative; 111 | top: -15px; 112 | /*background: #EBEBEC;*/ 113 | 114 | } 115 | 116 | .list-item { 117 | height: 66px; 118 | border-right: 1px solid gray; 119 | background: #FAF7F4; 120 | padding-top: 4px; 121 | padding-left: 45px; 122 | /*font-size: 20px;*/ 123 | } 124 | 125 | .list-item { 126 | display: none; 127 | } 128 | 129 | #user-no { 130 | display: none; 131 | } 132 | 133 | .a-card { 134 | text-decoration: none !important; 135 | display: block; 136 | border: 1px solid #DDD; 137 | margin: 0; 138 | color: black; 139 | } 140 | 141 | .card { 142 | height: 60px; 143 | text-align: center; 144 | padding-top: 25px; 145 | } 146 | 147 | .a-card:hover { 148 | transition:transform .8s cubic-bezier(0.23, 1, 0.32, 1), box-shadow .8s cubic-bezier(0.23, 1, 0.32, 1); 149 | box-shadow:0 0 20px rgba(0, 0, 0, 0.3); 150 | transform:scale(1.01); 151 | background-color: #F8F8F8; 152 | z-index:2; 153 | } -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/css/chatrobot.css: -------------------------------------------------------------------------------- 1 | .clear-float { 2 | clear: both; 3 | } 4 | 5 | #input-message { 6 | /*font-size: 30px;*/ 7 | } 8 | 9 | .chat-div { 10 | width: 100%; 11 | margin: 0 auto; 12 | } 13 | 14 | .chat { 15 | /*margin: 30px;*/ 16 | width: 100%; 17 | display: inline-block; 18 | /*margin-top: 0;*/ 19 | margin-left: 0%; 20 | position: relative; 21 | /*top: -45px;*/ 22 | } 23 | 24 | .chat-content { 25 | padding: 20px; 26 | background: #F8F8F8; 27 | width: 100%; 28 | height: 565px; 29 | overflow-x: hidden; 30 | overflow-y: auto; 31 | } 32 | 33 | .chat-message { 34 | margin-top: 8px; 35 | margin-bottom: 8px; 36 | } 37 | 38 | .message-icon-left { 39 | position: absolute; 40 | right: auto; 41 | left: -21px; 42 | color: #FFF; 43 | } 44 | 45 | .message-icon-right { 46 | position: absolute; 47 | /*left: 5px;*/ 48 | right: -280px; 49 | color: #DDD; 50 | } 51 | 52 | .info-content { 53 | display: inline-block !important; 54 | display: inline; 55 | width: auto; 56 | } 57 | 58 | .chat-message-content1 { 59 | position: relative; 60 | float: left; 61 | background: #FFFFFF; 62 | margin-right: 20%; 63 | width: auto; 64 | box-shadow: none; 65 | padding: 11px; 66 | border: 1px solid #DDD; 67 | border-radius: 4px; 68 | } 69 | 70 | 71 | .chat-message-content2 { 72 | position: relative; 73 | float: right; 74 | background: #34BBF9; 75 | margin-left: 20%; 76 | width: auto; 77 | box-shadow: none; 78 | padding: 11px; 79 | border: 1px solid #34BBF9; 80 | border-radius: 4px; 81 | } 82 | 83 | /*.form-group { 84 | width: 100%; 85 | height: 100%; 86 | }*/ 87 | 88 | .form-div { 89 | /*padding: 1%;*/ 90 | } 91 | 92 | .input-div { 93 | width: 86%; 94 | margin: 2% 0.8% 2% 0.9%; 95 | } 96 | 97 | .send-div { 98 | width: 11%; 99 | height: 53px; 100 | margin-top: 2%; 101 | } 102 | 103 | #input-message { 104 | width: 100%; 105 | } 106 | 107 | .send-div>input { 108 | height: 100%; 109 | } 110 | 111 | .chat-list { 112 | width: 20%; 113 | height: 625px; 114 | display: inline-block; 115 | overflow-x: hidden; 116 | overflow-y: hidden; 117 | margin-left: 2%; 118 | position: relative; 119 | top: 43px; 120 | /*background: #EBEBEC;*/ 121 | 122 | } 123 | 124 | .list-item { 125 | height: 66px; 126 | border-right: 1px solid gray; 127 | background: #FAF7F4; 128 | padding-top: 4px; 129 | padding-left: 45px; 130 | /*font-size: 20px;*/ 131 | } 132 | 133 | ::-webkit-scrollbar { 134 | height: 10px; 135 | width: 7px; 136 | background: rgba(0,0,0,.1); 137 | } 138 | 139 | ::-webkit-scrollbar-thumb { 140 | background: rgba(8, 174, 237, 0.3); 141 | border-radius: 6px; 142 | } 143 | 144 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/css/favorite.css: -------------------------------------------------------------------------------- 1 | /**{ 2 | margin:0px; 3 | padding:0px; 4 | } 5 | */ 6 | body{ 7 | background:#e5e6d0; 8 | } 9 | 10 | .favorite { 11 | margin-top: 2%; 12 | } 13 | 14 | .favorite-side { 15 | margin-top: 2%; 16 | width: 30%; 17 | } 18 | 19 | .fav-menu { 20 | margin-top: 5%; 21 | } 22 | 23 | .fav-menu,#banner,#main-fav,#footer{ 24 | /*margin-top:1%;*/ 25 | /*width:1140px;*/ 26 | } 27 | 28 | .caret-right { 29 | position: absolute; 30 | top: 22px; 31 | left: 210px; 32 | } 33 | 34 | /* 万能的清除*/ 35 | .clear{ 36 | clear:both; 37 | } 38 | .fav-menu{ 39 | padding-top:1px; 40 | } 41 | .fav-menu ul{ 42 | list-style:none; 43 | /*padding-left: 15px;*/ 44 | } 45 | .fav-menu>ul{ 46 | /*list-style:none;*/ 47 | padding-left: 15px; 48 | } 49 | 50 | .top-li { 51 | border-top: 1px solid #FFFFFF; 52 | } 53 | 54 | .fav-menu ul li{ 55 | /*float:left;*/ 56 | margin:1px; 57 | width: 230px; 58 | border-bottom: 1px solid #FFFFFF; 59 | border-right: 1px solid #FFFFFF; 60 | /*border-left: 1px solid #FFFFFF;*/ 61 | position: relative; 62 | } 63 | 64 | .fav-menu ul li a{ 65 | color:#996699; 66 | 67 | font-family:Vivaldi; 68 | text-align:center; 69 | display:block; 70 | width:120px; 71 | height:50px; 72 | line-height:46px; 73 | font-size:25px; 74 | margin-left: 22px; 75 | text-decoration: none; 76 | } 77 | .fav-menu ul li a:hover{ 78 | background:#ffcccc; 79 | } 80 | .fav-menu ul li ul{ 81 | display:none; 82 | width:120px; 83 | position:absolute; 84 | z-index: 10; 85 | left: 100%; 86 | top: 0%; 87 | background:#ffcccc; 88 | } 89 | .fav-menu ul li:hover ul{ 90 | display:block; 91 | } 92 | .fav-menu ul li ul li{ 93 | width:120px; 94 | position: relative; 95 | right: 40px; 96 | } 97 | .fav-menu ul li ul li a{ 98 | width:120px; 99 | padding-left: 0px; 100 | margin-left: 0px; 101 | } 102 | .fav-menu ul li ul li a:hover{ 103 | background:#ff9999; 104 | } 105 | 106 | #main-fav{ 107 | padding:10px 10px; 108 | } 109 | /*#main-fav .container{ 110 | width:900px; 111 | float:left; 112 | } 113 | */#main-fav .product{ 114 | float:left; 115 | padding-left:10px; 116 | list-style:none; 117 | } -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/css/infostyle.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 Google Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | html, body { 18 | font-family: 'Roboto', 'Helvetica', sans-serif; 19 | } 20 | .demo-avatar { 21 | width: 48px; 22 | height: 48px; 23 | border-radius: 24px; 24 | } 25 | .demo-layout .mdl-layout__header .mdl-layout__drawer-button { 26 | color: rgba(0, 0, 0, 0.54); 27 | } 28 | .mdl-layout__drawer .avatar { 29 | margin-bottom: 16px; 30 | } 31 | .demo-drawer { 32 | border: none; 33 | } 34 | /* iOS Safari specific workaround */ 35 | .demo-drawer .mdl-menu__container { 36 | z-index: -1; 37 | } 38 | .demo-drawer .demo-navigation { 39 | z-index: -2; 40 | } 41 | /* END iOS Safari specific workaround */ 42 | .demo-drawer .mdl-menu .mdl-menu__item { 43 | display: -webkit-flex; 44 | display: -ms-flexbox; 45 | display: flex; 46 | -webkit-align-items: center; 47 | -ms-flex-align: center; 48 | align-items: center; 49 | } 50 | .demo-drawer-header { 51 | box-sizing: border-box; 52 | display: -webkit-flex; 53 | display: -ms-flexbox; 54 | display: flex; 55 | -webkit-flex-direction: column; 56 | -ms-flex-direction: column; 57 | flex-direction: column; 58 | -webkit-justify-content: flex-end; 59 | -ms-flex-pack: end; 60 | justify-content: flex-end; 61 | padding: 16px; 62 | height: 151px; 63 | } 64 | .demo-avatar-dropdown { 65 | display: -webkit-flex; 66 | display: -ms-flexbox; 67 | display: flex; 68 | position: relative; 69 | -webkit-flex-direction: row; 70 | -ms-flex-direction: row; 71 | flex-direction: row; 72 | -webkit-align-items: center; 73 | -ms-flex-align: center; 74 | align-items: center; 75 | width: 100%; 76 | } 77 | 78 | .demo-navigation { 79 | -webkit-flex-grow: 1; 80 | -ms-flex-positive: 1; 81 | flex-grow: 1; 82 | } 83 | .demo-layout .demo-navigation .mdl-navigation__link { 84 | display: -webkit-flex !important; 85 | display: -ms-flexbox !important; 86 | display: flex !important; 87 | -webkit-flex-direction: row; 88 | -ms-flex-direction: row; 89 | flex-direction: row; 90 | -webkit-align-items: center; 91 | -ms-flex-align: center; 92 | align-items: center; 93 | color: rgba(255, 255, 255, 0.56); 94 | font-weight: 500; 95 | } 96 | .demo-layout .demo-navigation .mdl-navigation__link:hover { 97 | background-color: #00BCD4; 98 | color: #37474F; 99 | } 100 | .demo-navigation .mdl-navigation__link .material-icons { 101 | font-size: 24px; 102 | color: rgba(255, 255, 255, 0.56); 103 | margin-right: 32px; 104 | } 105 | 106 | .demo-content { 107 | max-width: 1080px; 108 | } 109 | 110 | .demo-charts { 111 | -webkit-align-items: center; 112 | -ms-flex-align: center; 113 | align-items: center; 114 | } 115 | .demo-chart:nth-child(1) { 116 | color: #ACEC00; 117 | } 118 | .demo-chart:nth-child(2) { 119 | color: #00BBD6; 120 | } 121 | .demo-chart:nth-child(3) { 122 | color: #BA65C9; 123 | } 124 | .demo-chart:nth-child(4) { 125 | color: #EF3C79; 126 | } 127 | .demo-graphs { 128 | padding: 16px 32px; 129 | display: -webkit-flex; 130 | display: -ms-flexbox; 131 | display: flex; 132 | -webkit-flex-direction: column; 133 | -ms-flex-direction: column; 134 | flex-direction: column; 135 | -webkit-align-items: stretch; 136 | -ms-flex-align: stretch; 137 | align-items: stretch; 138 | } 139 | /* TODO: Find a proper solution to have the graphs 140 | * not float around outside their container in IE10/11. 141 | * Using a browserhacks.com solution for now. 142 | */ 143 | _:-ms-input-placeholder, :root .demo-graphs { 144 | min-height: 664px; 145 | } 146 | _:-ms-input-placeholder, :root .demo-graph { 147 | max-height: 300px; 148 | } 149 | /* TODO end */ 150 | .demo-graph:nth-child(1) { 151 | color: #00b9d8; 152 | } 153 | .demo-graph:nth-child(2) { 154 | color: #d9006e; 155 | } 156 | 157 | .demo-cards { 158 | -webkit-align-items: flex-start; 159 | -ms-flex-align: start; 160 | align-items: flex-start; 161 | -webkit-align-content: flex-start; 162 | -ms-flex-line-pack: start; 163 | align-content: flex-start; 164 | } 165 | .demo-cards .demo-separator { 166 | height: 32px; 167 | } 168 | .demo-cards .mdl-card__title.mdl-card__title { 169 | color: white; 170 | font-size: 24px; 171 | font-weight: 400; 172 | } 173 | .demo-cards ul { 174 | padding: 0; 175 | } 176 | .demo-cards h3 { 177 | font-size: 1em; 178 | } 179 | .demo-updates .mdl-card__title { 180 | min-height: 200px; 181 | background-image: url('images/dog.png'); 182 | background-position: 90% 100%; 183 | background-repeat: no-repeat; 184 | } 185 | .demo-cards .mdl-card__actions a { 186 | color: #00BCD4; 187 | text-decoration: none; 188 | } 189 | 190 | .demo-options h3 { 191 | margin: 0; 192 | } 193 | .demo-options .mdl-checkbox__box-outline { 194 | border-color: rgba(255, 255, 255, 0.89); 195 | } 196 | .demo-options ul { 197 | margin: 0; 198 | list-style-type: none; 199 | } 200 | .demo-options li { 201 | margin: 4px 0; 202 | } 203 | .demo-options .material-icons { 204 | color: rgba(255, 255, 255, 0.89); 205 | } 206 | .demo-options .mdl-card__actions { 207 | height: 64px; 208 | display: -webkit-flex; 209 | display: -ms-flexbox; 210 | display: flex; 211 | box-sizing: border-box; 212 | -webkit-align-items: center; 213 | -ms-flex-align: center; 214 | align-items: center; 215 | } 216 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/css/login.css: -------------------------------------------------------------------------------- 1 | .form-login { 2 | margin-top: 15%; 3 | /* background-image: url(../image/tao.jpg); */ 4 | } 5 | 6 | body { 7 | /* background-image: url(../image/tao.jpg); */ 8 | } 9 | 10 | .login-h2 { 11 | margin-left: 25px; 12 | } 13 | 14 | .form-register { 15 | margin-top: 6%; 16 | } 17 | 18 | .error { 19 | color: red; 20 | } 21 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/css/main.css: -------------------------------------------------------------------------------- 1 | /*li { 2 | display: inline-block; 3 | list-style: none; 4 | margin-right: 7px; 5 | }*/ 6 | 7 | #header { 8 | margin-top: 8px; 9 | /*background: #F5F5F5;*/ 10 | } 11 | #header-bottom { 12 | 13 | } 14 | #header-nav-middle { 15 | background-color: #222; 16 | border-color: #080808; 17 | 18 | } 19 | 20 | #bs-example-navbar-collapse-1 { 21 | margin-left: 150px; 22 | } 23 | 24 | .header-bottom { 25 | height: auto; 26 | } 27 | 28 | .clear-float { 29 | clear: both; 30 | } 31 | 32 | #mycarousel { 33 | width: 80%; 34 | float: left; 35 | margin-left: 1%; 36 | /* display: inline; 37 | overflow: hidden; 38 | position: relative;*/ 39 | } 40 | 41 | .sort { 42 | width: 19%; 43 | height: auto; 44 | float: left; 45 | /*position: relative;*/ 46 | /*margin-right: 5%;*/ 47 | } 48 | 49 | .sort-channel { 50 | 51 | } 52 | 53 | .sort-detail { 54 | /*float: left;*/ 55 | position: absolute; 56 | z-index: 10; 57 | top: 0px; 58 | /*left: 218px;*/ 59 | left: 102%; 60 | background: white; 61 | width: 300px; 62 | display: none; 63 | /*float: left;*/ 64 | padding: 5px; 65 | border:1px solid gray; 66 | 67 | border-radius: 3px; 68 | 69 | } 70 | 71 | .sort-channel-list>li { 72 | list-style: none; 73 | padding: 10px 30px; 74 | } 75 | 76 | .list-group-item>a{ 77 | color: black; 78 | text-decoration: none; 79 | } 80 | 81 | /*.dl-horizontal dt { 82 | text-align: left !important; 83 | width: auto !important; 84 | } 85 | 86 | .dl-horizontal dd { 87 | text-align: left !important; 88 | width: auto !important; 89 | margin-left: 0; 90 | }*/ 91 | 92 | .dl-hor { 93 | /*border-top: none;*/ 94 | float: left; 95 | clear: both; 96 | margin: 10px 10px 10px 5px; 97 | } 98 | 99 | .dl-hor>dt { 100 | float: left; 101 | margin-right: 18px; 102 | } 103 | 104 | .dl-hor>dd { 105 | float: left; 106 | } 107 | 108 | .dl-hor>dd>a { 109 | margin-right: 8px; 110 | } 111 | 112 | .dl-hor>dt>a { 113 | color: red; 114 | } 115 | 116 | .hd>h2 { 117 | border-left: 3px solid black; 118 | padding-left: 10px; 119 | } 120 | 121 | .data>ul { 122 | padding: 0 15px; 123 | margin-bottom: 0 !important; 124 | } 125 | 126 | .data>ul>li { 127 | list-style: none; 128 | float: left; 129 | margin: 2px 9px; 130 | position: relative; 131 | } 132 | 133 | .hd>hr { 134 | margin-top: 10px; 135 | margin-bottom: 10px; 136 | } 137 | 138 | .content { 139 | margin: 23px 8px; 140 | } 141 | 142 | .module { 143 | border-bottom: 1px solid #EEE; 144 | margin-top: 6px; 145 | } 146 | 147 | p.text-right { 148 | margin-right: 5px; 149 | margin-bottom: 3px; 150 | margin-top: 3px; 151 | font-size: 20px; 152 | } 153 | 154 | p.text-right>a { 155 | color: black; 156 | text-decoration: none; 157 | } 158 | 159 | p.text-right>a:hover { 160 | color: orange; 161 | } 162 | 163 | div.text-right { 164 | margin-right: 5px; 165 | } 166 | 167 | .text-right>b { 168 | color: #f40; 169 | font-size: 15px; 170 | } 171 | 172 | .like-button { 173 | font-size: 15px !important; 174 | position: absolute !important; 175 | z-index: 10 !important; 176 | left: 70% !important; 177 | top: 60% !important; 178 | } 179 | 180 | /*.like-button2 { 181 | font-size: 15px !important; 182 | position: absolute !important; 183 | z-index: 10 !important; 184 | left: 80% !important; 185 | top: 70% !important; 186 | display: none !important; 187 | }*/ 188 | 189 | .dropdown-menu { 190 | top: 75% !important; 191 | } 192 | 193 | .login-out { 194 | color: red !important; 195 | } 196 | 197 | .navbar-nav>li>a { 198 | color: #d4c8bb !important; 199 | } 200 | 201 | .navbar-nav>li>a:hover{ 202 | color: #e83038 !important; 203 | } 204 | 205 | .logo-word { 206 | font-family:chiller; 207 | font-size:25px; 208 | color:#dad5d5 !important; 209 | } 210 | 211 | .log-word:hover { 212 | color:red !important; 213 | } 214 | 215 | .to-big:hover { 216 | transition:transform .8s cubic-bezier(0.23, 1, 0.32, 1), box-shadow .8s cubic-bezier(0.23, 1, 0.32, 1); 217 | box-shadow:0 0 20px rgba(0, 0, 0, 0.3); 218 | transform:scale(1.05); 219 | z-index:2; 220 | } -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/css/order.css: -------------------------------------------------------------------------------- 1 | .header-border { 2 | border-bottom: solid 1px #c6c5c5; 3 | } 4 | 5 | .h4-mar{ 6 | margin-top: 30px; 7 | } 8 | 9 | .h4-mar-2 { 10 | margin-top: 30px; 11 | } 12 | 13 | .address>.radio { 14 | padding-left: 50px; 15 | } 16 | 17 | .radio>label { 18 | margin: 5px 0 5px 0; 19 | } 20 | 21 | .address-check input[type='checkbox']:checked { 22 | background: #FFF0E8; 23 | border: solid 1px #f40; 24 | } 25 | 26 | .manage-a { 27 | font-size: 15px; 28 | color: #2aabd2; 29 | } -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/css/release.css: -------------------------------------------------------------------------------- 1 | @charset "utf-8"; 2 | /* CSS Document */ 3 | 4 | .release { 5 | margin-left: 10%; 6 | width: 80%; 7 | } 8 | 9 | .submit-input { 10 | /*width:30%; */ 11 | /*margin-left:*/ 12 | } 13 | 14 | .upload-button { 15 | /*width: 30%*/; 16 | margin-left: 0; 17 | } 18 | 19 | h1 { 20 | /*margin-left:-50px;*/ 21 | } -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/css/shopdetail.css: -------------------------------------------------------------------------------- 1 | @charset "utf-8"; 2 | 3 | /*通用样式*/ 4 | .shopdetails a{ 5 | text-decoration:none; 6 | color:#333; 7 | font-size:12px; 8 | } 9 | .shopdetails ul,li,dl,dt,dd,h1,h2,h3,h4,h5,h6,form,p{ 10 | padding:0; margin:0; 11 | list-style:none; 12 | } 13 | .shopdetails img{ border:0px;} 14 | .clear{ 15 | clear:both; 16 | } 17 | 18 | 19 | /*放大镜*/ 20 | #leftbox{ 21 | width:400px; 22 | z-index:999; 23 | margin-left: 15px; 24 | /*position:absolute;*/ 25 | } 26 | #showbox { background:#eee;} 27 | #showbox img{ 28 | z-index: 100; 29 | } 30 | #showbox span { 31 | background:url(../image/whitebg.png) repeat; 32 | } 33 | #showsum { 34 | left:25px; 35 | margin-top:10px; 36 | } 37 | #showsum span { 38 | border:1px solid #ddd; 39 | } 40 | #showsum span.sel { 41 | border:1px solid #f60; 42 | } 43 | 44 | .showpage { 45 | width:400px; 46 | position:relative; 47 | } 48 | .showpage a { 49 | display:block; width:15px; 50 | border:1px solid #ddd; 51 | height:60px; line-height:60px; 52 | background:#eee; 53 | text-align:center; 54 | font-size:18px; 55 | position:absolute; 56 | left:0; top:-62px; 57 | text-decoration:none; 58 | color:#999;} 59 | .showpage a#shownext { 60 | left:auto; right:0; 61 | } 62 | .showpage a:hover { 63 | background:#ccc; 64 | color:#777; 65 | } 66 | 67 | .rel-div { 68 | position: relative; 69 | top: 50px; 70 | } -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/SpringbootSchoolShop/src/main/webapp/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/SpringbootSchoolShop/src/main/webapp/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/SpringbootSchoolShop/src/main/webapp/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/SpringbootSchoolShop/src/main/webapp/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/SpringbootSchoolShop/src/main/webapp/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/image/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/SpringbootSchoolShop/src/main/webapp/image/3.jpg -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/image/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/SpringbootSchoolShop/src/main/webapp/image/4.jpg -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/image/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/SpringbootSchoolShop/src/main/webapp/image/5.jpg -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/image/6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/SpringbootSchoolShop/src/main/webapp/image/6.jpg -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/image/checkbox-radio-sheet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/SpringbootSchoolShop/src/main/webapp/image/checkbox-radio-sheet.png -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/image/darkbg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/SpringbootSchoolShop/src/main/webapp/image/darkbg.png -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/image/head.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/SpringbootSchoolShop/src/main/webapp/image/head.jpg -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/image/img/cancel-off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/SpringbootSchoolShop/src/main/webapp/image/img/cancel-off.png -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/image/img/cancel-on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/SpringbootSchoolShop/src/main/webapp/image/img/cancel-on.png -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/image/img/star-half.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/SpringbootSchoolShop/src/main/webapp/image/img/star-half.png -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/image/img/star-off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/SpringbootSchoolShop/src/main/webapp/image/img/star-off.png -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/image/img/star-on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/SpringbootSchoolShop/src/main/webapp/image/img/star-on.png -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/image/img01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/SpringbootSchoolShop/src/main/webapp/image/img01.png -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/image/img02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/SpringbootSchoolShop/src/main/webapp/image/img02.png -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/image/img03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/SpringbootSchoolShop/src/main/webapp/image/img03.png -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/image/img04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/SpringbootSchoolShop/src/main/webapp/image/img04.png -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/image/img05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/SpringbootSchoolShop/src/main/webapp/image/img05.png -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/image/login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/SpringbootSchoolShop/src/main/webapp/image/login.png -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/image/login0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/SpringbootSchoolShop/src/main/webapp/image/login0.png -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/image/register.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/SpringbootSchoolShop/src/main/webapp/image/register.png -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/image/register0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/SpringbootSchoolShop/src/main/webapp/image/register0.png -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/image/tao.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/SpringbootSchoolShop/src/main/webapp/image/tao.jpg -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/image/whitebg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/SpringbootSchoolShop/src/main/webapp/image/whitebg.png -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/js/address.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function (){ 2 | var addresId; 3 | $("[name='changeAddr']").click(function (){ 4 | $("#update-addr").modal({ 5 | backdrop:'static' 6 | }); 7 | 8 | $("#name").val($(this).parents("#parent").find("#conname").text()); 9 | $("#telephone").val($(this).parents("#parent").find("#contel").text()); 10 | $("#detailaddress").val($(this).parents("#parent").find("#detailaddr").text()); 11 | addresId=$(this).parents("#parent").find("#table").attr("address-id"); 12 | 13 | }); 14 | 15 | 16 | $("#saveAddr").click(function (){ 17 | var saveAddr={}; 18 | saveAddr.addressid=addresId; 19 | saveAddr.province=$("#provinceUpdate").val(); 20 | saveAddr.city=$("#cityUpdate").val(); 21 | saveAddr.county=$("#countyUpdate").val(); 22 | saveAddr.detailaddr=$("#detailaddress").val(); 23 | saveAddr.conname=$("#name").val(); 24 | saveAddr.contel=$("#telephone").val(); 25 | 26 | $.ajax({ 27 | type: "POST", 28 | url: "/shop/saveAddr", 29 | contentType:"application/x-www-form-urlencoded; charset=utf-8", 30 | data:saveAddr, 31 | dateType:"json", 32 | success: function(result){ 33 | if (result.msg=="更新失败") 34 | { 35 | swal(result.msg); 36 | } 37 | else { 38 | $("#update-info").modal('hide'); 39 | swal("修改成功", "", "success"); 40 | $("button").click(function (){ 41 | location.reload(); 42 | }); 43 | } 44 | }, 45 | error:function (){ 46 | alert("更新失败"); 47 | } 48 | }); 49 | }); 50 | 51 | $("[name='deleteAddr']").click(function (){ 52 | addresId=$(this).parents("#parent").find("#table").attr("address-id"); 53 | var address={}; 54 | address.addressid=addresId; 55 | $.ajax({ 56 | type: "POST", 57 | url: "/shop/deleteAddr", 58 | contentType:"application/x-www-form-urlencoded; charset=utf-8", 59 | data:address, 60 | dateType:"json", 61 | success:function (result){ 62 | swal(result.msg); 63 | $("button").click(function (){ 64 | location.reload(); 65 | }); 66 | }, 67 | error:function (){ 68 | alert("删除失败"); 69 | } 70 | }); 71 | }); 72 | 73 | $("[name='insertAddr']").click(function () { 74 | $("#insert-addr").modal({ 75 | backdrop:'static' 76 | }); 77 | }); 78 | 79 | $("#insertAddr").click(function (){ 80 | var insertAddr={}; 81 | insertAddr.addressid={}; 82 | insertAddr.userid={}; 83 | insertAddr.province=$("#provinceInsert").val(); 84 | insertAddr.city=$("#cityInsert").val(); 85 | insertAddr.county=$("#countyInsert").val(); 86 | insertAddr.detailaddr=$("#detailaddressInsert").val(); 87 | insertAddr.conname=$("#nameInsert").val(); 88 | insertAddr.contel=$("#telephoneInsert").val(); 89 | $.ajax({ 90 | type:"POST", 91 | url:"/shop/insertAddr", 92 | contentType:"application/x-www-form-urlencoded; charset=utf-8", 93 | data:insertAddr, 94 | dataType:"json", 95 | success:function (result){ 96 | swal(result.msg); 97 | $("button").click(function (){ 98 | location.reload(); 99 | }); 100 | }, 101 | error:function (){ 102 | alert("添加失败"); 103 | } 104 | }); 105 | 106 | }); 107 | }); -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/js/bootstrap-filestyle.min.js: -------------------------------------------------------------------------------- 1 | (function(c){var b=function(d,e){this.options=e;this.$elementFilestyle=[];this.$element=c(d)};b.prototype={clear:function(){this.$element.val("");this.$elementFilestyle.find(":text").val("");this.$elementFilestyle.find(".badge").remove()},destroy:function(){this.$element.removeAttr("style").removeData("filestyle").val("");this.$elementFilestyle.remove()},disabled:function(d){if(d===true){if(!this.options.disabled){this.$element.attr("disabled","true");this.$elementFilestyle.find("label").attr("disabled","true");this.options.disabled=true}}else{if(d===false){if(this.options.disabled){this.$element.removeAttr("disabled");this.$elementFilestyle.find("label").removeAttr("disabled");this.options.disabled=false}}else{return this.options.disabled}}},buttonBefore:function(d){if(d===true){if(!this.options.buttonBefore){this.options.buttonBefore=true;if(this.options.input){this.$elementFilestyle.remove();this.constructor();this.pushNameFiles()}}}else{if(d===false){if(this.options.buttonBefore){this.options.buttonBefore=false;if(this.options.input){this.$elementFilestyle.remove();this.constructor();this.pushNameFiles()}}}else{return this.options.buttonBefore}}},icon:function(d){if(d===true){if(!this.options.icon){this.options.icon=true;this.$elementFilestyle.find("label").prepend(this.htmlIcon())}}else{if(d===false){if(this.options.icon){this.options.icon=false;this.$elementFilestyle.find(".glyphicon").remove()}}else{return this.options.icon}}},input:function(e){if(e===true){if(!this.options.input){this.options.input=true;if(this.options.buttonBefore){this.$elementFilestyle.append(this.htmlInput())}else{this.$elementFilestyle.prepend(this.htmlInput())}this.$elementFilestyle.find(".badge").remove();this.pushNameFiles();this.$elementFilestyle.find(".group-span-filestyle").addClass("input-group-btn")}}else{if(e===false){if(this.options.input){this.options.input=false;this.$elementFilestyle.find(":text").remove();var d=this.pushNameFiles();if(d.length>0&&this.options.badge){this.$elementFilestyle.find("label").append(' '+d.length+"")}this.$elementFilestyle.find(".group-span-filestyle").removeClass("input-group-btn")}}else{return this.options.input}}},size:function(d){if(d!==undefined){var f=this.$elementFilestyle.find("label"),e=this.$elementFilestyle.find("input");f.removeClass("btn-lg btn-sm");e.removeClass("input-lg input-sm");if(d!="nr"){f.addClass("btn-"+d);e.addClass("input-"+d)}}else{return this.options.size}},buttonText:function(d){if(d!==undefined){this.options.buttonText=d;this.$elementFilestyle.find("label span").html(this.options.buttonText)}else{return this.options.buttonText}},buttonName:function(d){if(d!==undefined){this.options.buttonName=d;this.$elementFilestyle.find("label").attr({"class":"btn "+this.options.buttonName})}else{return this.options.buttonName}},iconName:function(d){if(d!==undefined){this.$elementFilestyle.find(".glyphicon").attr({"class":".glyphicon "+this.options.iconName})}else{return this.options.iconName}},htmlIcon:function(){if(this.options.icon){return' '}else{return""}},htmlInput:function(){if(this.options.input){return' '}else{return""}},pushNameFiles:function(){var d="",f=[];if(this.$element[0].files===undefined){f[0]={name:this.$element[0]&&this.$element[0].value}}else{f=this.$element[0].files}for(var e=0;e";f=h.options.buttonBefore?i+h.htmlInput():h.htmlInput()+i;h.$elementFilestyle=c('
'+f+"
");h.$elementFilestyle.find(".group-span-filestyle").attr("tabindex","0").keypress(function(j){if(j.keyCode===13||j.charCode===32){h.$elementFilestyle.find("label").click();return false}});h.$element.css({position:"absolute",clip:"rect(0px 0px 0px 0px)"}).attr("tabindex","-1").after(h.$elementFilestyle);if(h.options.disabled){h.$element.attr("disabled","true")}h.$element.change(function(){var j=h.pushNameFiles();if(h.options.input==false&&h.options.badge){if(h.$elementFilestyle.find(".badge").length==0){h.$elementFilestyle.find("label").append(' '+j.length+"")}else{if(j.length==0){h.$elementFilestyle.find(".badge").remove()}else{h.$elementFilestyle.find(".badge").html(j.length)}}}else{h.$elementFilestyle.find(".badge").remove()}});if(window.navigator.userAgent.search(/firefox/i)>-1){h.$elementFilestyle.find("label").click(function(){h.$element.click();return false})}}};var a=c.fn.filestyle;c.fn.filestyle=function(e,d){var f="",g=this.each(function(){if(c(this).attr("type")==="file"){var j=c(this),h=j.data("filestyle"),i=c.extend({},c.fn.filestyle.defaults,e,typeof e==="object"&&e);if(!h){j.data("filestyle",(h=new b(this,i)));h.constructor()}if(typeof e==="string"){f=h[e](d)}}});if(typeof f!==undefined){return f}else{return g}};c.fn.filestyle.defaults={buttonText:"Choose file",iconName:"glyphicon-folder-open",buttonName:"btn-default",size:"nr",input:true,badge:true,icon:true,buttonBefore:false,disabled:false};c.fn.filestyle.noConflict=function(){c.fn.filestyle=a;return this};c(function(){c(".filestyle").each(function(){var e=c(this),d={input:e.attr("data-input")==="false"?false:true,icon:e.attr("data-icon")==="false"?false:true,buttonBefore:e.attr("data-buttonBefore")==="true"?true:false,disabled:e.attr("data-disabled")==="true"?true:false,size:e.attr("data-size"),buttonText:e.attr("data-buttonText"),buttonName:e.attr("data-buttonName"),iconName:e.attr("data-iconName"),badge:e.attr("data-badge")==="false"?false:true};e.filestyle(d)})})})(window.jQuery); -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/js/categery.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function (){ 2 | var cateId={}; 3 | 4 | $("[name='changCate']") .click(function (){ 5 | $("#update-cate").modal({ 6 | backdrop:'static' 7 | }); 8 | $("#categoryName").val($(this).parent().prev().children().text()); 9 | cateId=$(this).parent().prev().children().attr("cateId"); 10 | }); 11 | 12 | $("#saveCatename").click(function (){ 13 | var category={}; 14 | category.cateid=cateId; 15 | category.catename=$("#categoryName").val(); 16 | $.ajax({ 17 | type:"POST", 18 | url:"/shop/admin/goods/saveCate", 19 | contentType:"application/x-www-form-urlencoded; charset=utf-8", 20 | data:category, 21 | dataType:"json", 22 | success:function (result){ 23 | if (result.msg=="名字已经存在") 24 | { 25 | swal(result.msg); 26 | } 27 | else { 28 | swal(result.msg); 29 | $("button").click(function (){ 30 | location.reload(); 31 | }); 32 | } 33 | }, 34 | error:function (){ 35 | alert("更新失败"); 36 | } 37 | }); 38 | }) 39 | $("[name='deleteCate']").click(function (){ 40 | var category={}; 41 | category.cateid=$(this).parent().prev().prev().children().attr("cateId"); 42 | $.ajax({ 43 | type:"POST", 44 | url:"/shop/admin/goods/deleteCate", 45 | contentType:"application/x-www-form-urlencoded; charset=utf-8", 46 | data:category, 47 | dataType:"json", 48 | success:function (result){ 49 | swal(result.msg); 50 | $("button").click(function (){ 51 | location.reload(); 52 | }); 53 | }, 54 | error:function (){ 55 | alert("更新失败"); 56 | } 57 | }); 58 | }) 59 | }); -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/js/information.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function(){ 2 | var oldPswflag=0; 3 | var newPswflag=0; 4 | $("#name").text($("#nameVal").text()); 5 | $("#email").val($("#emailVal").text()); 6 | $("#telephone").val($("#telephoneVal").text()); 7 | $("#changeInfo").click(function(){ 8 | $("#update-info").modal({ 9 | backdrop:'static' 10 | }); 11 | }); 12 | 13 | 14 | $("#saveInfo").click(function (){ 15 | var saveInfo={}; 16 | saveInfo.name=$("#name").val(); 17 | saveInfo.email=$("#email").val(); 18 | saveInfo.telephone=$("#telephone").val(); 19 | $.ajax({ 20 | type: "POST", 21 | url: "/shop/saveInfo", 22 | contentType:"application/x-www-form-urlencoded; charset=utf-8", 23 | data:saveInfo, 24 | dateType:"json", 25 | success: function(result){ 26 | if (result.msg=="更新失败") 27 | { 28 | swal(result.msg); 29 | } 30 | else { 31 | $("#update-info").modal('hide'); 32 | swal("修改成功", "", "success"); 33 | $("button").click(function (){ 34 | location.reload(); 35 | }); 36 | } 37 | }, 38 | error:function (){ 39 | alert("更新失败"); 40 | } 41 | }); 42 | }); 43 | 44 | $("#changePsw").click(function (){ 45 | $("#update-Psw").modal({ 46 | backdrop:'static' 47 | }); 48 | }); 49 | 50 | $("#oldPsw").blur(function (){ 51 | if ($("#oldPsw").val()!=$("#Psw").attr("Psw")) 52 | { 53 | $("#oldPswError").show(); 54 | } 55 | else 56 | { 57 | $("#oldPswError").hide(); 58 | oldPswflag=1; 59 | } 60 | }) 61 | 62 | /* $("#newPsw").focus(function (){ 63 | if ($("#oldPsw").val()==$("#Psw").attr("Psw")) 64 | { 65 | $("#oldPswError").hide(); 66 | oldPswflag=1; 67 | } 68 | });*/ 69 | 70 | $("#newPsw").blur(function (){ 71 | if($("#newPsw").val().length<8) 72 | { 73 | $("#newPswError").show(); 74 | } 75 | else { 76 | $("#newPswError").hide(); 77 | newPswflag=1; 78 | } 79 | }); 80 | 81 | $("#savePsw").click(function (){ 82 | if (oldPswflag==1&&newPswflag==1) 83 | { 84 | var Psw={}; 85 | Psw.Psw=$("#newPsw").val(); 86 | $.ajax({ 87 | type: "POST", 88 | url: "/shop/savePsw", 89 | contentType:"application/x-www-form-urlencoded; charset=utf-8", 90 | data:Psw, 91 | dateType:"json", 92 | success: function(result){ 93 | if (result.msg=="更新失败") 94 | { 95 | swal(result.msg); 96 | } 97 | else { 98 | $("#update-info").modal('hide'); 99 | swal(result.msg); 100 | $("button").click(function (){ 101 | location.reload(); 102 | }); 103 | } 104 | }, 105 | error:function (){ 106 | alert("更新失败"); 107 | } 108 | }); 109 | } 110 | }) 111 | 112 | }); 113 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/js/list.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function (){ 2 | $("[name='deleteList']").click(function (){ 3 | var orderid=$(this).parents("[name='parent']").find("[name='orderid']").text(); 4 | var order={}; 5 | order.orderid= parseInt(orderid); 6 | $.ajax({ 7 | type:"POST", 8 | url:"/shop/deleteList", 9 | contentType:"application/x-www-form-urlencoded; charset=utf-8", 10 | data:order, 11 | dataType:"json", 12 | success:function (result){ 13 | swal(result.msg); 14 | $("button").click(function (){ 15 | location.reload(); 16 | }); 17 | }, 18 | error:function (){ 19 | alert("删除失败"); 20 | } 21 | }); 22 | }); 23 | 24 | $("[name='finishList']").click(function (){ 25 | var orderid=$(this).parents("[name='parent']").find("[name='orderid']").text(); 26 | var order={}; 27 | order.orderid=orderid; 28 | $.ajax({ 29 | type:"POST", 30 | url:"/shop/finishList", 31 | contentType:"application/x-www-form-urlencoded; charset=utf-8", 32 | data:order, 33 | dataType:"json", 34 | success:function (result){ 35 | swal(result.msg); 36 | $("button").click(function (){ 37 | location.reload(); 38 | }); 39 | }, 40 | error:function (){ 41 | alert("点击失败"); 42 | } 43 | }); 44 | }) 45 | 46 | var goodsId={}; 47 | 48 | $("[name='evaluate']").click(function (){ 49 | $("#evaluate").modal({ 50 | backdrop:'static' 51 | }); 52 | goodsId=$(this).parents(".table-bordered").find(".col-lg-1").eq(0).text(); 53 | 54 | }) 55 | 56 | $("#star").raty({path: '../image/img'}); 57 | 58 | $("#saveEvaluate").click(function (){ 59 | var score=$("[name='score']").val(); 60 | var content=$("#description").val(); 61 | var comment={}; 62 | comment.commentid={}; 63 | comment.userid={}; 64 | comment.goodsid=goodsId; 65 | comment.point=score; 66 | comment.content=content; 67 | $.ajax({ 68 | type:"POST", 69 | url:"/shop/comment", 70 | contentType:"application/x-www-form-urlencoded; charset=utf-8", 71 | data:comment, 72 | dataType:"json", 73 | success:function (result){ 74 | $("#evaluate").modal('hide'); 75 | swal(result.msg); 76 | }, 77 | error:function (){ 78 | alert("评论失败"); 79 | } 80 | }); 81 | 82 | 83 | }) 84 | 85 | }); -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/js/login.js: -------------------------------------------------------------------------------- 1 | 2 | $.validator.setDefaults({ 3 | submitHandler: function() { 4 | form.submit(); 5 | } 6 | }); 7 | $(document).ready(function() { 8 | $('#form2').validate({ 9 | rules: { 10 | username: "required", 11 | 12 | password: { 13 | required: true, 14 | }, 15 | confirmlogo: "required", 16 | }, 17 | messages: { 18 | username: "用户名输入不能为空", 19 | 20 | password: { 21 | required: "密码输入不能为空", 22 | }, 23 | confirmlogo: "验证码输入不能为空", 24 | } 25 | }); 26 | }); -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/js/order.js: -------------------------------------------------------------------------------- 1 | 2 | $(document).ready(function () { 3 | $("#confirm-orders").click(function () { 4 | // alert("safd"); 5 | var selectAddr = $('input:radio[name="addressid"]:checked').val(); 6 | if(selectAddr == null) { 7 | swal("请先添加地址"); 8 | return; 9 | } 10 | var isPay = $('#pay-select').val(); 11 | var oldPrice = $('#total-old').text(); 12 | var newPrice = $('#total-new').text(); 13 | $.ajax({ 14 | url: "/shop/orderFinish", 15 | type: "POST", 16 | data: { 17 | oldPrice: oldPrice, 18 | newPrice: newPrice, 19 | isPay: isPay, 20 | addressid: selectAddr 21 | }, 22 | success: function () { 23 | swal("购买成功", "", "success"); 24 | location.href = "/shop/info/list" 25 | }, 26 | error: function () { 27 | swal("购买失败,无法连接到服务器!"); 28 | } 29 | }); 30 | }); 31 | }); -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/js/shopcart.js: -------------------------------------------------------------------------------- 1 | /* 2 | $(document).ready(function(){ 3 | $('.delete-goods').click(function(){ 4 | var goodsid = $(this).attr("data-goodsid"); 5 | alert("asfd"); 6 | // deleteGoods(goodsid); 7 | }); 8 | 9 | $('.confirm-orders').click(function(){ 10 | confirmOrders(); 11 | alert("已成功加入订单,并已发送邮件至卖家,请等待卖家回复!"); 12 | location.href = "/index.jsp"; 13 | }); 14 | });*/ 15 | /* 16 | function deleteGoods(goodsid){ 17 | $.post("servlet/DeleteCartServlet", { 18 | goodsId: goodsid, 19 | }); 20 | } 21 | 22 | function confirmOrders(){ 23 | $.post("servlet/SaleServlet"); 24 | }*/ 25 | $(document).ready(function () { 26 | var path = $("#path").text(); 27 | showcart(); 28 | 29 | /*$('.delete-goods').click(function(){ 30 | alert("adf"); 31 | var goodsid = $(this).attr("data-goodsid"); 32 | $.ajax({ 33 | url: "/shop/deleteCart" + goodsid, 34 | type: "DELETE", 35 | success:function (result) { 36 | swal(result.msg, "","success"); 37 | showcart(); 38 | }, 39 | error:function () { 40 | /!*to_page('/shop',currentPage);*!/ 41 | swal("删除失败"); 42 | } 43 | }) 44 | });*/ 45 | }); 46 | 47 | /*$(document).on("click",".delete-good",function () { 48 | alert("afd"); 49 | });*/ 50 | 51 | function deleteCartGoods(goodsid) { 52 | $.ajax({ 53 | url: "/shop/deleteCart/" + goodsid, 54 | type: "DELETE", 55 | success: function (result) { 56 | // swal(result.msg, "","success"); 57 | showcart(); 58 | }, 59 | error:function () { 60 | swal("删除失败"); 61 | } 62 | }) 63 | } 64 | 65 | //改变商品数量更新购物车 66 | function updateCart(goodsid, newNum) { 67 | //获取当前数量 68 | // var newNum = $(".num").val(); 69 | $.ajax({ 70 | url: "/shop/update", 71 | data: { 72 | goodsid: goodsid, 73 | num:newNum 74 | }, 75 | method: "post", 76 | success: function (result) { 77 | // swal(result.msg, "", "success"); 78 | showcart(); 79 | }, 80 | error: function (result) { 81 | swal("更新购物车失败"); 82 | } 83 | }); 84 | } 85 | 86 | function showcart() { 87 | $.ajax({ 88 | url: "/shop" + "/cartjson", 89 | type: "post", 90 | success: function (result) { 91 | //显示购物车 92 | build_cart_table(result); 93 | }, 94 | error: function (result) { 95 | swal("获取购物车失败"); 96 | } 97 | }); 98 | } 99 | 100 | function build_cart_table(result) { 101 | $("#cart-table tbody").empty(); 102 | var goods = result.info.shopcart; 103 | var totalnum = 0; 104 | var totalMoney = 0; 105 | 106 | if(goods.length === 0) { 107 | var spareTd = $('
购物车还是空的,快去首页看看吧!
'); 108 | spareTd.appendTo("#cart-table tbody"); 109 | } else { 110 | $.each(goods, function (index,item) { 111 | 112 | var delA = $("").addClass("delete-goods").attr("data-goodsid",item.goodsid).append("×"); 113 | 114 | var deleteCart = $("").addClass("product-remove product-remove_2") 115 | .append(delA); 116 | 117 | delA.click(function () { 118 | deleteCartGoods(item.goodsid); 119 | }); 120 | 121 | var shopimage = $("").addClass("product-thumbnail product-thumbnail-2") 122 | .append($("").attr("href","/shop/detail?goodsid="+item.goodsid) 123 | .append($("").attr("src","/shop/pictures/"+item.imagePaths[0].path))); 124 | 125 | var goodsname = $("").addClass("product-name product-name_2") 126 | .append($("").attr("href","/shop/detail?goodsid="+item.goodsid).append(item.goodsname)); 127 | 128 | var goodsprice = $("").addClass("product-price") 129 | .append($("").addClass("amount-list amount-list-2").append("¥"+item.price)); 130 | 131 | var numIput = $("").addClass("num").attr("type","number").attr("value",item.num); 132 | 133 | var num = $("").addClass("product-stock-status") 134 | .append($("
").addClass("latest_es_from_2") 135 | .append(numIput)); 136 | 137 | numIput.change(function () { 138 | updateCart(item.goodsid,$(this).val()); 139 | }); 140 | 141 | var totalPrice = $("").addClass("product-price") 142 | .append($("").addClass("amount-list amount-list-2").append("¥"+item.price*item.num)); 143 | 144 | var goodsitem = $("").append(deleteCart) 145 | .append(shopimage) 146 | .append(goodsname) 147 | .append(goodsprice) 148 | .append(num) 149 | .append(totalPrice) 150 | .appendTo("#cart-table tbody"); 151 | totalnum++; 152 | totalMoney = totalMoney + item.price*item.num; 153 | }); 154 | } 155 | 156 | //小计 157 | $("#total-num").text(totalnum); 158 | $("#total-price").text("¥"+totalMoney); 159 | } 160 | -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/js/sort.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function(){ 2 | // $(".data-item-li").children("div").addClass("to-big"); 3 | //分类栏隐藏显示 4 | $(".list-group-item").hover(function(){ 5 | $(this).children("div.sort-detail").show(); 6 | },function(){ 7 | $(this).children("div.sort-detail").delay(1).hide(0); 8 | // $(this).children("div.sort-detail").hide(10); 9 | }); 10 | 11 | //幻灯片左右控制器 12 | $("#mycarousel").hover(function(){ 13 | $(this).children(".carousel-control").show(); 14 | },function(){ 15 | $(this).children(".carousel-control").hide(); 16 | }); 17 | 18 | //收藏按钮 19 | $(".data-item-li").hover(function(){ 20 | //需处理显示哪个按钮 21 | // $(this).find(".like-button").css("display","inline-block"); 22 | $(this).find(".like-button").show(); 23 | },function(){ 24 | $(this).find(".like-button").hide(); 25 | }); 26 | 27 | $(".info-a").hover(function(){ 28 | //需处理显示哪个按钮 29 | // $(this).find(".like-button").css("display","inline-block"); 30 | $(this).find(".dropdown-menu").show(); 31 | },function(){ 32 | $(this).find(".dropdown-menu").hide(); 33 | }); 34 | 35 | $('.like-button').click(function(){ 36 | //$(this).removeClass("glyphicon-heart-empty"); 37 | var goodsId = $(this).attr('data-id'); 38 | var isChangeBtn = true; 39 | if(!$(this).hasClass('glyphicon-heart')) { 40 | //收藏 41 | $.ajax({ 42 | url:"/shop/collect", 43 | type:"POST", 44 | data:{ 45 | goodsid:goodsId 46 | }, 47 | success:function (result) { 48 | //收藏成功 49 | if(result.code === 200){ 50 | location.href = "/shop/login"; 51 | isChangeBtn = false; 52 | } 53 | }, 54 | error:function () { 55 | alert("收藏失败"); 56 | } 57 | }) 58 | } else { 59 | //取消收藏 60 | $.ajax({ 61 | url:"/shop/deleteCollect", 62 | type:"POST", 63 | data:{ 64 | goodsid:goodsId 65 | }, 66 | success:function (result) { 67 | //取消收藏成功 68 | if(result.code === 200){ 69 | location.href = "/shop/login"; 70 | isChangeBtn = false; 71 | } 72 | }, 73 | error:function () { 74 | alert("取消收藏失败"); 75 | } 76 | }) 77 | } 78 | 79 | /*$.post("servlet/CollectServlet", { 80 | goodsId: goodsId, 81 | }); 82 | // alert("商品已加入购物车!");*/ 83 | 84 | if(isChangeBtn) { 85 | $(this).toggleClass("glyphicon-heart glyphicon-heart-empty"); 86 | } 87 | }); 88 | }); -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/js/templatemo-script.js: -------------------------------------------------------------------------------- 1 | /* 2 | * www.templatemo.com 3 | *******************************************************/ 4 | 5 | /* HTML document is loaded. DOM is ready. 6 | -----------------------------------------*/ 7 | $(document).ready(function(){ 8 | 9 | /* Mobile menu */ 10 | $('.mobile-menu-icon').click(function(){ 11 | $('.templatemo-left-nav').slideToggle(); 12 | }); 13 | 14 | /* Close the widget when clicked on close button */ 15 | $('.templatemo-content-widget .fa-times').click(function(){ 16 | $(this).parent().slideUp(function(){ 17 | $(this).hide(); 18 | }); 19 | }); 20 | }); -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/js/userManage.js: -------------------------------------------------------------------------------- 1 | 2 | $(document).ready(function () { 3 | 4 | var path = $("#path").text(); 5 | 6 | var currentPage = 1; 7 | 8 | to_page(path, 1); 9 | 10 | 11 | }); 12 | 13 | $(document).on("click",".templatemo-delete-btn",function () { 14 | var goodsname = $(this).parents("tr").find("td:eq(1)").text(); 15 | var goodsid = $(this).parents("tr").find("td:eq(0)").text(); 16 | swal({ 17 | title: "确定删除" + goodsname + "吗?", 18 | type: "warning", 19 | showCancelButton: true, 20 | cancelButtonText:"取消", 21 | confirmButtonColor: "#DD6B55", 22 | confirmButtonText: "确定删除!", 23 | closeOnConfirm: false, 24 | }, 25 | function () { 26 | /*swal("删除!", "你的虚拟文件已经被删除。", "success");*/ 27 | $.ajax({ 28 | url: "/shop/admin/user/delete/" + goodsid, 29 | type: "DELETE", 30 | success:function (result) { 31 | swal(result.msg, "","success"); 32 | to_page('/shop',currentPage); 33 | }, 34 | error:function () { 35 | /*to_page('/shop',currentPage);*/ 36 | } 37 | }); 38 | }); 39 | }); 40 | 41 | function to_page(path, page) { 42 | $.ajax({ 43 | url: path + "/admin/user/showjson", 44 | data: "page=" + page, 45 | type: "get", 46 | success: function (result) { 47 | 48 | //解析显示 49 | build_user_table(path, result); 50 | 51 | //页面信息 52 | build_page_info(path, result); 53 | 54 | //分页 55 | build_page_nav(path, result); 56 | 57 | currentPage = page; 58 | } 59 | }); 60 | } 61 | 62 | function build_user_table(path,result) { 63 | $("#goodsinfo tbody").empty(); 64 | var goods = result.info.pageInfo.list; 65 | $.each(goods, function (index,item) { 66 | var userid = $("").append(item.userid); 67 | var username = $("").append(item.username); 68 | var email = $("").append(item.email); 69 | var telephone = $("").append(item.telephone); 70 | 71 | var deleteBtn = $("").addClass("templatemo-delete-btn").append("删除"); 72 | 73 | var deleteTd = $("").append(deleteBtn); 74 | 75 | 76 | $("").append(userid) 77 | .append(username) 78 | .append(email) 79 | .append(telephone) 80 | .append(deleteTd).appendTo("#goodsinfo tbody"); 81 | }) 82 | } 83 | 84 | function build_page_info(path,result) { 85 | $("#page-info-area").empty(); 86 | $("#page-info-area").append("当前第"+ result.info.pageInfo.pageNum +"页,总共"+ result.info.pageInfo.pages +"页,总共"+ result.info.pageInfo.total +"记录") 87 | } 88 | 89 | function build_page_nav(path,result) { 90 | $("#page-div-nav ul").empty(); 91 | var pageUl = $("
    ").addClass("pagination") 92 | 93 | var firstPage = $("
  • ").append($("") 94 | .append($("") 95 | .append("首页"))); 96 | 97 | var prePage = $("
  • ").append($("") 98 | .append($(""))); 99 | 100 | if(!result.info.pageInfo.hasPreviousPage) { 101 | prePage.addClass("li-none"); 102 | } else { 103 | prePage.click(function () { 104 | to_page('/shop',result.info.pageInfo.prePage); 105 | }); 106 | } 107 | 108 | //跳转 109 | firstPage.click(function () { 110 | to_page('/shop',1); 111 | }); 112 | 113 | var nextPage = $("
  • ").append($("") 114 | .append($(""))); 115 | 116 | var lastPage = $("
  • ").append($("") 117 | .append($("") 118 | .append("末页"))); 119 | 120 | if(!result.info.pageInfo.hasNextPage) { 121 | nextPage.addClass("li-none"); 122 | } else { 123 | nextPage.click(function () { 124 | to_page('/shop',result.info.pageInfo.nextPage); 125 | }); 126 | } 127 | 128 | lastPage.click(function () { 129 | to_page('/shop',result.info.pageInfo.lastPage); 130 | }); 131 | 132 | pageUl.append(firstPage).append(prePage); 133 | 134 | $.each(result.info.pageInfo.navigatepageNums,function (index,item) { 135 | var numLi = $("
  • ").append($("") 136 | .append($("").append(item))); 137 | if(result.info.pageInfo.pageNum === item) { 138 | numLi.addClass("active"); 139 | } 140 | numLi.click(function () { 141 | to_page('/shop',item); 142 | }); 143 | pageUl.append(numLi); 144 | }); 145 | 146 | pageUl.append(nextPage).append(lastPage).appendTo("#page-div-nav"); 147 | } -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/main/webapp/js/validate.js: -------------------------------------------------------------------------------- 1 | 2 | $.validator.setDefaults({ 3 | submitHandler: function() { 4 | form.submit(); 5 | } 6 | }); 7 | $(document).ready(function() { 8 | $('#form').validate({ 9 | rules: { 10 | username: "required", 11 | telephone: { 12 | required: true, 13 | }, 14 | email: { 15 | required: true, 16 | email: true, 17 | }, 18 | password: { 19 | required: true, 20 | minlength: 8, 21 | }, 22 | confirmPassword: { 23 | required: true, 24 | minlength: 8, 25 | equalTo: "#password", 26 | } 27 | }, 28 | messages: { 29 | username: "用户名不能为空", 30 | telephone: "联系电话不能为空", 31 | email: { 32 | required: "邮箱输入不能为空", 33 | email: "请输入一个正确的邮箱", 34 | }, 35 | password: { 36 | required: "密码输入不能为空", 37 | minlength: "密码长度不能小于8位", 38 | }, 39 | confirmPassword: { 40 | required: "输入不能为空", 41 | minlength: "密码长度不能小于8位", 42 | equalTo: "两次密码输入不一致", 43 | } 44 | } 45 | }); 46 | }); -------------------------------------------------------------------------------- /SpringbootSchoolShop/src/test/java/com/zhang/ssmschoolshop/SpringbootSchoolShopApplicationApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.zhang.ssmschoolshop; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class SpringbootSchoolShopApplicationApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /upload/0f0b西部数据固态硬盘1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/upload/0f0b西部数据固态硬盘1.jpg -------------------------------------------------------------------------------- /upload/0f0b西部数据固态硬盘2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/upload/0f0b西部数据固态硬盘2.jpg -------------------------------------------------------------------------------- /upload/0f0b西部数据固态硬盘3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/upload/0f0b西部数据固态硬盘3.jpg -------------------------------------------------------------------------------- /upload/0f0b西部数据固态硬盘4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/upload/0f0b西部数据固态硬盘4.jpg -------------------------------------------------------------------------------- /upload/3a25雷柏M217无线鼠标1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/upload/3a25雷柏M217无线鼠标1.jpg -------------------------------------------------------------------------------- /upload/3a25雷柏M217无线鼠标2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/upload/3a25雷柏M217无线鼠标2.jpg -------------------------------------------------------------------------------- /upload/3a6a童装女童连衣裙2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/upload/3a6a童装女童连衣裙2.jpg -------------------------------------------------------------------------------- /upload/cadf宏想8G内存条1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/upload/cadf宏想8G内存条1.jpg -------------------------------------------------------------------------------- /upload/cadf宏想8G内存条2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/upload/cadf宏想8G内存条2.jpg -------------------------------------------------------------------------------- /upload/cadf宏想8G内存条3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/upload/cadf宏想8G内存条3.jpg -------------------------------------------------------------------------------- /upload/dcf7童装女童连衣裙4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/upload/dcf7童装女童连衣裙4.jpg -------------------------------------------------------------------------------- /upload/dfwd女童夏装连衣裙2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/upload/dfwd女童夏装连衣裙2.jpg -------------------------------------------------------------------------------- /upload/eeb9童装女童连衣裙3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/upload/eeb9童装女童连衣裙3.jpg -------------------------------------------------------------------------------- /upload/fb42童装女童连衣裙1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/upload/fb42童装女童连衣裙1.jpg -------------------------------------------------------------------------------- /upload/fesc女童夏装连衣裙1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/upload/fesc女童夏装连衣裙1.jpg -------------------------------------------------------------------------------- /upload/sfca英特尔固态硬盘1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/upload/sfca英特尔固态硬盘1.jpg -------------------------------------------------------------------------------- /upload/sfca英特尔固态硬盘2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/upload/sfca英特尔固态硬盘2.jpg -------------------------------------------------------------------------------- /upload/sfca英特尔固态硬盘3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/upload/sfca英特尔固态硬盘3.jpg -------------------------------------------------------------------------------- /关于系统.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangjianlin1985/Springboot_WebShopping/326bb9ef7f684907ea0cd8fe787a45e1a0887557/关于系统.txt --------------------------------------------------------------------------------