├── .gitattributes ├── flutter常用插件.txt ├── live_shop_client ├── .gitignore ├── .gradle │ ├── 5.6.4 │ │ ├── fileChanges │ │ │ └── last-build.bin │ │ ├── fileHashes │ │ │ └── fileHashes.lock │ │ └── gc.properties │ ├── buildOutputCleanup │ │ ├── buildOutputCleanup.lock │ │ └── cache.properties │ └── vcs-1 │ │ └── gc.properties ├── .metadata ├── android │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── kotlin │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── live_shop_client │ │ │ │ │ └── MainActivity.kt │ │ │ └── res │ │ │ │ ├── drawable │ │ │ │ └── launch_background.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ └── values │ │ │ │ └── styles.xml │ │ │ └── profile │ │ │ └── AndroidManifest.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ └── settings.gradle ├── assets │ ├── fonts │ │ ├── Flamante-Roma-Medium.ttf │ │ ├── Flamante-Roma-MediumItalic.ttf │ │ └── Lato-Bold.ttf │ └── images │ │ ├── 2.0x │ │ ├── chapter_8_icon.png │ │ ├── macbookpro.jpg │ │ ├── me.jpg │ │ ├── my.jpg │ │ ├── phone0.png │ │ ├── phone1.png │ │ ├── phone2.png │ │ ├── phone3.png │ │ ├── phone4.png │ │ ├── phone5.png │ │ └── swipe1.png │ │ ├── 3.0x │ │ ├── chapter_8_icon.png │ │ ├── macbookpro.jpg │ │ ├── me.jpg │ │ ├── my.jpg │ │ ├── phone0.png │ │ ├── phone1.png │ │ ├── phone2.png │ │ ├── phone3.png │ │ ├── phone4.png │ │ ├── phone5.png │ │ ├── phone6.png │ │ └── swipe1.png │ │ ├── 4.0x │ │ ├── chapter_8_icon.png │ │ ├── macbookpro.jpg │ │ ├── me.jpg │ │ ├── my.jpg │ │ ├── phone0.png │ │ ├── phone1.png │ │ ├── phone2.png │ │ ├── phone3.png │ │ ├── phone4.png │ │ ├── phone5.png │ │ ├── phone6.png │ │ └── swipe1.png │ │ ├── chapter_8_icon.png │ │ ├── macbookpro.jpg │ │ ├── me.jpg │ │ ├── my.jpg │ │ ├── phone0.png │ │ ├── phone1.png │ │ ├── phone2.png │ │ ├── phone3.png │ │ ├── phone4.png │ │ ├── phone5.png │ │ ├── room0.png │ │ └── swipe1.png ├── build.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── ios │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ ├── Release.xcconfig │ │ └── flutter_export_environment.sh │ ├── Podfile │ ├── Podfile.lock │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ └── contents.xcworkspacedata │ └── Runner │ │ ├── AppDelegate.swift │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ │ ├── Info.plist │ │ └── Runner-Bridging-Header.h ├── lib │ ├── common │ │ └── AppConstants.dart │ ├── login.dart │ ├── main.dart │ ├── model │ │ ├── LoginModel.dart │ │ └── basicModel.dart │ ├── route │ │ ├── Application.dart │ │ ├── NavigatorUtil.dart │ │ ├── RouterHandler.dart │ │ └── Routers.dart │ ├── test │ │ └── TestEasyloading.dart │ ├── util │ │ ├── EventBus.dart │ │ ├── HttpUtil.dart │ │ ├── LiveShopUtil.dart │ │ └── LogUtil.dart │ ├── view │ │ ├── CaretRoute.dart │ │ ├── EditInfoRoute.dart │ │ ├── HomeRoute.dart │ │ ├── LiveRoute.dart │ │ ├── LobbyRoute.dart │ │ ├── MsgRoute.dart │ │ ├── ProfileRoute.dart │ │ └── RegisterRouter.dart │ └── widget │ │ ├── AddSubtractInput.dart │ │ ├── BeautifulButton.dart │ │ ├── CardWidget.dart │ │ ├── ClearInput.dart │ │ ├── CommonBottomSheet.dart │ │ ├── ListOptionsItem.dart │ │ ├── LoadingDialog.dart │ │ ├── NewsButton.dart │ │ ├── OASwiper.dart │ │ ├── RoundFormField.dart │ │ ├── SearchBar.dart │ │ └── SkuHomeList.dart ├── local.properties ├── pubspec.lock ├── pubspec.yaml └── test │ └── widget_test.dart ├── live_shop_server ├── .gitignore ├── Live_shop.postman_collection.json ├── lib │ └── fastdfs-client-java-1.29-SNAPSHOT.jar ├── live_shop.sql ├── pom.xml └── src │ ├── main │ ├── java │ │ └── cn │ │ │ └── jjvu │ │ │ └── xiao │ │ │ ├── App.java │ │ │ ├── config │ │ │ ├── ConverterConfig.java │ │ │ ├── CorsConfig.java │ │ │ ├── FastDFSClient.java │ │ │ ├── KaptchaConfig.java │ │ │ ├── MyBatisGeneratorConfig.java │ │ │ ├── MybatisPageHelper.java │ │ │ ├── RedisConfig.java │ │ │ ├── SessionConfig.java │ │ │ ├── SwaggerConfig.java │ │ │ └── WebSecurityConfig.java │ │ │ ├── controller │ │ │ ├── ConfigController.java │ │ │ ├── CustomerController.java │ │ │ ├── DeptController.java │ │ │ ├── DictController.java │ │ │ ├── FileController.java │ │ │ ├── LogController.java │ │ │ ├── LoginController.java │ │ │ ├── LoginLogController.java │ │ │ ├── MenuController.java │ │ │ ├── RoleController.java │ │ │ └── UserController.java │ │ │ ├── core │ │ │ ├── aop │ │ │ │ └── HttpAspect.java │ │ │ ├── constant │ │ │ │ └── LiveShopContants.java │ │ │ ├── converter │ │ │ │ └── DateConverter.java │ │ │ ├── model │ │ │ │ ├── BasicModel.java │ │ │ │ ├── HttpResult.java │ │ │ │ ├── HttpStatus.java │ │ │ │ ├── LoginBean.java │ │ │ │ ├── PageRequest.java │ │ │ │ └── PageResult.java │ │ │ └── security │ │ │ │ ├── GrantedAuthorityImpl.java │ │ │ │ ├── JwtAuthenticatioToken.java │ │ │ │ ├── JwtAuthenticationFilter.java │ │ │ │ ├── JwtAuthenticationProvider.java │ │ │ │ ├── JwtUserDetails.java │ │ │ │ └── UserDetailsServiceImpl.java │ │ │ ├── dao │ │ │ ├── ConfigMapper.java │ │ │ ├── CustomerMapper.java │ │ │ ├── DeptMapper.java │ │ │ ├── DictMapper.java │ │ │ ├── LogMapper.java │ │ │ ├── LoginLogMapper.java │ │ │ ├── MenuMapper.java │ │ │ ├── RoleDeptMapper.java │ │ │ ├── RoleMapper.java │ │ │ ├── RoleMenuMapper.java │ │ │ ├── UserMapper.java │ │ │ └── UserRoleMapper.java │ │ │ ├── pojo │ │ │ ├── Config.java │ │ │ ├── ConfigExample.java │ │ │ ├── Customer.java │ │ │ ├── CustomerExample.java │ │ │ ├── Dept.java │ │ │ ├── DeptExample.java │ │ │ ├── Dict.java │ │ │ ├── DictExample.java │ │ │ ├── Log.java │ │ │ ├── LogExample.java │ │ │ ├── LoginLog.java │ │ │ ├── LoginLogExample.java │ │ │ ├── Menu.java │ │ │ ├── MenuExample.java │ │ │ ├── Role.java │ │ │ ├── RoleDept.java │ │ │ ├── RoleDeptExample.java │ │ │ ├── RoleExample.java │ │ │ ├── RoleMenu.java │ │ │ ├── RoleMenuExample.java │ │ │ ├── User.java │ │ │ ├── UserExample.java │ │ │ ├── UserRole.java │ │ │ └── UserRoleExample.java │ │ │ ├── service │ │ │ ├── ConfigService.java │ │ │ ├── CrudService.java │ │ │ ├── CustomerService.java │ │ │ ├── DeptService.java │ │ │ ├── DictService.java │ │ │ ├── LogService.java │ │ │ ├── LoginLogService.java │ │ │ ├── MenuService.java │ │ │ ├── RoleService.java │ │ │ ├── UserService.java │ │ │ └── impl │ │ │ │ ├── ConfigServiceImpl.java │ │ │ │ ├── CustomerServiceImpl.java │ │ │ │ ├── DeptServiceImpl.java │ │ │ │ ├── DictServiceImpl.java │ │ │ │ ├── LogServiceImpl.java │ │ │ │ ├── LoginLogServiceImpl.java │ │ │ │ ├── MenuServiceImpl.java │ │ │ │ ├── RoleServiceImpl.java │ │ │ │ └── UserServiceImpl.java │ │ │ └── utils │ │ │ ├── FileUtils.java │ │ │ ├── ILiveShopStringUtils.java │ │ │ ├── JwtTokenUtils.java │ │ │ ├── PasswordEncoder.java │ │ │ ├── PasswordUtils.java │ │ │ ├── PoiUtils.java │ │ │ ├── ReflectionUtils.java │ │ │ └── SecurityUtils.java │ └── resources │ │ ├── application.yml │ │ ├── banner.txt │ │ ├── fastdfs-client.properties │ │ ├── generatorConfig.xml │ │ ├── jdbc.properties │ │ └── mapper │ │ ├── ConfigMapper.xml │ │ ├── CustomerMapper.xml │ │ ├── DeptMapper.xml │ │ ├── DictMapper.xml │ │ ├── LogMapper.xml │ │ ├── LoginLogMapper.xml │ │ ├── MenuMapper.xml │ │ ├── RoleDeptMapper.xml │ │ ├── RoleMapper.xml │ │ ├── RoleMenuMapper.xml │ │ ├── UserMapper.xml │ │ └── UserRoleMapper.xml │ └── test │ └── java │ └── cn │ └── jjvu │ └── xiao │ ├── AppTest.java │ └── AppUtilsTest.java ├── live_shop_web ├── .babelrc ├── .editorconfig ├── .gitignore ├── .postcssrc.js ├── README.md ├── build │ ├── build.js │ ├── check-versions.js │ ├── logo.png │ ├── utils.js │ ├── vue-loader.conf.js │ ├── webpack.base.conf.js │ ├── webpack.dev.conf.js │ └── webpack.prod.conf.js ├── config │ ├── dev.env.js │ ├── index.js │ └── prod.env.js ├── index.html ├── package-lock.json ├── package.json ├── src │ ├── App.vue │ ├── assets │ │ ├── languages │ │ │ ├── en_us.json │ │ │ └── zh_cn.json │ │ ├── logo.png │ │ └── user.png │ ├── components │ │ └── Hamburger │ │ │ └── index.vue │ ├── http │ │ ├── api.js │ │ ├── axios.js │ │ ├── config.js │ │ ├── index.js │ │ └── modules │ │ │ ├── config.js │ │ │ ├── dept.js │ │ │ ├── dict.js │ │ │ ├── log.js │ │ │ ├── login.js │ │ │ ├── loginlog.js │ │ │ ├── menu.js │ │ │ ├── role.js │ │ │ └── user.js │ ├── i18n │ │ └── index.js │ ├── main.js │ ├── mock │ │ ├── index.js │ │ └── modules │ │ │ ├── config.js │ │ │ ├── dept.js │ │ │ ├── dict.js │ │ │ ├── log.js │ │ │ ├── login.js │ │ │ ├── loginlog.js │ │ │ ├── menu.js │ │ │ ├── role.js │ │ │ └── user.js │ ├── router │ │ └── index.js │ ├── store │ │ ├── index.js │ │ └── modules │ │ │ └── app.js │ ├── utils │ │ ├── datetime.js │ │ ├── global.js │ │ ├── iframe.js │ │ └── validate.js │ └── views │ │ ├── 404.vue │ │ ├── HeadBar.vue │ │ ├── Home.vue │ │ ├── Login.vue │ │ ├── MainContent.vue │ │ └── NavBar.vue └── static │ └── .gitkeep ├── readme.md └── readme ├── image0.jpg ├── image1.jpg ├── image2.JPG ├── image3.JPG ├── image4.JPG ├── image5.jpg ├── image6.jpg └── show3.JPG /.gitattributes: -------------------------------------------------------------------------------- 1 | *.java linguist-language=dart 2 | *.html linguist-language=dart 3 | *.vue linguist-language=dart 4 | *.css linguist-language=dart -------------------------------------------------------------------------------- /flutter常用插件.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/flutter常用插件.txt -------------------------------------------------------------------------------- /live_shop_client/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # Visual Studio Code related 19 | .vscode/ 20 | 21 | # Flutter/Dart/Pub related 22 | **/doc/api/ 23 | .dart_tool/ 24 | .flutter-plugins 25 | .packages 26 | .pub-cache/ 27 | .pub/ 28 | /build/ 29 | 30 | # Android related 31 | **/android/**/gradle-wrapper.jar 32 | **/android/.gradle 33 | **/android/captures/ 34 | **/android/gradlew 35 | **/android/gradlew.bat 36 | **/android/local.properties 37 | **/android/**/GeneratedPluginRegistrant.java 38 | 39 | # iOS/XCode related 40 | **/ios/**/*.mode1v3 41 | **/ios/**/*.mode2v3 42 | **/ios/**/*.moved-aside 43 | **/ios/**/*.pbxuser 44 | **/ios/**/*.perspectivev3 45 | **/ios/**/*sync/ 46 | **/ios/**/.sconsign.dblite 47 | **/ios/**/.tags* 48 | **/ios/**/.vagrant/ 49 | **/ios/**/DerivedData/ 50 | **/ios/**/Icon? 51 | **/ios/**/Pods/ 52 | **/ios/**/.symlinks/ 53 | **/ios/**/profile 54 | **/ios/**/xcuserdata 55 | **/ios/.generated/ 56 | **/ios/Flutter/App.framework 57 | **/ios/Flutter/Flutter.framework 58 | **/ios/Flutter/Generated.xcconfig 59 | **/ios/Flutter/app.flx 60 | **/ios/Flutter/app.zip 61 | **/ios/Flutter/flutter_assets/ 62 | **/ios/ServiceDefinitions.json 63 | **/ios/Runner/GeneratedPluginRegistrant.* 64 | 65 | # Exceptions to above rules. 66 | !**/ios/**/default.mode1v3 67 | !**/ios/**/default.mode2v3 68 | !**/ios/**/default.pbxuser 69 | !**/ios/**/default.perspectivev3 70 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 71 | -------------------------------------------------------------------------------- /live_shop_client/.gradle/5.6.4/fileChanges/last-build.bin: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /live_shop_client/.gradle/5.6.4/fileHashes/fileHashes.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/.gradle/5.6.4/fileHashes/fileHashes.lock -------------------------------------------------------------------------------- /live_shop_client/.gradle/5.6.4/gc.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/.gradle/5.6.4/gc.properties -------------------------------------------------------------------------------- /live_shop_client/.gradle/buildOutputCleanup/buildOutputCleanup.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/.gradle/buildOutputCleanup/buildOutputCleanup.lock -------------------------------------------------------------------------------- /live_shop_client/.gradle/buildOutputCleanup/cache.properties: -------------------------------------------------------------------------------- 1 | #Thu Jun 18 12:18:14 CST 2020 2 | gradle.version=5.6.4 3 | -------------------------------------------------------------------------------- /live_shop_client/.gradle/vcs-1/gc.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/.gradle/vcs-1/gc.properties -------------------------------------------------------------------------------- /live_shop_client/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 68587a0916366e9512a78df22c44163d041dd5f3 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /live_shop_client/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /live_shop_client/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 14 | 18 | 25 | 29 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /live_shop_client/android/app/src/main/kotlin/com/example/live_shop_client/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.live_shop_client 2 | 3 | import android.os.Bundle 4 | 5 | import io.flutter.app.FlutterActivity 6 | import io.flutter.plugins.GeneratedPluginRegistrant 7 | 8 | class MainActivity: FlutterActivity() { 9 | override fun onCreate(savedInstanceState: Bundle?) { 10 | super.onCreate(savedInstanceState) 11 | GeneratedPluginRegistrant.registerWith(this) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /live_shop_client/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /live_shop_client/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /live_shop_client/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /live_shop_client/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /live_shop_client/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /live_shop_client/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /live_shop_client/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /live_shop_client/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /live_shop_client/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.2.71' 3 | repositories { 4 | maven { url 'https://maven.aliyun.com/repository/google' } 5 | maven { url 'https://maven.aliyun.com/repository/jcenter' } 6 | maven { url 'http://maven.aliyun.com/nexus/content/groups/public'} 7 | maven { url 'https://maven.aliyun.com/repository/gradle-plugin'} 8 | } 9 | 10 | dependencies { 11 | classpath 'com.android.tools.build:gradle:3.2.1' 12 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 13 | } 14 | } 15 | 16 | allprojects { 17 | repositories { 18 | maven { url 'https://maven.aliyun.com/repository/google' } 19 | maven { url 'https://maven.aliyun.com/repository/jcenter' } 20 | maven { url 'http://maven.aliyun.com/nexus/content/groups/public'} 21 | maven { url 'https://maven.aliyun.com/repository/gradle-plugin'} 22 | } 23 | } 24 | 25 | rootProject.buildDir = '../build' 26 | subprojects { 27 | project.buildDir = "${rootProject.buildDir}/${project.name}" 28 | } 29 | subprojects { 30 | project.evaluationDependsOn(':app') 31 | } 32 | 33 | task clean(type: Delete) { 34 | delete rootProject.buildDir 35 | } 36 | -------------------------------------------------------------------------------- /live_shop_client/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | 3 | -------------------------------------------------------------------------------- /live_shop_client/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip 7 | -------------------------------------------------------------------------------- /live_shop_client/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 4 | 5 | def plugins = new Properties() 6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 7 | if (pluginsFile.exists()) { 8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } 9 | } 10 | 11 | plugins.each { name, path -> 12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 13 | include ":$name" 14 | project(":$name").projectDir = pluginDirectory 15 | } 16 | -------------------------------------------------------------------------------- /live_shop_client/assets/fonts/Flamante-Roma-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/fonts/Flamante-Roma-Medium.ttf -------------------------------------------------------------------------------- /live_shop_client/assets/fonts/Flamante-Roma-MediumItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/fonts/Flamante-Roma-MediumItalic.ttf -------------------------------------------------------------------------------- /live_shop_client/assets/fonts/Lato-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/fonts/Lato-Bold.ttf -------------------------------------------------------------------------------- /live_shop_client/assets/images/2.0x/chapter_8_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/2.0x/chapter_8_icon.png -------------------------------------------------------------------------------- /live_shop_client/assets/images/2.0x/macbookpro.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/2.0x/macbookpro.jpg -------------------------------------------------------------------------------- /live_shop_client/assets/images/2.0x/me.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/2.0x/me.jpg -------------------------------------------------------------------------------- /live_shop_client/assets/images/2.0x/my.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/2.0x/my.jpg -------------------------------------------------------------------------------- /live_shop_client/assets/images/2.0x/phone0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/2.0x/phone0.png -------------------------------------------------------------------------------- /live_shop_client/assets/images/2.0x/phone1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/2.0x/phone1.png -------------------------------------------------------------------------------- /live_shop_client/assets/images/2.0x/phone2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/2.0x/phone2.png -------------------------------------------------------------------------------- /live_shop_client/assets/images/2.0x/phone3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/2.0x/phone3.png -------------------------------------------------------------------------------- /live_shop_client/assets/images/2.0x/phone4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/2.0x/phone4.png -------------------------------------------------------------------------------- /live_shop_client/assets/images/2.0x/phone5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/2.0x/phone5.png -------------------------------------------------------------------------------- /live_shop_client/assets/images/2.0x/swipe1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/2.0x/swipe1.png -------------------------------------------------------------------------------- /live_shop_client/assets/images/3.0x/chapter_8_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/3.0x/chapter_8_icon.png -------------------------------------------------------------------------------- /live_shop_client/assets/images/3.0x/macbookpro.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/3.0x/macbookpro.jpg -------------------------------------------------------------------------------- /live_shop_client/assets/images/3.0x/me.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/3.0x/me.jpg -------------------------------------------------------------------------------- /live_shop_client/assets/images/3.0x/my.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/3.0x/my.jpg -------------------------------------------------------------------------------- /live_shop_client/assets/images/3.0x/phone0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/3.0x/phone0.png -------------------------------------------------------------------------------- /live_shop_client/assets/images/3.0x/phone1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/3.0x/phone1.png -------------------------------------------------------------------------------- /live_shop_client/assets/images/3.0x/phone2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/3.0x/phone2.png -------------------------------------------------------------------------------- /live_shop_client/assets/images/3.0x/phone3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/3.0x/phone3.png -------------------------------------------------------------------------------- /live_shop_client/assets/images/3.0x/phone4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/3.0x/phone4.png -------------------------------------------------------------------------------- /live_shop_client/assets/images/3.0x/phone5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/3.0x/phone5.png -------------------------------------------------------------------------------- /live_shop_client/assets/images/3.0x/phone6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/3.0x/phone6.png -------------------------------------------------------------------------------- /live_shop_client/assets/images/3.0x/swipe1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/3.0x/swipe1.png -------------------------------------------------------------------------------- /live_shop_client/assets/images/4.0x/chapter_8_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/4.0x/chapter_8_icon.png -------------------------------------------------------------------------------- /live_shop_client/assets/images/4.0x/macbookpro.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/4.0x/macbookpro.jpg -------------------------------------------------------------------------------- /live_shop_client/assets/images/4.0x/me.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/4.0x/me.jpg -------------------------------------------------------------------------------- /live_shop_client/assets/images/4.0x/my.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/4.0x/my.jpg -------------------------------------------------------------------------------- /live_shop_client/assets/images/4.0x/phone0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/4.0x/phone0.png -------------------------------------------------------------------------------- /live_shop_client/assets/images/4.0x/phone1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/4.0x/phone1.png -------------------------------------------------------------------------------- /live_shop_client/assets/images/4.0x/phone2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/4.0x/phone2.png -------------------------------------------------------------------------------- /live_shop_client/assets/images/4.0x/phone3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/4.0x/phone3.png -------------------------------------------------------------------------------- /live_shop_client/assets/images/4.0x/phone4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/4.0x/phone4.png -------------------------------------------------------------------------------- /live_shop_client/assets/images/4.0x/phone5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/4.0x/phone5.png -------------------------------------------------------------------------------- /live_shop_client/assets/images/4.0x/phone6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/4.0x/phone6.png -------------------------------------------------------------------------------- /live_shop_client/assets/images/4.0x/swipe1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/4.0x/swipe1.png -------------------------------------------------------------------------------- /live_shop_client/assets/images/chapter_8_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/chapter_8_icon.png -------------------------------------------------------------------------------- /live_shop_client/assets/images/macbookpro.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/macbookpro.jpg -------------------------------------------------------------------------------- /live_shop_client/assets/images/me.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/me.jpg -------------------------------------------------------------------------------- /live_shop_client/assets/images/my.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/my.jpg -------------------------------------------------------------------------------- /live_shop_client/assets/images/phone0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/phone0.png -------------------------------------------------------------------------------- /live_shop_client/assets/images/phone1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/phone1.png -------------------------------------------------------------------------------- /live_shop_client/assets/images/phone2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/phone2.png -------------------------------------------------------------------------------- /live_shop_client/assets/images/phone3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/phone3.png -------------------------------------------------------------------------------- /live_shop_client/assets/images/phone4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/phone4.png -------------------------------------------------------------------------------- /live_shop_client/assets/images/phone5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/phone5.png -------------------------------------------------------------------------------- /live_shop_client/assets/images/room0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/room0.png -------------------------------------------------------------------------------- /live_shop_client/assets/images/swipe1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/assets/images/swipe1.png -------------------------------------------------------------------------------- /live_shop_client/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | -------------------------------------------------------------------------------- /live_shop_client/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /live_shop_client/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu Jun 18 12:17:49 CST 2020 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip 7 | -------------------------------------------------------------------------------- /live_shop_client/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /live_shop_client/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /live_shop_client/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /live_shop_client/ios/Flutter/flutter_export_environment.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # This is a generated file; do not edit or check into version control. 3 | export "FLUTTER_ROOT=/Users/xiaohongbing/Documents/flutter" 4 | export "FLUTTER_APPLICATION_PATH=/Users/xiaohongbing/Documents/liveshop/live_shop_client" 5 | export "FLUTTER_TARGET=/Users/xiaohongbing/Documents/liveshop/live_shop_client/lib/main.dart" 6 | export "FLUTTER_BUILD_DIR=build" 7 | export "SYMROOT=${SOURCE_ROOT}/../build/ios" 8 | export "FLUTTER_FRAMEWORK_DIR=/Users/xiaohongbing/Documents/flutter/bin/cache/artifacts/engine/ios" 9 | export "FLUTTER_BUILD_NAME=1.0.0" 10 | export "FLUTTER_BUILD_NUMBER=1" 11 | -------------------------------------------------------------------------------- /live_shop_client/ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Flutter (1.0.0) 3 | - fluttertoast (0.0.2): 4 | - Flutter 5 | 6 | DEPENDENCIES: 7 | - Flutter (from `.symlinks/flutter/ios`) 8 | - fluttertoast (from `.symlinks/plugins/fluttertoast/ios`) 9 | 10 | EXTERNAL SOURCES: 11 | Flutter: 12 | :path: ".symlinks/flutter/ios" 13 | fluttertoast: 14 | :path: ".symlinks/plugins/fluttertoast/ios" 15 | 16 | SPEC CHECKSUMS: 17 | Flutter: 0e3d915762c693b495b44d77113d4970485de6ec 18 | fluttertoast: b644586ef3b16f67fae9a1f8754cef6b2d6b634b 19 | 20 | PODFILE CHECKSUM: b6a0a141693093b304368d08511b46cf3d1d0ac5 21 | 22 | COCOAPODS: 1.9.1 23 | -------------------------------------------------------------------------------- /live_shop_client/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /live_shop_client/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /live_shop_client/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /live_shop_client/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /live_shop_client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /live_shop_client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /live_shop_client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /live_shop_client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /live_shop_client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /live_shop_client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /live_shop_client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /live_shop_client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /live_shop_client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /live_shop_client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /live_shop_client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /live_shop_client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /live_shop_client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /live_shop_client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /live_shop_client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /live_shop_client/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /live_shop_client/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /live_shop_client/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /live_shop_client/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_client/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /live_shop_client/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /live_shop_client/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /live_shop_client/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | live_shop_client 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /live_shop_client/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" -------------------------------------------------------------------------------- /live_shop_client/lib/common/AppConstants.dart: -------------------------------------------------------------------------------- 1 | import 'dart:core'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class AppConstants { 5 | // 主题颜色 6 | static Color primaryColor = Colors.blue; 7 | // 被激活时的颜色 8 | static Color activeColor = Colors.red; 9 | // 曾经访问过的颜色 10 | static Color visitedColor = Colors.grey; 11 | 12 | static Color PRIMARY_COLOR = Colors.white; 13 | 14 | // 服务器地址 15 | static const String BASE_URL = "http://192.168.179.1:85"; 16 | 17 | static const int CONNECT_TIMEOUT = 300000; 18 | 19 | static const int RECEIVE_TIMEOUT = 600000; 20 | 21 | static const String CHAR_SEQUENCE = "\t"; 22 | 23 | static const double FONT_SIZE = 14.0; 24 | 25 | // 本地的图片路径前缀 26 | static const String NATIVE_IMAGE_PATH = "assets/images/"; 27 | 28 | // 基础服务器地址 29 | static const basicUrl = "http://192.168.179.1:85"; 30 | } -------------------------------------------------------------------------------- /live_shop_client/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'dart:core'; 2 | 3 | import 'package:fluro/fluro.dart'; 4 | import 'package:flutter/cupertino.dart'; 5 | import 'package:flutter/material.dart'; 6 | import 'package:flutter_easyloading/flutter_easyloading.dart'; 7 | import 'package:flutter_localizations/flutter_localizations.dart'; 8 | import 'package:liveshop/login.dart'; 9 | import 'package:liveshop/route/Application.dart'; 10 | import 'package:liveshop/route/Routers.dart'; 11 | import 'package:liveshop/util/HttpUtil.dart'; 12 | import 'package:liveshop/util/LogUtil.dart'; 13 | 14 | 15 | 16 | void main() => runApp(new App()); 17 | 18 | /// 初始化Fluto路由 19 | /// 初始化日志工具,网络请求日志,loading进度条,国际化 20 | class App extends StatelessWidget { 21 | @override 22 | Widget build(BuildContext context) { 23 | final router = Router(); 24 | Routers.configureRoutes(router); 25 | Application.router = router; 26 | LogUtil.init(isDebug: true); 27 | HttpUtil.init(); 28 | return FlutterEasyLoading( 29 | child: MaterialApp( 30 | title: '绿源直播', 31 | onGenerateRoute: Application.router.generator, 32 | debugShowCheckedModeBanner: false, 33 | theme: ThemeData( 34 | primaryColor: Colors.white 35 | ), 36 | home: LoginRoute(), 37 | localizationsDelegates: [ 38 | GlobalMaterialLocalizations.delegate, 39 | GlobalWidgetsLocalizations.delegate, 40 | ], 41 | supportedLocales: [ 42 | const Locale('zh', 'CH'), 43 | const Locale('en', 'US'), 44 | ] 45 | ) 46 | ); 47 | } 48 | 49 | void configLoading() { 50 | // EasyLoading.instance 51 | // ..displayDuration = const Duration(milliseconds: 2000) 52 | // ..indicatorType = EasyLoadingIndicatorType.fadingCircle 53 | // ..loadingStyle = EasyLoadingStyle.dark 54 | // ..indicatorSize = 45.0 55 | // ..radius = 10.0 56 | // ..progressColor = Colors.yellow 57 | // ..backgroundColor = Colors.green 58 | // ..indicatorColor = Colors.yellow 59 | // ..textColor = Colors.yellow 60 | // ..maskColor = Colors.blue.withOpacity(0.5) 61 | // ..userInteractions = true; 62 | } 63 | } 64 | 65 | -------------------------------------------------------------------------------- /live_shop_client/lib/model/basicModel.dart: -------------------------------------------------------------------------------- 1 | import 'dart:collection'; 2 | 3 | import 'package:flutter/widgets.dart'; 4 | 5 | class BasicModel { 6 | int code; 7 | String msg; 8 | // HashMap 9 | BasicModel({this.code, this.msg}); 10 | } 11 | 12 | class SkuModel { 13 | Image image; 14 | String title; 15 | SkuModel({this.title, this.image}); 16 | } 17 | -------------------------------------------------------------------------------- /live_shop_client/lib/route/Application.dart: -------------------------------------------------------------------------------- 1 | import 'package:fluro/fluro.dart'; 2 | 3 | class Application { 4 | static Router router; 5 | } -------------------------------------------------------------------------------- /live_shop_client/lib/route/RouterHandler.dart: -------------------------------------------------------------------------------- 1 | import 'package:fluro/fluro.dart'; 2 | import 'package:flutter/cupertino.dart'; 3 | import 'package:liveshop/login.dart'; 4 | import 'package:liveshop/view/EditInfoRoute.dart'; 5 | import 'package:liveshop/view/HomeRoute.dart'; 6 | import 'package:liveshop/view/RegisterRouter.dart'; 7 | 8 | /// 路由表对应的路由处理 9 | /// xiao 10 | /// 2020-07-28 11 | 12 | /// handler就是每个路由的规则,编写handler就是配置路由规则, 13 | /// 比如我们要传递参数,参数的值是什么,这些都需要在Handler中完成。 14 | 15 | /// 首页 16 | Handler indexPageHander = Handler( 17 | handlerFunc: (BuildContext context, Map> params) { 18 | String loginname = params['loginname'].first; 19 | return HomeRoute(loginname: loginname); 20 | }, 21 | ); 22 | 23 | //// 正常路由跳转 24 | //Handler normalPageHanderl = Handler( 25 | // handlerFunc: (BuildContext context, Map> params) { 26 | // return NormalPage(); 27 | // } 28 | //); 29 | // 30 | //// 路由传参 31 | //Handler routingReferenceHanderl = Handler( 32 | // handlerFunc: (BuildContext context, Map> params) { 33 | // String id = params['id'].first; 34 | // return RoutingReference(id: id); 35 | // } 36 | //); 37 | 38 | // 登陆页面 39 | Handler loginHanderl = Handler( 40 | handlerFunc: (BuildContext context, Map> params) { 41 | String loginname = params['loginname'].first; 42 | String passwd = params['passwd'].first; 43 | return LoginRoute(loginname: loginname, passwd: passwd); 44 | } 45 | ); 46 | 47 | // 注册页面 48 | Handler registerHandler = Handler( 49 | handlerFunc: (BuildContext context, Map> params) { 50 | return RegisterRouter(); 51 | } 52 | ); 53 | 54 | // 用户信息编辑页面 55 | Handler profileHandler = Handler( 56 | handlerFunc: (BuildContext context, Map> params) { 57 | String loginname = params['loginname'].first; 58 | String method = params['method'].first; 59 | return EditInfoRoute(loginname: loginname, method: method); 60 | } 61 | ); 62 | -------------------------------------------------------------------------------- /live_shop_client/lib/route/Routers.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:fluro/fluro.dart'; 3 | import 'package:liveshop/route/RouterHandler.dart'; 4 | import 'package:liveshop/util/LogUtil.dart'; 5 | 6 | class Routers { 7 | 8 | static String root = '/'; 9 | 10 | static String indexPage = '/index'; 11 | 12 | static String normalPage = '/normalPage'; 13 | 14 | static String routingReference = '/routingReference'; 15 | 16 | static String login = '/login'; 17 | 18 | static String register = '/register'; 19 | 20 | static String editInfo = '/editInfo'; 21 | 22 | static void configureRoutes(Router router) { 23 | router.notFoundHandler = new Handler( 24 | handlerFunc: (BuildContext context, Map> params) { 25 | LogUtil.v('ERROR====>ROUTE WAS NOT FONUND!!!'); // 找不到路由,跳转404页面 26 | LogUtil.v('找不到路由,404'); 27 | }, 28 | ); 29 | 30 | // 路由页面配置 31 | router.define(indexPage, handler: indexPageHander); 32 | // router.define(normalPage, handler: normalPageHanderl); 33 | // router.define(routingReference, handler: routingReferenceHanderl); 34 | router.define(login, handler: loginHanderl); 35 | 36 | router.define(register, handler: registerHandler); 37 | 38 | router.define(editInfo, handler: profileHandler); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /live_shop_client/lib/util/EventBus.dart: -------------------------------------------------------------------------------- 1 | // 订阅者回调签名 2 | typedef void EventCallback(arg); 3 | 4 | class EventBus { 5 | /// 私有构造函数 6 | EventBus._internal(); 7 | 8 | /// 保存单例 9 | static EventBus _singleton = new EventBus._internal(); 10 | 11 | /// 工厂构造函数 12 | factory EventBus() => _singleton; 13 | 14 | /// 保存事件订阅者队列,key:事件名(id),value: 对应事件的订阅者队列 15 | var _eMap = new Map>(); 16 | 17 | /// 添加订阅者 18 | void on(eventName, EventCallback f) { 19 | if (eventName == null || f == null) return; 20 | _eMap[eventName] ??= new List(); 21 | _eMap[eventName].add(f); 22 | } 23 | 24 | /// 移除订阅者 25 | void off(eventName, [EventCallback f]) { 26 | var list = _eMap[eventName]; 27 | if (eventName == null || list == null) return; 28 | if (f == null) { 29 | _eMap[eventName] = null; 30 | } else { 31 | list.remove(f); 32 | } 33 | } 34 | 35 | /// 触发事件,事件触发后该事件所有订阅者会被调用 36 | void send(eventName, [arg]) { 37 | var list = _eMap[eventName]; 38 | if (list == null) return; 39 | int len = list.length - 1; 40 | //反向遍历,防止订阅者在回调中移除自身带来的下标错位 41 | for (var i = len; i > -1; --i) { 42 | list[i](arg); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /live_shop_client/lib/util/LiveShopUtil.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | /// 字符串工具 3 | class LiveShopStringUtil { 4 | /// 格式化城市信息 5 | static String formatCity(String cityJson) { 6 | var data = jsonDecode(cityJson); 7 | var provinceName = data['provinceName']; 8 | var cityName = data['cityName']; 9 | var areaName = data['areaName']; 10 | return '$provinceName-$cityName-$areaName'; 11 | } 12 | } -------------------------------------------------------------------------------- /live_shop_client/lib/util/LogUtil.dart: -------------------------------------------------------------------------------- 1 | /// 日志打印工具 2 | class LogUtil { 3 | static const String _TAG_DEF = "###Xiao###"; 4 | static bool debuggable = false; //是否是debug模式,true: log v 不输出. 5 | static String TAG = _TAG_DEF; 6 | 7 | /// 初始化日志工具配置 8 | static void init({bool isDebug = false, String tag = _TAG_DEF}) { 9 | debuggable = isDebug; 10 | TAG = tag; 11 | } 12 | 13 | static void e(Object object, {String tag}) { 14 | _printLog(tag, ' e ', object); 15 | } 16 | 17 | static void v(Object object, {String tag}) { 18 | if (debuggable) { 19 | _printLog(tag, ' v ', object); 20 | } 21 | } 22 | 23 | static void _printLog(String tag, String stag, Object object) { 24 | StringBuffer sb = new StringBuffer(); 25 | sb.write((tag == null || tag.isEmpty) ? TAG : tag); 26 | sb.write(stag); 27 | sb.write(object); 28 | print(sb.toString()); 29 | } 30 | } -------------------------------------------------------------------------------- /live_shop_client/lib/view/MsgRoute.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:liveshop/common/AppConstants.dart'; 3 | /// 消息页 4 | class MsgRoute extends StatefulWidget { 5 | @override 6 | _MsgRouteState createState() => _MsgRouteState(); 7 | } 8 | 9 | class _MsgRouteState extends State { 10 | Widget avatar = Image.asset( 11 | AppConstants.NATIVE_IMAGE_PATH + "my.jpg", 12 | width: 50.0, 13 | height: 50.0, 14 | ); 15 | 16 | Widget divider1 = Divider( 17 | color: Colors.blue, 18 | ); 19 | Widget divider2 = Divider(color: Colors.green); 20 | 21 | @override 22 | Widget build(BuildContext context) { 23 | // TODO: implement build 24 | return Container( 25 | color: Colors.white, 26 | child: 27 | ListView.separated( 28 | itemCount: 20, 29 | // itemExtent: , 30 | shrinkWrap: true, 31 | padding: const EdgeInsets.all(20.0), 32 | separatorBuilder: (context, index) { 33 | return index % 2 == 0 ? divider1 : divider2; 34 | }, 35 | itemBuilder: (context, int index) { 36 | return ListTile( 37 | title: Text("我是爵哥"), 38 | leading: ClipOval( 39 | child: avatar, 40 | ), 41 | subtitle: Text("Hello Baby"), 42 | trailing: Text("11:18"), 43 | ); 44 | }, 45 | ) 46 | ); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /live_shop_client/lib/widget/BeautifulButton.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class GradientButton extends StatelessWidget { 4 | // 渐变色数组 5 | final List colors; 6 | 7 | // 按钮宽高 8 | final double width; 9 | final double height; 10 | 11 | final Widget child; 12 | final BorderRadius borderRadius; 13 | 14 | //点击回调 15 | final GestureTapCallback onPressed; 16 | 17 | GradientButton({ 18 | this.colors, 19 | this.width, 20 | this.height, 21 | this.onPressed, 22 | this.borderRadius, 23 | @required this.child, 24 | }); 25 | 26 | @override 27 | Widget build(BuildContext context) { 28 | // TODO: implement build 29 | return null; 30 | } 31 | } 32 | 33 | class CustomPaintRoute extends StatelessWidget { 34 | @override 35 | Widget build(BuildContext context) { 36 | // TODO: implement build 37 | // return ListView( 38 | // children: [ 39 | // CustomPaint( 40 | // size: Size(300, 300), 41 | // painter: MyPainter(), 42 | // ), 43 | return Container( 44 | child: Stack( 45 | alignment: Alignment.center, 46 | children: [ 47 | Positioned(child: null,) 48 | ], 49 | ) 50 | ); 51 | // ] 52 | // ); 53 | } 54 | } 55 | 56 | class MyPainter extends CustomPainter { 57 | @override 58 | void paint(Canvas canvas, Size size) { 59 | Paint p = Paint() 60 | ..color = Colors.blueAccent 61 | ..strokeCap = StrokeCap.round 62 | ..isAntiAlias = true 63 | ..strokeWidth = 5.0 64 | ..style = PaintingStyle.stroke; 65 | // canvas.drawLine(Offset(10, 10), Offset(250, 250), p); 66 | canvas.drawCircle(Offset(125, 125), 20, p); 67 | } 68 | 69 | @override 70 | bool shouldRepaint(CustomPainter oldDelegate) { 71 | // TODO: implement shouldRepaint 72 | return null; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /live_shop_client/lib/widget/ListOptionsItem.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:liveshop/common/AppConstants.dart'; 3 | 4 | class ListOptionItem extends StatefulWidget { 5 | 6 | IconData _mainIcon; 7 | 8 | String _content; 9 | 10 | Function onClick; 11 | 12 | ListOptionItem(mainIcon, content, onClick) { 13 | this._mainIcon = mainIcon; 14 | this._content = content; 15 | this.onClick = onClick; 16 | } 17 | 18 | @override 19 | ListOptionItemState createState() => ListOptionItemState(_mainIcon, _content, onClick); 20 | } 21 | 22 | class ListOptionItemState extends State { 23 | 24 | IconData _mainIcon; 25 | 26 | String _content; 27 | 28 | Function onClick; 29 | 30 | bool isActive = false; 31 | 32 | ListOptionItemState(mainIcon, content, onClick) { 33 | this._mainIcon = mainIcon; 34 | this._content = content; 35 | this.onClick = onClick; 36 | } 37 | 38 | @override 39 | Widget build(BuildContext context) { 40 | // TODO: implement build 41 | return Container( 42 | child: ListTile( 43 | leading: Icon(_mainIcon, color: Colors.black,), 44 | trailing: Icon(Icons.arrow_forward_ios), 45 | title: Text( 46 | _content, 47 | style: TextStyle( 48 | fontSize: AppConstants.FONT_SIZE, 49 | color: Colors.black87, 50 | fontWeight: FontWeight.normal 51 | ), 52 | ), 53 | onTap: this.onClick 54 | ), 55 | decoration: BoxDecoration( 56 | color: !isActive ? Colors.white : Colors.lightBlue, 57 | border: Border( 58 | bottom: BorderSide( 59 | width: 1, 60 | color: Colors.blue, //边框颜色 61 | ), 62 | ), 63 | ) 64 | ); 65 | } 66 | } -------------------------------------------------------------------------------- /live_shop_client/lib/widget/LoadingDialog.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class LoadingDialog extends Dialog { 4 | final String text; 5 | 6 | LoadingDialog({Key key, @required this.text}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return new Material( 11 | type: MaterialType.transparency, 12 | child: new Center( 13 | child: new SizedBox( 14 | width: 120.0, 15 | height: 120.0, 16 | child: new Container( 17 | decoration: ShapeDecoration( 18 | color: Color(0xffffffff), 19 | shape: RoundedRectangleBorder( 20 | borderRadius: BorderRadius.all( 21 | Radius.circular(8.0), 22 | ), 23 | ), 24 | ), 25 | child: new Column( 26 | mainAxisAlignment: MainAxisAlignment.center, 27 | crossAxisAlignment: CrossAxisAlignment.center, 28 | children: [ 29 | new CircularProgressIndicator(), 30 | new Padding( 31 | padding: const EdgeInsets.only( 32 | top: 20.0, 33 | ), 34 | child: new Text(text), 35 | ), 36 | ], 37 | ), 38 | ), 39 | ), 40 | ), 41 | ); 42 | } 43 | } -------------------------------------------------------------------------------- /live_shop_client/lib/widget/NewsButton.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:liveshop/common/AppConstants.dart'; 3 | 4 | /** 5 | * 块状圆角按钮 6 | */ 7 | class NewsBlockButton extends StatefulWidget { 8 | String _text = "确定"; 9 | 10 | // 当前显示颜色 11 | Color showColor = AppConstants.primaryColor; 12 | 13 | var _pressFunction; 14 | 15 | NewsBlockButton(String text, Color showColor, pressFunction) { 16 | this._text = text; 17 | this.showColor = showColor; 18 | this._pressFunction = pressFunction; 19 | } 20 | 21 | @override 22 | _NewsBlockButton createState() => 23 | _NewsBlockButton(_text, showColor, _pressFunction); 24 | } 25 | 26 | class _NewsBlockButton extends State { 27 | _NewsBlockButton(String text, Color showColor, _pressFunction) { 28 | this._text = text; 29 | this.showColor = showColor; 30 | this._pressFunction = _pressFunction; 31 | } 32 | 33 | String _text; 34 | 35 | // 当前显示颜色 36 | Color showColor; 37 | 38 | // 点击处理 39 | var _pressFunction; 40 | 41 | @override 42 | Widget build(BuildContext context) { 43 | // TODO: implement build 44 | return FlatButton( 45 | color: showColor, 46 | highlightColor: Colors.blue[700], 47 | colorBrightness: Brightness.dark, 48 | splashColor: Colors.grey, 49 | child: Text(_text), 50 | // 设置成圆角 51 | shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20.0)), 52 | onPressed: this._pressFunction, 53 | ); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /live_shop_client/lib/widget/OASwiper.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_swiper/flutter_swiper.dart'; 3 | import 'package:liveshop/common/AppConstants.dart'; 4 | /// 主页轮播图 5 | /// XiaoHongBing 6 | class SwiperPage extends StatefulWidget { 7 | SwiperPage({Key key, this.title}) : super(key: key); 8 | 9 | final String title; 10 | 11 | @override 12 | _SwiperPageState createState() => new _SwiperPageState(); 13 | } 14 | 15 | class _SwiperPageState extends State { 16 | 17 | List data = [ 18 | {"url": AppConstants.NATIVE_IMAGE_PATH + "swipe1.png"}, 19 | {"url": AppConstants.NATIVE_IMAGE_PATH + "swipe1.png"}, 20 | {"url": AppConstants.NATIVE_IMAGE_PATH + "swipe1.png"}, 21 | ]; 22 | 23 | @override 24 | Widget build(BuildContext context) { 25 | return 26 | Swiper( 27 | itemBuilder: (BuildContext context, int index) { 28 | return Padding( 29 | padding: const EdgeInsets.all(8.0), 30 | child: 31 | Image.asset( 32 | this.data[index]["url"], 33 | fit: BoxFit.fill, 34 | ) 35 | ); 36 | }, 37 | itemCount: this.data.length, 38 | pagination: SwiperPagination(), 39 | control: SwiperControl(), 40 | ); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /live_shop_client/lib/widget/SearchBar.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | // ignore: camel_case_types 4 | class searchBarDelegate extends SearchDelegate { 5 | @override 6 | List buildActions(BuildContext context) { 7 | return [ 8 | IconButton( 9 | icon: Icon(Icons.clear), 10 | onPressed: () { 11 | query = ""; 12 | showSuggestions(context); 13 | }, 14 | ), 15 | ]; 16 | } 17 | 18 | @override 19 | Widget buildLeading(BuildContext context) { 20 | return IconButton( 21 | icon: AnimatedIcon( 22 | icon: AnimatedIcons.menu_arrow, progress: transitionAnimation), 23 | onPressed: () { 24 | if (query.isEmpty) { 25 | close(context, null); 26 | } else { 27 | query = ""; 28 | showSuggestions(context); 29 | } 30 | }, 31 | ); 32 | } 33 | 34 | @override 35 | Widget buildResults(BuildContext context) { 36 | return null; 37 | } 38 | 39 | @override 40 | Widget buildSuggestions(BuildContext context) { 41 | return null; 42 | } 43 | 44 | @override 45 | ThemeData appBarTheme(BuildContext context) { 46 | assert(context != null); 47 | final ThemeData theme = Theme.of(context); 48 | assert(theme != null); 49 | return theme.copyWith( 50 | primaryColor: Colors.white, 51 | primaryIconTheme: theme.primaryIconTheme.copyWith(color: Colors.grey), 52 | primaryColorBrightness: Brightness.light, 53 | primaryTextTheme: theme.textTheme, 54 | ); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /live_shop_client/lib/widget/SkuHomeList.dart: -------------------------------------------------------------------------------- 1 | import 'dart:core'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:liveshop/common/AppConstants.dart'; 5 | import 'package:liveshop/model/basicModel.dart'; 6 | 7 | import 'CardWidget.dart'; 8 | 9 | class SkuHomeList extends StatefulWidget { 10 | @override 11 | _SkuHomeListState createState() => _SkuHomeListState(); 12 | 13 | } 14 | 15 | class _SkuHomeListState extends State { 16 | 17 | List _cards = new List(); 18 | 19 | List datas = new List(); 20 | 21 | List leftDatas = new List(); 22 | 23 | List rightDatas = new List(); 24 | 25 | @override 26 | void initState() { 27 | // TODO: implement initState 28 | super.initState(); 29 | _getData(); 30 | initView(); 31 | } 32 | 33 | @override 34 | Widget build(BuildContext context) { 35 | // TODO: implement build 36 | return ListView( 37 | shrinkWrap: true, 38 | physics: NeverScrollableScrollPhysics(), 39 | padding: const EdgeInsets.all(20.0), 40 | children: _cards 41 | ); 42 | } 43 | 44 | void _getData() { 45 | for (int i = 0; i < 6; i++) { 46 | String imagePath = AppConstants.NATIVE_IMAGE_PATH + "phone$i.png"; 47 | var image = Image.asset(imagePath, width: 100.0,); 48 | String title = "iphone${i+1}"; 49 | var sku = SkuModel(image: image, title: title); 50 | i % 2 == 0 ? leftDatas.add(sku) : rightDatas.add(sku); 51 | } 52 | } 53 | 54 | void initView() { 55 | for (int i = 0; i < rightDatas.length; i++) { 56 | var leftSku = CardWidget(leftDatas[i].image, leftDatas[i].title); 57 | var rightSku = CardWidget(rightDatas[i].image, rightDatas[i].title); 58 | var rowWidget = Flex( 59 | direction: Axis.horizontal, 60 | children: [ 61 | Expanded(child: leftSku, flex: 1,), 62 | Expanded(child: rightSku, flex: 1,), 63 | ], 64 | ); 65 | _cards.add(rowWidget); 66 | } 67 | } 68 | } -------------------------------------------------------------------------------- /live_shop_client/local.properties: -------------------------------------------------------------------------------- 1 | ## This file must *NOT* be checked into Version Control Systems, 2 | # as it contains information specific to your local configuration. 3 | # 4 | # Location of the SDK. This is only used by Gradle. 5 | # For customization when using a Version Control System, please read the 6 | # header note. 7 | #Thu Jun 18 12:15:54 CST 2020 8 | sdk.dir=D\:\\AndroidStudio\\AppData\\Local\\Android\\sdk 9 | -------------------------------------------------------------------------------- /live_shop_client/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | import 'package:liveshop/main.dart'; 11 | 12 | void main() { 13 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 14 | // Build our app and trigger a frame. 15 | await tester.pumpWidget(App()); 16 | 17 | // Verify that our counter starts at 0. 18 | expect(find.text('0'), findsOneWidget); 19 | expect(find.text('1'), findsNothing); 20 | 21 | // Tap the '+' icon and trigger a frame. 22 | await tester.tap(find.byIcon(Icons.add)); 23 | await tester.pump(); 24 | 25 | // Verify that our counter has incremented. 26 | expect(find.text('0'), findsNothing); 27 | expect(find.text('1'), findsOneWidget); 28 | }); 29 | } 30 | -------------------------------------------------------------------------------- /live_shop_server/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | C:/ 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/** 17 | /target/* 18 | 19 | # Visual Studio Code related 20 | .vscode/ 21 | 22 | # Flutter/Dart/Pub related 23 | **/doc/api/ 24 | .dart_tool/ 25 | .flutter-plugins 26 | .packages 27 | .pub-cache/ 28 | .pub/ 29 | /build/ 30 | 31 | # Android related 32 | **/android/**/gradle-wrapper.jar 33 | **/android/.gradle 34 | **/android/captures/ 35 | **/android/gradlew 36 | **/android/gradlew.bat 37 | **/android/local.properties 38 | **/android/**/GeneratedPluginRegistrant.java 39 | 40 | # iOS/XCode related 41 | **/ios/**/*.mode1v3 42 | **/ios/**/*.mode2v3 43 | **/ios/**/*.moved-aside 44 | **/ios/**/*.pbxuser 45 | **/ios/**/*.perspectivev3 46 | **/ios/**/*sync/ 47 | **/ios/**/.sconsign.dblite 48 | **/ios/**/.tags* 49 | **/ios/**/.vagrant/ 50 | **/ios/**/DerivedData/ 51 | **/ios/**/Icon? 52 | **/ios/**/Pods/ 53 | **/ios/**/.symlinks/ 54 | **/ios/**/profile 55 | **/ios/**/xcuserdata 56 | **/ios/.generated/ 57 | **/ios/Flutter/App.framework 58 | **/ios/Flutter/Flutter.framework 59 | **/ios/Flutter/Generated.xcconfig 60 | **/ios/Flutter/app.flx 61 | **/ios/Flutter/app.zip 62 | **/ios/Flutter/flutter_assets/ 63 | **/ios/ServiceDefinitions.json 64 | **/ios/Runner/GeneratedPluginRegistrant.* 65 | 66 | # Exceptions to above rules. 67 | !**/ios/**/default.mode1v3 68 | !**/ios/**/default.mode2v3 69 | !**/ios/**/default.pbxuser 70 | !**/ios/**/default.perspectivev3 71 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 72 | /target/ 73 | -------------------------------------------------------------------------------- /live_shop_server/lib/fastdfs-client-java-1.29-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_server/lib/fastdfs-client-java-1.29-SNAPSHOT.jar -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/App.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao; 2 | 3 | //import de.codecentric.boot.admin.server.config.EnableAdminServer; 4 | import org.mybatis.spring.annotation.MapperScan; 5 | import org.springframework.boot.SpringApplication; 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; 7 | import org.springframework.context.annotation.Bean; 8 | import org.springframework.transaction.PlatformTransactionManager; 9 | import org.springframework.transaction.annotation.EnableTransactionManagement; 10 | 11 | /** 12 | * Hello world! 13 | * 14 | */ 15 | @EnableTransactionManagement // 开启事务 16 | @MapperScan("cn.jjvu.xiao.dao") // 开启 MyBatis扫描 17 | @SpringBootApplication 18 | //@EnableAdminServer // 开启监控管理 19 | public class App 20 | { 21 | public static void main( String[] args ) 22 | { 23 | SpringApplication.run(App.class, args); 24 | } 25 | 26 | @Bean 27 | public Object testBean(PlatformTransactionManager platformTransactionManager){ 28 | System.out.println(">>>>>>>>>>事务管理器:" + platformTransactionManager.getClass().getName()); 29 | return new Object(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/config/ConverterConfig.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.config; 2 | 3 | import javax.annotation.PostConstruct; 4 | import javax.annotation.Resource; 5 | 6 | import org.springframework.context.annotation.Configuration; 7 | import org.springframework.core.convert.support.GenericConversionService; 8 | import org.springframework.web.bind.support.ConfigurableWebBindingInitializer; 9 | import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter; 10 | 11 | import cn.jjvu.xiao.core.converter.DateConverter; 12 | 13 | /** 14 | * 注册日期转化器 15 | * @author xiao 16 | * @Date 2020-07-30 17 | */ 18 | @Configuration 19 | public class ConverterConfig { 20 | @Resource 21 | private RequestMappingHandlerAdapter handlerAdapter; 22 | 23 | @PostConstruct 24 | public void initEditableAvlidation() { 25 | ConfigurableWebBindingInitializer initializer = (ConfigurableWebBindingInitializer)handlerAdapter.getWebBindingInitializer(); 26 | if(initializer.getConversionService()!=null) { 27 | GenericConversionService genericConversionService = (GenericConversionService)initializer.getConversionService(); 28 | // 注册日期类型转换器 29 | genericConversionService.addConverter(new DateConverter()); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/config/CorsConfig.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.config; 2 | 3 | import org.springframework.web.servlet.config.annotation.CorsRegistry; 4 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 5 | 6 | /** 7 | * CORS 跨域配置 8 | */ 9 | public class CorsConfig implements WebMvcConfigurer { 10 | 11 | /** 12 | * 允许所有跨域访问的路径 13 | * 允许所有跨域访问的源 14 | * 允许 POST GET PUT DELETE OPTIONS 方法请求 15 | * 预检间隔时间为 168秒 16 | * 允许头部设置 17 | * 允许发送Cookie 18 | */ 19 | @Override 20 | public void addCorsMappings(CorsRegistry registry) { 21 | registry.addMapping("/**") 22 | .allowedOrigins("*") 23 | .allowedMethods("POST", "GET", "PUT", "OPTIONS", "DELETE") 24 | .maxAge(168000) 25 | .allowedMethods("*") 26 | .allowCredentials(true); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/config/KaptchaConfig.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.config; 2 | 3 | import com.google.code.kaptcha.impl.DefaultKaptcha; 4 | import com.google.code.kaptcha.util.Config; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | 8 | import java.util.Properties; 9 | /** 10 | * 验证码配置 11 | * @author xiao 12 | * 13 | */ 14 | @Configuration 15 | public class KaptchaConfig { 16 | 17 | /** 18 | * 设置验证码 19 | * 验证码没有干扰线条,字体颜色为黑色,5个字母 20 | * @return 返回验证码配置 21 | */ 22 | @Bean 23 | public DefaultKaptcha producer() { 24 | Properties properties = new Properties(); 25 | properties.put("kaptcha.border", "no"); 26 | properties.put("kaptcha.textproducer.font.color", "black"); 27 | properties.put("kaptcha.textproducer.char.space", "5"); 28 | Config config = new Config(properties); 29 | DefaultKaptcha defaultKaptcha = new DefaultKaptcha(); 30 | defaultKaptcha.setConfig(config); 31 | return defaultKaptcha; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/config/MyBatisGeneratorConfig.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.config; 2 | 3 | import java.io.File; 4 | import java.io.IOException; 5 | import java.sql.SQLException; 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | import org.mybatis.generator.api.MyBatisGenerator; 10 | import org.mybatis.generator.config.Configuration; 11 | import org.mybatis.generator.config.xml.ConfigurationParser; 12 | import org.mybatis.generator.exception.InvalidConfigurationException; 13 | import org.mybatis.generator.exception.XMLParserException; 14 | import org.mybatis.generator.internal.DefaultShellCallback; 15 | 16 | public class MyBatisGeneratorConfig { 17 | public static void main(String[] args) 18 | throws IOException, XMLParserException, InvalidConfigurationException, SQLException, InterruptedException { 19 | 20 | List warnings = new ArrayList(); 21 | boolean overwrite = true; 22 | //加载配置文件 23 | File configFile = new File("./src/main/resources/generatorConfig.xml"); 24 | ConfigurationParser cp = new ConfigurationParser(warnings); 25 | Configuration config = cp.parseConfiguration(configFile); 26 | DefaultShellCallback callback = new DefaultShellCallback(overwrite); 27 | MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config, 28 | callback, warnings); 29 | myBatisGenerator.generate(null); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/config/MybatisPageHelper.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.config; 2 | 3 | import cn.jjvu.xiao.core.model.PageRequest; 4 | import cn.jjvu.xiao.core.model.PageResult; 5 | import cn.jjvu.xiao.utils.ReflectionUtils; 6 | import com.github.pagehelper.PageHelper; 7 | import com.github.pagehelper.PageInfo; 8 | import java.util.List; 9 | 10 | public class MybatisPageHelper { 11 | 12 | public static final String findPage = "findPage"; 13 | 14 | /** 15 | * 分页查询, 约定查询方法名为 “findPage” 16 | * @param pageRequest 分页请求 17 | * @param mapper Dao对象,MyBatis的 Mapper 18 | * @param args 方法参数 19 | * @return 20 | */ 21 | public static PageResult findPage(PageRequest pageRequest, Object mapper) { 22 | return findPage(pageRequest, mapper, findPage); 23 | } 24 | 25 | /** 26 | * 调用分页插件进行分页查询 27 | * @param pageRequest 分页请求 28 | * @param mapper Dao对象,MyBatis的 Mapper 29 | * @param queryMethodName 要分页的查询方法名 30 | * @param args 方法参数 31 | * @return 32 | */ 33 | @SuppressWarnings({ "unchecked", "rawtypes" }) 34 | public static PageResult findPage(PageRequest pageRequest, Object mapper, String queryMethodName, Object... args) { 35 | // 设置分页参数 36 | int pageNum = pageRequest.getPageNum(); 37 | int pageSize = pageRequest.getPageSize(); 38 | PageHelper.startPage(pageNum, pageSize); 39 | // 利用反射调用查询方法 40 | Object result = ReflectionUtils.invoke(mapper, queryMethodName, args); 41 | return getPageResult(pageRequest, new PageInfo((List) result)); 42 | } 43 | 44 | /** 45 | * 将分页信息封装到统一的接口 46 | * @param pageRequest 47 | * @param page 48 | * @return 49 | */ 50 | private static PageResult getPageResult(PageRequest pageRequest, PageInfo> pageInfo) { 51 | PageResult pageResult = new PageResult(); 52 | pageResult.setPageNum(pageInfo.getPageNum()); 53 | pageResult.setPageSize(pageInfo.getPageSize()); 54 | pageResult.setTotalSize(pageInfo.getTotal()); 55 | pageResult.setTotalPages(pageInfo.getPages()); 56 | pageResult.setContent(pageInfo.getList()); 57 | return pageResult; 58 | } 59 | 60 | } -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/config/RedisConfig.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.config; 2 | 3 | import org.springframework.cache.annotation.CachingConfigurerSupport; 4 | import org.springframework.cache.annotation.EnableCaching; 5 | import org.springframework.cache.interceptor.KeyGenerator; 6 | import org.springframework.context.annotation.Bean; 7 | import org.springframework.context.annotation.Configuration; 8 | 9 | import java.lang.reflect.Method; 10 | 11 | @Configuration 12 | @EnableCaching 13 | public class RedisConfig extends CachingConfigurerSupport { 14 | 15 | @Bean 16 | public KeyGenerator keyGenerator() { 17 | return new KeyGenerator() { 18 | @Override 19 | public Object generate(Object target, Method method, Object... params) { 20 | StringBuilder sb = new StringBuilder(); 21 | sb.append(target.getClass().getName()); 22 | sb.append(method.getName()); 23 | for (Object obj : params) { 24 | sb.append(obj.toString()); 25 | } 26 | return sb.toString(); 27 | } 28 | }; 29 | } 30 | } -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/config/SessionConfig.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.config; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession; 5 | 6 | @Configuration 7 | @EnableRedisHttpSession(maxInactiveIntervalInSeconds = 86400*30) 8 | public class SessionConfig { 9 | } 10 | -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/config/SwaggerConfig.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import springfox.documentation.builders.ApiInfoBuilder; 6 | import springfox.documentation.builders.ParameterBuilder; 7 | import springfox.documentation.builders.PathSelectors; 8 | import springfox.documentation.builders.RequestHandlerSelectors; 9 | import springfox.documentation.schema.ModelRef; 10 | import springfox.documentation.service.ApiInfo; 11 | import springfox.documentation.service.Parameter; 12 | import springfox.documentation.spi.DocumentationType; 13 | import springfox.documentation.spring.web.plugins.Docket; 14 | import springfox.documentation.swagger2.annotations.EnableSwagger2; 15 | 16 | import java.util.ArrayList; 17 | import java.util.List; 18 | 19 | @Configuration 20 | @EnableSwagger2 21 | public class SwaggerConfig { 22 | @Bean 23 | public Docket createRestApi(){ 24 | // 添加请求参数,我们这里把token作为请求头部参数传入后端 25 | ParameterBuilder parameterBuilder = new ParameterBuilder(); 26 | List parameters = new ArrayList(); 27 | parameterBuilder.name("token").description("令牌") 28 | .modelRef(new ModelRef("string")) 29 | .parameterType("header") 30 | .required(false) 31 | .build(); 32 | parameters.add(parameterBuilder.build()); 33 | return new Docket(DocumentationType.SWAGGER_2) 34 | .apiInfo(apiInfo()).select() 35 | .apis(RequestHandlerSelectors.any()) 36 | .paths(PathSelectors.any()) 37 | .build().globalOperationParameters(parameters); 38 | } 39 | 40 | private ApiInfo apiInfo(){ 41 | return new ApiInfoBuilder().build(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/controller/ConfigController.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.controller; 2 | 3 | import java.util.HashSet; 4 | 5 | import cn.jjvu.xiao.core.model.HttpResult; 6 | import cn.jjvu.xiao.core.model.PageRequest; 7 | import cn.jjvu.xiao.pojo.Config; 8 | import cn.jjvu.xiao.service.ConfigService; 9 | import org.springframework.security.access.prepost.PreAuthorize; 10 | import org.springframework.web.bind.annotation.GetMapping; 11 | import org.springframework.web.bind.annotation.PostMapping; 12 | import org.springframework.web.bind.annotation.RequestBody; 13 | import org.springframework.web.bind.annotation.RequestMapping; 14 | import org.springframework.web.bind.annotation.RequestParam; 15 | import org.springframework.web.bind.annotation.RestController; 16 | 17 | import javax.annotation.Resource; 18 | 19 | /** 20 | * 系统配置控制器 21 | * @author xiaohongbing 22 | * @date 2020-06-19 23 | */ 24 | @RestController 25 | @RequestMapping("config") 26 | public class ConfigController { 27 | 28 | @Resource 29 | private ConfigService configService; 30 | 31 | @PreAuthorize("hasAuthority('sys:config:add') AND hasAuthority('sys:config:edit')") 32 | @PostMapping(value="/save") 33 | public HttpResult save(@RequestBody Config record) { 34 | return HttpResult.ok(configService.save(record)); 35 | } 36 | 37 | @PreAuthorize("hasAuthority('sys:config:delete')") 38 | @PostMapping(value="/delete") 39 | public HttpResult delete(@RequestBody HashSet records) { 40 | return HttpResult.ok(configService.delete(records)); 41 | } 42 | 43 | @PreAuthorize("hasAuthority('sys:config:view')") 44 | @PostMapping(value="/findPage") 45 | public HttpResult findPage(@RequestBody PageRequest pageRequest) { 46 | return HttpResult.ok(configService.findPage(pageRequest)); 47 | } 48 | 49 | @PreAuthorize("hasAuthority('sys:config:view')") 50 | @GetMapping(value="/findByLable") 51 | public HttpResult findByLable(@RequestParam String lable) { 52 | return HttpResult.ok(configService.findByLable(lable)); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/controller/DeptController.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.controller; 2 | 3 | import cn.jjvu.xiao.core.model.HttpResult; 4 | import cn.jjvu.xiao.pojo.Dept; 5 | import cn.jjvu.xiao.service.DeptService; 6 | import org.springframework.security.access.prepost.PreAuthorize; 7 | import org.springframework.web.bind.annotation.*; 8 | 9 | import javax.annotation.Resource; 10 | import java.util.HashSet; 11 | 12 | /** 13 | * 部门管理 14 | * @author xiaohongbing 15 | * @date 2020-06-19 16 | */ 17 | @RestController 18 | @RequestMapping("dept") 19 | public class DeptController { 20 | 21 | @Resource 22 | private DeptService deptService; 23 | 24 | @PreAuthorize("hasAuthority('sys:dept:add') AND hasAuthority('sys:dept:edit')") 25 | @PostMapping(value="/save") 26 | public HttpResult save(@RequestBody Dept record) { 27 | return HttpResult.ok(deptService.save(record)); 28 | } 29 | 30 | @PreAuthorize("hasAuthority('sys:dept:delete')") 31 | @PostMapping(value="/delete") 32 | public HttpResult delete(@RequestBody HashSet records) { 33 | return HttpResult.ok(deptService.delete(records)); 34 | } 35 | 36 | @PreAuthorize("hasAuthority('sys:dept:view')") 37 | @GetMapping(value="/findTree") 38 | public HttpResult findTree() { 39 | return HttpResult.ok(deptService.findTree()); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/controller/DictController.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.controller; 2 | 3 | import cn.jjvu.xiao.pojo.Dict; 4 | import cn.jjvu.xiao.service.DictService; 5 | import org.springframework.security.access.prepost.PreAuthorize; 6 | import org.springframework.web.bind.annotation.RequestBody; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.web.bind.annotation.RestController; 9 | 10 | import javax.annotation.Resource; 11 | 12 | @RestController 13 | @RequestMapping("/dict") 14 | public class DictController { 15 | 16 | @Resource 17 | private DictService dictService; 18 | 19 | @PreAuthorize("hasAuthority('sys:dict:add')") 20 | @RequestMapping(value = "/save") 21 | public Object save(@RequestBody Dict record) { 22 | return dictService.save(record); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/controller/FileController.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.controller; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.web.bind.annotation.RequestParam; 9 | import org.springframework.web.bind.annotation.RestController; 10 | import org.springframework.web.multipart.MultipartFile; 11 | 12 | import cn.jjvu.xiao.config.FastDFSClient; 13 | 14 | /** 15 | * 文件处理 16 | * 17 | * @author Xiao 18 | * @date 2020-07-31 19 | * @version V1.0.0 20 | */ 21 | @RestController 22 | @RequestMapping("/fdfs") 23 | public class FileController { 24 | 25 | @Autowired 26 | private FastDFSClient fdfsClient; 27 | 28 | /** 29 | * 文件上传 30 | * 31 | * @param file 32 | * @return 33 | * @throws Exception 34 | */ 35 | @RequestMapping("/upload") 36 | public Map upload(@RequestParam("avator") MultipartFile file) throws Exception { 37 | 38 | String url = fdfsClient.uploadFile(file.getBytes()); 39 | 40 | Map result = new HashMap<>(); 41 | result.put("code", 200); 42 | result.put("msg", "上传成功"); 43 | result.put("url", url); 44 | 45 | return result; 46 | } 47 | 48 | /** 49 | * 文件下载 50 | * 51 | * @param fileUrl 52 | * url 开头从组名开始 53 | * @param response 54 | * @throws Exception 55 | */ 56 | // @RequestMapping("/download") 57 | // public void download(String fileUrl, HttpServletResponse response) throws Exception { 58 | // 59 | // byte[] data = fdfsClient.download(fileUrl); 60 | // 61 | // response.setCharacterEncoding("UTF-8"); 62 | // response.setHeader("Content-disposition", "attachment;filename=" + URLEncoder.encode("test.jpg", "UTF-8")); 63 | // 64 | // // 写出 65 | // ServletOutputStream outputStream = response.getOutputStream(); 66 | // IOUtils.write(data, outputStream); 67 | // } 68 | } 69 | -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/controller/LogController.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.controller; 2 | 3 | import cn.jjvu.xiao.core.model.HttpResult; 4 | import cn.jjvu.xiao.core.model.PageRequest; 5 | import cn.jjvu.xiao.service.LogService; 6 | import org.springframework.security.access.prepost.PreAuthorize; 7 | import org.springframework.web.bind.annotation.PostMapping; 8 | import org.springframework.web.bind.annotation.RequestBody; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | import org.springframework.web.bind.annotation.RestController; 11 | 12 | import javax.annotation.Resource; 13 | import java.util.HashSet; 14 | 15 | @RequestMapping("/log") 16 | @RestController 17 | public class LogController { 18 | 19 | @Resource 20 | private LogService logService; 21 | 22 | @PreAuthorize("hasAuthority('sys:log:view')") 23 | @PostMapping(value="/findPage") 24 | public HttpResult findPage(@RequestBody PageRequest pageRequest) { 25 | return HttpResult.ok(logService.findPage(pageRequest)); 26 | } 27 | 28 | @PreAuthorize("hasAuthority('sys:log:delete')") 29 | @PostMapping(value="/delete") 30 | public HttpResult delete(@RequestBody HashSet records) { 31 | return HttpResult.ok(logService.delete(records)); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/controller/LoginLogController.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.controller; 2 | 3 | import cn.jjvu.xiao.core.model.HttpResult; 4 | import cn.jjvu.xiao.core.model.PageRequest; 5 | import cn.jjvu.xiao.pojo.LoginLog; 6 | import cn.jjvu.xiao.service.LoginLogService; 7 | import org.springframework.security.access.prepost.PreAuthorize; 8 | import org.springframework.web.bind.annotation.PostMapping; 9 | import org.springframework.web.bind.annotation.RequestBody; 10 | import org.springframework.web.bind.annotation.RequestMapping; 11 | import org.springframework.web.bind.annotation.RestController; 12 | 13 | import javax.annotation.Resource; 14 | import java.util.HashSet; 15 | 16 | /** 17 | * 登录日志控制器 18 | * @author Xiaohongbing 19 | * @date 2020-06-19 20 | */ 21 | @RestController 22 | @RequestMapping("loginlog") 23 | public class LoginLogController { 24 | 25 | @Resource 26 | private LoginLogService loginLogService; 27 | 28 | @PreAuthorize("hasAuthority('sys:loginlog:view')") 29 | @PostMapping(value="/findPage") 30 | public HttpResult findPage(@RequestBody PageRequest pageRequest) { 31 | return HttpResult.ok(loginLogService.findPage(pageRequest)); 32 | } 33 | 34 | @PreAuthorize("hasAuthority('sys:loginlog:delete')") 35 | @PostMapping(value="/delete") 36 | public HttpResult delete(@RequestBody HashSet records) { 37 | return HttpResult.ok(loginLogService.delete(records)); 38 | } 39 | } 40 | 41 | -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/controller/MenuController.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.controller; 2 | 3 | import cn.jjvu.xiao.core.model.HttpResult; 4 | import cn.jjvu.xiao.pojo.Menu; 5 | import cn.jjvu.xiao.service.MenuService; 6 | import org.springframework.security.access.prepost.PreAuthorize; 7 | import org.springframework.web.bind.annotation.*; 8 | 9 | import javax.annotation.Resource; 10 | import java.util.HashSet; 11 | 12 | /** 13 | * 菜单控制器 14 | * @author xiaohongbing 15 | * @date 2020-06-19 16 | */ 17 | @RestController 18 | @RequestMapping("menu") 19 | public class MenuController { 20 | 21 | @Resource 22 | private MenuService sysMenuService; 23 | 24 | @PreAuthorize("hasAuthority('sys:menu:add') AND hasAuthority('sys:menu:edit')") 25 | @PostMapping(value="/save") 26 | public HttpResult save(@RequestBody Menu record) { 27 | return HttpResult.ok(sysMenuService.save(record)); 28 | } 29 | 30 | @PreAuthorize("hasAuthority('sys:menu:delete')") 31 | @PostMapping(value="/delete") 32 | public HttpResult delete(@RequestBody HashSet records) { 33 | return HttpResult.ok(sysMenuService.delete(records)); 34 | } 35 | 36 | @PreAuthorize("hasAuthority('sys:menu:view')") 37 | @GetMapping(value="/findNavTree") 38 | public HttpResult findNavTree(@RequestParam String userName) { 39 | return HttpResult.ok(sysMenuService.findTree(userName, 1)); 40 | } 41 | 42 | @PreAuthorize("hasAuthority('sys:menu:view')") 43 | @GetMapping(value="/findMenuTree") 44 | public HttpResult findMenuTree() { 45 | return HttpResult.ok(sysMenuService.findTree(null, 0)); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/controller/RoleController.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.controller; 2 | 3 | import cn.jjvu.xiao.core.model.HttpResult; 4 | import cn.jjvu.xiao.pojo.Menu; 5 | import cn.jjvu.xiao.service.MenuService; 6 | import org.springframework.security.access.prepost.PreAuthorize; 7 | import org.springframework.web.bind.annotation.*; 8 | 9 | import javax.annotation.Resource; 10 | import java.util.HashSet; 11 | 12 | /** 13 | * 菜单控制器 14 | * @author xiaohongbing 15 | * @date 2020-06-19 16 | */ 17 | @RestController 18 | @RequestMapping("role") 19 | public class RoleController { 20 | @Resource 21 | private MenuService menuService; 22 | 23 | @PreAuthorize("hasAuthority('sys:role:add') AND hasAuthority('sys:role:edit')") 24 | @PostMapping(value="/save") 25 | public HttpResult save(@RequestBody Menu record) { 26 | return HttpResult.ok(menuService.save(record)); 27 | } 28 | 29 | @PreAuthorize("hasAuthority('sys:role:delete')") 30 | @PostMapping(value="/delete") 31 | public HttpResult delete(@RequestBody HashSet records) { 32 | return HttpResult.ok(menuService.delete(records)); 33 | } 34 | 35 | @PreAuthorize("hasAuthority('sys:role:view')") 36 | @GetMapping(value="/findNavTree") 37 | public HttpResult findNavTree(@RequestParam String userName) { 38 | return HttpResult.ok(menuService.findTree(userName, 1)); 39 | } 40 | 41 | @PreAuthorize("hasAuthority('sys:role:view')") 42 | @GetMapping(value="/findMenuTree") 43 | public HttpResult findMenuTree() { 44 | return HttpResult.ok(menuService.findTree(null, 0)); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/controller/UserController.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.controller; 2 | 3 | import cn.jjvu.xiao.config.FastDFSClient; 4 | import cn.jjvu.xiao.service.CustomerService; 5 | import cn.jjvu.xiao.service.LogService; 6 | import cn.jjvu.xiao.service.UserService; 7 | import org.slf4j.Logger; 8 | import org.slf4j.LoggerFactory; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.beans.factory.annotation.Value; 11 | import org.springframework.data.redis.core.StringRedisTemplate; 12 | import org.springframework.security.authentication.AuthenticationManager; 13 | import org.springframework.web.bind.annotation.RequestMapping; 14 | import org.springframework.web.bind.annotation.RestController; 15 | import javax.annotation.Resource; 16 | 17 | /** 18 | * 用户的注册,登录Web服务接口 19 | * @author Xiaohongbing 20 | * @date 2020-07-15 21 | */ 22 | @RestController 23 | @RequestMapping("/user") 24 | public class UserController { 25 | 26 | @Resource 27 | private UserService userService; 28 | 29 | 30 | 31 | @Autowired 32 | private StringRedisTemplate stringRedisTemplate; 33 | 34 | @Resource 35 | private AuthenticationManager authenticationManager; 36 | 37 | private Logger logger = LoggerFactory.getLogger(this.getClass()); 38 | 39 | @Resource 40 | private LogService logService; 41 | 42 | @Resource 43 | private CustomerService customerService; 44 | 45 | @Autowired 46 | private FastDFSClient fdfsClient; 47 | 48 | @Value("${upload.url}") 49 | private String FILE_UPLOAD_URL; 50 | 51 | } 52 | -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/core/constant/LiveShopContants.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.core.constant; 2 | 3 | /** 4 | * 常量管理 5 | * @author XiaoHongBing 6 | * @date 2020-06-10 7 | */ 8 | public class LiveShopContants { 9 | 10 | /** 11 | * 系统管理员用户名 12 | */ 13 | public static final String ADMIN = "admin"; 14 | 15 | public static final String EMAIL_CODE = "email"; 16 | 17 | public static final String CAPTCHA_CODE = "captcha"; 18 | 19 | public static final String EMAIL_SAVE = "email_save"; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/core/converter/DateConverter.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.core.converter; 2 | 3 | import java.text.DateFormat; 4 | import java.text.SimpleDateFormat; 5 | import java.util.ArrayList; 6 | import java.util.Date; 7 | import java.util.List; 8 | 9 | import org.springframework.core.convert.converter.Converter; 10 | 11 | /** 12 | * 字符串日期转化器 13 | * @author xiao 14 | * @Date 2020-07-30 15 | */ 16 | public class DateConverter implements Converter { 17 | 18 | private static final List formarts = new ArrayList<>(4); 19 | 20 | static{ 21 | formarts.add("yyyy-MM"); 22 | formarts.add("yyyy-MM-dd"); 23 | formarts.add("yyyy-MM-dd hh:mm"); 24 | formarts.add("yyyy-MM-dd hh:mm:ss"); 25 | } 26 | 27 | @Override 28 | public Date convert(String source) { 29 | String value = source.trim(); 30 | if ("".equals(value)) { 31 | return null; 32 | } 33 | if(source.matches("^\\d{4}-\\d{1,2}$")){ 34 | return parseDate(source, formarts.get(0)); 35 | }else if(source.matches("^\\d{4}-\\d{1,2}-\\d{1,2}$")){ 36 | return parseDate(source, formarts.get(1)); 37 | }else if(source.matches("^\\d{4}-\\d{1,2}-\\d{1,2} {1}\\d{1,2}:\\d{1,2}$")){ 38 | return parseDate(source, formarts.get(2)); 39 | }else if(source.matches("^\\d{4}-\\d{1,2}-\\d{1,2} {1}\\d{1,2}:\\d{1,2}:\\d{1,2}$")){ 40 | return parseDate(source, formarts.get(3)); 41 | }else { 42 | throw new IllegalArgumentException("Invalid boolean value '" + source + "'"); 43 | } 44 | } 45 | 46 | /** 47 | * 格式化日期 48 | * @param dateStr String 字符型日期 49 | * @param format String 格式 50 | * @return Date 日期 51 | */ 52 | public Date parseDate(String dateStr, String format) { 53 | System.out.println("时间格式化"); 54 | Date date = null; 55 | try { 56 | DateFormat dateFormat = new SimpleDateFormat(format); 57 | date = dateFormat.parse(dateStr); 58 | } catch (Exception e) { 59 | 60 | } 61 | return date; 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/core/model/BasicModel.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.core.model; 2 | 3 | public class BasicModel { 4 | } 5 | -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/core/model/HttpResult.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.core.model; 2 | 3 | /** 4 | * HTTP结果封装 5 | * @author XiaoHongBing 6 | * @date 2020-06-10 7 | */ 8 | public class HttpResult { 9 | 10 | private int code = 200; 11 | private String msg; 12 | private Object data; 13 | 14 | public static HttpResult error() { 15 | return error(HttpStatus.SC_INTERNAL_SERVER_ERROR, "未知异常,请联系管理员"); 16 | } 17 | 18 | public static HttpResult error(String msg) { 19 | return error(HttpStatus.SC_INTERNAL_SERVER_ERROR, msg); 20 | } 21 | 22 | public static HttpResult error(int code, String msg) { 23 | HttpResult r = new HttpResult(); 24 | r.setCode(code); 25 | r.setMsg(msg); 26 | return r; 27 | } 28 | 29 | public static HttpResult ok(String msg) { 30 | HttpResult r = new HttpResult(); 31 | r.setMsg(msg); 32 | return r; 33 | } 34 | 35 | public static HttpResult ok(Object data) { 36 | HttpResult r = new HttpResult(); 37 | r.setData(data); 38 | return r; 39 | } 40 | 41 | public static HttpResult ok(Object data, String msg) { 42 | HttpResult r = new HttpResult(); 43 | r.setData(data); 44 | r.setMsg(msg); 45 | return r; 46 | } 47 | 48 | public static HttpResult ok() { 49 | return new HttpResult(); 50 | } 51 | 52 | public int getCode() { 53 | return code; 54 | } 55 | 56 | public void setCode(int code) { 57 | this.code = code; 58 | } 59 | 60 | public String getMsg() { 61 | return msg; 62 | } 63 | 64 | public void setMsg(String msg) { 65 | this.msg = msg; 66 | } 67 | 68 | public Object getData() { 69 | return data; 70 | } 71 | 72 | public void setData(Object data) { 73 | this.data = data; 74 | } 75 | 76 | @Override 77 | public String toString() { 78 | return "HttpResult{" + 79 | "code=" + code + 80 | ", msg='" + msg + '\'' + 81 | ", data=" + data + 82 | '}'; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/core/model/LoginBean.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.core.model; 2 | 3 | /** 4 | * 登录接口封装对象 5 | * @author XiaoHongBing 6 | * @date 2020-06-10 7 | */ 8 | public class LoginBean { 9 | 10 | private String account; 11 | private String password; 12 | private String captcha; 13 | 14 | public String getAccount() { 15 | return account; 16 | } 17 | public void setAccount(String account) { 18 | this.account = account; 19 | } 20 | public String getPassword() { 21 | return password; 22 | } 23 | public void setPassword(String password) { 24 | this.password = password; 25 | } 26 | public String getCaptcha() { 27 | return captcha; 28 | } 29 | public void setCaptcha(String captcha) { 30 | this.captcha = captcha; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/core/model/PageRequest.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.core.model; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | public class PageRequest { 7 | 8 | /** 9 | * 当前页码 10 | */ 11 | private int pageNum = 1; 12 | /** 13 | * 每页数量 14 | */ 15 | private int pageSize = 10; 16 | /** 17 | * 查询参数 18 | */ 19 | private Map params = new HashMap<>(); 20 | 21 | public int getPageNum() { 22 | return pageNum; 23 | } 24 | public void setPageNum(int pageNum) { 25 | this.pageNum = pageNum; 26 | } 27 | public int getPageSize() { 28 | return pageSize; 29 | } 30 | public void setPageSize(int pageSize) { 31 | this.pageSize = pageSize; 32 | } 33 | public Map getParams() { 34 | return params; 35 | } 36 | public void setParams(Map params) { 37 | this.params = params; 38 | } 39 | public Object getParam(String key) { 40 | return getParams().get(key); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/core/model/PageResult.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.core.model; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * 分页返回结果 7 | * @author xiaohongbing 8 | * @date 2020-06-03 9 | */ 10 | public class PageResult { 11 | /** 12 | * 当前页码 13 | */ 14 | private int pageNum; 15 | /** 16 | * 每页数量 17 | */ 18 | private int pageSize; 19 | /** 20 | * 记录总数 21 | */ 22 | private long totalSize; 23 | /** 24 | * 页码总数 25 | */ 26 | private int totalPages; 27 | /** 28 | * 分页数据 29 | */ 30 | private List> content; 31 | public int getPageNum() { 32 | return pageNum; 33 | } 34 | public void setPageNum(int pageNum) { 35 | this.pageNum = pageNum; 36 | } 37 | public int getPageSize() { 38 | return pageSize; 39 | } 40 | public void setPageSize(int pageSize) { 41 | this.pageSize = pageSize; 42 | } 43 | public long getTotalSize() { 44 | return totalSize; 45 | } 46 | public void setTotalSize(long totalSize) { 47 | this.totalSize = totalSize; 48 | } 49 | public int getTotalPages() { 50 | return totalPages; 51 | } 52 | public void setTotalPages(int totalPages) { 53 | this.totalPages = totalPages; 54 | } 55 | public List> getContent() { 56 | return content; 57 | } 58 | public void setContent(List> content) { 59 | this.content = content; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/core/security/GrantedAuthorityImpl.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.core.security; 2 | import org.springframework.security.core.GrantedAuthority; 3 | 4 | /** 5 | * 权限封装 6 | * @author XiaoHongBing 7 | * @date 2020-06-09 8 | */ 9 | public class GrantedAuthorityImpl implements GrantedAuthority { 10 | 11 | private static final long serialVersionUID = 1L; 12 | 13 | private String authority; 14 | 15 | public GrantedAuthorityImpl(String authority) { 16 | this.authority = authority; 17 | } 18 | 19 | public void setAuthority(String authority) { 20 | this.authority = authority; 21 | } 22 | 23 | @Override 24 | public String getAuthority() { 25 | return this.authority; 26 | } 27 | } -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/core/security/JwtAuthenticatioToken.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.core.security; 2 | 3 | import java.util.Collection; 4 | 5 | import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; 6 | import org.springframework.security.core.GrantedAuthority; 7 | 8 | /** 9 | * 自定义令牌对象 10 | * @author xiaohongbing 11 | * @date 2020-06-09 12 | */ 13 | public class JwtAuthenticatioToken extends UsernamePasswordAuthenticationToken { 14 | 15 | private static final long serialVersionUID = 1L; 16 | 17 | private String token; 18 | 19 | public JwtAuthenticatioToken(Object principal, Object credentials){ 20 | super(principal, credentials); 21 | } 22 | 23 | public JwtAuthenticatioToken(Object principal, Object credentials, String token){ 24 | super(principal, credentials); 25 | this.token = token; 26 | } 27 | 28 | public JwtAuthenticatioToken(Object principal, Object credentials, Collection extends GrantedAuthority> authorities, String token) { 29 | super(principal, credentials, authorities); 30 | this.token = token; 31 | } 32 | 33 | public String getToken() { 34 | return token; 35 | } 36 | 37 | public void setToken(String token) { 38 | this.token = token; 39 | } 40 | 41 | public static long getSerialversionuid() { 42 | return serialVersionUID; 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/core/security/JwtAuthenticationFilter.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.core.security; 2 | 3 | import java.io.IOException; 4 | 5 | import javax.servlet.FilterChain; 6 | import javax.servlet.ServletException; 7 | import javax.servlet.http.HttpServletRequest; 8 | import javax.servlet.http.HttpServletResponse; 9 | 10 | import cn.jjvu.xiao.utils.SecurityUtils; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.security.authentication.AuthenticationManager; 13 | import org.springframework.security.web.authentication.www.BasicAuthenticationFilter; 14 | 15 | /** 16 | * 登录认证过滤器 17 | */ 18 | public class JwtAuthenticationFilter extends BasicAuthenticationFilter { 19 | 20 | 21 | @Autowired 22 | public JwtAuthenticationFilter(AuthenticationManager authenticationManager) { 23 | super(authenticationManager); 24 | } 25 | 26 | @Override 27 | protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException { 28 | // 获取token, 并检查登录状态 29 | SecurityUtils.checkAuthentication(request); 30 | chain.doFilter(request, response); 31 | } 32 | 33 | } -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/core/security/JwtAuthenticationProvider.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.core.security; 2 | 3 | import cn.jjvu.xiao.utils.PasswordEncoder; 4 | import org.springframework.security.authentication.BadCredentialsException; 5 | import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; 6 | import org.springframework.security.authentication.dao.DaoAuthenticationProvider; 7 | import org.springframework.security.core.AuthenticationException; 8 | import org.springframework.security.core.userdetails.UserDetails; 9 | import org.springframework.security.core.userdetails.UserDetailsService; 10 | 11 | /** 12 | * 身份验证提供者 13 | */ 14 | public class JwtAuthenticationProvider extends DaoAuthenticationProvider { 15 | 16 | public JwtAuthenticationProvider(UserDetailsService userDetailsService) { 17 | setUserDetailsService(userDetailsService); 18 | } 19 | 20 | @Override 21 | protected void additionalAuthenticationChecks(UserDetails userDetails, UsernamePasswordAuthenticationToken authentication) 22 | throws AuthenticationException { 23 | if (authentication.getCredentials() == null) { 24 | logger.debug("Authentication failed: no credentials provided"); 25 | throw new BadCredentialsException(messages.getMessage("AbstractUserDetailsAuthenticationProvider.badCredentials", "Bad credentials")); 26 | } 27 | 28 | String presentedPassword = authentication.getCredentials().toString(); 29 | String salt = ((JwtUserDetails) userDetails).getSalt(); 30 | // 覆写密码验证逻辑 31 | if (!new PasswordEncoder(salt).matches(userDetails.getPassword(), presentedPassword)) { 32 | logger.debug("Authentication failed: password does not match stored value"); 33 | throw new BadCredentialsException(messages.getMessage("AbstractUserDetailsAuthenticationProvider.badCredentials", "Bad credentials")); 34 | } 35 | } 36 | 37 | } -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/core/security/JwtUserDetails.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.core.security; 2 | import java.util.Collection; 3 | 4 | import org.springframework.security.core.GrantedAuthority; 5 | import org.springframework.security.core.userdetails.UserDetails; 6 | 7 | import com.fasterxml.jackson.annotation.JsonIgnore; 8 | 9 | /** 10 | * 安全用户模型 11 | */ 12 | public class JwtUserDetails implements UserDetails { 13 | 14 | private static final long serialVersionUID = 1L; 15 | 16 | private String name; 17 | private String passwd; 18 | private String salt; 19 | private Collection extends GrantedAuthority> authorities; 20 | 21 | JwtUserDetails(String name, String passwd, String salt, Collection extends GrantedAuthority> authorities) { 22 | this.name = name; 23 | this.passwd = passwd; 24 | this.salt = salt; 25 | this.authorities = authorities; 26 | } 27 | 28 | @Override 29 | public String getUsername() { 30 | return name; 31 | } 32 | 33 | @JsonIgnore 34 | @Override 35 | public String getPassword() { 36 | return passwd; 37 | } 38 | 39 | public String getSalt() { 40 | return salt; 41 | } 42 | 43 | @Override 44 | public Collection extends GrantedAuthority> getAuthorities() { 45 | return authorities; 46 | } 47 | 48 | @JsonIgnore 49 | @Override 50 | public boolean isAccountNonExpired() { 51 | return true; 52 | } 53 | 54 | @JsonIgnore 55 | @Override 56 | public boolean isAccountNonLocked() { 57 | return true; 58 | } 59 | 60 | @JsonIgnore 61 | @Override 62 | public boolean isCredentialsNonExpired() { 63 | return true; 64 | } 65 | 66 | @JsonIgnore 67 | @Override 68 | public boolean isEnabled() { 69 | return true; 70 | } 71 | } -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/dao/ConfigMapper.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.dao; 2 | 3 | import cn.jjvu.xiao.pojo.Config; 4 | import cn.jjvu.xiao.pojo.ConfigExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface ConfigMapper { 9 | int countByExample(ConfigExample example); 10 | 11 | int deleteByExample(ConfigExample example); 12 | 13 | int deleteByPrimaryKey(Integer id); 14 | 15 | int insert(Config record); 16 | 17 | int insertSelective(Config record); 18 | 19 | List selectByExample(ConfigExample example); 20 | 21 | Config selectByPrimaryKey(Integer id); 22 | 23 | int updateByExampleSelective(@Param("record") Config record, @Param("example") ConfigExample example); 24 | 25 | int updateByExample(@Param("record") Config record, @Param("example") ConfigExample example); 26 | 27 | int updateByPrimaryKeySelective(Config record); 28 | 29 | int updateByPrimaryKey(Config record); 30 | } -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/dao/CustomerMapper.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.dao; 2 | 3 | import cn.jjvu.xiao.pojo.Customer; 4 | import cn.jjvu.xiao.pojo.CustomerExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface CustomerMapper { 9 | int countByExample(CustomerExample example); 10 | 11 | int deleteByExample(CustomerExample example); 12 | 13 | int deleteByPrimaryKey(Long id); 14 | 15 | int insert(Customer record); 16 | 17 | int insertSelective(Customer record); 18 | 19 | List selectByExample(CustomerExample example); 20 | 21 | Customer selectByPrimaryKey(Long id); 22 | 23 | int updateByExampleSelective(@Param("record") Customer record, @Param("example") CustomerExample example); 24 | 25 | int updateByExample(@Param("record") Customer record, @Param("example") CustomerExample example); 26 | 27 | int updateByPrimaryKeySelective(Customer record); 28 | 29 | int updateByPrimaryKey(Customer record); 30 | } -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/dao/DeptMapper.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.dao; 2 | 3 | import cn.jjvu.xiao.pojo.Dept; 4 | import cn.jjvu.xiao.pojo.DeptExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface DeptMapper { 9 | int countByExample(DeptExample example); 10 | 11 | int deleteByExample(DeptExample example); 12 | 13 | int deleteByPrimaryKey(Long id); 14 | 15 | int insert(Dept record); 16 | 17 | int insertSelective(Dept record); 18 | 19 | List selectByExample(DeptExample example); 20 | 21 | Dept selectByPrimaryKey(Long id); 22 | 23 | int updateByExampleSelective(@Param("record") Dept record, @Param("example") DeptExample example); 24 | 25 | int updateByExample(@Param("record") Dept record, @Param("example") DeptExample example); 26 | 27 | int updateByPrimaryKeySelective(Dept record); 28 | 29 | int updateByPrimaryKey(Dept record); 30 | } -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/dao/DictMapper.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.dao; 2 | 3 | import cn.jjvu.xiao.pojo.Dict; 4 | import cn.jjvu.xiao.pojo.DictExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface DictMapper { 9 | int countByExample(DictExample example); 10 | 11 | int deleteByExample(DictExample example); 12 | 13 | int deleteByPrimaryKey(Integer id); 14 | 15 | int insert(Dict record); 16 | 17 | int insertSelective(Dict record); 18 | 19 | List selectByExample(DictExample example); 20 | 21 | Dict selectByPrimaryKey(Integer id); 22 | 23 | int updateByExampleSelective(@Param("record") Dict record, @Param("example") DictExample example); 24 | 25 | int updateByExample(@Param("record") Dict record, @Param("example") DictExample example); 26 | 27 | int updateByPrimaryKeySelective(Dict record); 28 | 29 | int updateByPrimaryKey(Dict record); 30 | } -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/dao/LogMapper.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.dao; 2 | 3 | import cn.jjvu.xiao.pojo.Log; 4 | import cn.jjvu.xiao.pojo.LogExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface LogMapper { 9 | int countByExample(LogExample example); 10 | 11 | int deleteByExample(LogExample example); 12 | 13 | int deleteByPrimaryKey(Integer id); 14 | 15 | int insert(Log record); 16 | 17 | int insertSelective(Log record); 18 | 19 | List selectByExample(LogExample example); 20 | 21 | Log selectByPrimaryKey(Integer id); 22 | 23 | int updateByExampleSelective(@Param("record") Log record, @Param("example") LogExample example); 24 | 25 | int updateByExample(@Param("record") Log record, @Param("example") LogExample example); 26 | 27 | int updateByPrimaryKeySelective(Log record); 28 | 29 | int updateByPrimaryKey(Log record); 30 | } -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/dao/LoginLogMapper.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.dao; 2 | 3 | import cn.jjvu.xiao.pojo.LoginLog; 4 | import cn.jjvu.xiao.pojo.LoginLogExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface LoginLogMapper { 9 | int countByExample(LoginLogExample example); 10 | 11 | int deleteByExample(LoginLogExample example); 12 | 13 | int deleteByPrimaryKey(Integer id); 14 | 15 | int insert(LoginLog record); 16 | 17 | int insertSelective(LoginLog record); 18 | 19 | List selectByExample(LoginLogExample example); 20 | 21 | LoginLog selectByPrimaryKey(Integer id); 22 | 23 | int updateByExampleSelective(@Param("record") LoginLog record, @Param("example") LoginLogExample example); 24 | 25 | int updateByExample(@Param("record") LoginLog record, @Param("example") LoginLogExample example); 26 | 27 | int updateByPrimaryKeySelective(LoginLog record); 28 | 29 | int updateByPrimaryKey(LoginLog record); 30 | } -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/dao/MenuMapper.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.dao; 2 | 3 | import cn.jjvu.xiao.pojo.Menu; 4 | import cn.jjvu.xiao.pojo.MenuExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface MenuMapper { 9 | int countByExample(MenuExample example); 10 | 11 | int deleteByExample(MenuExample example); 12 | 13 | int deleteByPrimaryKey(Integer id); 14 | 15 | int insert(Menu record); 16 | 17 | int insertSelective(Menu record); 18 | 19 | List selectByExample(MenuExample example); 20 | 21 | Menu selectByPrimaryKey(Integer id); 22 | 23 | int updateByExampleSelective(@Param("record") Menu record, @Param("example") MenuExample example); 24 | 25 | int updateByExample(@Param("record") Menu record, @Param("example") MenuExample example); 26 | 27 | int updateByPrimaryKeySelective(Menu record); 28 | 29 | int updateByPrimaryKey(Menu record); 30 | 31 | List findByUserName(@Param(value="userName") String userName); 32 | } -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/dao/RoleDeptMapper.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.dao; 2 | 3 | import cn.jjvu.xiao.pojo.RoleDept; 4 | import cn.jjvu.xiao.pojo.RoleDeptExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface RoleDeptMapper { 9 | int countByExample(RoleDeptExample example); 10 | 11 | int deleteByExample(RoleDeptExample example); 12 | 13 | int deleteByPrimaryKey(Long id); 14 | 15 | int insert(RoleDept record); 16 | 17 | int insertSelective(RoleDept record); 18 | 19 | List selectByExample(RoleDeptExample example); 20 | 21 | RoleDept selectByPrimaryKey(Long id); 22 | 23 | int updateByExampleSelective(@Param("record") RoleDept record, @Param("example") RoleDeptExample example); 24 | 25 | int updateByExample(@Param("record") RoleDept record, @Param("example") RoleDeptExample example); 26 | 27 | int updateByPrimaryKeySelective(RoleDept record); 28 | 29 | int updateByPrimaryKey(RoleDept record); 30 | } -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/dao/RoleMapper.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.dao; 2 | 3 | import cn.jjvu.xiao.pojo.Role; 4 | import cn.jjvu.xiao.pojo.RoleExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface RoleMapper { 9 | int countByExample(RoleExample example); 10 | 11 | int deleteByExample(RoleExample example); 12 | 13 | int deleteByPrimaryKey(Integer id); 14 | 15 | int insert(Role record); 16 | 17 | int insertSelective(Role record); 18 | 19 | List selectByExample(RoleExample example); 20 | 21 | Role selectByPrimaryKey(Integer id); 22 | 23 | int updateByExampleSelective(@Param("record") Role record, @Param("example") RoleExample example); 24 | 25 | int updateByExample(@Param("record") Role record, @Param("example") RoleExample example); 26 | 27 | int updateByPrimaryKeySelective(Role record); 28 | 29 | int updateByPrimaryKey(Role record); 30 | } -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/dao/RoleMenuMapper.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.dao; 2 | 3 | import cn.jjvu.xiao.pojo.RoleMenu; 4 | import cn.jjvu.xiao.pojo.RoleMenuExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface RoleMenuMapper { 9 | int countByExample(RoleMenuExample example); 10 | 11 | int deleteByExample(RoleMenuExample example); 12 | 13 | int deleteByPrimaryKey(Long id); 14 | 15 | int insert(RoleMenu record); 16 | 17 | int insertSelective(RoleMenu record); 18 | 19 | List selectByExample(RoleMenuExample example); 20 | 21 | RoleMenu selectByPrimaryKey(Long id); 22 | 23 | int updateByExampleSelective(@Param("record") RoleMenu record, @Param("example") RoleMenuExample example); 24 | 25 | int updateByExample(@Param("record") RoleMenu record, @Param("example") RoleMenuExample example); 26 | 27 | int updateByPrimaryKeySelective(RoleMenu record); 28 | 29 | int updateByPrimaryKey(RoleMenu record); 30 | } -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/dao/UserMapper.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.dao; 2 | 3 | import cn.jjvu.xiao.pojo.User; 4 | import cn.jjvu.xiao.pojo.UserExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface UserMapper { 9 | int countByExample(UserExample example); 10 | 11 | int deleteByExample(UserExample example); 12 | 13 | int deleteByPrimaryKey(Integer id); 14 | 15 | int insert(User record); 16 | 17 | int insertSelective(User record); 18 | 19 | List selectByExample(UserExample example); 20 | 21 | User selectByPrimaryKey(Integer id); 22 | 23 | int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example); 24 | 25 | int updateByExample(@Param("record") User record, @Param("example") UserExample example); 26 | 27 | int updateByPrimaryKeySelective(User record); 28 | 29 | int updateByPrimaryKey(User record); 30 | } -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/dao/UserRoleMapper.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.dao; 2 | 3 | import cn.jjvu.xiao.pojo.UserRole; 4 | import cn.jjvu.xiao.pojo.UserRoleExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface UserRoleMapper { 9 | int countByExample(UserRoleExample example); 10 | 11 | int deleteByExample(UserRoleExample example); 12 | 13 | int deleteByPrimaryKey(Integer id); 14 | 15 | int insert(UserRole record); 16 | 17 | int insertSelective(UserRole record); 18 | 19 | List selectByExample(UserRoleExample example); 20 | 21 | UserRole selectByPrimaryKey(Integer id); 22 | 23 | int updateByExampleSelective(@Param("record") UserRole record, @Param("example") UserRoleExample example); 24 | 25 | int updateByExample(@Param("record") UserRole record, @Param("example") UserRoleExample example); 26 | 27 | int updateByPrimaryKeySelective(UserRole record); 28 | 29 | int updateByPrimaryKey(UserRole record); 30 | } -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/pojo/Role.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.pojo; 2 | 3 | import java.util.Date; 4 | 5 | public class Role { 6 | private Integer id; 7 | 8 | private String name; 9 | 10 | private String remark; 11 | 12 | private String createBy; 13 | 14 | private Date createTime; 15 | 16 | private String lastUpdateBy; 17 | 18 | private Date lastUpdateTime; 19 | 20 | private Byte delFlag; 21 | 22 | public Integer getId() { 23 | return id; 24 | } 25 | 26 | public void setId(Integer id) { 27 | this.id = id; 28 | } 29 | 30 | public String getName() { 31 | return name; 32 | } 33 | 34 | public void setName(String name) { 35 | this.name = name == null ? null : name.trim(); 36 | } 37 | 38 | public String getRemark() { 39 | return remark; 40 | } 41 | 42 | public void setRemark(String remark) { 43 | this.remark = remark == null ? null : remark.trim(); 44 | } 45 | 46 | public String getCreateBy() { 47 | return createBy; 48 | } 49 | 50 | public void setCreateBy(String createBy) { 51 | this.createBy = createBy == null ? null : createBy.trim(); 52 | } 53 | 54 | public Date getCreateTime() { 55 | return createTime; 56 | } 57 | 58 | public void setCreateTime(Date createTime) { 59 | this.createTime = createTime; 60 | } 61 | 62 | public String getLastUpdateBy() { 63 | return lastUpdateBy; 64 | } 65 | 66 | public void setLastUpdateBy(String lastUpdateBy) { 67 | this.lastUpdateBy = lastUpdateBy == null ? null : lastUpdateBy.trim(); 68 | } 69 | 70 | public Date getLastUpdateTime() { 71 | return lastUpdateTime; 72 | } 73 | 74 | public void setLastUpdateTime(Date lastUpdateTime) { 75 | this.lastUpdateTime = lastUpdateTime; 76 | } 77 | 78 | public Byte getDelFlag() { 79 | return delFlag; 80 | } 81 | 82 | public void setDelFlag(Byte delFlag) { 83 | this.delFlag = delFlag; 84 | } 85 | } -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/pojo/RoleDept.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.pojo; 2 | 3 | import java.util.Date; 4 | 5 | public class RoleDept { 6 | private Long id; 7 | 8 | private Long roleId; 9 | 10 | private Long deptId; 11 | 12 | private String createBy; 13 | 14 | private Date createTime; 15 | 16 | private String lastUpdateBy; 17 | 18 | private Date lastUpdateTime; 19 | 20 | public Long getId() { 21 | return id; 22 | } 23 | 24 | public void setId(Long id) { 25 | this.id = id; 26 | } 27 | 28 | public Long getRoleId() { 29 | return roleId; 30 | } 31 | 32 | public void setRoleId(Long roleId) { 33 | this.roleId = roleId; 34 | } 35 | 36 | public Long getDeptId() { 37 | return deptId; 38 | } 39 | 40 | public void setDeptId(Long deptId) { 41 | this.deptId = deptId; 42 | } 43 | 44 | public String getCreateBy() { 45 | return createBy; 46 | } 47 | 48 | public void setCreateBy(String createBy) { 49 | this.createBy = createBy == null ? null : createBy.trim(); 50 | } 51 | 52 | public Date getCreateTime() { 53 | return createTime; 54 | } 55 | 56 | public void setCreateTime(Date createTime) { 57 | this.createTime = createTime; 58 | } 59 | 60 | public String getLastUpdateBy() { 61 | return lastUpdateBy; 62 | } 63 | 64 | public void setLastUpdateBy(String lastUpdateBy) { 65 | this.lastUpdateBy = lastUpdateBy == null ? null : lastUpdateBy.trim(); 66 | } 67 | 68 | public Date getLastUpdateTime() { 69 | return lastUpdateTime; 70 | } 71 | 72 | public void setLastUpdateTime(Date lastUpdateTime) { 73 | this.lastUpdateTime = lastUpdateTime; 74 | } 75 | } -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/pojo/RoleMenu.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.pojo; 2 | 3 | import java.util.Date; 4 | 5 | public class RoleMenu { 6 | private Long id; 7 | 8 | private Long roleId; 9 | 10 | private Long menuId; 11 | 12 | private String createBy; 13 | 14 | private Date createTime; 15 | 16 | private String lastUpdateBy; 17 | 18 | private Date lastUpdateTime; 19 | 20 | public Long getId() { 21 | return id; 22 | } 23 | 24 | public void setId(Long id) { 25 | this.id = id; 26 | } 27 | 28 | public Long getRoleId() { 29 | return roleId; 30 | } 31 | 32 | public void setRoleId(Long roleId) { 33 | this.roleId = roleId; 34 | } 35 | 36 | public Long getMenuId() { 37 | return menuId; 38 | } 39 | 40 | public void setMenuId(Long menuId) { 41 | this.menuId = menuId; 42 | } 43 | 44 | public String getCreateBy() { 45 | return createBy; 46 | } 47 | 48 | public void setCreateBy(String createBy) { 49 | this.createBy = createBy == null ? null : createBy.trim(); 50 | } 51 | 52 | public Date getCreateTime() { 53 | return createTime; 54 | } 55 | 56 | public void setCreateTime(Date createTime) { 57 | this.createTime = createTime; 58 | } 59 | 60 | public String getLastUpdateBy() { 61 | return lastUpdateBy; 62 | } 63 | 64 | public void setLastUpdateBy(String lastUpdateBy) { 65 | this.lastUpdateBy = lastUpdateBy == null ? null : lastUpdateBy.trim(); 66 | } 67 | 68 | public Date getLastUpdateTime() { 69 | return lastUpdateTime; 70 | } 71 | 72 | public void setLastUpdateTime(Date lastUpdateTime) { 73 | this.lastUpdateTime = lastUpdateTime; 74 | } 75 | } -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/pojo/UserRole.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.pojo; 2 | 3 | import java.util.Date; 4 | 5 | public class UserRole { 6 | private Integer id; 7 | 8 | private Integer userId; 9 | 10 | private Integer roleId; 11 | 12 | private String createBy; 13 | 14 | private Date createTime; 15 | 16 | private Date lastUpdateBy; 17 | 18 | private Date lastUpdateTime; 19 | 20 | public Integer getId() { 21 | return id; 22 | } 23 | 24 | public void setId(Integer id) { 25 | this.id = id; 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 getRoleId() { 37 | return roleId; 38 | } 39 | 40 | public void setRoleId(Integer roleId) { 41 | this.roleId = roleId; 42 | } 43 | 44 | public String getCreateBy() { 45 | return createBy; 46 | } 47 | 48 | public void setCreateBy(String createBy) { 49 | this.createBy = createBy == null ? null : createBy.trim(); 50 | } 51 | 52 | public Date getCreateTime() { 53 | return createTime; 54 | } 55 | 56 | public void setCreateTime(Date createTime) { 57 | this.createTime = createTime; 58 | } 59 | 60 | public Date getLastUpdateBy() { 61 | return lastUpdateBy; 62 | } 63 | 64 | public void setLastUpdateBy(Date lastUpdateBy) { 65 | this.lastUpdateBy = lastUpdateBy; 66 | } 67 | 68 | public Date getLastUpdateTime() { 69 | return lastUpdateTime; 70 | } 71 | 72 | public void setLastUpdateTime(Date lastUpdateTime) { 73 | this.lastUpdateTime = lastUpdateTime; 74 | } 75 | } -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/service/ConfigService.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.service; 2 | 3 | import cn.jjvu.xiao.pojo.Config; 4 | 5 | import java.util.List; 6 | 7 | public interface ConfigService extends CrudService { 8 | 9 | /** 10 | * 根据名称查询 11 | * @param lable 12 | * @return 13 | */ 14 | List findByLable(String lable); 15 | } 16 | 17 | -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/service/CrudService.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.service; 2 | 3 | import cn.jjvu.xiao.core.model.PageRequest; 4 | import cn.jjvu.xiao.core.model.PageResult; 5 | 6 | import java.util.Set; 7 | 8 | /** 9 | * 通用CRUD接口 10 | * @author xiaohongbing 11 | * @date 2020-06-03 12 | */ 13 | public interface CrudService { 14 | // 插入数据 15 | int save(T record); 16 | 17 | // 删除数据 18 | int delete(Number id); 19 | 20 | // 批量删除数据 21 | int delete(Set ids); 22 | 23 | // 单条修改数据 24 | int update(T record); 25 | 26 | // 单条数据查询 27 | T findById(Number id); 28 | 29 | // 分页查询 30 | PageResult findPage(PageRequest pageRequest); 31 | } 32 | -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/service/CustomerService.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.service; 2 | 3 | import cn.jjvu.xiao.pojo.Customer; 4 | import cn.jjvu.xiao.pojo.Log; 5 | 6 | public interface CustomerService extends CrudService { 7 | Customer login(String loginname, String passwd, Log loginLog); 8 | Customer getInfo(String loginname); 9 | } 10 | -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/service/DeptService.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.service; 2 | 3 | import cn.jjvu.xiao.pojo.Dept; 4 | 5 | import java.util.List; 6 | 7 | public interface DeptService extends CrudService { 8 | 9 | /** 10 | * 查询机构树 11 | * @param userId 12 | * @return 13 | */ 14 | List findTree(); 15 | } 16 | -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/service/DictService.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.service; 2 | 3 | import cn.jjvu.xiao.pojo.Dict; 4 | 5 | import java.util.List; 6 | 7 | public interface DictService extends CrudService { 8 | 9 | /** 10 | * 根据名称查询 11 | * @param lable 12 | * @return 13 | */ 14 | List findByLable(String lable); 15 | } 16 | -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/service/LogService.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.service; 2 | 3 | import cn.jjvu.xiao.pojo.Log; 4 | 5 | /** 6 | * 操作日志 7 | * @author Louis 8 | * @date Jan 13, 2019 9 | */ 10 | public interface LogService extends CrudService { 11 | 12 | } -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/service/LoginLogService.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.service; 2 | 3 | import cn.jjvu.xiao.pojo.LoginLog; 4 | 5 | /** 6 | * 登录日志 7 | */ 8 | public interface LoginLogService extends CrudService { 9 | 10 | } -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/service/MenuService.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.service; 2 | 3 | import cn.jjvu.xiao.pojo.Menu; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 菜单管理 9 | */ 10 | public interface MenuService extends CrudService { 11 | 12 | /** 13 | * 查询菜单树,用户ID和用户名为空则查询全部 14 | * @param menuType 获取菜单类型,0:获取所有菜单,包含按钮,1:获取所有菜单,不包含按钮 15 | * @param userId 16 | * @return 17 | */ 18 | List findTree(String userName, int menuType); 19 | 20 | /** 21 | * 根据用户名查找菜单列表 22 | * @param userName 23 | * @return 24 | */ 25 | List findByUser(String userName); 26 | } 27 | -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/service/RoleService.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.service; 2 | 3 | import cn.jjvu.xiao.pojo.Role; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 角色管理 9 | */ 10 | public interface RoleService extends CrudService { 11 | 12 | /** 13 | * 查询全部 14 | * @return 15 | */ 16 | List findAll(); 17 | 18 | /** 19 | * 查询角色菜单集合 20 | * @return 21 | */ 22 | List findRoleMenus(Long roleId); 23 | 24 | /** 25 | * 保存角色菜单 26 | * @param records 27 | * @return 28 | */ 29 | int saveRoleMenus(List records); 30 | 31 | /** 32 | * 根据名称查询 33 | * @param name 34 | * @return 35 | */ 36 | List findByName(String name); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/service/UserService.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.service; 2 | 3 | import cn.jjvu.xiao.pojo.LoginLog; 4 | import cn.jjvu.xiao.pojo.User; 5 | 6 | import java.io.File; 7 | import java.util.List; 8 | import java.util.Set; 9 | 10 | public interface UserService extends CrudService { 11 | 12 | User login(String loginname, String passwd, LoginLog loginLog); 13 | 14 | User findByName(String username); 15 | 16 | /** 17 | * 查找用户的菜单权限标识集合 18 | * @param userName 19 | * @return 20 | */ 21 | Set findPermissions(String userName); 22 | 23 | /** 24 | * 查找用户的角色集合 25 | * @param userName 26 | * @return 27 | */ 28 | List findUserRoles(Long userId); 29 | 30 | /** 31 | * 生成用户信息Excel文件 32 | * @param pageRequest 要导出的分页查询参数 33 | * @return 34 | */ 35 | File createUserExcelFile(int page, int size); 36 | } 37 | -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/service/impl/ConfigServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.service.impl; 2 | 3 | import java.util.List; 4 | import java.util.Set; 5 | 6 | import cn.jjvu.xiao.config.MybatisPageHelper; 7 | import cn.jjvu.xiao.core.model.PageRequest; 8 | import cn.jjvu.xiao.core.model.PageResult; 9 | import cn.jjvu.xiao.dao.ConfigMapper; 10 | import cn.jjvu.xiao.pojo.Config; 11 | import cn.jjvu.xiao.pojo.ConfigExample; 12 | import cn.jjvu.xiao.service.ConfigService; 13 | import org.springframework.stereotype.Service; 14 | import org.springframework.transaction.annotation.Transactional; 15 | 16 | import javax.annotation.Resource; 17 | 18 | @Service 19 | @Transactional 20 | public class ConfigServiceImpl implements ConfigService { 21 | 22 | @Resource 23 | private ConfigMapper configMapper; 24 | 25 | @Override 26 | public int save(Config record) { 27 | if(record.getId() == null || record.getId() == 0) { 28 | return configMapper.insertSelective(record); 29 | } 30 | return update(record); 31 | } 32 | 33 | @Override 34 | public int delete(Number id) { 35 | return configMapper.deleteByPrimaryKey(id.intValue()); 36 | } 37 | 38 | @Override 39 | public int delete(Set ids) { 40 | for (Number id: ids) { 41 | configMapper.deleteByPrimaryKey(id.intValue()); 42 | } 43 | return ids.size(); 44 | } 45 | 46 | @Override 47 | public int update(Config record) { 48 | return configMapper.updateByPrimaryKeySelective(record); 49 | } 50 | 51 | @Override 52 | public Config findById(Number T) { 53 | return configMapper.selectByPrimaryKey((Integer) T); 54 | } 55 | 56 | @Override 57 | public PageResult findPage(PageRequest pageRequest) { 58 | Object label = pageRequest.getParam("label"); 59 | if(label != null) { 60 | return MybatisPageHelper.findPage(pageRequest, configMapper, "findPageByLabel", label); 61 | } 62 | return MybatisPageHelper.findPage(pageRequest, configMapper); 63 | } 64 | 65 | @Override 66 | public List findByLable(String lable) { 67 | ConfigExample example = new ConfigExample(); 68 | ConfigExample.Criteria criteria = example.createCriteria(); 69 | criteria.andLabelEqualTo(lable); 70 | return configMapper.selectByExample(example); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/service/impl/DeptServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.service.impl; 2 | 3 | import cn.jjvu.xiao.core.model.PageRequest; 4 | import cn.jjvu.xiao.core.model.PageResult; 5 | import cn.jjvu.xiao.dao.DeptMapper; 6 | import cn.jjvu.xiao.pojo.Dept; 7 | import cn.jjvu.xiao.service.DeptService; 8 | import org.springframework.stereotype.Service; 9 | 10 | import javax.annotation.Resource; 11 | import java.util.ArrayList; 12 | import java.util.List; 13 | import java.util.Set; 14 | 15 | @Service 16 | public class DeptServiceImpl implements DeptService { 17 | 18 | @Resource 19 | private DeptMapper deptMapper; 20 | 21 | @Override 22 | public List findTree() { 23 | List depts = new ArrayList<>(); 24 | List sysDepts = new ArrayList<>(); 25 | for (Dept dept : depts) { 26 | if (dept.getParentId() == null || dept.getParentId() == 0) { 27 | // dept.set 28 | } 29 | } 30 | return null; 31 | } 32 | 33 | @Override 34 | public int save(Dept record) { 35 | return deptMapper.insertSelective(record); 36 | } 37 | 38 | @Override 39 | public int delete(Number id) { 40 | return deptMapper.deleteByPrimaryKey(id.longValue()); 41 | } 42 | 43 | @Override 44 | public int delete(Set id) { 45 | // for (: 46 | // ) { 47 | // 48 | // } 49 | return 1; 50 | } 51 | 52 | @Override 53 | public int update(Dept record) { 54 | return deptMapper.updateByPrimaryKeySelective(record); 55 | } 56 | 57 | @Override 58 | public Dept findById(Number T) { 59 | return deptMapper.selectByPrimaryKey(T.longValue()); 60 | } 61 | 62 | @Override 63 | public PageResult findPage(PageRequest pageRequest) { 64 | return null; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/service/impl/DictServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.service.impl; 2 | 3 | import cn.jjvu.xiao.core.model.PageRequest; 4 | import cn.jjvu.xiao.core.model.PageResult; 5 | import cn.jjvu.xiao.dao.DictMapper; 6 | import cn.jjvu.xiao.pojo.Dict; 7 | import cn.jjvu.xiao.service.DictService; 8 | import org.springframework.security.access.prepost.PreAuthorize; 9 | import org.springframework.stereotype.Service; 10 | 11 | import javax.annotation.Resource; 12 | import java.util.List; 13 | import java.util.Set; 14 | 15 | @Service 16 | public class DictServiceImpl implements DictService { 17 | 18 | @Resource 19 | private DictMapper dictMapper; 20 | 21 | @Override 22 | public List findByLable(String lable) { 23 | return null; 24 | } 25 | 26 | @PreAuthorize("hasAuthority('sys:dict:add')") 27 | @Override 28 | public int save(Dict record) { 29 | if (record.getId() == null || record.getId() == 0) { 30 | return dictMapper.insertSelective(record); 31 | } 32 | return update(record); 33 | } 34 | 35 | @Override 36 | public int delete(Number id) { 37 | return dictMapper.deleteByPrimaryKey((Integer) id); 38 | } 39 | 40 | @Override 41 | public int delete(Set ids) { 42 | for (Number id : ids) { 43 | dictMapper.deleteByPrimaryKey((Integer) id); 44 | } 45 | return ids.size(); 46 | } 47 | 48 | @Override 49 | public int update(Dict record) { 50 | return dictMapper.updateByPrimaryKeySelective(record); 51 | } 52 | 53 | @Override 54 | public Dict findById(Number T) { 55 | return dictMapper.selectByPrimaryKey(T.intValue()); 56 | } 57 | 58 | @Override 59 | public PageResult findPage(PageRequest pageRequest) { 60 | return null; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/service/impl/LogServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.service.impl; 2 | 3 | import cn.jjvu.xiao.core.model.PageRequest; 4 | import cn.jjvu.xiao.core.model.PageResult; 5 | import cn.jjvu.xiao.dao.LogMapper; 6 | import cn.jjvu.xiao.pojo.Log; 7 | import cn.jjvu.xiao.service.LogService; 8 | import org.springframework.stereotype.Service; 9 | 10 | import javax.annotation.Resource; 11 | import java.util.Set; 12 | 13 | @Service 14 | public class LogServiceImpl implements LogService { 15 | 16 | @Resource 17 | private LogMapper logMapper; 18 | 19 | @Override 20 | public int save(Log record) { 21 | return logMapper.insert(record); 22 | } 23 | 24 | @Override 25 | public int delete(Number id) { 26 | return logMapper.deleteByPrimaryKey((Integer) id); 27 | } 28 | 29 | @Override 30 | public int delete(Set ids) { 31 | for (Number id : ids) { 32 | logMapper.deleteByPrimaryKey((Integer) id); 33 | } 34 | return 1; 35 | } 36 | 37 | @Override 38 | public int update(Log record) { 39 | return logMapper.updateByPrimaryKeySelective(record); 40 | } 41 | 42 | @Override 43 | public Log findById(Number id) { 44 | return logMapper.selectByPrimaryKey((Integer) id); 45 | } 46 | 47 | @Override 48 | public PageResult findPage(PageRequest pageRequest) { 49 | return null; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/service/impl/LoginLogServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.service.impl; 2 | 3 | import cn.jjvu.xiao.config.MybatisPageHelper; 4 | import cn.jjvu.xiao.core.model.PageRequest; 5 | import cn.jjvu.xiao.core.model.PageResult; 6 | import cn.jjvu.xiao.dao.LoginLogMapper; 7 | import cn.jjvu.xiao.pojo.LoginLog; 8 | import cn.jjvu.xiao.service.LoginLogService; 9 | import org.springframework.stereotype.Service; 10 | 11 | import javax.annotation.Resource; 12 | import java.util.Set; 13 | 14 | @Service 15 | public class LoginLogServiceImpl implements LoginLogService { 16 | 17 | @Resource 18 | private LoginLogMapper loginLogMapper; 19 | 20 | @Override 21 | public int save(LoginLog record) { 22 | if(record.getId() == null || record.getId() == 0) { 23 | return loginLogMapper.insertSelective(record); 24 | } 25 | return loginLogMapper.updateByPrimaryKeySelective(record); 26 | } 27 | 28 | @Override 29 | public int delete(Number id) { 30 | return loginLogMapper.deleteByPrimaryKey((Integer) id); 31 | } 32 | 33 | @Override 34 | public int delete(Set records) { 35 | for (Number id : records) { 36 | loginLogMapper.deleteByPrimaryKey((Integer) id); 37 | } 38 | return 1; 39 | } 40 | 41 | @Override 42 | public int update(LoginLog record) { 43 | return loginLogMapper.updateByPrimaryKeySelective(record); 44 | } 45 | 46 | @Override 47 | public LoginLog findById(Number id) { 48 | return loginLogMapper.selectByPrimaryKey((Integer) id); 49 | } 50 | 51 | @Override 52 | public PageResult findPage(PageRequest pageRequest) { 53 | Object userName = pageRequest.getParam("userName"); 54 | if(userName != null) { 55 | return MybatisPageHelper.findPage(pageRequest, loginLogMapper, "findPageByUserName", userName); 56 | } 57 | Object status = pageRequest.getParam("status"); 58 | if(status != null) { 59 | return MybatisPageHelper.findPage(pageRequest, loginLogMapper, "findPageByStatus", status); 60 | } 61 | return MybatisPageHelper.findPage(pageRequest, loginLogMapper); 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/service/impl/MenuServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.service.impl; 2 | 3 | import cn.jjvu.xiao.core.constant.LiveShopContants; 4 | import cn.jjvu.xiao.core.model.PageRequest; 5 | import cn.jjvu.xiao.core.model.PageResult; 6 | import cn.jjvu.xiao.dao.MenuMapper; 7 | import cn.jjvu.xiao.pojo.Menu; 8 | import cn.jjvu.xiao.pojo.MenuExample; 9 | import cn.jjvu.xiao.service.MenuService; 10 | import org.springframework.stereotype.Service; 11 | 12 | import javax.annotation.Resource; 13 | import java.util.ArrayList; 14 | import java.util.List; 15 | import java.util.Set; 16 | 17 | @Service 18 | public class MenuServiceImpl implements MenuService { 19 | 20 | @Resource 21 | private MenuMapper menuMapper; 22 | 23 | 24 | @Override 25 | public List findTree(String userName, int menuType) { 26 | List sysMenus = new ArrayList<>(); 27 | return null; 28 | } 29 | 30 | @Override 31 | public List findByUser(String userName) { 32 | MenuExample example = new MenuExample(); 33 | if(userName == null || "".equals(userName) || LiveShopContants.ADMIN.equalsIgnoreCase(userName)) { 34 | return menuMapper.selectByExample(example); 35 | } 36 | return menuMapper.findByUserName(userName); 37 | } 38 | 39 | @Override 40 | public int save(Menu record) { 41 | return menuMapper.insert(record); 42 | } 43 | 44 | @Override 45 | public int delete(Number id) { 46 | return menuMapper.deleteByPrimaryKey((Integer) id); 47 | } 48 | 49 | @Override 50 | public int delete(Set ids) { 51 | for (Number id : ids) { 52 | menuMapper.deleteByPrimaryKey((Integer) id); 53 | } 54 | return 1; 55 | } 56 | 57 | @Override 58 | public int update(Menu record) { 59 | return menuMapper.updateByPrimaryKeySelective(record); 60 | } 61 | 62 | @Override 63 | public Menu findById(Number id) { 64 | return menuMapper.selectByPrimaryKey((Integer) id); 65 | } 66 | 67 | @Override 68 | public PageResult findPage(PageRequest pageRequest) { 69 | return null; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/service/impl/RoleServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.service.impl; 2 | 3 | import cn.jjvu.xiao.core.model.PageRequest; 4 | import cn.jjvu.xiao.core.model.PageResult; 5 | import cn.jjvu.xiao.dao.RoleMapper; 6 | import cn.jjvu.xiao.pojo.Role; 7 | import cn.jjvu.xiao.service.RoleService; 8 | import org.springframework.stereotype.Service; 9 | 10 | import javax.annotation.Resource; 11 | import java.util.List; 12 | import java.util.Set; 13 | 14 | @Service 15 | public class RoleServiceImpl implements RoleService { 16 | 17 | @Resource 18 | private RoleMapper roleMapper; 19 | 20 | @Override 21 | public List findAll() { 22 | return null; 23 | } 24 | 25 | @Override 26 | public List findRoleMenus(Long roleId) { 27 | return null; 28 | } 29 | 30 | @Override 31 | public int saveRoleMenus(List records) { 32 | return 0; 33 | } 34 | 35 | @Override 36 | public List findByName(String name) { 37 | return null; 38 | } 39 | 40 | @Override 41 | public int save(Role record) { 42 | return 0; 43 | } 44 | 45 | @Override 46 | public int delete(Number id) { 47 | return 0; 48 | } 49 | 50 | @Override 51 | public int delete(Set ids) { 52 | return 0; 53 | } 54 | 55 | @Override 56 | public int update(Role record) { 57 | return 0; 58 | } 59 | 60 | @Override 61 | public Role findById(Number id) { 62 | return null; 63 | } 64 | 65 | @Override 66 | public PageResult findPage(PageRequest pageRequest) { 67 | return null; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/utils/FileUtils.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.utils; 2 | 3 | import javax.servlet.http.HttpServletResponse; 4 | import java.io.*; 5 | 6 | public class FileUtils { 7 | /** 8 | * 下载文件 9 | * @param response 10 | * @param file 11 | * @param newFileName 12 | */ 13 | public static void downloadFile(HttpServletResponse response, File file, String newFileName) { 14 | try { 15 | response.setHeader("Content-Disposition", "attachment; filename=" + new String(newFileName.getBytes("ISO-8859-1"), "UTF-8")); 16 | BufferedOutputStream bos = new BufferedOutputStream(response.getOutputStream()); 17 | InputStream is = new FileInputStream(file.getAbsolutePath()); 18 | BufferedInputStream bis = new BufferedInputStream(is); 19 | int length = 0; 20 | byte[] temp = new byte[1 * 1024 * 10]; 21 | while ((length = bis.read(temp)) != -1) { 22 | bos.write(temp, 0, length); 23 | } 24 | bos.flush(); 25 | bis.close(); 26 | bos.close(); 27 | is.close(); 28 | } catch (Exception e) { 29 | e.printStackTrace(); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/utils/ILiveShopStringUtils.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.utils; 2 | 3 | import java.util.regex.Pattern; 4 | 5 | /** 6 | * 字符串工具类 7 | * @Date 2020-07-17 8 | */ 9 | public class ILiveShopStringUtils { 10 | 11 | /** 12 | * 校验邮箱地址格式是否正确 13 | * @param email 邮箱地址 14 | * @return 正确结果 15 | */ 16 | public static boolean isValidEmail(String email) { 17 | if ((email != null) && (!email.isEmpty())) { 18 | return Pattern.matches("^(\\w+([-.][A-Za-z0-9]+)*){3,18}@\\w+([-.][A-Za-z0-9]+)*\\.\\w+([-.][A-Za-z0-9]+)*$", email); 19 | } 20 | return false; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/utils/PasswordUtils.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.utils; 2 | 3 | import java.util.UUID; 4 | 5 | public class PasswordUtils { 6 | 7 | /** 8 | * 匹配密码 9 | * @param salt 盐 10 | * @param rawPass 明文 11 | * @param encPass 密文 12 | * @return 13 | */ 14 | public static boolean matches(String salt, String rawPass, String encPass) { 15 | return new PasswordEncoder(salt).matches(encPass, rawPass); 16 | } 17 | 18 | /** 19 | * 明文密码加密 20 | * @param rawPass 明文 21 | * @param salt 22 | * @return 23 | */ 24 | public static String encode(String rawPass, String salt) { 25 | return new PasswordEncoder(salt).encode(rawPass); 26 | } 27 | 28 | /** 29 | * 获取加密盐 30 | * @return 31 | */ 32 | public static String getSalt() { 33 | return UUID.randomUUID().toString().replaceAll("-", "").substring(0, 20); 34 | } 35 | } 36 | 37 | -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/utils/PoiUtils.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.utils; 2 | 3 | import org.apache.poi.ss.usermodel.Workbook; 4 | import org.apache.poi.util.IOUtils; 5 | 6 | import java.io.*; 7 | 8 | public class PoiUtils { 9 | /** 10 | * 生成Excel文件 11 | * @param workbook 12 | * @param fileName 13 | * @return 14 | */ 15 | public static File createExcelFile(Workbook workbook, String fileName) { 16 | OutputStream stream = null; 17 | File file = null; 18 | try { 19 | file = File.createTempFile(fileName, ".xlsx"); 20 | stream = new FileOutputStream(file.getAbsoluteFile()); 21 | workbook.write(stream); 22 | } catch (FileNotFoundException e) { 23 | e.printStackTrace(); 24 | } catch (IOException e) { 25 | e.printStackTrace(); 26 | } finally { 27 | IOUtils.closeQuietly(workbook); 28 | IOUtils.closeQuietly(stream); 29 | } 30 | return file; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /live_shop_server/src/main/java/cn/jjvu/xiao/utils/ReflectionUtils.java: -------------------------------------------------------------------------------- 1 | package cn.jjvu.xiao.utils; 2 | 3 | import java.lang.reflect.InvocationTargetException; 4 | import java.lang.reflect.Method; 5 | 6 | public class ReflectionUtils { 7 | 8 | 9 | /** 10 | * 根据方法名调用指定对象的方法 11 | * @param object 要调用方法的对象 12 | * @param method 要调用的方法名 13 | * @param args 参数对象数组 14 | * @return 15 | */ 16 | public static Object invoke(Object object, String method, Object... args) { 17 | Object result = null; 18 | Class extends Object> clazz = object.getClass(); 19 | Method queryMethod = getMethod(clazz, method, args); 20 | if(queryMethod != null) { 21 | try { 22 | result = queryMethod.invoke(object, args); 23 | } catch (IllegalAccessException e) { 24 | e.printStackTrace(); 25 | } catch (IllegalArgumentException e) { 26 | e.printStackTrace(); 27 | } catch (InvocationTargetException e) { 28 | e.printStackTrace(); 29 | } 30 | } else { 31 | try { 32 | throw new NoSuchMethodException(clazz.getName() + " 类中没有找到 " + method + " 方法。"); 33 | } catch (NoSuchMethodException e) { 34 | e.printStackTrace(); 35 | } 36 | } 37 | return result; 38 | } 39 | 40 | /** 41 | * 根据方法名和参数对象查找方法 42 | * @param clazz 43 | * @param name 44 | * @param args 参数实例数据 45 | * @return 46 | */ 47 | public static Method getMethod(Class extends Object> clazz, String name, Object[] args) { 48 | Method queryMethod = null; 49 | Method[] methods = clazz.getMethods(); 50 | for(Method method:methods) { 51 | if(method.getName().equals(name)) { 52 | Class>[] parameterTypes = method.getParameterTypes(); 53 | if(parameterTypes.length == args.length) { 54 | boolean isSameMethod = true; 55 | for(int i=0; i 1%", "last 2 versions", "not ie <= 8"] 7 | } 8 | }], 9 | "stage-2" 10 | ], 11 | "plugins": ["transform-vue-jsx", "transform-runtime"] 12 | } 13 | -------------------------------------------------------------------------------- /live_shop_web/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /live_shop_web/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | /dist/ 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # Editor directories and files 9 | .idea 10 | .vscode 11 | *.suo 12 | *.ntvs* 13 | *.njsproj 14 | *.sln 15 | -------------------------------------------------------------------------------- /live_shop_web/.postcssrc.js: -------------------------------------------------------------------------------- 1 | // https://github.com/michael-ciniawsky/postcss-load-config 2 | 3 | module.exports = { 4 | "plugins": { 5 | "postcss-import": {}, 6 | "postcss-url": {}, 7 | // to edit target browsers: use "browserslist" field in package.json 8 | "autoprefixer": {} 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /live_shop_web/README.md: -------------------------------------------------------------------------------- 1 | # live_shop_web 2 | 3 | > 4 | 5 | ## Build Setup 6 | 7 | ``` bash 8 | # install dependencies 9 | npm install 10 | 11 | # serve with hot reload at localhost:8080 12 | npm run dev 13 | 14 | # build for production with minification 15 | npm run build 16 | 17 | # build for production and view the bundle analyzer report 18 | npm run build --report 19 | ``` 20 | 21 | For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader). 22 | -------------------------------------------------------------------------------- /live_shop_web/build/build.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | require('./check-versions')() 3 | 4 | process.env.NODE_ENV = 'production' 5 | 6 | const ora = require('ora') 7 | const rm = require('rimraf') 8 | const path = require('path') 9 | const chalk = require('chalk') 10 | const webpack = require('webpack') 11 | const config = require('../config') 12 | const webpackConfig = require('./webpack.prod.conf') 13 | 14 | const spinner = ora('building for production...') 15 | spinner.start() 16 | 17 | rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { 18 | if (err) throw err 19 | webpack(webpackConfig, (err, stats) => { 20 | spinner.stop() 21 | if (err) throw err 22 | process.stdout.write(stats.toString({ 23 | colors: true, 24 | modules: false, 25 | children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. 26 | chunks: false, 27 | chunkModules: false 28 | }) + '\n\n') 29 | 30 | if (stats.hasErrors()) { 31 | console.log(chalk.red(' Build failed with errors.\n')) 32 | process.exit(1) 33 | } 34 | 35 | console.log(chalk.cyan(' Build complete.\n')) 36 | console.log(chalk.yellow( 37 | ' Tip: built files are meant to be served over an HTTP server.\n' + 38 | ' Opening index.html over file:// won\'t work.\n' 39 | )) 40 | }) 41 | }) 42 | -------------------------------------------------------------------------------- /live_shop_web/build/check-versions.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const chalk = require('chalk') 3 | const semver = require('semver') 4 | const packageConfig = require('../package.json') 5 | const shell = require('shelljs') 6 | 7 | function exec (cmd) { 8 | return require('child_process').execSync(cmd).toString().trim() 9 | } 10 | 11 | const versionRequirements = [ 12 | { 13 | name: 'node', 14 | currentVersion: semver.clean(process.version), 15 | versionRequirement: packageConfig.engines.node 16 | } 17 | ] 18 | 19 | if (shell.which('npm')) { 20 | versionRequirements.push({ 21 | name: 'npm', 22 | currentVersion: exec('npm --version'), 23 | versionRequirement: packageConfig.engines.npm 24 | }) 25 | } 26 | 27 | module.exports = function () { 28 | const warnings = [] 29 | 30 | for (let i = 0; i < versionRequirements.length; i++) { 31 | const mod = versionRequirements[i] 32 | 33 | if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { 34 | warnings.push(mod.name + ': ' + 35 | chalk.red(mod.currentVersion) + ' should be ' + 36 | chalk.green(mod.versionRequirement) 37 | ) 38 | } 39 | } 40 | 41 | if (warnings.length) { 42 | console.log('') 43 | console.log(chalk.yellow('To use this template, you must update following to modules:')) 44 | console.log() 45 | 46 | for (let i = 0; i < warnings.length; i++) { 47 | const warning = warnings[i] 48 | console.log(' ' + warning) 49 | } 50 | 51 | console.log() 52 | process.exit(1) 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /live_shop_web/build/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_web/build/logo.png -------------------------------------------------------------------------------- /live_shop_web/build/vue-loader.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const utils = require('./utils') 3 | const config = require('../config') 4 | const isProduction = process.env.NODE_ENV === 'production' 5 | const sourceMapEnabled = isProduction 6 | ? config.build.productionSourceMap 7 | : config.dev.cssSourceMap 8 | 9 | module.exports = { 10 | loaders: utils.cssLoaders({ 11 | sourceMap: sourceMapEnabled, 12 | extract: isProduction 13 | }), 14 | cssSourceMap: sourceMapEnabled, 15 | cacheBusting: config.dev.cacheBusting, 16 | transformToRequire: { 17 | video: ['src', 'poster'], 18 | source: 'src', 19 | img: 'src', 20 | image: 'xlink:href' 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /live_shop_web/config/dev.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const merge = require('webpack-merge') 3 | const prodEnv = require('./prod.env') 4 | 5 | module.exports = merge(prodEnv, { 6 | NODE_ENV: '"development"' 7 | }) 8 | -------------------------------------------------------------------------------- /live_shop_web/config/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | // Template version: 1.3.1 3 | // see http://vuejs-templates.github.io/webpack for documentation. 4 | 5 | const path = require('path') 6 | 7 | module.exports = { 8 | dev: { 9 | 10 | // Paths 11 | assetsSubDirectory: 'static', 12 | assetsPublicPath: '/', 13 | proxyTable: {}, 14 | 15 | // Various Dev Server settings 16 | host: 'localhost', // can be overwritten by process.env.HOST 17 | port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined 18 | autoOpenBrowser: false, 19 | errorOverlay: true, 20 | notifyOnErrors: true, 21 | poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- 22 | 23 | 24 | /** 25 | * Source Maps 26 | */ 27 | 28 | // https://webpack.js.org/configuration/devtool/#development 29 | devtool: 'cheap-module-eval-source-map', 30 | 31 | // If you have problems debugging vue-files in devtools, 32 | // set this to false - it *may* help 33 | // https://vue-loader.vuejs.org/en/options.html#cachebusting 34 | cacheBusting: true, 35 | 36 | cssSourceMap: true 37 | }, 38 | 39 | build: { 40 | // Template for index.html 41 | index: path.resolve(__dirname, '../dist/index.html'), 42 | 43 | // Paths 44 | assetsRoot: path.resolve(__dirname, '../dist'), 45 | assetsSubDirectory: 'static', 46 | assetsPublicPath: '/', 47 | 48 | /** 49 | * Source Maps 50 | */ 51 | 52 | productionSourceMap: true, 53 | // https://webpack.js.org/configuration/devtool/#production 54 | devtool: '#source-map', 55 | 56 | // Gzip off by default as many popular static hosts such as 57 | // Surge or Netlify already gzip all static assets for you. 58 | // Before setting to `true`, make sure to: 59 | // npm install --save-dev compression-webpack-plugin 60 | productionGzip: false, 61 | productionGzipExtensions: ['js', 'css'], 62 | 63 | // Run the build command with an extra argument to 64 | // View the bundle analyzer report after build finishes: 65 | // `npm run build --report` 66 | // Set to `true` or `false` to always turn it on or off 67 | bundleAnalyzerReport: process.env.npm_config_report 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /live_shop_web/config/prod.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | module.exports = { 3 | NODE_ENV: '"production"' 4 | } 5 | -------------------------------------------------------------------------------- /live_shop_web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | live_shop_web 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /live_shop_web/src/App.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | 23 | -------------------------------------------------------------------------------- /live_shop_web/src/assets/languages/en_us.json: -------------------------------------------------------------------------------- 1 | { 2 | "common": { 3 | "home": "Home", 4 | "login": "Login", 5 | "logout": "Logout", 6 | "doc": "Document", 7 | "blog": "Blog", 8 | "projectRepo": "Project", 9 | "myMsg": "My Message", 10 | "config": "Config", 11 | "backup": "Backup", 12 | "restore": "Restore", 13 | "backupRestore": "Backup Restore", 14 | "versionName": "Version", 15 | "exit": "Exit" 16 | }, 17 | "action": { 18 | "operation": "Operation", 19 | "add": "Add", 20 | "edit": "Edit", 21 | "delete": "Delete", 22 | "batchDelete": "Batch Delete", 23 | "search": "Search", 24 | "loading": "loading", 25 | "submit": "Submit", 26 | "comfirm": "Comfirm", 27 | "cancel": "Cancel", 28 | "reset": "Reset" 29 | } 30 | } -------------------------------------------------------------------------------- /live_shop_web/src/assets/languages/zh_cn.json: -------------------------------------------------------------------------------- 1 | { 2 | "common": { 3 | "home": "首页", 4 | "login": "登录", 5 | "logout": "退出登录", 6 | "doc": "文档", 7 | "blog": "博客", 8 | "projectRepo": "项目", 9 | "myMsg": "我的消息", 10 | "config": "系统配置", 11 | "backup": "备份", 12 | "restore": "还原", 13 | "backupRestore": "备份还原", 14 | "versionName": "版本名称", 15 | "exit": "退出" 16 | }, 17 | "action": { 18 | "operation": "操作", 19 | "add": "新增", 20 | "edit": "编辑", 21 | "delete": "删除", 22 | "batchDelete": "批量删除", 23 | "search": "查询", 24 | "loading": "拼命加载中", 25 | "submit": "提交", 26 | "comfirm": "确定", 27 | "cancel": "取消", 28 | "reset": "重置" 29 | 30 | } 31 | } -------------------------------------------------------------------------------- /live_shop_web/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_web/src/assets/logo.png -------------------------------------------------------------------------------- /live_shop_web/src/assets/user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_web/src/assets/user.png -------------------------------------------------------------------------------- /live_shop_web/src/components/Hamburger/index.vue: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 8 | 10 | 11 | 12 | 13 | 33 | 34 | -------------------------------------------------------------------------------- /live_shop_web/src/http/api.js: -------------------------------------------------------------------------------- 1 | /* 2 | * 接口统一集成模块 3 | */ 4 | import * as login from './modules/login' 5 | import * as user from './modules/user' 6 | import * as dept from './modules/dept' 7 | import * as role from './modules/role' 8 | import * as menu from './modules/menu' 9 | import * as dict from './modules/dict' 10 | import * as config from './modules/config' 11 | import * as log from './modules/log' 12 | import * as loginlog from './modules/loginlog' 13 | 14 | 15 | // 默认全部导出 16 | export default { 17 | login, 18 | user, 19 | dept, 20 | role, 21 | menu, 22 | dict, 23 | config, 24 | log, 25 | loginlog 26 | } -------------------------------------------------------------------------------- /live_shop_web/src/http/axios.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios' 2 | import config from './config' 3 | import Cookies from 'js-cookie' 4 | import router from '@/router' 5 | 6 | export default function $axios(opions) { 7 | return new Promise((resolve, reject) => { 8 | const instance = axios.create({ 9 | baseURL: config.baseUrl, 10 | headers: config.headers, 11 | timeout: config.timeout, 12 | withCredentials: config.withCredentials 13 | }); 14 | instance.interceptors.request.use( 15 | config => { 16 | let token = Cookies.get('token') 17 | if (token) 18 | config.headers.token = token 19 | else 20 | router.push('/login') 21 | return config 22 | }, 23 | error => { 24 | return Promise.reject(error) 25 | } 26 | ), 27 | instance.interceptors.response.use( 28 | response => { 29 | return response.data 30 | }, 31 | err => { 32 | return Promise.reject(err) 33 | } 34 | ), 35 | instance(options).then(res => { 36 | resolve(res) 37 | return false 38 | }).catch(err => { 39 | reject(err) 40 | }) 41 | }); 42 | } 43 | 44 | -------------------------------------------------------------------------------- /live_shop_web/src/http/config.js: -------------------------------------------------------------------------------- 1 | 2 | import {baseUrl} from '@/utils/global' 3 | 4 | export default { 5 | method: 'get', 6 | // URL的前缀 IP地址或者域名 7 | baseUrl: baseUrl, 8 | // 设置请求头的数据类型为json 9 | headers: { 10 | 'Content-Type': 'application/json;charset=UTF-8' 11 | }, 12 | // 请求参数 13 | data: {}, 14 | // 超时时间为10秒 15 | timeout: 10000, 16 | // 携带凭证 17 | withCredentials: true, 18 | // 服务器响应数据类型 19 | responseType: 'json' 20 | } -------------------------------------------------------------------------------- /live_shop_web/src/http/index.js: -------------------------------------------------------------------------------- 1 | // 导入所有接口 2 | import api from './api' 3 | 4 | const install = Vue => { 5 | if (install.installed) 6 | return; 7 | 8 | install.installed = true; 9 | 10 | Object.defineProperties(Vue.prototype, { 11 | // 注意,此处挂载在 Vue 原型的 $api 对象上 12 | $api: { 13 | get() { 14 | return api 15 | } 16 | } 17 | }) 18 | } 19 | 20 | export default install -------------------------------------------------------------------------------- /live_shop_web/src/http/modules/config.js: -------------------------------------------------------------------------------- 1 | import axios from '../axios' 2 | 3 | /* 4 | * 系统配置模块 5 | */ 6 | 7 | // 保存 8 | export const save = (data) => { 9 | return axios({ 10 | url: '/config/save', 11 | method: 'post', 12 | data 13 | }) 14 | } 15 | // 删除 16 | export const batchDelete = (data) => { 17 | return axios({ 18 | url: '/config/delete', 19 | method: 'post', 20 | data 21 | }) 22 | } 23 | // 分页查询 24 | export const findPage = (data) => { 25 | return axios({ 26 | url: '/config/findPage', 27 | method: 'post', 28 | data 29 | }) 30 | } -------------------------------------------------------------------------------- /live_shop_web/src/http/modules/dept.js: -------------------------------------------------------------------------------- 1 | import axios from '../axios' 2 | 3 | /* 4 | * 机构管理模块 5 | */ 6 | 7 | // 保存 8 | export const save = (data) => { 9 | return axios({ 10 | url: '/dept/save', 11 | method: 'post', 12 | data 13 | }) 14 | } 15 | // 删除 16 | export const batchDelete = (data) => { 17 | return axios({ 18 | url: '/dept/delete', 19 | method: 'post', 20 | data 21 | }) 22 | } 23 | // 查询机构树 24 | export const findDeptTree = () => { 25 | return axios({ 26 | url: '/dept/findTree', 27 | method: 'get' 28 | }) 29 | } -------------------------------------------------------------------------------- /live_shop_web/src/http/modules/dict.js: -------------------------------------------------------------------------------- 1 | import axios from '../axios' 2 | 3 | /* 4 | * 字典管理模块 5 | */ 6 | 7 | // 保存 8 | export const save = (data) => { 9 | return axios({ 10 | url: '/dict/save', 11 | method: 'post', 12 | data 13 | }) 14 | } 15 | // 删除 16 | export const batchDelete = (data) => { 17 | return axios({ 18 | url: '/dict/delete', 19 | method: 'post', 20 | data 21 | }) 22 | } 23 | // 分页查询 24 | export const findPage = (data) => { 25 | return axios({ 26 | url: '/dict/findPage', 27 | method: 'post', 28 | data 29 | }) 30 | } -------------------------------------------------------------------------------- /live_shop_web/src/http/modules/log.js: -------------------------------------------------------------------------------- 1 | import axios from '../axios' 2 | 3 | /* 4 | * 操作日志模块 5 | */ 6 | 7 | // 删除 8 | export const batchDelete = (data) => { 9 | return axios({ 10 | url: '/log/delete', 11 | method: 'post', 12 | data 13 | }) 14 | } 15 | // 分页查询 16 | export const findPage = (data) => { 17 | return axios({ 18 | url: '/log/findPage', 19 | method: 'post', 20 | data 21 | }) 22 | } -------------------------------------------------------------------------------- /live_shop_web/src/http/modules/login.js: -------------------------------------------------------------------------------- 1 | import axios from '../axios' 2 | 3 | /* 4 | * 系统登录模块 5 | */ 6 | 7 | // 登录 8 | export const login = data => { 9 | return axios({ 10 | url: 'login', 11 | method: 'post', 12 | data 13 | }) 14 | } 15 | 16 | // 登出 17 | export const logout = () => { 18 | return axios({ 19 | url: 'logout', 20 | method: 'get' 21 | }) 22 | } 23 | -------------------------------------------------------------------------------- /live_shop_web/src/http/modules/loginlog.js: -------------------------------------------------------------------------------- 1 | import axios from '../axios' 2 | 3 | /* 4 | * 操作日志模块 5 | */ 6 | 7 | // 删除 8 | export const batchDelete = (data) => { 9 | return axios({ 10 | url: '/loginlog/delete', 11 | method: 'post', 12 | data 13 | }) 14 | } 15 | // 分页查询 16 | export const findPage = (data) => { 17 | return axios({ 18 | url: '/loginlog/findPage', 19 | method: 'post', 20 | data 21 | }) 22 | } -------------------------------------------------------------------------------- /live_shop_web/src/http/modules/menu.js: -------------------------------------------------------------------------------- 1 | import axios from '../axios' 2 | 3 | /* 4 | * 菜单管理模块 5 | */ 6 | 7 | // 保存 8 | export const save = (data) => { 9 | return axios({ 10 | url: '/menu/save', 11 | method: 'post', 12 | data 13 | }) 14 | } 15 | // 删除 16 | export const batchDelete = (data) => { 17 | return axios({ 18 | url: '/menu/delete', 19 | method: 'post', 20 | data 21 | }) 22 | } 23 | // 查找导航菜单树 24 | export const findNavTree = (params) => { 25 | return axios({ 26 | url: '/menu/findNavTree', 27 | method: 'get', 28 | params 29 | }) 30 | } 31 | // 查找导航菜单树 32 | export const findMenuTree = () => { 33 | return axios({ 34 | url: '/menu/findMenuTree', 35 | method: 'get' 36 | }) 37 | } -------------------------------------------------------------------------------- /live_shop_web/src/http/modules/role.js: -------------------------------------------------------------------------------- 1 | import axios from '../axios' 2 | 3 | /* 4 | * 角色管理模块 5 | */ 6 | 7 | // 保存 8 | export const save = (data) => { 9 | return axios({ 10 | url: '/role/save', 11 | method: 'post', 12 | data 13 | }) 14 | } 15 | // 删除 16 | export const batchDelete = (data) => { 17 | return axios({ 18 | url: '/role/delete', 19 | method: 'post', 20 | data 21 | }) 22 | } 23 | // 分页查询 24 | export const findPage = (data) => { 25 | return axios({ 26 | url: '/role/findPage', 27 | method: 'post', 28 | data 29 | }) 30 | } 31 | // 查询全部 32 | export const findAll = () => { 33 | return axios({ 34 | url: '/role/findAll', 35 | method: 'get' 36 | }) 37 | } 38 | // 查询角色菜单集合 39 | export const findRoleMenus = (params) => { 40 | return axios({ 41 | url: '/role/findRoleMenus', 42 | method: 'get', 43 | params 44 | }) 45 | } 46 | // 保存角色菜单集合 47 | export const saveRoleMenus = (data) => { 48 | return axios({ 49 | url: '/role/saveRoleMenus', 50 | method: 'post', 51 | data 52 | }) 53 | } -------------------------------------------------------------------------------- /live_shop_web/src/http/modules/user.js: -------------------------------------------------------------------------------- 1 | import axios from '../axios' 2 | 3 | /* 4 | * 用户管理模块 5 | */ 6 | 7 | // 保存 8 | export const save = (data) => { 9 | return axios({ 10 | url: '/user/save', 11 | method: 'post', 12 | data 13 | }) 14 | } 15 | // 删除 16 | export const batchDelete = (data) => { 17 | return axios({ 18 | url: '/user/delete', 19 | method: 'post', 20 | data 21 | }) 22 | } 23 | // 分页查询 24 | export const findPage = (data) => { 25 | return axios({ 26 | url: '/user/findPage', 27 | method: 'post', 28 | data 29 | }) 30 | } 31 | // 查找用户的菜单权限标识集合 32 | export const findPermissions = (params) => { 33 | return axios({ 34 | url: '/user/findPermissions', 35 | method: 'get', 36 | params 37 | }) 38 | } -------------------------------------------------------------------------------- /live_shop_web/src/i18n/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VueI18n from 'vue-i18n' 3 | 4 | Vue.use(VueI18n) 5 | 6 | // 注册i18n实例并引入语言文件,文件格式等下解析 7 | const i18n = new VueI18n({ 8 | locale: 'zh_cn', 9 | messages: { 10 | 'zh_cn': require('@/assets/languages/zh_cn.json'), 11 | 'en_us': require('@/assets/languages/en_us.json') 12 | } 13 | }) 14 | 15 | export default i18n -------------------------------------------------------------------------------- /live_shop_web/src/main.js: -------------------------------------------------------------------------------- 1 | // The Vue build version to load with the `import` command 2 | // (runtime-only or standalone) has been set in webpack.base.conf with an alias. 3 | import Vue from 'vue' 4 | import App from '@/App' 5 | import router from '@/router' 6 | import api from '@/http' 7 | import global from '@/utils/global' 8 | import ElementUI from 'element-ui'; 9 | import i18n from '@/i18n' 10 | import 'element-ui/lib/theme-chalk/index.css' 11 | import 'font-awesome/css/font-awesome.min.css' 12 | import store from '@/store' 13 | 14 | Vue.use(ElementUI); 15 | 16 | Vue.use(api) 17 | 18 | Vue.config.productionTip = false 19 | 20 | Vue.prototype.global = global // 挂载全局配置模块 21 | 22 | /* eslint-disable no-new */ 23 | new Vue({ 24 | el: '#app', 25 | i18n, 26 | router, 27 | store, 28 | components: { App }, 29 | template: '' 30 | }) 31 | -------------------------------------------------------------------------------- /live_shop_web/src/mock/index.js: -------------------------------------------------------------------------------- 1 | import Mock from 'mockjs' 2 | import { baseUrl } from '@/utils/global' 3 | import * as login from './modules/login' 4 | import * as user from './modules/user' 5 | import * as role from './modules/role' 6 | import * as dept from './modules/dept' 7 | import * as menu from './modules/menu' 8 | import * as dict from './modules/dict' 9 | import * as config from './modules/config' 10 | import * as log from './modules/log' 11 | import * as loginlog from './modules/loginlog' 12 | 13 | // 1. 开启/关闭[所有模块]拦截, 通过调[openMock参数]设置. 14 | // 2. 开启/关闭[业务模块]拦截, 通过调用fnCreate方法[isOpen参数]设置. 15 | // 3. 开启/关闭[业务模块中某个请求]拦截, 通过函数返回对象中的[isOpen属性]设置. 16 | let openMock = true 17 | // let openMock = false 18 | fnCreate(login, openMock) 19 | fnCreate(user, openMock) 20 | fnCreate(role, openMock) 21 | fnCreate(dept, openMock) 22 | fnCreate(menu, openMock) 23 | fnCreate(dict, openMock) 24 | fnCreate(config, openMock) 25 | fnCreate(log, openMock) 26 | fnCreate(loginlog, openMock) 27 | 28 | /** 29 | * 创建mock模拟数据 30 | * @param {*} mod 模块 31 | * @param {*} isOpen 是否开启? 32 | */ 33 | function fnCreate (mod, isOpen = true) { 34 | 35 | if (isOpen) { 36 | for (var key in mod) { 37 | ((res) => { 38 | if (res.isOpen !== false) { 39 | let url = baseUrl 40 | if(!url.endsWith("/")) { 41 | url = url + "/" 42 | } 43 | url = url + res.url 44 | Mock.mock(new RegExp(url), res.type, (opts) => { 45 | opts['data'] = opts.body ? JSON.parse(opts.body) : null 46 | delete opts.body 47 | console.log('\n') 48 | console.log('%cmock拦截, 请求: ', 'color:blue', opts) 49 | console.log('%cmock拦截, 响应: ', 'color:blue', res.data) 50 | return res.data 51 | }) 52 | } 53 | })(mod[key]() || {}) 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /live_shop_web/src/mock/modules/config.js: -------------------------------------------------------------------------------- 1 | /* 2 | * 系统配置模块 3 | */ 4 | 5 | // 保存 6 | export function save() { 7 | return { 8 | url: 'config/save', 9 | type: 'post', 10 | data: { 11 | "code": 200, 12 | "msg": null, 13 | "data": 1 14 | } 15 | } 16 | } 17 | // 批量删除 18 | export function batchDelete() { 19 | return { 20 | url: 'config/delete', 21 | type: 'post', 22 | data: { 23 | "code": 200, 24 | "msg": null, 25 | "data": 1 26 | } 27 | } 28 | } 29 | // 分页查询 30 | export function findPage(params) { 31 | let findPageData = { 32 | "code": 200, 33 | "msg": null, 34 | "data": {} 35 | } 36 | let pageNum = 1 37 | let pageSize = 8 38 | if(params !== null) { 39 | // pageNum = params.pageNum 40 | } 41 | if(params !== null) { 42 | // pageSize = params.pageSize 43 | } 44 | let content = this.getContent(pageNum, pageSize) 45 | findPageData.data.pageNum = pageNum 46 | findPageData.data.pageSize = pageSize 47 | findPageData.data.totalSize = 50 48 | findPageData.data.content = content 49 | return { 50 | url: 'config/findPage', 51 | type: 'post', 52 | data: findPageData 53 | } 54 | } 55 | export function getContent(pageNum, pageSize) { 56 | let content = [] 57 | for(let i=0; i 2 | 3 | 4 | 5 | 404 6 | 抱歉!您访问的页面失联啦 ... 7 | 返回上一页 8 | 进入首页 9 | 10 | 11 | 12 | 13 | 14 | 19 | 20 | 63 | -------------------------------------------------------------------------------- /live_shop_web/src/views/Home.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 20 | 21 | 22 | 36 | 37 | -------------------------------------------------------------------------------- /live_shop_web/src/views/MainContent.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 27 | 28 | -------------------------------------------------------------------------------- /live_shop_web/src/views/NavBar.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | {{collapse?'':appName}} 7 | 8 | 9 | 10 | 11 | 24 | 25 | -------------------------------------------------------------------------------- /live_shop_web/static/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/live_shop_web/static/.gitkeep -------------------------------------------------------------------------------- /readme/image0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/readme/image0.jpg -------------------------------------------------------------------------------- /readme/image1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/readme/image1.jpg -------------------------------------------------------------------------------- /readme/image2.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/readme/image2.JPG -------------------------------------------------------------------------------- /readme/image3.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/readme/image3.JPG -------------------------------------------------------------------------------- /readme/image4.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/readme/image4.JPG -------------------------------------------------------------------------------- /readme/image5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/readme/image5.jpg -------------------------------------------------------------------------------- /readme/image6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/readme/image6.jpg -------------------------------------------------------------------------------- /readme/show3.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjvu-xiao/liveshop/914e124299e5d6d24c163be4d99eba9be3a3d4ce/readme/show3.JPG --------------------------------------------------------------------------------
抱歉!您访问的页面失联啦 ...