├── vue3-admin
├── theme
│ ├── submenu.css
│ ├── button-group.css
│ ├── form-item.css
│ ├── menu-item.css
│ ├── tab-pane.css
│ ├── breadcrumb-item.css
│ ├── checkbox-button.css
│ ├── checkbox-group.css
│ ├── collapse-item.css
│ ├── dropdown-item.css
│ ├── dropdown-menu.css
│ ├── infinite-scroll.css
│ ├── infiniteScroll.css
│ ├── menu-item-group.css
│ ├── fonts
│ │ ├── element-icons.ttf
│ │ └── element-icons.woff
│ ├── element-variables.css
│ └── aside.css
├── .gitattributes
├── public
│ └── favicon.ico
├── src
│ ├── assets
│ │ └── logo.png
│ ├── components
│ │ ├── Footer.vue
│ │ └── Header.vue
│ ├── utils
│ │ ├── axios.js
│ │ └── index.js
│ ├── main.js
│ ├── router
│ │ └── index.js
│ └── views
│ │ └── Introduce.vue
├── vue3-admin-server.js
├── config
│ └── index.js
├── index.html
├── .gitignore
├── ecosystem.config.js
├── vite.config.js
└── package.json
├── mall-api
├── .gitattributes
├── static-files
│ ├── 登录.png
│ ├── 首页.png
│ ├── 商品搜索.png
│ ├── 地址管理.png
│ ├── 生成订单.png
│ ├── 订单列表.png
│ ├── 订单详情.png
│ ├── 详情页.png
│ ├── 购物车.png
│ ├── newbee-mall.png
│ └── newbee-mall-api-swagger.png
├── .gitignore
├── src
│ └── main
│ │ ├── java
│ │ └── ltd
│ │ │ └── newbee
│ │ │ └── mall
│ │ │ ├── entity
│ │ │ ├── StockNumDTO.java
│ │ │ ├── MallUserToken.java
│ │ │ ├── AdminUserToken.java
│ │ │ ├── AdminUser.java
│ │ │ ├── NewBeeMallOrderAddress.java
│ │ │ ├── NewBeeMallShoppingCartItem.java
│ │ │ ├── NewBeeMallOrderItem.java
│ │ │ ├── MallUser.java
│ │ │ ├── MallUserAddress.java
│ │ │ ├── Carousel.java
│ │ │ ├── GoodsCategory.java
│ │ │ ├── IndexConfig.java
│ │ │ ├── NewBeeMallOrder.java
│ │ │ └── NewBeeMallGoods.java
│ │ │ ├── api
│ │ │ ├── admin
│ │ │ │ ├── param
│ │ │ │ │ ├── BatchIdParam.java
│ │ │ │ │ ├── UpdateAdminNameParam.java
│ │ │ │ │ ├── UpdateAdminPasswordParam.java
│ │ │ │ │ ├── AdminLoginParam.java
│ │ │ │ │ ├── CarouselAddParam.java
│ │ │ │ │ ├── CarouselEditParam.java
│ │ │ │ │ ├── IndexConfigAddParam.java
│ │ │ │ │ ├── GoodsCategoryAddParam.java
│ │ │ │ │ ├── IndexConfigEditParam.java
│ │ │ │ │ ├── GoodsCategoryEditParam.java
│ │ │ │ │ ├── GoodsAddParam.java
│ │ │ │ │ └── GoodsEditParam.java
│ │ │ │ └── NewBeeAdminRegisteUserAPI.java
│ │ │ └── mall
│ │ │ │ ├── param
│ │ │ │ ├── SaveOrderParam.java
│ │ │ │ ├── SaveCartItemParam.java
│ │ │ │ ├── UpdateCartItemParam.java
│ │ │ │ ├── MallUserUpdateParam.java
│ │ │ │ ├── MallUserRegisterParam.java
│ │ │ │ ├── MallUserLoginParam.java
│ │ │ │ ├── SaveMallUserAddressParam.java
│ │ │ │ └── UpdateMallUserAddressParam.java
│ │ │ │ ├── vo
│ │ │ │ ├── NewBeeMallIndexCarouselVO.java
│ │ │ │ ├── NewBeeMallUserVO.java
│ │ │ │ ├── ThirdLevelCategoryVO.java
│ │ │ │ ├── NewBeeMallIndexCategoryVO.java
│ │ │ │ ├── NewBeeMallOrderItemVO.java
│ │ │ │ ├── NewBeeMallSearchGoodsVO.java
│ │ │ │ ├── IndexInfoVO.java
│ │ │ │ ├── NewBeeMallIndexConfigGoodsVO.java
│ │ │ │ ├── SecondLevelCategoryVO.java
│ │ │ │ ├── NewBeeMallShoppingCartItemVO.java
│ │ │ │ ├── NewBeeMallUserAddressVO.java
│ │ │ │ ├── NewBeeMallGoodsDetailVO.java
│ │ │ │ ├── NewBeeMallOrderListVO.java
│ │ │ │ ├── NewBeeMallOrderDetailVO.java
│ │ │ │ └── SearchPageCategoryVO.java
│ │ │ │ ├── NewBeeMallGoodsCategoryAPI.java
│ │ │ │ └── NewBeeMallIndexAPI.java
│ │ │ ├── config
│ │ │ ├── annotation
│ │ │ │ ├── TokenToMallUser.java
│ │ │ │ └── TokenToAdminUser.java
│ │ │ ├── NeeBeeMallWebMvcConfigurer.java
│ │ │ ├── Swagger2Config.java
│ │ │ ├── handler
│ │ │ │ └── TokenToAdminUserMethodArgumentResolver.java
│ │ │ └── NewBeeMallExceptionHandler.java
│ │ │ ├── common
│ │ │ ├── NewBeeMallException.java
│ │ │ ├── PayTypeEnum.java
│ │ │ ├── PayStatusEnum.java
│ │ │ ├── NewBeeMallCategoryLevelEnum.java
│ │ │ ├── IndexConfigTypeEnum.java
│ │ │ ├── Constants.java
│ │ │ ├── NewBeeMallOrderStatusEnum.java
│ │ │ └── ServiceResultEnum.java
│ │ │ ├── dao
│ │ │ ├── NewBeeMallUserTokenMapper.java
│ │ │ ├── NewBeeMallOrderAddressMapper.java
│ │ │ ├── NewBeeAdminUserTokenMapper.java
│ │ │ ├── MallUserAddressMapper.java
│ │ │ ├── AdminUserMapper.java
│ │ │ ├── CarouselMapper.java
│ │ │ ├── IndexConfigMapper.java
│ │ │ ├── MallUserMapper.java
│ │ │ ├── GoodsCategoryMapper.java
│ │ │ ├── NewBeeMallOrderMapper.java
│ │ │ ├── NewBeeMallOrderItemMapper.java
│ │ │ ├── NewBeeMallGoodsMapper.java
│ │ │ └── NewBeeMallShoppingCartItemMapper.java
│ │ │ ├── NewBeeMallAPIApplication.java
│ │ │ ├── util
│ │ │ ├── SystemUtil.java
│ │ │ ├── PageQueryUtil.java
│ │ │ ├── NumberUtil.java
│ │ │ ├── MD5Util.java
│ │ │ ├── Result.java
│ │ │ ├── ResultGenerator.java
│ │ │ ├── PageResult.java
│ │ │ └── NewBeeMallUtils.java
│ │ │ └── service
│ │ │ ├── NewBeeMallCarouselService.java
│ │ │ ├── NewBeeMallIndexConfigService.java
│ │ │ ├── NewBeeMallCategoryService.java
│ │ │ ├── AdminUserService.java
│ │ │ ├── NewBeeMallUserAddressService.java
│ │ │ ├── NewBeeMallUserService.java
│ │ │ ├── NewBeeMallGoodsService.java
│ │ │ ├── NewBeeMallShoppingCartService.java
│ │ │ ├── NewBeeMallOrderService.java
│ │ │ └── impl
│ │ │ └── NewBeeMallCarouselServiceImpl.java
│ │ └── resources
│ │ └── application.properties
└── pom.xml
├── 关于系统.txt
├── mall-vue3-app
├── .gitattributes
├── public
│ ├── favicon.ico
│ └── index.html
├── src
│ ├── assets
│ │ └── logo.png
│ ├── store
│ │ ├── index.js
│ │ ├── state.js
│ │ ├── mutations.js
│ │ └── actions.js
│ ├── service
│ │ ├── home.js
│ │ ├── good.js
│ │ ├── user.js
│ │ ├── cart.js
│ │ ├── order.js
│ │ └── address.js
│ ├── components
│ │ ├── Swiper.vue
│ │ ├── SimpleHeader.vue
│ │ ├── ListScroll.vue
│ │ └── NavBar.vue
│ ├── common
│ │ └── style
│ │ │ ├── base.less
│ │ │ └── mixin.less
│ ├── utils
│ │ └── axios.js
│ ├── main.js
│ ├── views
│ │ ├── About.vue
│ │ ├── Setting.vue
│ │ └── Address.vue
│ ├── App.vue
│ └── router
│ │ └── index.js
├── static-files
│ ├── 登录.png
│ ├── 首页.png
│ ├── 商品搜索.png
│ ├── 地址管理.png
│ ├── 生成订单.png
│ ├── 订单列表.png
│ ├── 订单详情.png
│ ├── 详情页.png
│ ├── 购物车.png
│ ├── newbee-mall.png
│ └── newbee-mall-api-swagger.png
├── babel.config.js
├── newbee-v3-server.js
├── postcss.config.js
├── .gitignore
└── package.json
└── README.md
/vue3-admin/theme/submenu.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vue3-admin/theme/button-group.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vue3-admin/theme/form-item.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vue3-admin/theme/menu-item.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vue3-admin/theme/tab-pane.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vue3-admin/theme/breadcrumb-item.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vue3-admin/theme/checkbox-button.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vue3-admin/theme/checkbox-group.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vue3-admin/theme/collapse-item.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vue3-admin/theme/dropdown-item.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vue3-admin/theme/dropdown-menu.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vue3-admin/theme/infinite-scroll.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vue3-admin/theme/infiniteScroll.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vue3-admin/theme/menu-item-group.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/mall-api/.gitattributes:
--------------------------------------------------------------------------------
1 | *.sql linguist-language=java
2 |
--------------------------------------------------------------------------------
/关于系统.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Springboot_Vue_ShoppingWebSite/HEAD/关于系统.txt
--------------------------------------------------------------------------------
/vue3-admin/.gitattributes:
--------------------------------------------------------------------------------
1 | *.js linguist-language=vue
2 |
3 | *.css linguist-language=vue
4 |
5 | *.html linguist-language=vue
--------------------------------------------------------------------------------
/mall-vue3-app/.gitattributes:
--------------------------------------------------------------------------------
1 | *.js linguist-language=vue
2 |
3 | *.css linguist-language=vue
4 |
5 | *.html linguist-language=vue
--------------------------------------------------------------------------------
/mall-api/static-files/登录.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Springboot_Vue_ShoppingWebSite/HEAD/mall-api/static-files/登录.png
--------------------------------------------------------------------------------
/mall-api/static-files/首页.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Springboot_Vue_ShoppingWebSite/HEAD/mall-api/static-files/首页.png
--------------------------------------------------------------------------------
/mall-api/static-files/商品搜索.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Springboot_Vue_ShoppingWebSite/HEAD/mall-api/static-files/商品搜索.png
--------------------------------------------------------------------------------
/mall-api/static-files/地址管理.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Springboot_Vue_ShoppingWebSite/HEAD/mall-api/static-files/地址管理.png
--------------------------------------------------------------------------------
/mall-api/static-files/生成订单.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Springboot_Vue_ShoppingWebSite/HEAD/mall-api/static-files/生成订单.png
--------------------------------------------------------------------------------
/mall-api/static-files/订单列表.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Springboot_Vue_ShoppingWebSite/HEAD/mall-api/static-files/订单列表.png
--------------------------------------------------------------------------------
/mall-api/static-files/订单详情.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Springboot_Vue_ShoppingWebSite/HEAD/mall-api/static-files/订单详情.png
--------------------------------------------------------------------------------
/mall-api/static-files/详情页.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Springboot_Vue_ShoppingWebSite/HEAD/mall-api/static-files/详情页.png
--------------------------------------------------------------------------------
/mall-api/static-files/购物车.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Springboot_Vue_ShoppingWebSite/HEAD/mall-api/static-files/购物车.png
--------------------------------------------------------------------------------
/vue3-admin/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Springboot_Vue_ShoppingWebSite/HEAD/vue3-admin/public/favicon.ico
--------------------------------------------------------------------------------
/vue3-admin/src/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Springboot_Vue_ShoppingWebSite/HEAD/vue3-admin/src/assets/logo.png
--------------------------------------------------------------------------------
/mall-vue3-app/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Springboot_Vue_ShoppingWebSite/HEAD/mall-vue3-app/public/favicon.ico
--------------------------------------------------------------------------------
/mall-vue3-app/src/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Springboot_Vue_ShoppingWebSite/HEAD/mall-vue3-app/src/assets/logo.png
--------------------------------------------------------------------------------
/mall-vue3-app/static-files/登录.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Springboot_Vue_ShoppingWebSite/HEAD/mall-vue3-app/static-files/登录.png
--------------------------------------------------------------------------------
/mall-vue3-app/static-files/首页.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Springboot_Vue_ShoppingWebSite/HEAD/mall-vue3-app/static-files/首页.png
--------------------------------------------------------------------------------
/vue3-admin/vue3-admin-server.js:
--------------------------------------------------------------------------------
1 | const server = require('pushstate-server')
2 |
3 | server.start({
4 | port: 5018,
5 | directory: './dist'
6 | })
--------------------------------------------------------------------------------
/mall-vue3-app/static-files/商品搜索.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Springboot_Vue_ShoppingWebSite/HEAD/mall-vue3-app/static-files/商品搜索.png
--------------------------------------------------------------------------------
/mall-vue3-app/static-files/地址管理.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Springboot_Vue_ShoppingWebSite/HEAD/mall-vue3-app/static-files/地址管理.png
--------------------------------------------------------------------------------
/mall-vue3-app/static-files/生成订单.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Springboot_Vue_ShoppingWebSite/HEAD/mall-vue3-app/static-files/生成订单.png
--------------------------------------------------------------------------------
/mall-vue3-app/static-files/订单列表.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Springboot_Vue_ShoppingWebSite/HEAD/mall-vue3-app/static-files/订单列表.png
--------------------------------------------------------------------------------
/mall-vue3-app/static-files/订单详情.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Springboot_Vue_ShoppingWebSite/HEAD/mall-vue3-app/static-files/订单详情.png
--------------------------------------------------------------------------------
/mall-vue3-app/static-files/详情页.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Springboot_Vue_ShoppingWebSite/HEAD/mall-vue3-app/static-files/详情页.png
--------------------------------------------------------------------------------
/mall-vue3-app/static-files/购物车.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Springboot_Vue_ShoppingWebSite/HEAD/mall-vue3-app/static-files/购物车.png
--------------------------------------------------------------------------------
/mall-api/static-files/newbee-mall.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Springboot_Vue_ShoppingWebSite/HEAD/mall-api/static-files/newbee-mall.png
--------------------------------------------------------------------------------
/vue3-admin/theme/fonts/element-icons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Springboot_Vue_ShoppingWebSite/HEAD/vue3-admin/theme/fonts/element-icons.ttf
--------------------------------------------------------------------------------
/mall-vue3-app/static-files/newbee-mall.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Springboot_Vue_ShoppingWebSite/HEAD/mall-vue3-app/static-files/newbee-mall.png
--------------------------------------------------------------------------------
/vue3-admin/theme/fonts/element-icons.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Springboot_Vue_ShoppingWebSite/HEAD/vue3-admin/theme/fonts/element-icons.woff
--------------------------------------------------------------------------------
/mall-api/static-files/newbee-mall-api-swagger.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Springboot_Vue_ShoppingWebSite/HEAD/mall-api/static-files/newbee-mall-api-swagger.png
--------------------------------------------------------------------------------
/mall-vue3-app/static-files/newbee-mall-api-swagger.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangjianlin1985/Springboot_Vue_ShoppingWebSite/HEAD/mall-vue3-app/static-files/newbee-mall-api-swagger.png
--------------------------------------------------------------------------------
/mall-vue3-app/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: [
3 | '@vue/cli-plugin-babel/preset'
4 | ],
5 | plugins: [
6 | ['import', {
7 | libraryName: 'vant',
8 | libraryDirectory: 'es',
9 | style: true
10 | }, 'vant']
11 | ]
12 | }
13 |
--------------------------------------------------------------------------------
/mall-vue3-app/src/store/index.js:
--------------------------------------------------------------------------------
1 | import { createStore } from 'vuex'
2 | import state from './state'
3 | import actions from './actions'
4 | import mutations from './mutations'
5 |
6 | export default createStore({
7 | state,
8 | mutations,
9 | actions,
10 | modules: {}
11 | })
--------------------------------------------------------------------------------
/mall-vue3-app/src/store/state.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本系统已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2020 陈尼克 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 |
10 | export default {
11 | cartCount: 0
12 | }
13 |
--------------------------------------------------------------------------------
/vue3-admin/config/index.js:
--------------------------------------------------------------------------------
1 | export default {
2 | development: {
3 | baseUrl: '/api' // 测试接口域名
4 | },
5 | beta: {
6 | baseUrl: '//backend-api-02.newbee.ltd:28019/manage-api/v1' // 测试接口域名
7 | },
8 | release: {
9 | baseUrl: '//backend-api-02.newbee.ltd:28019/manage-api/v1' // 正式接口域名
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/mall-vue3-app/src/store/mutations.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本系统已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2020 陈尼克 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 |
10 | export default {
11 | addCart (state, payload) {
12 | state.cartCount = payload.count
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/mall-vue3-app/newbee-v3-server.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本系统已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2020 陈尼克 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 |
10 | var server = require('pushstate-server');
11 |
12 | server.start({
13 | port: 5008,
14 | directory: './dist'
15 | });
16 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Springboot_Vue_ShoppingWebSite
2 | 基于Springboot+Vue的前后端分离电子购物商城设计毕业源码案例设计
3 |
4 | 开发软件: Eclipse/Idea + WebStorm/Vscode + Mysql
5 |
6 | 基于Vue的一套电商系统,包括移动端商城和后台管理系统,基于SpringBoot2.X及相关技术栈开发。 前台商城系统包含首页门户、商品分类、新品上线、首页轮播、商品推荐、商品搜索、商品展示、购物车、订单结算、订单流程、个人订单管理、会员中心、帮助中心等模块。 后台管理系统包含数据面板、轮播图管理、商品管理、订单管理、会员管理、分类管理、设置等模块。
7 |
8 | 管理员账号密码: admin/123456
9 | 用户账号密码:13700002703/123456
10 |
--------------------------------------------------------------------------------
/mall-vue3-app/src/service/home.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本系统已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2020 陈尼克 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 |
10 | import axios from '../utils/axios'
11 |
12 | export function getHome() {
13 | return axios.get('/index-infos');
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/mall-api/.gitignore:
--------------------------------------------------------------------------------
1 | /target/
2 | !.mvn/wrapper/maven-wrapper.jar
3 |
4 | ### STS ###
5 | .apt_generated
6 | .classpath
7 | .factorypath
8 | .project
9 | .settings
10 | .springBeans
11 | .sts4-cache
12 |
13 | ### IntelliJ IDEA ###
14 | .idea
15 | *.iws
16 | *.iml
17 | *.ipr
18 |
19 | ### NetBeans ###
20 | /nbproject/private/
21 | /build/
22 | /nbbuild/
23 | /dist/
24 | /nbdist/
25 | /.nb-gradle/
--------------------------------------------------------------------------------
/mall-vue3-app/postcss.config.js:
--------------------------------------------------------------------------------
1 | // postcss.config.js
2 | // 用 vite 创建项目,配置 postcss 需要使用 post.config.js,之前使用的 .postcssrc.js 已经被抛弃
3 | // 具体配置可以去 postcss-pxtorem 仓库看看文档
4 | module.exports = {
5 | "plugins": {
6 | "postcss-pxtorem": {
7 | rootValue: 37.5, // Vant 官方根字体大小是 37.5
8 | propList: ['*'],
9 | selectorBlackList: ['.norem'] // 过滤掉.norem-开头的class,不进行rem转换
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/vue3-admin/src/components/Footer.vue:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/mall-vue3-app/src/store/actions.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本系统已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2020 陈尼克 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 |
10 | import { getCart } from '../service/cart'
11 |
12 | export default {
13 | async updateCart(ctx) {
14 | const { data } = await getCart()
15 | ctx.commit('addCart', {
16 | count: data.length || 0
17 | })
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/vue3-admin/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | vue3-admin
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/entity/StockNumDTO.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.entity;
10 |
11 | import lombok.Data;
12 |
13 | /**
14 | * 库存修改所需实体
15 | */
16 |
17 | @Data
18 | public class StockNumDTO {
19 | private Long goodsId;
20 |
21 | private Integer goodsCount;
22 | }
23 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/api/admin/param/BatchIdParam.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.api.admin.param;
10 |
11 | import lombok.Data;
12 |
13 | import java.io.Serializable;
14 |
15 | @Data
16 | public class BatchIdParam implements Serializable {
17 | //id数组
18 | Long[] ids;
19 | }
20 |
--------------------------------------------------------------------------------
/vue3-admin/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | /dist
4 |
5 | # local env files
6 | .env.local
7 | .env.*.local
8 |
9 | # Log files
10 | npm-debug.log*
11 | yarn-debug.log*
12 | yarn-error.log*
13 | pnpm-debug.log*
14 |
15 | # Editor directories and files
16 | .idea
17 | .vscode
18 | *.suo
19 | *.ntvs*
20 | *.njsproj
21 | *.sln
22 | *.sw?
23 |
24 | ### IntelliJ IDEA ###
25 | .idea
26 | *.iws
27 | *.iml
28 | *.ipr
29 |
30 | ### NetBeans ###
31 | /nbproject/private/
32 | /build/
33 | /nbbuild/
34 | /dist/
35 | /nbdist/
36 | /.nb-gradle/
--------------------------------------------------------------------------------
/mall-vue3-app/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | /dist
4 |
5 | # local env files
6 | .env.local
7 | .env.*.local
8 |
9 | # Log files
10 | npm-debug.log*
11 | yarn-debug.log*
12 | yarn-error.log*
13 | pnpm-debug.log*
14 |
15 | # Editor directories and files
16 | .idea
17 | .vscode
18 | *.suo
19 | *.ntvs*
20 | *.njsproj
21 | *.sln
22 | *.sw?
23 |
24 | ### IntelliJ IDEA ###
25 | .idea
26 | *.iws
27 | *.iml
28 | *.ipr
29 |
30 | ### NetBeans ###
31 | /nbproject/private/
32 | /build/
33 | /nbbuild/
34 | /dist/
35 | /nbdist/
36 | /.nb-gradle/
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/entity/MallUserToken.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.entity;
10 |
11 | import lombok.Data;
12 |
13 | import java.util.Date;
14 |
15 | @Data
16 | public class MallUserToken {
17 | private Long userId;
18 |
19 | private String token;
20 |
21 | private Date updateTime;
22 |
23 | private Date expireTime;
24 | }
--------------------------------------------------------------------------------
/mall-vue3-app/src/service/good.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本系统已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2020 陈尼克 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 |
10 | import axios from '../utils/axios'
11 |
12 | export function getDetail(id) {
13 | return axios.get(`/goods/detail/${id}`);
14 | }
15 |
16 | export function getCategory() {
17 | return axios.get('/categories');
18 | }
19 |
20 | export function search(params) {
21 | return axios.get('/search', { params });
22 | }
23 |
24 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/entity/AdminUserToken.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.entity;
10 |
11 | import lombok.Data;
12 |
13 | import java.util.Date;
14 |
15 | @Data
16 | public class AdminUserToken {
17 | private Long adminUserId;
18 |
19 | private String token;
20 |
21 | private Date updateTime;
22 |
23 | private Date expireTime;
24 | }
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/entity/AdminUser.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本系统已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.entity;
10 |
11 | import lombok.Data;
12 |
13 | @Data
14 | public class AdminUser {
15 | private Long adminUserId;
16 |
17 | private String loginUserName;
18 |
19 | private String loginPassword;
20 |
21 | private String nickName;
22 |
23 | private Byte locked;
24 | }
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/config/annotation/TokenToMallUser.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.config.annotation;
10 |
11 | import java.lang.annotation.*;
12 |
13 | @Target({ElementType.PARAMETER})
14 | @Retention(RetentionPolicy.RUNTIME)
15 | @Documented
16 | public @interface TokenToMallUser {
17 |
18 | /**
19 | * 当前用户在request中的名字
20 | *
21 | * @return
22 | */
23 | String value() default "user";
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/api/admin/param/UpdateAdminNameParam.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.api.admin.param;
10 |
11 | import lombok.Data;
12 |
13 | import javax.validation.constraints.NotEmpty;
14 |
15 | @Data
16 | public class UpdateAdminNameParam {
17 |
18 | @NotEmpty(message = "loginUserName不能为空")
19 | private String loginUserName;
20 |
21 | @NotEmpty(message = "nickName不能为空")
22 | private String nickName;
23 | }
24 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/config/annotation/TokenToAdminUser.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.config.annotation;
10 |
11 | import java.lang.annotation.*;
12 |
13 | @Target({ElementType.PARAMETER})
14 | @Retention(RetentionPolicy.RUNTIME)
15 | @Documented
16 | public @interface TokenToAdminUser {
17 |
18 | /**
19 | * 当前用户在request中的名字
20 | *
21 | * @return
22 | */
23 | String value() default "adminUser";
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/vue3-admin/ecosystem.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | apps: [
3 | {
4 | name: 'vue3-admin',
5 | script: 'vue3-admin-server.js'
6 | },
7 | ],
8 | deploy: {
9 | production: {
10 | user: 'root',
11 | host: '47.99.134.126',
12 | ref: 'origin/main',
13 | repo: 'git@git.zhlh6.cn:newbee-ltd/vue3-admin.git',
14 | path: '/workspace/vue3-admin',
15 | 'post-deploy': 'git reset --hard && git checkout main && git pull && npm i --production=false && npm run build:release && pm2 startOrReload ecosystem.config.js', // -production=false 下载全量包
16 | env: {
17 | NODE_ENV: 'production'
18 | }
19 | }
20 | }
21 | }
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/api/admin/param/UpdateAdminPasswordParam.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.api.admin.param;
10 |
11 | import lombok.Data;
12 |
13 | import javax.validation.constraints.NotEmpty;
14 |
15 | @Data
16 | public class UpdateAdminPasswordParam {
17 |
18 | @NotEmpty(message = "originalPassword不能为空")
19 | private String originalPassword;
20 |
21 | @NotEmpty(message = "newPassword不能为空")
22 | private String newPassword;
23 | }
24 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/entity/NewBeeMallOrderAddress.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.entity;
10 |
11 | import lombok.Data;
12 |
13 | @Data
14 | public class NewBeeMallOrderAddress {
15 | private Long orderId;
16 |
17 | private String userName;
18 |
19 | private String userPhone;
20 |
21 | private String provinceName;
22 |
23 | private String cityName;
24 |
25 | private String regionName;
26 |
27 | private String detailAddress;
28 | }
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/api/mall/param/SaveOrderParam.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.api.mall.param;
10 |
11 | import io.swagger.annotations.ApiModelProperty;
12 | import lombok.Data;
13 |
14 | import java.io.Serializable;
15 |
16 | /**
17 | * 保存订单param
18 | */
19 | @Data
20 | public class SaveOrderParam implements Serializable {
21 |
22 | @ApiModelProperty("订单项id数组")
23 | private Long[] cartItemIds;
24 |
25 | @ApiModelProperty("地址id")
26 | private Long addressId;
27 | }
28 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/entity/NewBeeMallShoppingCartItem.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.entity;
10 |
11 | import lombok.Data;
12 |
13 | import java.util.Date;
14 |
15 | @Data
16 | public class NewBeeMallShoppingCartItem {
17 | private Long cartItemId;
18 |
19 | private Long userId;
20 |
21 | private Long goodsId;
22 |
23 | private Integer goodsCount;
24 |
25 | private Byte isDeleted;
26 |
27 | private Date createTime;
28 |
29 | private Date updateTime;
30 | }
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/api/mall/param/SaveCartItemParam.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.api.mall.param;
10 |
11 | import io.swagger.annotations.ApiModelProperty;
12 | import lombok.Data;
13 |
14 | import java.io.Serializable;
15 |
16 | /**
17 | * 添加购物项param
18 | */
19 | @Data
20 | public class SaveCartItemParam implements Serializable {
21 |
22 | @ApiModelProperty("商品数量")
23 | private Integer goodsCount;
24 |
25 | @ApiModelProperty("商品id")
26 | private Long goodsId;
27 | }
28 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/api/mall/param/UpdateCartItemParam.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.api.mall.param;
10 |
11 | import io.swagger.annotations.ApiModelProperty;
12 | import lombok.Data;
13 |
14 | import java.io.Serializable;
15 |
16 | /**
17 | * 修改购物项param
18 | */
19 | @Data
20 | public class UpdateCartItemParam implements Serializable {
21 |
22 | @ApiModelProperty("购物项id")
23 | private Long cartItemId;
24 |
25 | @ApiModelProperty("商品数量")
26 | private Integer goodsCount;
27 | }
28 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/api/mall/vo/NewBeeMallIndexCarouselVO.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.api.mall.vo;
10 |
11 | import io.swagger.annotations.ApiModelProperty;
12 | import lombok.Data;
13 |
14 | import java.io.Serializable;
15 |
16 | /**
17 | * 首页轮播图VO
18 | */
19 | @Data
20 | public class NewBeeMallIndexCarouselVO implements Serializable {
21 |
22 | @ApiModelProperty("轮播图图片地址")
23 | private String carouselUrl;
24 |
25 | @ApiModelProperty("轮播图点击后的跳转路径")
26 | private String redirectUrl;
27 | }
28 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/api/mall/vo/NewBeeMallUserVO.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.api.mall.vo;
10 |
11 | import io.swagger.annotations.ApiModelProperty;
12 | import lombok.Data;
13 |
14 | import java.io.Serializable;
15 |
16 | @Data
17 | public class NewBeeMallUserVO implements Serializable {
18 |
19 | @ApiModelProperty("用户昵称")
20 | private String nickName;
21 |
22 | @ApiModelProperty("用户登录名")
23 | private String loginName;
24 |
25 | @ApiModelProperty("个性签名")
26 | private String introduceSign;
27 | }
28 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/common/NewBeeMallException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.common;
10 |
11 | public class NewBeeMallException extends RuntimeException {
12 |
13 | public NewBeeMallException() {
14 | }
15 |
16 | public NewBeeMallException(String message) {
17 | super(message);
18 | }
19 |
20 | /**
21 | * 丢出一个异常
22 | *
23 | * @param message
24 | */
25 | public static void fail(String message) {
26 | throw new NewBeeMallException(message);
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/entity/NewBeeMallOrderItem.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.entity;
10 |
11 | import lombok.Data;
12 |
13 | import java.util.Date;
14 |
15 | @Data
16 | public class NewBeeMallOrderItem {
17 | private Long orderItemId;
18 |
19 | private Long orderId;
20 |
21 | private Long goodsId;
22 |
23 | private String goodsName;
24 |
25 | private String goodsCoverImg;
26 |
27 | private Integer sellingPrice;
28 |
29 | private Integer goodsCount;
30 |
31 | private Date createTime;
32 | }
--------------------------------------------------------------------------------
/mall-vue3-app/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/mall-vue3-app/src/service/user.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本系统已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2020 陈尼克 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 |
10 | import axios from '../utils/axios'
11 |
12 | export function getUserInfo() {
13 | return axios.get('/user/info');
14 | }
15 |
16 | export function EditUserInfo(params) {
17 | return axios.put('/user/info', params);
18 | }
19 |
20 | export function login(params) {
21 | return axios.post('/user/login', params);
22 | }
23 |
24 | export function logout() {
25 | return axios.post('/user/logout')
26 | }
27 |
28 | export function register(params) {
29 | return axios.post('/user/register', params);
30 | }
31 |
32 |
--------------------------------------------------------------------------------
/mall-vue3-app/src/service/cart.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本系统已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2020 陈尼克 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 |
10 | import axios from '../utils/axios'
11 |
12 | export function addCart(params) {
13 | return axios.post('/shop-cart', params);
14 | }
15 |
16 | export function modifyCart(params) {
17 | return axios.put('/shop-cart', params);
18 | }
19 |
20 | export function getCart(params) {
21 | return axios.get('/shop-cart', { params });
22 | }
23 |
24 | export function deleteCartItem(id) {
25 | return axios.delete(`/shop-cart/${id}`);
26 | }
27 |
28 | export function getByCartItemIds(params) {
29 | return axios.get('/shop-cart/settle', { params });
30 | }
31 |
32 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/api/mall/param/MallUserUpdateParam.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.api.mall.param;
10 |
11 | import io.swagger.annotations.ApiModelProperty;
12 | import lombok.Data;
13 | import java.io.Serializable;
14 |
15 | /**
16 | * 用户修改param
17 | */
18 | @Data
19 | public class MallUserUpdateParam implements Serializable {
20 |
21 | @ApiModelProperty("用户昵称")
22 | private String nickName;
23 |
24 | @ApiModelProperty("用户密码(需要MD5加密)")
25 | private String passwordMd5;
26 |
27 | @ApiModelProperty("个性签名")
28 | private String introduceSign;
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/api/mall/vo/ThirdLevelCategoryVO.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.api.mall.vo;
10 |
11 | import io.swagger.annotations.ApiModelProperty;
12 | import lombok.Data;
13 |
14 | import java.io.Serializable;
15 |
16 | /**
17 | * 首页分类数据VO(第三级)
18 | */
19 | @Data
20 | public class ThirdLevelCategoryVO implements Serializable {
21 |
22 | @ApiModelProperty("当前三级分类id")
23 | private Long categoryId;
24 |
25 | @ApiModelProperty("当前分类级别")
26 | private Byte categoryLevel;
27 |
28 | @ApiModelProperty("当前三级分类名称")
29 | private String categoryName;
30 | }
31 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/api/admin/param/AdminLoginParam.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.api.admin.param;
10 |
11 | import io.swagger.annotations.ApiModelProperty;
12 | import lombok.Data;
13 |
14 | import javax.validation.constraints.NotEmpty;
15 | import java.io.Serializable;
16 |
17 | @Data
18 | public class AdminLoginParam implements Serializable {
19 |
20 | @ApiModelProperty("登录名")
21 | @NotEmpty(message = "登录名不能为空")
22 | private String userName;
23 |
24 | @ApiModelProperty("用户密码(需要MD5加密)")
25 | @NotEmpty(message = "密码不能为空")
26 | private String passwordMd5;
27 | }
28 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/dao/NewBeeMallUserTokenMapper.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.dao;
10 |
11 | import ltd.newbee.mall.entity.MallUserToken;
12 |
13 | public interface NewBeeMallUserTokenMapper {
14 | int deleteByPrimaryKey(Long userId);
15 |
16 | int insert(MallUserToken record);
17 |
18 | int insertSelective(MallUserToken record);
19 |
20 | MallUserToken selectByPrimaryKey(Long userId);
21 |
22 | MallUserToken selectByToken(String token);
23 |
24 | int updateByPrimaryKeySelective(MallUserToken record);
25 |
26 | int updateByPrimaryKey(MallUserToken record);
27 | }
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/dao/NewBeeMallOrderAddressMapper.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.dao;
10 |
11 | import ltd.newbee.mall.entity.NewBeeMallOrderAddress;
12 |
13 | public interface NewBeeMallOrderAddressMapper {
14 | int deleteByPrimaryKey(Long orderId);
15 |
16 | int insert(NewBeeMallOrderAddress record);
17 |
18 | int insertSelective(NewBeeMallOrderAddress record);
19 |
20 | NewBeeMallOrderAddress selectByPrimaryKey(Long orderId);
21 |
22 | int updateByPrimaryKeySelective(NewBeeMallOrderAddress record);
23 |
24 | int updateByPrimaryKey(NewBeeMallOrderAddress record);
25 | }
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/dao/NewBeeAdminUserTokenMapper.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.dao;
10 |
11 | import ltd.newbee.mall.entity.AdminUserToken;
12 |
13 | public interface NewBeeAdminUserTokenMapper {
14 | int deleteByPrimaryKey(Long userId);
15 |
16 | int insert(AdminUserToken record);
17 |
18 | int insertSelective(AdminUserToken record);
19 |
20 | AdminUserToken selectByPrimaryKey(Long userId);
21 |
22 | AdminUserToken selectByToken(String token);
23 |
24 | int updateByPrimaryKeySelective(AdminUserToken record);
25 |
26 | int updateByPrimaryKey(AdminUserToken record);
27 | }
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/NewBeeMallAPIApplication.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall;
10 |
11 | import org.mybatis.spring.annotation.MapperScan;
12 | import org.springframework.boot.SpringApplication;
13 | import org.springframework.boot.autoconfigure.SpringBootApplication;
14 |
15 | /**
16 | * @author 13
17 | *
18 | * @email
19 | * @link
20 | */
21 | @MapperScan("ltd.newbee.mall.dao")
22 | @SpringBootApplication
23 | public class NewBeeMallAPIApplication {
24 |
25 | public static void main(String[] args) {
26 | SpringApplication.run(NewBeeMallAPIApplication.class, args);
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/api/mall/param/MallUserRegisterParam.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.api.mall.param;
10 |
11 | import io.swagger.annotations.ApiModelProperty;
12 | import lombok.Data;
13 |
14 | import javax.validation.constraints.NotEmpty;
15 | import java.io.Serializable;
16 |
17 | /**
18 | * 用户注册param
19 | */
20 | @Data
21 | public class MallUserRegisterParam implements Serializable {
22 |
23 | @ApiModelProperty("登录名")
24 | @NotEmpty(message = "登录名不能为空")
25 | private String loginName;
26 |
27 | @ApiModelProperty("用户密码")
28 | @NotEmpty(message = "密码不能为空")
29 | private String password;
30 | }
31 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/api/mall/param/MallUserLoginParam.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.api.mall.param;
10 |
11 | import io.swagger.annotations.ApiModelProperty;
12 | import lombok.Data;
13 |
14 | import javax.validation.constraints.NotEmpty;
15 | import java.io.Serializable;
16 |
17 | /**
18 | * 用户登录param
19 | */
20 | @Data
21 | public class MallUserLoginParam implements Serializable {
22 |
23 | @ApiModelProperty("登录名")
24 | @NotEmpty(message = "登录名不能为空")
25 | private String loginName;
26 |
27 | @ApiModelProperty("用户密码(需要MD5加密)")
28 | @NotEmpty(message = "密码不能为空")
29 | private String passwordMd5;
30 | }
31 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/entity/MallUser.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.entity;
10 |
11 | import com.fasterxml.jackson.annotation.JsonFormat;
12 | import lombok.Data;
13 |
14 | import java.util.Date;
15 |
16 | @Data
17 | public class MallUser {
18 | private Long userId;
19 |
20 | private String nickName;
21 |
22 | private String loginName;
23 |
24 | private String passwordMd5;
25 |
26 | private String introduceSign;
27 |
28 | private Byte isDeleted;
29 |
30 | private Byte lockedFlag;
31 |
32 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
33 | private Date createTime;
34 | }
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/entity/MallUserAddress.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.entity;
10 |
11 | import lombok.Data;
12 |
13 | import java.util.Date;
14 |
15 | @Data
16 | public class MallUserAddress {
17 | private Long addressId;
18 |
19 | private Long userId;
20 |
21 | private String userName;
22 |
23 | private String userPhone;
24 |
25 | private Byte defaultFlag;
26 |
27 | private String provinceName;
28 |
29 | private String cityName;
30 |
31 | private String regionName;
32 |
33 | private String detailAddress;
34 |
35 | private Byte isDeleted;
36 |
37 | private Date createTime;
38 |
39 | private Date updateTime;
40 | }
--------------------------------------------------------------------------------
/mall-vue3-app/src/components/Swiper.vue:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
31 |
32 |
40 |
--------------------------------------------------------------------------------
/mall-vue3-app/src/service/order.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本系统已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2020 陈尼克 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 |
10 | import axios from '../utils/axios'
11 |
12 | export function createOrder(params) {
13 | return axios.post('/saveOrder', params);
14 | }
15 |
16 | export function getOrderList(params) {
17 | return axios.get('/order', { params });
18 | }
19 |
20 | export function getOrderDetail(id) {
21 | return axios.get(`/order/${id}`);
22 | }
23 |
24 | export function cancelOrder(id) {
25 | return axios.put(`/order/${id}/cancel`);
26 | }
27 |
28 | export function confirmOrder(id) {
29 | return axios.put(`/order/${id}/finish`)
30 | }
31 |
32 | export function payOrder(params) {
33 | return axios.get('/paySuccess', { params })
34 | }
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/mall-vue3-app/src/service/address.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本系统已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2020 陈尼克 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 |
10 | import axios from '../utils/axios'
11 |
12 | export function addAddress(params) {
13 | return axios.post('/address', params);
14 | }
15 |
16 | export function EditAddress(params) {
17 | return axios.put('/address', params);
18 | }
19 |
20 | export function DeleteAddress(id) {
21 | return axios.delete(`/address/${id}`);
22 | }
23 |
24 | export function getDefaultAddress() {
25 | return axios.get('/address/default');
26 | }
27 |
28 | export function getAddressList() {
29 | return axios.get('/address', { pageNumber: 1, pageSize: 1000 })
30 | }
31 |
32 | export function getAddressDetail(id) {
33 | return axios.get(`/address/${id}`)
34 | }
35 |
36 |
37 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/dao/MallUserAddressMapper.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.dao;
10 |
11 | import ltd.newbee.mall.entity.MallUserAddress;
12 |
13 | import java.util.List;
14 |
15 | public interface MallUserAddressMapper {
16 | int deleteByPrimaryKey(Long addressId);
17 |
18 | int insert(MallUserAddress record);
19 |
20 | int insertSelective(MallUserAddress record);
21 |
22 | MallUserAddress selectByPrimaryKey(Long addressId);
23 |
24 | MallUserAddress getMyDefaultAddress(Long userId);
25 |
26 | List findMyAddressList(Long userId);
27 |
28 | int updateByPrimaryKeySelective(MallUserAddress record);
29 |
30 | int updateByPrimaryKey(MallUserAddress record);
31 | }
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/api/mall/vo/NewBeeMallIndexCategoryVO.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.api.mall.vo;
10 |
11 | import io.swagger.annotations.ApiModelProperty;
12 | import lombok.Data;
13 |
14 | import java.io.Serializable;
15 | import java.util.List;
16 |
17 | /**
18 | * 首页分类数据VO
19 | */
20 | @Data
21 | public class NewBeeMallIndexCategoryVO implements Serializable {
22 |
23 | @ApiModelProperty("当前一级分类id")
24 | private Long categoryId;
25 |
26 | @ApiModelProperty("当前分类级别")
27 | private Byte categoryLevel;
28 |
29 | @ApiModelProperty("当前一级分类名称")
30 | private String categoryName;
31 |
32 | @ApiModelProperty("二级分类列表")
33 | private List secondLevelCategoryVOS;
34 | }
35 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/api/mall/vo/NewBeeMallOrderItemVO.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.api.mall.vo;
10 |
11 | import io.swagger.annotations.ApiModelProperty;
12 | import lombok.Data;
13 |
14 | import java.io.Serializable;
15 |
16 | /**
17 | * 订单详情页页面订单项VO
18 | */
19 | @Data
20 | public class NewBeeMallOrderItemVO implements Serializable {
21 |
22 | @ApiModelProperty("商品id")
23 | private Long goodsId;
24 |
25 | @ApiModelProperty("商品数量")
26 | private Integer goodsCount;
27 |
28 | @ApiModelProperty("商品名称")
29 | private String goodsName;
30 |
31 | @ApiModelProperty("商品图片")
32 | private String goodsCoverImg;
33 |
34 | @ApiModelProperty("商品价格")
35 | private Integer sellingPrice;
36 | }
37 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/dao/AdminUserMapper.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本系统已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.dao;
10 |
11 | import ltd.newbee.mall.entity.AdminUser;
12 | import org.apache.ibatis.annotations.Param;
13 |
14 | public interface AdminUserMapper {
15 | int insert(AdminUser record);
16 |
17 | int insertSelective(AdminUser record);
18 |
19 | /**
20 | * 登陆方法
21 | *
22 | * @param userName
23 | * @param password
24 | * @return
25 | */
26 | AdminUser login(@Param("userName") String userName, @Param("password") String password);
27 |
28 | AdminUser selectByPrimaryKey(Long adminUserId);
29 |
30 | int updateByPrimaryKeySelective(AdminUser record);
31 |
32 | int updateByPrimaryKey(AdminUser record);
33 | }
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/api/mall/vo/NewBeeMallSearchGoodsVO.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.api.mall.vo;
10 |
11 | import io.swagger.annotations.ApiModelProperty;
12 | import lombok.Data;
13 |
14 | import java.io.Serializable;
15 |
16 | /**
17 | * 搜索列表页商品VO
18 | */
19 | @Data
20 | public class NewBeeMallSearchGoodsVO implements Serializable {
21 |
22 | @ApiModelProperty("商品id")
23 | private Long goodsId;
24 |
25 | @ApiModelProperty("商品名称")
26 | private String goodsName;
27 |
28 | @ApiModelProperty("商品简介")
29 | private String goodsIntro;
30 |
31 | @ApiModelProperty("商品图片地址")
32 | private String goodsCoverImg;
33 |
34 | @ApiModelProperty("商品价格")
35 | private Integer sellingPrice;
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/api/mall/vo/IndexInfoVO.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.api.mall.vo;
10 |
11 | import io.swagger.annotations.ApiModelProperty;
12 | import lombok.Data;
13 |
14 | import java.io.Serializable;
15 | import java.util.List;
16 |
17 | @Data
18 | public class IndexInfoVO implements Serializable {
19 |
20 | @ApiModelProperty("轮播图(列表)")
21 | private List carousels;
22 |
23 | @ApiModelProperty("首页热销商品(列表)")
24 | private List hotGoodses;
25 |
26 | @ApiModelProperty("首页新品推荐(列表)")
27 | private List newGoodses;
28 |
29 | @ApiModelProperty("首页推荐商品(列表)")
30 | private List recommendGoodses;
31 | }
32 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/entity/Carousel.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.entity;
10 |
11 | import com.fasterxml.jackson.annotation.JsonFormat;
12 | import lombok.Data;
13 |
14 | import java.util.Date;
15 |
16 | @Data
17 | public class Carousel {
18 | private Integer carouselId;
19 |
20 | private String carouselUrl;
21 |
22 | private String redirectUrl;
23 |
24 | private Integer carouselRank;
25 |
26 | private Byte isDeleted;
27 |
28 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
29 | private Date createTime;
30 |
31 | private Integer createUser;
32 |
33 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
34 | private Date updateTime;
35 |
36 | private Integer updateUser;
37 | }
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/api/mall/vo/NewBeeMallIndexConfigGoodsVO.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.api.mall.vo;
10 |
11 | import io.swagger.annotations.ApiModelProperty;
12 | import lombok.Data;
13 |
14 | import java.io.Serializable;
15 |
16 | /**
17 | * 首页配置商品VO
18 | */
19 | @Data
20 | public class NewBeeMallIndexConfigGoodsVO implements Serializable {
21 |
22 | @ApiModelProperty("商品id")
23 | private Long goodsId;
24 | @ApiModelProperty("商品名称")
25 | private String goodsName;
26 | @ApiModelProperty("商品简介")
27 | private String goodsIntro;
28 | @ApiModelProperty("商品图片地址")
29 | private String goodsCoverImg;
30 | @ApiModelProperty("商品价格")
31 | private Integer sellingPrice;
32 | @ApiModelProperty("商品标签")
33 | private String tag;
34 | }
35 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/api/mall/vo/SecondLevelCategoryVO.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.api.mall.vo;
10 |
11 | import io.swagger.annotations.ApiModelProperty;
12 | import lombok.Data;
13 |
14 | import java.io.Serializable;
15 | import java.util.List;
16 |
17 | /**
18 | * 首页分类数据VO(第二级)
19 | */
20 | @Data
21 | public class SecondLevelCategoryVO implements Serializable {
22 |
23 | @ApiModelProperty("当前二级分类id")
24 | private Long categoryId;
25 |
26 | @ApiModelProperty("父级分类id")
27 | private Long parentId;
28 |
29 | @ApiModelProperty("当前分类级别")
30 | private Byte categoryLevel;
31 |
32 | @ApiModelProperty("当前二级分类名称")
33 | private String categoryName;
34 |
35 | @ApiModelProperty("三级分类列表")
36 | private List thirdLevelCategoryVOS;
37 | }
38 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/entity/GoodsCategory.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.entity;
10 |
11 | import com.fasterxml.jackson.annotation.JsonFormat;
12 | import lombok.Data;
13 |
14 | import java.util.Date;
15 |
16 | @Data
17 | public class GoodsCategory {
18 | private Long categoryId;
19 |
20 | private Byte categoryLevel;
21 |
22 | private Long parentId;
23 |
24 | private String categoryName;
25 |
26 | private Integer categoryRank;
27 |
28 | private Byte isDeleted;
29 |
30 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
31 | private Date createTime;
32 |
33 | private Integer createUser;
34 |
35 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
36 | private Date updateTime;
37 |
38 | private Integer updateUser;
39 | }
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/api/mall/vo/NewBeeMallShoppingCartItemVO.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.api.mall.vo;
10 |
11 | import io.swagger.annotations.ApiModelProperty;
12 | import lombok.Data;
13 |
14 | import java.io.Serializable;
15 |
16 | /**
17 | * 购物车页面购物项VO
18 | */
19 | @Data
20 | public class NewBeeMallShoppingCartItemVO implements Serializable {
21 |
22 | @ApiModelProperty("购物项id")
23 | private Long cartItemId;
24 |
25 | @ApiModelProperty("商品id")
26 | private Long goodsId;
27 |
28 | @ApiModelProperty("商品数量")
29 | private Integer goodsCount;
30 |
31 | @ApiModelProperty("商品名称")
32 | private String goodsName;
33 |
34 | @ApiModelProperty("商品图片")
35 | private String goodsCoverImg;
36 |
37 | @ApiModelProperty("商品价格")
38 | private Integer sellingPrice;
39 | }
40 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/entity/IndexConfig.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.entity;
10 |
11 | import com.fasterxml.jackson.annotation.JsonFormat;
12 | import lombok.Data;
13 |
14 | import java.util.Date;
15 |
16 | @Data
17 | public class IndexConfig {
18 | private Long configId;
19 |
20 | private String configName;
21 |
22 | private Byte configType;
23 |
24 | private Long goodsId;
25 |
26 | private String redirectUrl;
27 |
28 | private Integer configRank;
29 |
30 | private Byte isDeleted;
31 |
32 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
33 | private Date createTime;
34 |
35 | private Integer createUser;
36 |
37 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
38 | private Date updateTime;
39 |
40 | private Integer updateUser;
41 | }
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/api/mall/param/SaveMallUserAddressParam.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.api.mall.param;
10 |
11 | import io.swagger.annotations.ApiModelProperty;
12 | import lombok.Data;
13 |
14 | /**
15 | * 添加收货地址param
16 | */
17 | @Data
18 | public class SaveMallUserAddressParam {
19 |
20 | @ApiModelProperty("收件人名称")
21 | private String userName;
22 |
23 | @ApiModelProperty("收件人联系方式")
24 | private String userPhone;
25 |
26 | @ApiModelProperty("是否默认地址 0-不是 1-是")
27 | private Byte defaultFlag;
28 |
29 | @ApiModelProperty("省")
30 | private String provinceName;
31 |
32 | @ApiModelProperty("市")
33 | private String cityName;
34 |
35 | @ApiModelProperty("区/县")
36 | private String regionName;
37 |
38 | @ApiModelProperty("详细地址")
39 | private String detailAddress;
40 | }
41 |
--------------------------------------------------------------------------------
/mall-vue3-app/src/common/style/base.less:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本系统已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2020 陈尼克 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 |
10 | // *{
11 | // margin: 0;
12 | // padding: 0;
13 | // }
14 | //移动端点击高亮
15 | html,body{
16 | -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
17 | }
18 | input{
19 | border: none;
20 | outline: none;
21 | -webkit-appearance: none;
22 | -webkit-appearance: none;
23 | -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
24 | }
25 | textarea{
26 | border: none;
27 | outline: none;
28 | }
29 | button{
30 | border: none;
31 | outline: none;
32 | }
33 | a{
34 | text-decoration: none;
35 | color: #333;
36 | }
37 | li{
38 | list-style-type: none;
39 | }
40 | //解决端遮罩层穿透
41 | body.dialog-open {
42 | position: fixed;
43 | width: 100%;
44 | }
45 | .page{
46 | padding: 0 50px;
47 | width: 100%;
48 | -webkit-box-sizing: border-box;
49 | -moz-box-sizing: border-box;
50 | box-sizing: border-box;
51 | }
52 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/entity/NewBeeMallOrder.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.entity;
10 |
11 | import com.fasterxml.jackson.annotation.JsonFormat;
12 | import lombok.Data;
13 |
14 | import java.util.Date;
15 |
16 | @Data
17 | public class NewBeeMallOrder {
18 | private Long orderId;
19 |
20 | private String orderNo;
21 |
22 | private Long userId;
23 |
24 | private Integer totalPrice;
25 |
26 | private Byte payStatus;
27 |
28 | private Byte payType;
29 |
30 | private Date payTime;
31 |
32 | private Byte orderStatus;
33 |
34 | private String extraInfo;
35 |
36 | private Byte isDeleted;
37 |
38 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
39 | private Date createTime;
40 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
41 | private Date updateTime;
42 | }
--------------------------------------------------------------------------------
/vue3-admin/vite.config.js:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'vite'
2 | import vue from '@vitejs/plugin-vue'
3 | import vitePluginImport from 'vite-plugin-babel-import';
4 | import path from 'path'
5 |
6 | const baseUrl = {
7 | development: './',
8 | beta: './',
9 | release: './'
10 | }
11 |
12 | // https://vitejs.dev/config/
13 | export default ({ mode }) => defineConfig({
14 | plugins: [
15 | vue(),
16 | vitePluginImport([
17 | {
18 | libraryName: 'element-plus',
19 | libraryDirectory: 'es',
20 | style(name) {
21 | return `element-plus/lib/theme-chalk/${name}.css`;
22 | },
23 | }
24 | ])
25 | ],
26 | base: baseUrl[mode],
27 | resolve: {
28 | alias: {
29 | '~': path.resolve(__dirname, './'),
30 | '@': path.resolve(__dirname, 'src')
31 | }
32 | },
33 | server: {
34 | proxy: {
35 | '/api': {
36 | target: 'http://localhost:28019/manage-api/v1',
37 | changeOrigin: true,
38 | rewrite: path => path.replace(/^\/api/, '')
39 | }
40 | }
41 | }
42 | })
43 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/dao/CarouselMapper.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.dao;
10 |
11 | import ltd.newbee.mall.entity.Carousel;
12 | import ltd.newbee.mall.util.PageQueryUtil;
13 | import org.apache.ibatis.annotations.Param;
14 |
15 | import java.util.List;
16 |
17 | public interface CarouselMapper {
18 | int deleteByPrimaryKey(Integer carouselId);
19 |
20 | int insert(Carousel record);
21 |
22 | int insertSelective(Carousel record);
23 |
24 | Carousel selectByPrimaryKey(Integer carouselId);
25 |
26 | int updateByPrimaryKeySelective(Carousel record);
27 |
28 | int updateByPrimaryKey(Carousel record);
29 |
30 | List findCarouselList(PageQueryUtil pageUtil);
31 |
32 | int getTotalCarousels(PageQueryUtil pageUtil);
33 |
34 | int deleteBatch(Long[] ids);
35 |
36 | List findCarouselsByNum(@Param("number") int number);
37 | }
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/util/SystemUtil.java:
--------------------------------------------------------------------------------
1 | package ltd.newbee.mall.util;
2 |
3 | import java.math.BigInteger;
4 | import java.security.MessageDigest;
5 |
6 | /**
7 | * @author 13
8 | *
9 | * @email
10 | * @link
11 | */
12 | public class SystemUtil {
13 |
14 | private SystemUtil() {
15 | }
16 |
17 |
18 | /**
19 | * 登录或注册成功后,生成保持用户登录状态会话token值
20 | *
21 | * @param src:为用户最新一次登录时的now()+user.id+random(4)
22 | * @return
23 | */
24 | public static String genToken(String src) {
25 | if (null == src || "".equals(src)) {
26 | return null;
27 | }
28 | try {
29 | MessageDigest md = MessageDigest.getInstance("MD5");
30 | md.update(src.getBytes());
31 | String result = new BigInteger(1, md.digest()).toString(16);
32 | if (result.length() == 31) {
33 | result = result + "-";
34 | }
35 | System.out.println(result);
36 | return result;
37 | } catch (Exception e) {
38 | return null;
39 | }
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/api/admin/param/CarouselAddParam.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.api.admin.param;
10 |
11 | import io.swagger.annotations.ApiModelProperty;
12 | import lombok.Data;
13 |
14 | import javax.validation.constraints.Max;
15 | import javax.validation.constraints.Min;
16 | import javax.validation.constraints.NotEmpty;
17 | import javax.validation.constraints.NotNull;
18 |
19 | @Data
20 | public class CarouselAddParam {
21 |
22 | @ApiModelProperty("轮播图URL地址")
23 | @NotEmpty(message = "轮播图URL不能为空")
24 | private String carouselUrl;
25 |
26 | @ApiModelProperty("轮播图跳转地址")
27 | @NotEmpty(message = "轮播图跳转地址不能为空")
28 | private String redirectUrl;
29 |
30 | @ApiModelProperty("排序值")
31 | @Min(value = 1, message = "carouselRank最低为1")
32 | @Max(value = 200, message = "carouselRank最高为200")
33 | @NotNull(message = "carouselRank不能为空")
34 | private Integer carouselRank;
35 | }
36 |
--------------------------------------------------------------------------------
/vue3-admin/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "vue3-admin",
3 | "version": "0.0.0",
4 | "scripts": {
5 | "dev": "vite --mode development",
6 | "build:beta": "vite build --mode beta",
7 | "build:release": "vite build --mode release",
8 | "serve": "vite preview"
9 | },
10 | "dependencies": {
11 | "@sentry/browser": "^6.3.1",
12 | "@sentry/tracing": "^6.3.1",
13 | "axios": "^0.21.1",
14 | "element-plus": "^1.0.2-beta.33",
15 | "js-md5": "^0.7.3",
16 | "pushstate-server": "^3.1.0",
17 | "qs": "^6.9.6",
18 | "vue": "^3.0.5",
19 | "vue-router": "^4.0.4",
20 | "wangeditor": "^4.6.10"
21 | },
22 | "devDependencies": {
23 | "@babel/core": "^7.13.8",
24 | "@babel/runtime": "^7.13.8",
25 | "@rollup/plugin-babel": "^5.3.0",
26 | "@vitejs/plugin-vue": "^1.1.4",
27 | "@vue/compiler-sfc": "^3.0.5",
28 | "babel": "^6.23.0",
29 | "babel-plugin-component": "^1.1.1",
30 | "babel-plugin-import": "^1.13.3",
31 | "element-theme-chalk": "^2.15.1",
32 | "vite": "^2.0.1",
33 | "vite-babel-plugin": "^0.0.2",
34 | "vite-plugin-babel-import": "^2.0.2",
35 | "vite-plugin-imp": "^2.0.4"
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/dao/IndexConfigMapper.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.dao;
10 |
11 | import ltd.newbee.mall.entity.IndexConfig;
12 | import ltd.newbee.mall.util.PageQueryUtil;
13 | import org.apache.ibatis.annotations.Param;
14 |
15 | import java.util.List;
16 |
17 | public interface IndexConfigMapper {
18 | int deleteByPrimaryKey(Long configId);
19 |
20 | int insert(IndexConfig record);
21 |
22 | int insertSelective(IndexConfig record);
23 |
24 | IndexConfig selectByPrimaryKey(Long configId);
25 |
26 | int updateByPrimaryKeySelective(IndexConfig record);
27 |
28 | int updateByPrimaryKey(IndexConfig record);
29 |
30 | List findIndexConfigList(PageQueryUtil pageUtil);
31 |
32 | int getTotalIndexConfigs(PageQueryUtil pageUtil);
33 |
34 | int deleteBatch(Long[] ids);
35 |
36 | List findIndexConfigsByTypeAndNum(@Param("configType") int configType, @Param("number") int number);
37 | }
--------------------------------------------------------------------------------
/vue3-admin/src/utils/axios.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios'
2 | import { ElMessage } from 'element-plus'
3 | import router from '@/router/index'
4 | import { localGet } from './index'
5 | import config from '~/config'
6 |
7 |
8 | // 这边由于后端没有区分测试和正式,姑且都写成一个接口。
9 | axios.defaults.baseURL = config[import.meta.env.MODE].baseUrl
10 | // 携带 cookie,对目前的项目没有什么作用,因为我们是 token 鉴权
11 | axios.defaults.withCredentials = true
12 | // 请求头,headers 信息
13 | axios.defaults.headers['X-Requested-With'] = 'XMLHttpRequest'
14 | axios.defaults.headers['token'] = localGet('token') || ''
15 | // 默认 post 请求,使用 application/json 形式
16 | axios.defaults.headers.post['Content-Type'] = 'application/json'
17 |
18 | // 请求拦截器,内部根据返回值,重新组装,统一管理。
19 | axios.interceptors.response.use(res => {
20 | if (typeof res.data !== 'object') {
21 | ElMessage.error('服务端异常!')
22 | return Promise.reject(res)
23 | }
24 | if (res.data.resultCode != 200) {
25 | if (res.data.message) ElMessage.error(res.data.message)
26 | if (res.data.resultCode == 419) {
27 | router.push({ path: '/login' })
28 | }
29 | return Promise.reject(res.data)
30 | }
31 |
32 | return res.data.data
33 | })
34 |
35 | export default axios
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/api/mall/vo/NewBeeMallUserAddressVO.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.api.mall.vo;
10 |
11 | import io.swagger.annotations.ApiModelProperty;
12 | import lombok.Data;
13 |
14 | /**
15 | * 收货地址VO
16 | */
17 | @Data
18 | public class NewBeeMallUserAddressVO {
19 |
20 | @ApiModelProperty("地址id")
21 | private Long addressId;
22 |
23 | @ApiModelProperty("用户id")
24 | private Long userId;
25 |
26 | @ApiModelProperty("收件人名称")
27 | private String userName;
28 |
29 | @ApiModelProperty("收件人联系方式")
30 | private String userPhone;
31 |
32 | @ApiModelProperty("是否默认地址 0-不是 1-是")
33 | private Byte defaultFlag;
34 |
35 | @ApiModelProperty("省")
36 | private String provinceName;
37 |
38 | @ApiModelProperty("市")
39 | private String cityName;
40 |
41 | @ApiModelProperty("区/县")
42 | private String regionName;
43 |
44 | @ApiModelProperty("详细地址")
45 | private String detailAddress;
46 | }
47 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/service/NewBeeMallCarouselService.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.service;
10 |
11 | import ltd.newbee.mall.api.mall.vo.NewBeeMallIndexCarouselVO;
12 | import ltd.newbee.mall.entity.Carousel;
13 | import ltd.newbee.mall.util.PageQueryUtil;
14 | import ltd.newbee.mall.util.PageResult;
15 |
16 | import java.util.List;
17 |
18 | public interface NewBeeMallCarouselService {
19 |
20 | /**
21 | * 返回固定数量的轮播图对象(首页调用)
22 | *
23 | * @param number
24 | * @return
25 | */
26 | List getCarouselsForIndex(int number);
27 |
28 | /**
29 | * 后台分页
30 | *
31 | * @param pageUtil
32 | * @return
33 | */
34 | PageResult getCarouselPage(PageQueryUtil pageUtil);
35 |
36 | String saveCarousel(Carousel carousel);
37 |
38 | String updateCarousel(Carousel carousel);
39 |
40 | Carousel getCarouselById(Integer id);
41 |
42 | Boolean deleteBatch(Long[] ids);
43 | }
44 |
--------------------------------------------------------------------------------
/mall-vue3-app/src/utils/axios.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本系统已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2020 陈尼克 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | import axios from 'axios'
10 | import { Toast } from 'vant'
11 | import router from '../router'
12 |
13 | axios.defaults.baseURL = process.env.NODE_ENV == 'development' ? '//localhost:28019/api/v1' : '//localhost:28019/api/v1'
14 | axios.defaults.withCredentials = true
15 | axios.defaults.headers['X-Requested-With'] = 'XMLHttpRequest'
16 | axios.defaults.headers['token'] = localStorage.getItem('token') || ''
17 | axios.defaults.headers.post['Content-Type'] = 'application/json'
18 |
19 | axios.interceptors.response.use(res => {
20 | if (typeof res.data !== 'object') {
21 | Toast.fail('服务端异常!')
22 | return Promise.reject(res)
23 | }
24 | if (res.data.resultCode != 200) {
25 | if (res.data.message) Toast.fail(res.data.message)
26 | if (res.data.resultCode == 416) {
27 | router.push({ path: '/login' })
28 | }
29 | return Promise.reject(res.data)
30 | }
31 |
32 | return res.data
33 | })
34 |
35 | export default axios
36 |
--------------------------------------------------------------------------------
/mall-api/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | # 严肃声明:
2 | # 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
3 | # 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
4 | # 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
5 | # Copyright (c) 2019-2021 十三 all rights reserved.
6 | # 版权所有,侵权必究!
7 |
8 | server.port=28019
9 | spring.thymeleaf.cache=false
10 | spring.datasource.name=newbee-mall-datasource
11 | spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
12 | spring.datasource.url=jdbc:mysql://localhost:3306/newbee_mall_db_v2?useUnicode=true&serverTimezone=Asia/Shanghai&characterEncoding=utf8&autoReconnect=true&useSSL=false&allowMultiQueries=true
13 | spring.datasource.username=root
14 | spring.datasource.password=123456
15 | spring.datasource.hikari.minimum-idle=5
16 | spring.datasource.hikari.maximum-pool-size=15
17 | spring.datasource.hikari.auto-commit=true
18 | spring.datasource.hikari.idle-timeout=60000
19 | spring.datasource.hikari.pool-name=hikariCP
20 | spring.datasource.hikari.max-lifetime=600000
21 | spring.datasource.hikari.connection-timeout=30000
22 | spring.datasource.hikari.connection-test-query=SELECT 1
23 | # mybatis config
24 | mybatis.mapper-locations=classpath:mapper/*Mapper.xml
25 |
26 | # logging.level.ltd.newbee.mall.dao=debug
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/api/mall/param/UpdateMallUserAddressParam.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.api.mall.param;
10 |
11 | import io.swagger.annotations.ApiModelProperty;
12 | import lombok.Data;
13 |
14 | /**
15 | * 修改收货地址param
16 | */
17 | @Data
18 | public class UpdateMallUserAddressParam {
19 |
20 | @ApiModelProperty("地址id")
21 | private Long addressId;
22 |
23 | @ApiModelProperty("用户id")
24 | private Long userId;
25 |
26 | @ApiModelProperty("收件人名称")
27 | private String userName;
28 |
29 | @ApiModelProperty("收件人联系方式")
30 | private String userPhone;
31 |
32 | @ApiModelProperty("是否默认地址 0-不是 1-是")
33 | private Byte defaultFlag;
34 |
35 | @ApiModelProperty("省")
36 | private String provinceName;
37 |
38 | @ApiModelProperty("市")
39 | private String cityName;
40 |
41 | @ApiModelProperty("区/县")
42 | private String regionName;
43 |
44 | @ApiModelProperty("详细地址")
45 | private String detailAddress;
46 | }
47 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/service/NewBeeMallIndexConfigService.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.service;
10 |
11 | import ltd.newbee.mall.api.mall.vo.NewBeeMallIndexConfigGoodsVO;
12 | import ltd.newbee.mall.entity.IndexConfig;
13 | import ltd.newbee.mall.util.PageQueryUtil;
14 | import ltd.newbee.mall.util.PageResult;
15 |
16 | import java.util.List;
17 |
18 | public interface NewBeeMallIndexConfigService {
19 |
20 | /**
21 | * 返回固定数量的首页配置商品对象(首页调用)
22 | *
23 | * @param number
24 | * @return
25 | */
26 | List getConfigGoodsesForIndex(int configType, int number);
27 |
28 | /**
29 | * 后台分页
30 | *
31 | * @param pageUtil
32 | * @return
33 | */
34 | PageResult getConfigsPage(PageQueryUtil pageUtil);
35 |
36 | String saveIndexConfig(IndexConfig indexConfig);
37 |
38 | String updateIndexConfig(IndexConfig indexConfig);
39 |
40 | IndexConfig getIndexConfigById(Long id);
41 |
42 | Boolean deleteBatch(Long[] ids);
43 | }
44 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/dao/MallUserMapper.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.dao;
10 |
11 | import ltd.newbee.mall.entity.MallUser;
12 | import ltd.newbee.mall.util.PageQueryUtil;
13 | import org.apache.ibatis.annotations.Param;
14 |
15 | import java.util.List;
16 |
17 | public interface MallUserMapper {
18 | int deleteByPrimaryKey(Long userId);
19 |
20 | int insert(MallUser record);
21 |
22 | int insertSelective(MallUser record);
23 |
24 | MallUser selectByPrimaryKey(Long userId);
25 |
26 | MallUser selectByLoginName(String loginName);
27 |
28 | MallUser selectByLoginNameAndPasswd(@Param("loginName") String loginName, @Param("password") String password);
29 |
30 | int updateByPrimaryKeySelective(MallUser record);
31 |
32 | int updateByPrimaryKey(MallUser record);
33 |
34 | List findMallUserList(PageQueryUtil pageUtil);
35 |
36 | int getTotalMallUsers(PageQueryUtil pageUtil);
37 |
38 | int lockUserBatch(@Param("ids") Long[] ids, @Param("lockStatus") int lockStatus);
39 | }
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/api/mall/vo/NewBeeMallGoodsDetailVO.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.api.mall.vo;
10 |
11 | import io.swagger.annotations.ApiModelProperty;
12 | import lombok.Data;
13 |
14 | import java.io.Serializable;
15 |
16 | /**
17 | * 商品详情页VO
18 | */
19 | @Data
20 | public class NewBeeMallGoodsDetailVO implements Serializable {
21 |
22 | @ApiModelProperty("商品id")
23 | private Long goodsId;
24 |
25 | @ApiModelProperty("商品名称")
26 | private String goodsName;
27 |
28 | @ApiModelProperty("商品简介")
29 | private String goodsIntro;
30 |
31 | @ApiModelProperty("商品图片地址")
32 | private String goodsCoverImg;
33 |
34 | @ApiModelProperty("商品价格")
35 | private Integer sellingPrice;
36 |
37 | @ApiModelProperty("商品标签")
38 | private String tag;
39 |
40 | @ApiModelProperty("商品图片")
41 | private String[] goodsCarouselList;
42 |
43 | @ApiModelProperty("商品原价")
44 | private Integer originalPrice;
45 |
46 | @ApiModelProperty("商品详情字段")
47 | private String goodsDetailContent;
48 | }
49 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/api/admin/param/CarouselEditParam.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.api.admin.param;
10 |
11 | import io.swagger.annotations.ApiModelProperty;
12 | import lombok.Data;
13 |
14 | import javax.validation.constraints.Max;
15 | import javax.validation.constraints.Min;
16 | import javax.validation.constraints.NotEmpty;
17 | import javax.validation.constraints.NotNull;
18 |
19 | @Data
20 | public class CarouselEditParam {
21 |
22 | @ApiModelProperty("待修改轮播图id")
23 | @NotNull(message = "轮播图id不能为空")
24 | @Min(1)
25 | private Integer carouselId;
26 |
27 | @ApiModelProperty("轮播图URL地址")
28 | @NotEmpty(message = "轮播图URL不能为空")
29 | private String carouselUrl;
30 |
31 | @ApiModelProperty("轮播图跳转地址")
32 | @NotEmpty(message = "轮播图跳转地址不能为空")
33 | private String redirectUrl;
34 |
35 | @ApiModelProperty("排序值")
36 | @Min(value = 1, message = "carouselRank最低为1")
37 | @Max(value = 200, message = "carouselRank最高为200")
38 | @NotNull(message = "carouselRank不能为空")
39 | private Integer carouselRank;
40 | }
41 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/entity/NewBeeMallGoods.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.entity;
10 |
11 | import com.fasterxml.jackson.annotation.JsonFormat;
12 | import lombok.Data;
13 |
14 | import java.util.Date;
15 |
16 | @Data
17 | public class NewBeeMallGoods {
18 | private Long goodsId;
19 |
20 | private String goodsName;
21 |
22 | private String goodsIntro;
23 |
24 | private Long goodsCategoryId;
25 |
26 | private String goodsCoverImg;
27 |
28 | private String goodsCarousel;
29 |
30 | private Integer originalPrice;
31 |
32 | private Integer sellingPrice;
33 |
34 | private Integer stockNum;
35 |
36 | private String tag;
37 |
38 | private Byte goodsSellStatus;
39 |
40 | private Integer createUser;
41 |
42 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
43 | private Date createTime;
44 |
45 | private Integer updateUser;
46 |
47 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
48 | private Date updateTime;
49 |
50 | private String goodsDetailContent;
51 | }
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/api/mall/vo/NewBeeMallOrderListVO.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.api.mall.vo;
10 |
11 | import com.fasterxml.jackson.annotation.JsonFormat;
12 | import io.swagger.annotations.ApiModelProperty;
13 | import lombok.Data;
14 |
15 | import java.io.Serializable;
16 | import java.util.Date;
17 | import java.util.List;
18 |
19 | /**
20 | * 订单列表页面VO
21 | */
22 | @Data
23 | public class NewBeeMallOrderListVO implements Serializable {
24 |
25 | private Long orderId;
26 |
27 | @ApiModelProperty("订单号")
28 | private String orderNo;
29 |
30 | @ApiModelProperty("订单价格")
31 | private Integer totalPrice;
32 |
33 | @ApiModelProperty("订单支付方式")
34 | private Byte payType;
35 |
36 | @ApiModelProperty("订单状态码")
37 | private Byte orderStatus;
38 |
39 | @ApiModelProperty("订单状态")
40 | private String orderStatusString;
41 |
42 | @ApiModelProperty("创建时间")
43 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
44 | private Date createTime;
45 |
46 | @ApiModelProperty("订单项列表")
47 | private List newBeeMallOrderItemVOS;
48 | }
49 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/util/PageQueryUtil.java:
--------------------------------------------------------------------------------
1 | package ltd.newbee.mall.util;
2 |
3 | import java.util.LinkedHashMap;
4 | import java.util.Map;
5 |
6 | /**
7 | * 分页查询参数
8 | *
9 | * @author 13
10 | *
11 | * @email
12 | * @link
13 | */
14 | public class PageQueryUtil extends LinkedHashMap {
15 | //当前页码
16 | private int page;
17 | //每页条数
18 | private int limit;
19 |
20 | public PageQueryUtil(Map params) {
21 | this.putAll(params);
22 |
23 | //分页参数
24 | this.page = Integer.parseInt(params.get("page").toString());
25 | this.limit = Integer.parseInt(params.get("limit").toString());
26 | this.put("start", (page - 1) * limit);
27 | this.put("page", page);
28 | this.put("limit", limit);
29 | }
30 |
31 |
32 | public int getPage() {
33 | return page;
34 | }
35 |
36 | public void setPage(int page) {
37 | this.page = page;
38 | }
39 |
40 | public int getLimit() {
41 | return limit;
42 | }
43 |
44 | public void setLimit(int limit) {
45 | this.limit = limit;
46 | }
47 |
48 | @Override
49 | public String toString() {
50 | return "PageUtil{" +
51 | "page=" + page +
52 | ", limit=" + limit +
53 | '}';
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/vue3-admin/src/utils/index.js:
--------------------------------------------------------------------------------
1 | export function localGet (key) {
2 | const value = window.localStorage.getItem(key)
3 | try {
4 | return JSON.parse(window.localStorage.getItem(key))
5 | } catch (error) {
6 | return value
7 | }
8 | }
9 |
10 | export function localSet (key, value) {
11 | window.localStorage.setItem(key, JSON.stringify(value))
12 | }
13 |
14 | export function localRemove (key) {
15 | window.localStorage.removeItem(key)
16 | }
17 |
18 | // 判断内容是否含有表情字符,现有数据库不支持。
19 | export function hasEmoji (str = '') {
20 | const reg = /[^\u0020-\u007E\u00A0-\u00BE\u2E80-\uA4CF\uF900-\uFAFF\uFE30-\uFE4F\uFF00-\uFFEF\u0080-\u009F\u2000-\u201f\u2026\u2022\u20ac\r\n]/g;
21 | return str.match(reg) && str.match(reg).length
22 | }
23 |
24 | // 单张图片上传
25 | export const uploadImgServer = 'http://backend-api-02.newbee.ltd:28019/manage-api/v1/upload/file'
26 | // 多张图片上传
27 | export const uploadImgsServer = 'http://backend-api-02.newbee.ltd:28019/manage-api/v1/upload/files'
28 |
29 | export const pathMap = {
30 | login: '登录',
31 | introduce: '系统介绍',
32 | dashboard: '大盘数据',
33 | add: '添加商品',
34 | swiper: '轮播图配置',
35 | hot: '热销商品配置',
36 | new: '新品上线配置',
37 | recommend: '为你推荐配置',
38 | category: '分类管理',
39 | level2: '分类二级管理',
40 | level3: '分类三级管理',
41 | good: '商品管理',
42 | guest: '会员管理',
43 | order: '订单管理',
44 | order_detail: '订单详情',
45 | account: '修改账户'
46 | }
47 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/api/admin/param/IndexConfigAddParam.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.api.admin.param;
10 |
11 | import io.swagger.annotations.ApiModelProperty;
12 | import lombok.Data;
13 |
14 | import javax.validation.constraints.Max;
15 | import javax.validation.constraints.Min;
16 | import javax.validation.constraints.NotEmpty;
17 | import javax.validation.constraints.NotNull;
18 |
19 | @Data
20 | public class IndexConfigAddParam {
21 |
22 | @ApiModelProperty("配置项名称")
23 | @NotEmpty(message = "configName不能为空")
24 | private String configName;
25 |
26 | @ApiModelProperty("配置类别")
27 | @NotNull(message = "configType不能为空")
28 | @Min(value = 1, message = "configType最小为1")
29 | @Max(value = 5, message = "configType最大为5")
30 | private Byte configType;
31 |
32 | @ApiModelProperty("商品id")
33 | @NotNull(message = "商品id不能为空")
34 | @Min(value = 1, message = "商品id不能为空")
35 | private Long goodsId;
36 |
37 | @ApiModelProperty("排序值")
38 | @Min(value = 1, message = "configRank最低为1")
39 | @Max(value = 200, message = "configRank最高为200")
40 | @NotNull(message = "configRank不能为空")
41 | private Integer configRank;
42 | }
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/dao/GoodsCategoryMapper.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.dao;
10 |
11 | import ltd.newbee.mall.entity.GoodsCategory;
12 | import ltd.newbee.mall.util.PageQueryUtil;
13 | import org.apache.ibatis.annotations.Param;
14 |
15 | import java.util.List;
16 |
17 | public interface GoodsCategoryMapper {
18 | int deleteByPrimaryKey(Long categoryId);
19 |
20 | int insert(GoodsCategory record);
21 |
22 | int insertSelective(GoodsCategory record);
23 |
24 | GoodsCategory selectByPrimaryKey(Long categoryId);
25 |
26 | GoodsCategory selectByLevelAndName(@Param("categoryLevel") Byte categoryLevel, @Param("categoryName") String categoryName);
27 |
28 | int updateByPrimaryKeySelective(GoodsCategory record);
29 |
30 | int updateByPrimaryKey(GoodsCategory record);
31 |
32 | List findGoodsCategoryList(PageQueryUtil pageUtil);
33 |
34 | int getTotalGoodsCategories(PageQueryUtil pageUtil);
35 |
36 | int deleteBatch(Long[] ids);
37 |
38 | List selectByLevelAndParentIdsAndNumber(@Param("parentIds") List parentIds, @Param("categoryLevel") int categoryLevel, @Param("number") int number);
39 | }
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/api/admin/param/GoodsCategoryAddParam.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.api.admin.param;
10 |
11 | import io.swagger.annotations.ApiModelProperty;
12 | import lombok.Data;
13 |
14 | import javax.validation.constraints.Max;
15 | import javax.validation.constraints.Min;
16 | import javax.validation.constraints.NotEmpty;
17 | import javax.validation.constraints.NotNull;
18 |
19 | @Data
20 | public class GoodsCategoryAddParam {
21 |
22 | @ApiModelProperty("分类层级")
23 | @NotNull(message = "categoryLevel不能为空")
24 | @Min(value = 1, message = "分类级别最低为1")
25 | @Max(value = 3, message = "分类级别最高为3")
26 | private Byte categoryLevel;
27 |
28 | @ApiModelProperty("父类id")
29 | @NotNull(message = "parentId不能为空")
30 | @Min(value = 0, message = "parentId最低为0")
31 | private Long parentId;
32 |
33 | @ApiModelProperty("分类名称")
34 | @NotEmpty(message = "categoryName不能为空")
35 | private String categoryName;
36 |
37 | @ApiModelProperty("排序值")
38 | @Min(value = 1, message = "categoryRank最低为1")
39 | @Max(value = 200, message = "categoryRank最高为200")
40 | @NotNull(message = "categoryRank不能为空")
41 | private Integer categoryRank;
42 | }
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/common/PayTypeEnum.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.common;
10 |
11 | /**
12 | * @author 13
13 | *
14 | * @email
15 | * @link
16 | * @apiNote 订单状态:0.无 1.支付宝 2.微信支付
17 | */
18 | public enum PayTypeEnum {
19 |
20 | DEFAULT(-1, "ERROR"),
21 | NOT_PAY(0, "无"),
22 | ALI_PAY(1, "支付宝"),
23 | WEIXIN_PAY(2, "微信支付");
24 |
25 | private int payType;
26 |
27 | private String name;
28 |
29 | PayTypeEnum(int payType, String name) {
30 | this.payType = payType;
31 | this.name = name;
32 | }
33 |
34 | public static PayTypeEnum getPayTypeEnumByType(int payType) {
35 | for (PayTypeEnum payTypeEnum : PayTypeEnum.values()) {
36 | if (payTypeEnum.getPayType() == payType) {
37 | return payTypeEnum;
38 | }
39 | }
40 | return DEFAULT;
41 | }
42 |
43 | public int getPayType() {
44 | return payType;
45 | }
46 |
47 | public void setPayType(int payType) {
48 | this.payType = payType;
49 | }
50 |
51 | public String getName() {
52 | return name;
53 | }
54 |
55 | public void setName(String name) {
56 | this.name = name;
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/service/NewBeeMallCategoryService.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.service;
10 |
11 | import ltd.newbee.mall.api.mall.vo.NewBeeMallIndexCategoryVO;
12 | import ltd.newbee.mall.entity.GoodsCategory;
13 | import ltd.newbee.mall.util.PageQueryUtil;
14 | import ltd.newbee.mall.util.PageResult;
15 |
16 | import java.util.List;
17 |
18 | public interface NewBeeMallCategoryService {
19 |
20 | String saveCategory(GoodsCategory goodsCategory);
21 |
22 | String updateGoodsCategory(GoodsCategory goodsCategory);
23 |
24 | GoodsCategory getGoodsCategoryById(Long id);
25 |
26 | Boolean deleteBatch(Long[] ids);
27 |
28 | /**
29 | * 返回分类数据(首页调用)
30 | *
31 | * @return
32 | */
33 | List getCategoriesForIndex();
34 |
35 | /**
36 | * 后台分页
37 | *
38 | * @param pageUtil
39 | * @return
40 | */
41 | PageResult getCategorisPage(PageQueryUtil pageUtil);
42 |
43 | /**
44 | * 根据parentId和level获取分类列表
45 | *
46 | * @param parentIds
47 | * @param categoryLevel
48 | * @return
49 | */
50 | List selectByLevelAndParentIdsAndNumber(List parentIds, int categoryLevel);
51 | }
52 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/dao/NewBeeMallOrderMapper.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.dao;
10 |
11 | import ltd.newbee.mall.entity.NewBeeMallOrder;
12 | import ltd.newbee.mall.util.PageQueryUtil;
13 | import org.apache.ibatis.annotations.Param;
14 |
15 | import java.util.List;
16 |
17 | public interface NewBeeMallOrderMapper {
18 | int deleteByPrimaryKey(Long orderId);
19 |
20 | int insert(NewBeeMallOrder record);
21 |
22 | int insertSelective(NewBeeMallOrder record);
23 |
24 | NewBeeMallOrder selectByPrimaryKey(Long orderId);
25 |
26 | NewBeeMallOrder selectByOrderNo(String orderNo);
27 |
28 | int updateByPrimaryKeySelective(NewBeeMallOrder record);
29 |
30 | int updateByPrimaryKey(NewBeeMallOrder record);
31 |
32 | List findNewBeeMallOrderList(PageQueryUtil pageUtil);
33 |
34 | int getTotalNewBeeMallOrders(PageQueryUtil pageUtil);
35 |
36 | List selectByPrimaryKeys(@Param("orderIds") List orderIds);
37 |
38 | int checkOut(@Param("orderIds") List orderIds);
39 |
40 | int closeOrder(@Param("orderIds") List orderIds, @Param("orderStatus") int orderStatus);
41 |
42 | int checkDone(@Param("orderIds") List asList);
43 | }
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/service/AdminUserService.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本系统已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.service;
10 |
11 | import ltd.newbee.mall.entity.AdminUser;
12 |
13 | public interface AdminUserService {
14 |
15 | /**
16 | * 登录
17 | * @param userName
18 | * @param password
19 | * @return
20 | */
21 | String login(String userName, String password);
22 |
23 | /**
24 | * 获取用户信息
25 | *
26 | * @param loginUserId
27 | * @return
28 | */
29 | AdminUser getUserDetailById(Long loginUserId);
30 |
31 | /**
32 | * 修改当前登录用户的密码
33 | *
34 | * @param loginUserId
35 | * @param originalPassword
36 | * @param newPassword
37 | * @return
38 | */
39 | Boolean updatePassword(Long loginUserId, String originalPassword, String newPassword);
40 |
41 | /**
42 | * 修改当前登录用户的名称信息
43 | *
44 | * @param loginUserId
45 | * @param loginUserName
46 | * @param nickName
47 | * @return
48 | */
49 | Boolean updateName(Long loginUserId, String loginUserName, String nickName);
50 |
51 | /**
52 | * 登出接口
53 | * @param adminUserId
54 | * @return
55 | */
56 | Boolean logout(Long adminUserId);
57 |
58 |
59 | }
60 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/common/PayStatusEnum.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.common;
10 |
11 | /**
12 | * @author 13
13 | *
14 | * @email
15 | * @link
16 | * @apiNote 订单状态:0.支付中 1.支付成功 -1.支付失败
17 | */
18 | public enum PayStatusEnum {
19 |
20 | DEFAULT(-1, "支付失败"),
21 | PAY_ING(0, "支付中"),
22 | PAY_SUCCESS(1, "支付成功");
23 |
24 | private int payStatus;
25 |
26 | private String name;
27 |
28 | PayStatusEnum(int payStatus, String name) {
29 | this.payStatus = payStatus;
30 | this.name = name;
31 | }
32 |
33 | public static PayStatusEnum getPayStatusEnumByStatus(int payStatus) {
34 | for (PayStatusEnum payStatusEnum : PayStatusEnum.values()) {
35 | if (payStatusEnum.getPayStatus() == payStatus) {
36 | return payStatusEnum;
37 | }
38 | }
39 | return DEFAULT;
40 | }
41 |
42 | public int getPayStatus() {
43 | return payStatus;
44 | }
45 |
46 | public void setPayStatus(int payStatus) {
47 | this.payStatus = payStatus;
48 | }
49 |
50 | public String getName() {
51 | return name;
52 | }
53 |
54 | public void setName(String name) {
55 | this.name = name;
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/dao/NewBeeMallOrderItemMapper.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.dao;
10 |
11 | import ltd.newbee.mall.entity.NewBeeMallOrderItem;
12 | import org.apache.ibatis.annotations.Param;
13 |
14 | import java.util.List;
15 |
16 | public interface NewBeeMallOrderItemMapper {
17 | int deleteByPrimaryKey(Long orderItemId);
18 |
19 | int insert(NewBeeMallOrderItem record);
20 |
21 | int insertSelective(NewBeeMallOrderItem record);
22 |
23 | NewBeeMallOrderItem selectByPrimaryKey(Long orderItemId);
24 |
25 | /**
26 | * 根据订单id获取订单项列表
27 | *
28 | * @param orderId
29 | * @return
30 | */
31 | List selectByOrderId(Long orderId);
32 |
33 | /**
34 | * 根据订单ids获取订单项列表
35 | *
36 | * @param orderIds
37 | * @return
38 | */
39 | List selectByOrderIds(@Param("orderIds") List orderIds);
40 |
41 | /**
42 | * 批量insert订单项数据
43 | *
44 | * @param orderItems
45 | * @return
46 | */
47 | int insertBatch(@Param("orderItems") List orderItems);
48 |
49 | int updateByPrimaryKeySelective(NewBeeMallOrderItem record);
50 |
51 | int updateByPrimaryKey(NewBeeMallOrderItem record);
52 | }
--------------------------------------------------------------------------------
/mall-vue3-app/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "newbee-mall-vue3-app",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "serve": "vue-cli-service serve",
7 | "build": "vue-cli-service build",
8 | "lint": "vue-cli-service lint"
9 | },
10 | "dependencies": {
11 | "axios": "^0.20.0",
12 | "better-scroll": "^2.0.5",
13 | "core-js": "^3.6.5",
14 | "js-md5": "^0.7.3",
15 | "lib-flexible": "^0.3.2",
16 | "pushstate-server": "^3.1.0",
17 | "vant": "^3.0.0-beta.5",
18 | "vue": "^3.0.0",
19 | "vue-router": "^4.0.0-beta.13",
20 | "vue2-verify": "^1.1.5",
21 | "vuex": "^4.0.0-beta.4"
22 | },
23 | "devDependencies": {
24 | "@vue/cli-plugin-babel": "~4.5.0",
25 | "@vue/cli-plugin-eslint": "~4.5.0",
26 | "@vue/cli-service": "~4.5.0",
27 | "@vue/compiler-sfc": "^3.0.0",
28 | "babel-eslint": "^10.1.0",
29 | "babel-plugin-import": "^1.13.1",
30 | "eslint": "^6.7.2",
31 | "eslint-plugin-vue": "^7.0.0-0",
32 | "less": "^3.12.2",
33 | "less-loader": "^7.0.2",
34 | "postcss-pxtorem": "^5.1.1"
35 | },
36 | "eslintConfig": {
37 | "root": true,
38 | "env": {
39 | "node": true
40 | },
41 | "extends": [
42 | "plugin:vue/vue3-essential",
43 | "eslint:recommended"
44 | ],
45 | "parserOptions": {
46 | "parser": "babel-eslint"
47 | },
48 | "rules": {}
49 | },
50 | "browserslist": [
51 | "> 1%",
52 | "last 2 versions",
53 | "not dead"
54 | ]
55 | }
56 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/util/NumberUtil.java:
--------------------------------------------------------------------------------
1 | package ltd.newbee.mall.util;
2 |
3 | import java.util.regex.Matcher;
4 | import java.util.regex.Pattern;
5 |
6 | /**
7 | * @author 13
8 | *
9 | * @email
10 | * @link
11 | */
12 | public class NumberUtil {
13 |
14 | private NumberUtil() {
15 | }
16 |
17 |
18 | /**
19 | * 判断是否为11位电话号码
20 | *
21 | * @param phone
22 | * @return
23 | */
24 | public static boolean isPhone(String phone) {
25 | Pattern pattern = Pattern.compile("^((13[0-9])|(14[5,7])|(15[^4,\\D])|(17[0-8])|(18[0-9]))\\d{8}$");
26 | Matcher matcher = pattern.matcher(phone);
27 | return matcher.matches();
28 | }
29 |
30 | /**
31 | * 生成指定长度的随机数
32 | *
33 | * @param length
34 | * @return
35 | */
36 | public static int genRandomNum(int length) {
37 | int num = 1;
38 | double random = Math.random();
39 | if (random < 0.1) {
40 | random = random + 0.1;
41 | }
42 | for (int i = 0; i < length; i++) {
43 | num = num * 10;
44 | }
45 | return (int) ((random * num));
46 | }
47 |
48 | /**
49 | * 生成订单流水号
50 | *
51 | * @return
52 | */
53 | public static String genOrderNo() {
54 | StringBuffer buffer = new StringBuffer(String.valueOf(System.currentTimeMillis()));
55 | int num = genRandomNum(4);
56 | buffer.append(num);
57 | return buffer.toString();
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/api/mall/vo/NewBeeMallOrderDetailVO.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.api.mall.vo;
10 |
11 | import com.fasterxml.jackson.annotation.JsonFormat;
12 | import io.swagger.annotations.ApiModelProperty;
13 | import lombok.Data;
14 |
15 | import java.io.Serializable;
16 | import java.util.Date;
17 | import java.util.List;
18 |
19 | /**
20 | * 订单详情页页面VO
21 | */
22 | @Data
23 | public class NewBeeMallOrderDetailVO implements Serializable {
24 |
25 | @ApiModelProperty("订单号")
26 | private String orderNo;
27 |
28 | @ApiModelProperty("订单价格")
29 | private Integer totalPrice;
30 |
31 | @ApiModelProperty("订单支付状态码")
32 | private Byte payStatus;
33 |
34 | @ApiModelProperty("订单支付方式")
35 | private Byte payType;
36 |
37 | @ApiModelProperty("订单支付方式")
38 | private String payTypeString;
39 |
40 | @ApiModelProperty("订单支付实践")
41 | private Date payTime;
42 |
43 | @ApiModelProperty("订单状态码")
44 | private Byte orderStatus;
45 |
46 | @ApiModelProperty("订单状态")
47 | private String orderStatusString;
48 |
49 | @ApiModelProperty("创建时间")
50 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
51 | private Date createTime;
52 |
53 | @ApiModelProperty("订单项列表")
54 | private List newBeeMallOrderItemVOS;
55 | }
56 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/api/admin/param/IndexConfigEditParam.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.api.admin.param;
10 |
11 | import io.swagger.annotations.ApiModelProperty;
12 | import lombok.Data;
13 |
14 | import javax.validation.constraints.Max;
15 | import javax.validation.constraints.Min;
16 | import javax.validation.constraints.NotEmpty;
17 | import javax.validation.constraints.NotNull;
18 |
19 | @Data
20 | public class IndexConfigEditParam {
21 |
22 | @ApiModelProperty("待修改配置id")
23 | @NotNull(message = "configId不能为空")
24 | @Min(value = 1, message = "configId不能为空")
25 | private Long configId;
26 |
27 | @ApiModelProperty("配置的名称")
28 | @NotEmpty(message = "configName不能为空")
29 | private String configName;
30 |
31 | @ApiModelProperty("配置类别")
32 | @NotNull(message = "configType不能为空")
33 | @Min(value = 1, message = "configType最小为1")
34 | @Max(value = 5, message = "configType最大为5")
35 | private Byte configType;
36 |
37 | @ApiModelProperty("商品id")
38 | @NotNull(message = "商品id不能为空")
39 | @Min(value = 1, message = "商品id不能为空")
40 | private Long goodsId;
41 |
42 | @ApiModelProperty("排序值")
43 | @Min(value = 1, message = "configRank最低为1")
44 | @Max(value = 200, message = "configRank最高为200")
45 | @NotNull(message = "configRank不能为空")
46 | private Integer configRank;
47 | }
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/common/NewBeeMallCategoryLevelEnum.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.common;
10 |
11 | /**
12 | * @author 13
13 | *
14 | * @email
15 | * @link
16 | * @apiNote 分类级别
17 | */
18 | public enum NewBeeMallCategoryLevelEnum {
19 |
20 | DEFAULT(0, "ERROR"),
21 | LEVEL_ONE(1, "一级分类"),
22 | LEVEL_TWO(2, "二级分类"),
23 | LEVEL_THREE(3, "三级分类");
24 |
25 | private int level;
26 |
27 | private String name;
28 |
29 | NewBeeMallCategoryLevelEnum(int level, String name) {
30 | this.level = level;
31 | this.name = name;
32 | }
33 |
34 | public static NewBeeMallCategoryLevelEnum getNewBeeMallOrderStatusEnumByLevel(int level) {
35 | for (NewBeeMallCategoryLevelEnum newBeeMallCategoryLevelEnum : NewBeeMallCategoryLevelEnum.values()) {
36 | if (newBeeMallCategoryLevelEnum.getLevel() == level) {
37 | return newBeeMallCategoryLevelEnum;
38 | }
39 | }
40 | return DEFAULT;
41 | }
42 |
43 | public int getLevel() {
44 | return level;
45 | }
46 |
47 | public void setLevel(int level) {
48 | this.level = level;
49 | }
50 |
51 | public String getName() {
52 | return name;
53 | }
54 |
55 | public void setName(String name) {
56 | this.name = name;
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/api/admin/param/GoodsCategoryEditParam.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.api.admin.param;
10 |
11 | import io.swagger.annotations.ApiModelProperty;
12 | import lombok.Data;
13 |
14 | import javax.validation.constraints.Max;
15 | import javax.validation.constraints.Min;
16 | import javax.validation.constraints.NotEmpty;
17 | import javax.validation.constraints.NotNull;
18 |
19 | @Data
20 | public class GoodsCategoryEditParam {
21 |
22 | @ApiModelProperty("待修改分类id")
23 | @NotNull(message = "分类id不能为空")
24 | @Min(value = 1, message = "分类id不能为空")
25 | private Long categoryId;
26 |
27 | @ApiModelProperty("分类层级")
28 | @NotNull(message = "categoryLevel不能为空")
29 | @Min(value = 1, message = "分类级别最低为1")
30 | @Max(value = 3, message = "分类级别最高为3")
31 | private Byte categoryLevel;
32 |
33 | @ApiModelProperty("父类id")
34 | @NotNull(message = "parentId不能为空")
35 | @Min(value = 0, message = "parentId最低为0")
36 | private Long parentId;
37 |
38 | @ApiModelProperty("分类名称")
39 | @NotEmpty(message = "categoryName不能为空")
40 | private String categoryName;
41 |
42 | @ApiModelProperty("排序值")
43 | @Min(value = 1, message = "categoryRank最低为1")
44 | @Max(value = 200, message = "categoryRank最高为200")
45 | @NotNull(message = "categoryRank不能为空")
46 | private Integer categoryRank;
47 | }
--------------------------------------------------------------------------------
/mall-vue3-app/src/main.js:
--------------------------------------------------------------------------------
1 | import { createApp } from 'vue'
2 | import { ActionBar, ActionBarIcon, ActionBarButton, Divider, Popup, Overlay, Loading, Dialog, ContactCard, Form, AddressEdit, AddressList, Field, CellGroup, Cell, SwipeCell, Icon, Stepper, Card, Checkbox, CheckboxGroup, Button, Swipe, SwipeItem, PullRefresh, List, Tab, Tabs, SubmitBar, Toast, Skeleton } from 'vant'
3 | import App from './App.vue'
4 | import store from './store'
5 | import router from './router'
6 | import 'lib-flexible/flexible'
7 | import 'vant/lib/index.css'; // 全局引入样式
8 |
9 | const app = createApp(App) // 创建实例
10 |
11 | // 全局过滤器
12 | app.config.globalProperties.$filters = {
13 | prefix(url) {
14 | if (url && url.startsWith('http')) {
15 | return url
16 | } else {
17 | url = `http://localhost:28019${url}`
18 | return url
19 | }
20 | }
21 | }
22 |
23 | app.use(ActionBarButton)
24 | .use(ActionBarIcon)
25 | .use(ActionBar)
26 | .use(Divider)
27 | .use(Popup)
28 | .use(Overlay)
29 | .use(Loading)
30 | .use(Dialog)
31 | .use(Toast)
32 | .use(ContactCard)
33 | .use(Form)
34 | .use(AddressEdit)
35 | .use(AddressList)
36 | .use(Field)
37 | .use(CellGroup)
38 | .use(Cell)
39 | .use(SwipeCell)
40 | .use(Icon)
41 | .use(Stepper)
42 | .use(Card)
43 | .use(Button)
44 | .use(Swipe)
45 | .use(SwipeItem)
46 | .use(PullRefresh)
47 | .use(List)
48 | .use(Tab)
49 | .use(Tabs)
50 | .use(SubmitBar)
51 | .use(Checkbox)
52 | .use(CheckboxGroup)
53 | .use(Skeleton)
54 |
55 | app.use(router)
56 | app.use(store)
57 |
58 | app.mount('#app')
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/service/NewBeeMallUserAddressService.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.service;
10 |
11 | import ltd.newbee.mall.api.mall.vo.NewBeeMallUserAddressVO;
12 | import ltd.newbee.mall.entity.MallUserAddress;
13 |
14 | import java.util.List;
15 |
16 | public interface NewBeeMallUserAddressService {
17 |
18 | /**
19 | * 获取我的收货地址
20 | *
21 | * @param userId
22 | * @return
23 | */
24 | List getMyAddresses(Long userId);
25 |
26 | /**
27 | * 保存收货地址
28 | *
29 | * @param mallUserAddress
30 | * @return
31 | */
32 | Boolean saveUserAddress(MallUserAddress mallUserAddress);
33 |
34 | /**
35 | * 修改收货地址
36 | *
37 | * @param mallUserAddress
38 | * @return
39 | */
40 | Boolean updateMallUserAddress(MallUserAddress mallUserAddress);
41 |
42 | /**
43 | * 获取收货地址详情
44 | *
45 | * @param addressId
46 | * @return
47 | */
48 | MallUserAddress getMallUserAddressById(Long addressId);
49 |
50 | /**
51 | * 获取我的默认收货地址
52 | *
53 | * @param userId
54 | * @return
55 | */
56 | MallUserAddress getMyDefaultAddressByUserId(Long userId);
57 |
58 | /**
59 | * 删除收货地址
60 | *
61 | * @param addressId
62 | * @return
63 | */
64 | Boolean deleteById(Long addressId);
65 | }
66 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/service/NewBeeMallUserService.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.service;
10 |
11 | import ltd.newbee.mall.api.mall.param.MallUserUpdateParam;
12 | import ltd.newbee.mall.util.PageQueryUtil;
13 | import ltd.newbee.mall.util.PageResult;
14 |
15 | public interface NewBeeMallUserService {
16 |
17 | /**
18 | * 用户注册
19 | *
20 | * @param loginName
21 | * @param password
22 | * @return
23 | */
24 | String register(String loginName, String password);
25 |
26 |
27 | /**
28 | * 登录
29 | *
30 | * @param loginName
31 | * @param passwordMD5
32 | * @return
33 | */
34 | String login(String loginName, String passwordMD5);
35 |
36 | /**
37 | * 用户信息修改
38 | *
39 | * @param mallUser
40 | * @return
41 | */
42 | Boolean updateUserInfo(MallUserUpdateParam mallUser, Long userId);
43 |
44 | /**
45 | * 登出接口
46 | * @param userId
47 | * @return
48 | */
49 | Boolean logout(Long userId);
50 |
51 | /**
52 | * 用户禁用与解除禁用(0-未锁定 1-已锁定)
53 | *
54 | * @param ids
55 | * @param lockStatus
56 | * @return
57 | */
58 | Boolean lockUsers(Long[] ids, int lockStatus);
59 |
60 | /**
61 | * 后台分页
62 | *
63 | * @param pageUtil
64 | * @return
65 | */
66 | PageResult getNewBeeMallUsersPage(PageQueryUtil pageUtil);
67 | }
68 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/util/MD5Util.java:
--------------------------------------------------------------------------------
1 | package ltd.newbee.mall.util;
2 |
3 | import java.security.MessageDigest;
4 |
5 | /**
6 | * @author 13
7 | *
8 | * @email
9 | * @link
10 | */
11 | public class MD5Util {
12 |
13 | private static String byteArrayToHexString(byte b[]) {
14 | StringBuffer resultSb = new StringBuffer();
15 | for (int i = 0; i < b.length; i++)
16 | resultSb.append(byteToHexString(b[i]));
17 |
18 | return resultSb.toString();
19 | }
20 |
21 | private static String byteToHexString(byte b) {
22 | int n = b;
23 | if (n < 0)
24 | n += 256;
25 | int d1 = n / 16;
26 | int d2 = n % 16;
27 | return hexDigits[d1] + hexDigits[d2];
28 | }
29 |
30 | public static String MD5Encode(String origin, String charsetname) {
31 | String resultString = null;
32 | try {
33 | resultString = new String(origin);
34 | MessageDigest md = MessageDigest.getInstance("MD5");
35 | if (charsetname == null || "".equals(charsetname))
36 | resultString = byteArrayToHexString(md.digest(resultString
37 | .getBytes()));
38 | else
39 | resultString = byteArrayToHexString(md.digest(resultString
40 | .getBytes(charsetname)));
41 | } catch (Exception exception) {
42 | }
43 | return resultString;
44 | }
45 |
46 | private static final String hexDigits[] = {"0", "1", "2", "3", "4", "5",
47 | "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"};
48 | }
49 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/util/Result.java:
--------------------------------------------------------------------------------
1 | package ltd.newbee.mall.util;
2 |
3 | import io.swagger.annotations.ApiModelProperty;
4 |
5 | import java.io.Serializable;
6 |
7 | /**
8 | * @author 13
9 | *
10 | * @email
11 | * @link
12 | */
13 | public class Result implements Serializable {
14 | private static final long serialVersionUID = 1L;
15 |
16 | //业务码,比如成功、失败、权限不足等 code,可自行定义
17 | @ApiModelProperty("返回码")
18 | private int resultCode;
19 | //返回信息,后端在进行业务处理后返回给前端一个提示信息,可自行定义
20 | @ApiModelProperty("返回信息")
21 | private String message;
22 | //数据结果,泛型,可以是列表、单个对象、数字、布尔值等
23 | @ApiModelProperty("返回数据")
24 | private T data;
25 |
26 | public Result() {
27 | }
28 |
29 | public Result(int resultCode, String message) {
30 | this.resultCode = resultCode;
31 | this.message = message;
32 | }
33 |
34 | public int getResultCode() {
35 | return resultCode;
36 | }
37 |
38 | public void setResultCode(int resultCode) {
39 | this.resultCode = resultCode;
40 | }
41 |
42 | public String getMessage() {
43 | return message;
44 | }
45 |
46 | public void setMessage(String message) {
47 | this.message = message;
48 | }
49 |
50 | public T getData() {
51 | return data;
52 | }
53 |
54 | public void setData(T data) {
55 | this.data = data;
56 | }
57 |
58 | @Override
59 | public String toString() {
60 | return "Result{" +
61 | "resultCode=" + resultCode +
62 | ", message='" + message + '\'' +
63 | ", data=" + data +
64 | '}';
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/common/IndexConfigTypeEnum.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.common;
10 |
11 | /**
12 | * @author 13
13 | *
14 | * @email
15 | * @link
16 | * @apiNote 首页配置项 1-搜索框热搜 2-搜索下拉框热搜 3-(首页)热销商品 4-(首页)新品上线 5-(首页)为你推荐
17 | */
18 | public enum IndexConfigTypeEnum {
19 |
20 | DEFAULT(0, "DEFAULT"),
21 | INDEX_SEARCH_HOTS(1, "INDEX_SEARCH_HOTS"),
22 | INDEX_SEARCH_DOWN_HOTS(2, "INDEX_SEARCH_DOWN_HOTS"),
23 | INDEX_GOODS_HOT(3, "INDEX_GOODS_HOTS"),
24 | INDEX_GOODS_NEW(4, "INDEX_GOODS_NEW"),
25 | INDEX_GOODS_RECOMMOND(5, "INDEX_GOODS_RECOMMOND");
26 |
27 | private int type;
28 |
29 | private String name;
30 |
31 | IndexConfigTypeEnum(int type, String name) {
32 | this.type = type;
33 | this.name = name;
34 | }
35 |
36 | public static IndexConfigTypeEnum getIndexConfigTypeEnumByType(int type) {
37 | for (IndexConfigTypeEnum indexConfigTypeEnum : IndexConfigTypeEnum.values()) {
38 | if (indexConfigTypeEnum.getType() == type) {
39 | return indexConfigTypeEnum;
40 | }
41 | }
42 | return DEFAULT;
43 | }
44 |
45 | public int getType() {
46 | return type;
47 | }
48 |
49 | public void setType(int type) {
50 | this.type = type;
51 | }
52 |
53 | public String getName() {
54 | return name;
55 | }
56 |
57 | public void setName(String name) {
58 | this.name = name;
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/dao/NewBeeMallGoodsMapper.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.dao;
10 |
11 | import ltd.newbee.mall.entity.NewBeeMallGoods;
12 | import ltd.newbee.mall.entity.StockNumDTO;
13 | import ltd.newbee.mall.util.PageQueryUtil;
14 | import org.apache.ibatis.annotations.Param;
15 |
16 | import java.util.List;
17 |
18 | public interface NewBeeMallGoodsMapper {
19 | int deleteByPrimaryKey(Long goodsId);
20 |
21 | int insert(NewBeeMallGoods record);
22 |
23 | int insertSelective(NewBeeMallGoods record);
24 |
25 | NewBeeMallGoods selectByPrimaryKey(Long goodsId);
26 |
27 | int updateByPrimaryKeySelective(NewBeeMallGoods record);
28 |
29 | int updateByPrimaryKeyWithBLOBs(NewBeeMallGoods record);
30 |
31 | int updateByPrimaryKey(NewBeeMallGoods record);
32 |
33 | List findNewBeeMallGoodsList(PageQueryUtil pageUtil);
34 |
35 | int getTotalNewBeeMallGoods(PageQueryUtil pageUtil);
36 |
37 | List selectByPrimaryKeys(List goodsIds);
38 |
39 | List findNewBeeMallGoodsListBySearch(PageQueryUtil pageUtil);
40 |
41 | int getTotalNewBeeMallGoodsBySearch(PageQueryUtil pageUtil);
42 |
43 | int batchInsert(@Param("newBeeMallGoodsList") List newBeeMallGoodsList);
44 |
45 | int updateStockNum(@Param("stockNumDTOS") List stockNumDTOS);
46 |
47 | int batchUpdateSellStatus(@Param("orderIds")Long[] orderIds,@Param("sellStatus") int sellStatus);
48 |
49 | }
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/dao/NewBeeMallShoppingCartItemMapper.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.dao;
10 |
11 | import ltd.newbee.mall.entity.NewBeeMallShoppingCartItem;
12 | import ltd.newbee.mall.util.PageQueryUtil;
13 | import org.apache.ibatis.annotations.Param;
14 |
15 | import java.util.List;
16 |
17 | public interface NewBeeMallShoppingCartItemMapper {
18 | int deleteByPrimaryKey(Long cartItemId);
19 |
20 | int insert(NewBeeMallShoppingCartItem record);
21 |
22 | int insertSelective(NewBeeMallShoppingCartItem record);
23 |
24 | NewBeeMallShoppingCartItem selectByPrimaryKey(Long cartItemId);
25 |
26 | NewBeeMallShoppingCartItem selectByUserIdAndGoodsId(@Param("newBeeMallUserId") Long newBeeMallUserId, @Param("goodsId") Long goodsId);
27 |
28 | List selectByUserId(@Param("newBeeMallUserId") Long newBeeMallUserId, @Param("number") int number);
29 |
30 | List selectByUserIdAndCartItemIds(@Param("newBeeMallUserId") Long newBeeMallUserId, @Param("cartItemIds") List cartItemIds);
31 |
32 | int selectCountByUserId(Long newBeeMallUserId);
33 |
34 | int updateByPrimaryKeySelective(NewBeeMallShoppingCartItem record);
35 |
36 | int updateByPrimaryKey(NewBeeMallShoppingCartItem record);
37 |
38 | int deleteBatch(List ids);
39 |
40 | List findMyNewBeeMallCartItems(PageQueryUtil pageUtil);
41 |
42 | int getTotalMyNewBeeMallCartItems(PageQueryUtil pageUtil);
43 | }
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/common/Constants.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.common;
10 |
11 | /**
12 | * @author 13
13 | *
14 | * @email
15 | * @link
16 | * @apiNote 常量配置
17 | */
18 | public class Constants {
19 | //public final static String FILE_UPLOAD_DIC = "/opt/newbee/upload/";//上传文件的默认url前缀,根据部署设置自行修改
20 | public final static String FILE_UPLOAD_DIC = "D:\\upload\\";//上传文件的默认url前缀,根据部署设置自行修改
21 |
22 | public final static int INDEX_CAROUSEL_NUMBER = 5;//首页轮播图数量(可根据自身需求修改)
23 |
24 | public final static int INDEX_CATEGORY_NUMBER = 10;//首页一级分类的最大数量
25 |
26 | public final static int INDEX_GOODS_HOT_NUMBER = 4;//首页热卖商品数量
27 | public final static int INDEX_GOODS_NEW_NUMBER = 5;//首页新品数量
28 | public final static int INDEX_GOODS_RECOMMOND_NUMBER = 10;//首页推荐商品数量
29 |
30 | public final static int SHOPPING_CART_ITEM_TOTAL_NUMBER = 20;//购物车中商品的最大数量(可根据自身需求修改)
31 |
32 | public final static int SHOPPING_CART_ITEM_LIMIT_NUMBER = 5;//购物车中单个商品的最大购买数量(可根据自身需求修改)
33 |
34 | public final static int GOODS_SEARCH_PAGE_LIMIT = 10;//搜索分页的默认条数(每页10条)
35 |
36 | public final static int SHOPPING_CART_PAGE_LIMIT = 5;//购物车分页的默认条数(每页5条)
37 |
38 | public final static int ORDER_SEARCH_PAGE_LIMIT = 5;//我的订单列表分页的默认条数(每页5条)
39 |
40 | public final static int SELL_STATUS_UP = 0;//商品上架状态
41 | public final static int SELL_STATUS_DOWN = 1;//商品下架状态
42 |
43 | public final static int TOKEN_LENGTH = 32;//token字段长度
44 |
45 | public final static String USER_INTRO = "随新所欲,蜂富多彩";//默认简介
46 | }
47 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/service/NewBeeMallGoodsService.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.service;
10 |
11 | import ltd.newbee.mall.entity.NewBeeMallGoods;
12 | import ltd.newbee.mall.util.PageQueryUtil;
13 | import ltd.newbee.mall.util.PageResult;
14 |
15 | import java.util.List;
16 |
17 | public interface NewBeeMallGoodsService {
18 | /**
19 | * 后台分页
20 | *
21 | * @param pageUtil
22 | * @return
23 | */
24 | PageResult getNewBeeMallGoodsPage(PageQueryUtil pageUtil);
25 |
26 | /**
27 | * 添加商品
28 | *
29 | * @param goods
30 | * @return
31 | */
32 | String saveNewBeeMallGoods(NewBeeMallGoods goods);
33 |
34 | /**
35 | * 批量新增商品数据
36 | *
37 | * @param newBeeMallGoodsList
38 | * @return
39 | */
40 | void batchSaveNewBeeMallGoods(List newBeeMallGoodsList);
41 |
42 | /**
43 | * 修改商品信息
44 | *
45 | * @param goods
46 | * @return
47 | */
48 | String updateNewBeeMallGoods(NewBeeMallGoods goods);
49 |
50 | /**
51 | * 批量修改销售状态(上架下架)
52 | *
53 | * @param ids
54 | * @return
55 | */
56 | Boolean batchUpdateSellStatus(Long[] ids, int sellStatus);
57 |
58 | /**
59 | * 获取商品详情
60 | *
61 | * @param id
62 | * @return
63 | */
64 | NewBeeMallGoods getNewBeeMallGoodsById(Long id);
65 |
66 | /**
67 | * 商品搜索
68 | *
69 | * @param pageUtil
70 | * @return
71 | */
72 | PageResult searchNewBeeMallGoods(PageQueryUtil pageUtil);
73 | }
74 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/api/mall/NewBeeMallGoodsCategoryAPI.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.api.mall;
10 |
11 | import io.swagger.annotations.Api;
12 | import io.swagger.annotations.ApiOperation;
13 | import ltd.newbee.mall.common.NewBeeMallException;
14 | import ltd.newbee.mall.common.ServiceResultEnum;
15 | import ltd.newbee.mall.api.mall.vo.NewBeeMallIndexCategoryVO;
16 | import ltd.newbee.mall.service.NewBeeMallCategoryService;
17 | import ltd.newbee.mall.util.Result;
18 | import ltd.newbee.mall.util.ResultGenerator;
19 | import org.springframework.util.CollectionUtils;
20 | import org.springframework.web.bind.annotation.GetMapping;
21 | import org.springframework.web.bind.annotation.RequestMapping;
22 | import org.springframework.web.bind.annotation.RestController;
23 |
24 | import javax.annotation.Resource;
25 | import java.util.List;
26 |
27 | @RestController
28 | @Api(value = "v1", tags = "3.商城分类页面接口")
29 | @RequestMapping("/api/v1")
30 | public class NewBeeMallGoodsCategoryAPI {
31 |
32 | @Resource
33 | private NewBeeMallCategoryService newBeeMallCategoryService;
34 |
35 | @GetMapping("/categories")
36 | @ApiOperation(value = "获取分类数据", notes = "分类页面使用")
37 | public Result> getCategories() {
38 | List categories = newBeeMallCategoryService.getCategoriesForIndex();
39 | if (CollectionUtils.isEmpty(categories)) {
40 | NewBeeMallException.fail(ServiceResultEnum.DATA_NOT_EXIST.getResult());
41 | }
42 | return ResultGenerator.genSuccessResult(categories);
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/common/NewBeeMallOrderStatusEnum.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.common;
10 |
11 | /**
12 | * @author 13
13 | *
14 | * @email
15 | * @link
16 | * @apiNote 订单状态:0.待支付 1.已支付 2.配货完成 3:出库成功 4.交易成功 -1.手动关闭 -2.超时关闭 -3.商家关闭
17 | */
18 | public enum NewBeeMallOrderStatusEnum {
19 |
20 | DEFAULT(-9, "ERROR"),
21 | ORDER_PRE_PAY(0, "待支付"),
22 | ORDER_PAID(1, "已支付"),
23 | ORDER_PACKAGED(2, "配货完成"),
24 | ORDER_EXPRESS(3, "出库成功"),
25 | ORDER_SUCCESS(4, "交易成功"),
26 | ORDER_CLOSED_BY_MALLUSER(-1, "手动关闭"),
27 | ORDER_CLOSED_BY_EXPIRED(-2, "超时关闭"),
28 | ORDER_CLOSED_BY_JUDGE(-3, "商家关闭");
29 |
30 | private int orderStatus;
31 |
32 | private String name;
33 |
34 | NewBeeMallOrderStatusEnum(int orderStatus, String name) {
35 | this.orderStatus = orderStatus;
36 | this.name = name;
37 | }
38 |
39 | public static NewBeeMallOrderStatusEnum getNewBeeMallOrderStatusEnumByStatus(int orderStatus) {
40 | for (NewBeeMallOrderStatusEnum newBeeMallOrderStatusEnum : NewBeeMallOrderStatusEnum.values()) {
41 | if (newBeeMallOrderStatusEnum.getOrderStatus() == orderStatus) {
42 | return newBeeMallOrderStatusEnum;
43 | }
44 | }
45 | return DEFAULT;
46 | }
47 |
48 | public int getOrderStatus() {
49 | return orderStatus;
50 | }
51 |
52 | public void setOrderStatus(int orderStatus) {
53 | this.orderStatus = orderStatus;
54 | }
55 |
56 | public String getName() {
57 | return name;
58 | }
59 |
60 | public void setName(String name) {
61 | this.name = name;
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/mall-vue3-app/src/components/SimpleHeader.vue:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
18 |
19 |
20 |
21 |
58 |
59 |
81 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/util/ResultGenerator.java:
--------------------------------------------------------------------------------
1 | package ltd.newbee.mall.util;
2 |
3 | import org.springframework.util.StringUtils;
4 |
5 | /**
6 | * 响应结果生成工具
7 | *
8 | * @author 13
9 | *
10 | * @email
11 | * @link
12 | */
13 | public class ResultGenerator {
14 | private static final String DEFAULT_SUCCESS_MESSAGE = "SUCCESS";
15 | private static final String DEFAULT_FAIL_MESSAGE = "FAIL";
16 | private static final int RESULT_CODE_SUCCESS = 200;
17 | private static final int RESULT_CODE_SERVER_ERROR = 500;
18 |
19 | public static Result genSuccessResult() {
20 | Result result = new Result();
21 | result.setResultCode(RESULT_CODE_SUCCESS);
22 | result.setMessage(DEFAULT_SUCCESS_MESSAGE);
23 | return result;
24 | }
25 |
26 | public static Result genSuccessResult(String message) {
27 | Result result = new Result();
28 | result.setResultCode(RESULT_CODE_SUCCESS);
29 | result.setMessage(message);
30 | return result;
31 | }
32 |
33 | public static Result genSuccessResult(Object data) {
34 | Result result = new Result();
35 | result.setResultCode(RESULT_CODE_SUCCESS);
36 | result.setMessage(DEFAULT_SUCCESS_MESSAGE);
37 | result.setData(data);
38 | return result;
39 | }
40 |
41 | public static Result genFailResult(String message) {
42 | Result result = new Result();
43 | result.setResultCode(RESULT_CODE_SERVER_ERROR);
44 | if (StringUtils.isEmpty(message)) {
45 | result.setMessage(DEFAULT_FAIL_MESSAGE);
46 | } else {
47 | result.setMessage(message);
48 | }
49 | return result;
50 | }
51 |
52 | public static Result genErrorResult(int code, String message) {
53 | Result result = new Result();
54 | result.setResultCode(code);
55 | result.setMessage(message);
56 | return result;
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/mall-vue3-app/src/common/style/mixin.less:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本系统已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2020 陈尼克 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 |
10 | @import './base.less';
11 | @primary: #1baeae; // 主题色
12 | @orange: #FF6B01;
13 | @bc: #F7F7F7;
14 | @fc:#fff;
15 |
16 | // // 背景图片地址和大小
17 | .bis(@url) {
18 | background-image: url(@url);
19 | background-repeat: no-repeat;
20 | background-size: 100% 100%;
21 | }
22 |
23 | // //圆角
24 | .borderRadius(@radius) {
25 | -webkit-border-radius: @radius;
26 | -moz-border-radius: @radius;
27 | -ms-border-radius: @radius;
28 | -o-border-radius: @radius;
29 | border-radius: @radius;
30 | }
31 |
32 | // //1px底部边框
33 | .border-1px(@color){
34 | position: relative;
35 | &:after{
36 | display: block;
37 | position: absolute;
38 | left: 0;
39 | bottom: 0;
40 | width: 100%;
41 | border-top: 1px solid @color;
42 | content: '';
43 | }
44 | }
45 | // //定位全屏
46 | .allcover{
47 | position:absolute;
48 | top:0;
49 | right:0;
50 | }
51 |
52 | // //定位上下左右居中
53 | .center {
54 | position: absolute;
55 | top: 50%;
56 | left: 50%;
57 | transform: translate(-50%, -50%);
58 | }
59 |
60 | // //定位上下居中
61 | .ct {
62 | position: absolute;
63 | top: 50%;
64 | transform: translateY(-50%);
65 | }
66 |
67 | // //定位左右居中
68 | .cl {
69 | position: absolute;
70 | left: 50%;
71 | transform: translateX(-50%);
72 | }
73 |
74 | // //宽高
75 | .wh(@width, @height){
76 | width: @width;
77 | height: @height;
78 | }
79 |
80 | // //字体大小,颜色
81 | .sc(@size, @color){
82 | font-size: @size;
83 | color: @color;
84 | }
85 |
86 | .boxSizing {
87 | -webkit-box-sizing: border-box;
88 | -moz-box-sizing: border-box;
89 | box-sizing: border-box;
90 | }
91 |
92 | // //flex 布局和 子元素 对其方式
93 | .fj(@type: space-between){
94 | display: flex;
95 | justify-content: @type;
96 | }
97 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/api/admin/param/GoodsAddParam.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.api.admin.param;
10 |
11 | import io.swagger.annotations.ApiModelProperty;
12 | import lombok.Data;
13 |
14 | import javax.validation.constraints.Max;
15 | import javax.validation.constraints.Min;
16 | import javax.validation.constraints.NotEmpty;
17 | import javax.validation.constraints.NotNull;
18 |
19 | @Data
20 | public class GoodsAddParam {
21 |
22 | @ApiModelProperty("商品名称")
23 | @NotEmpty(message = "商品名称不能为空")
24 | private String goodsName;
25 |
26 | @ApiModelProperty("商品简介")
27 | @NotEmpty(message = "商品简介不能为空")
28 | private String goodsIntro;
29 |
30 | @ApiModelProperty("分类id")
31 | @NotNull(message = "分类id不能为空")
32 | @Min(value = 1, message = "分类id最低为1")
33 | private Long goodsCategoryId;
34 |
35 | @ApiModelProperty("商品主图")
36 | @NotEmpty(message = "商品主图不能为空")
37 | private String goodsCoverImg;
38 |
39 | @ApiModelProperty("originalPrice")
40 | @NotNull(message = "originalPrice不能为空")
41 | @Min(value = 1, message = "originalPrice最低为1")
42 | @Max(value = 1000000, message = "originalPrice最高为1000000")
43 | private Integer originalPrice;
44 |
45 | @ApiModelProperty("sellingPrice")
46 | @NotNull(message = "sellingPrice不能为空")
47 | @Min(value = 1, message = "sellingPrice最低为1")
48 | @Max(value = 1000000, message = "sellingPrice最高为1000000")
49 | private Integer sellingPrice;
50 |
51 | @ApiModelProperty("库存")
52 | @NotNull(message = "库存不能为空")
53 | @Min(value = 1, message = "库存最低为1")
54 | @Max(value = 100000, message = "库存最高为100000")
55 | private Integer stockNum;
56 |
57 | @ApiModelProperty("商品标签")
58 | @NotEmpty(message = "商品标签不能为空")
59 | private String tag;
60 |
61 | private Byte goodsSellStatus;
62 |
63 | @ApiModelProperty("商品详情")
64 | @NotEmpty(message = "商品详情不能为空")
65 | private String goodsDetailContent;
66 | }
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/util/PageResult.java:
--------------------------------------------------------------------------------
1 | package ltd.newbee.mall.util;
2 |
3 | import io.swagger.annotations.ApiModelProperty;
4 |
5 | import java.io.Serializable;
6 | import java.util.List;
7 |
8 | /**
9 | * 分页工具类
10 | *
11 | * @author 13
12 | *
13 | * @email
14 | * @link
15 | */
16 | public class PageResult implements Serializable {
17 |
18 | @ApiModelProperty("总记录数")
19 | private int totalCount;
20 |
21 | @ApiModelProperty("每页记录数")
22 | private int pageSize;
23 |
24 | @ApiModelProperty("总页数")
25 | private int totalPage;
26 |
27 | @ApiModelProperty("当前页数")
28 | private int currPage;
29 |
30 | @ApiModelProperty("列表数据")
31 | private List list;
32 |
33 | /**
34 | * 分页
35 | *
36 | * @param list 列表数据
37 | * @param totalCount 总记录数
38 | * @param pageSize 每页记录数
39 | * @param currPage 当前页数
40 | */
41 | public PageResult(List list, int totalCount, int pageSize, int currPage) {
42 | this.list = list;
43 | this.totalCount = totalCount;
44 | this.pageSize = pageSize;
45 | this.currPage = currPage;
46 | this.totalPage = (int) Math.ceil((double) totalCount / pageSize);
47 | }
48 |
49 | public int getTotalCount() {
50 | return totalCount;
51 | }
52 |
53 | public void setTotalCount(int totalCount) {
54 | this.totalCount = totalCount;
55 | }
56 |
57 | public int getPageSize() {
58 | return pageSize;
59 | }
60 |
61 | public void setPageSize(int pageSize) {
62 | this.pageSize = pageSize;
63 | }
64 |
65 | public int getTotalPage() {
66 | return totalPage;
67 | }
68 |
69 | public void setTotalPage(int totalPage) {
70 | this.totalPage = totalPage;
71 | }
72 |
73 | public int getCurrPage() {
74 | return currPage;
75 | }
76 |
77 | public void setCurrPage(int currPage) {
78 | this.currPage = currPage;
79 | }
80 |
81 | public List getList() {
82 | return list;
83 | }
84 |
85 | public void setList(List list) {
86 | this.list = list;
87 | }
88 |
89 | }
90 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/api/mall/vo/SearchPageCategoryVO.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.api.mall.vo;
10 |
11 | import ltd.newbee.mall.entity.GoodsCategory;
12 |
13 | import java.io.Serializable;
14 | import java.util.List;
15 |
16 | /**
17 | * 搜索页面分类数据VO
18 | */
19 | public class SearchPageCategoryVO implements Serializable {
20 |
21 | private String firstLevelCategoryName;
22 |
23 | private List secondLevelCategoryList;
24 |
25 | private String secondLevelCategoryName;
26 |
27 | private List thirdLevelCategoryList;
28 |
29 | private String currentCategoryName;
30 |
31 | public String getFirstLevelCategoryName() {
32 | return firstLevelCategoryName;
33 | }
34 |
35 | public void setFirstLevelCategoryName(String firstLevelCategoryName) {
36 | this.firstLevelCategoryName = firstLevelCategoryName;
37 | }
38 |
39 | public List getSecondLevelCategoryList() {
40 | return secondLevelCategoryList;
41 | }
42 |
43 | public void setSecondLevelCategoryList(List secondLevelCategoryList) {
44 | this.secondLevelCategoryList = secondLevelCategoryList;
45 | }
46 |
47 | public String getSecondLevelCategoryName() {
48 | return secondLevelCategoryName;
49 | }
50 |
51 | public void setSecondLevelCategoryName(String secondLevelCategoryName) {
52 | this.secondLevelCategoryName = secondLevelCategoryName;
53 | }
54 |
55 | public List getThirdLevelCategoryList() {
56 | return thirdLevelCategoryList;
57 | }
58 |
59 | public void setThirdLevelCategoryList(List thirdLevelCategoryList) {
60 | this.thirdLevelCategoryList = thirdLevelCategoryList;
61 | }
62 |
63 | public String getCurrentCategoryName() {
64 | return currentCategoryName;
65 | }
66 |
67 | public void setCurrentCategoryName(String currentCategoryName) {
68 | this.currentCategoryName = currentCategoryName;
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/mall-vue3-app/src/views/About.vue:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |

14 |
简介
15 |
newbee-mall 项目是一套电商系统,包括 newbee-mall 商城系统及 newbee-mall-admin 商城后台管理系统,基于 Spring Boot 2.X 及相关技术栈开发。 前台商城系统包含首页门户、商品分类、新品上线、首页轮播、商品推荐、商品搜索、商品展示、购物车、订单结算、订单流程、个人订单管理、会员中心、帮助中心等模块。 后台管理系统包含数据面板、轮播图管理、商品管理、订单管理、会员管理、分类管理、设置等模块。
16 |
开源地址
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
39 |
40 |
55 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/common/ServiceResultEnum.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.common;
10 |
11 | public enum ServiceResultEnum {
12 | ERROR("error"),
13 |
14 | SUCCESS("success"),
15 |
16 | DATA_NOT_EXIST("未查询到记录!"),
17 |
18 | PARAM_ERROR("参数错误!"),
19 |
20 | SAME_CATEGORY_EXIST("有同级同名的分类!"),
21 |
22 | SAME_LOGIN_NAME_EXIST("用户名已存在!"),
23 |
24 | LOGIN_NAME_NULL("请输入登录名!"),
25 |
26 | LOGIN_NAME_IS_NOT_PHONE("请输入正确的手机号!"),
27 |
28 | LOGIN_PASSWORD_NULL("请输入密码!"),
29 |
30 | LOGIN_VERIFY_CODE_NULL("请输入验证码!"),
31 |
32 | LOGIN_VERIFY_CODE_ERROR("验证码错误!"),
33 |
34 | GOODS_NOT_EXIST("商品不存在!"),
35 |
36 | GOODS_PUT_DOWN("商品已下架!"),
37 |
38 | SHOPPING_CART_ITEM_LIMIT_NUMBER_ERROR("超出单个商品的最大购买数量!"),
39 |
40 | SHOPPING_CART_ITEM_NUMBER_ERROR("商品数量不能小于 1 !"),
41 |
42 | SHOPPING_CART_ITEM_TOTAL_NUMBER_ERROR("超出购物车最大容量!"),
43 |
44 | SHOPPING_CART_ITEM_EXIST_ERROR("已存在!无需重复添加!"),
45 |
46 | LOGIN_ERROR("登录失败!"),
47 |
48 | NOT_LOGIN_ERROR("未登录!"),
49 |
50 | ADMIN_NOT_LOGIN_ERROR("管理员未登录!"),
51 |
52 | TOKEN_EXPIRE_ERROR("无效认证!请重新登录!"),
53 |
54 | ADMIN_TOKEN_EXPIRE_ERROR("管理员登录过期!请重新登录!"),
55 |
56 | USER_NULL_ERROR("无效用户!请重新登录!"),
57 |
58 | LOGIN_USER_LOCKED_ERROR("用户已被禁止登录!"),
59 |
60 | ORDER_NOT_EXIST_ERROR("订单不存在!"),
61 |
62 | NULL_ADDRESS_ERROR("地址不能为空!"),
63 |
64 | ORDER_PRICE_ERROR("订单价格异常!"),
65 |
66 | ORDER_ITEM_NULL_ERROR("订单项异常!"),
67 |
68 | ORDER_GENERATE_ERROR("生成订单异常!"),
69 |
70 | SHOPPING_ITEM_ERROR("购物车数据异常!"),
71 |
72 | SHOPPING_ITEM_COUNT_ERROR("库存不足!"),
73 |
74 | ORDER_STATUS_ERROR("订单状态异常!"),
75 |
76 | OPERATE_ERROR("操作失败!"),
77 |
78 | REQUEST_FORBIDEN_ERROR("禁止该操作!"),
79 |
80 | DB_ERROR("database error");
81 |
82 | private String result;
83 |
84 | ServiceResultEnum(String result) {
85 | this.result = result;
86 | }
87 |
88 | public String getResult() {
89 | return result;
90 | }
91 |
92 | public void setResult(String result) {
93 | this.result = result;
94 | }
95 | }
96 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/api/admin/param/GoodsEditParam.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.api.admin.param;
10 |
11 | import io.swagger.annotations.ApiModelProperty;
12 | import lombok.Data;
13 |
14 | import javax.validation.constraints.Max;
15 | import javax.validation.constraints.Min;
16 | import javax.validation.constraints.NotEmpty;
17 | import javax.validation.constraints.NotNull;
18 |
19 | @Data
20 | public class GoodsEditParam {
21 |
22 | @ApiModelProperty("待修改商品id")
23 | @NotNull(message = "商品id不能为空")
24 | @Min(value = 1, message = "商品id不能为空")
25 | private Long goodsId;
26 |
27 | @ApiModelProperty("商品名称")
28 | @NotEmpty(message = "商品名称不能为空")
29 | private String goodsName;
30 |
31 | @ApiModelProperty("商品简介")
32 | @NotEmpty(message = "商品简介不能为空")
33 | private String goodsIntro;
34 |
35 | @ApiModelProperty("分类id")
36 | @NotNull(message = "分类id不能为空")
37 | @Min(value = 1, message = "分类id最低为1")
38 | private Long goodsCategoryId;
39 |
40 | @ApiModelProperty("商品主图")
41 | @NotEmpty(message = "商品主图不能为空")
42 | private String goodsCoverImg;
43 |
44 | @ApiModelProperty("originalPrice")
45 | @NotNull(message = "originalPrice不能为空")
46 | @Min(value = 1, message = "originalPrice最低为1")
47 | @Max(value = 1000000, message = "originalPrice最高为1000000")
48 | private Integer originalPrice;
49 |
50 | @ApiModelProperty("sellingPrice")
51 | @NotNull(message = "sellingPrice不能为空")
52 | @Min(value = 1, message = "sellingPrice最低为1")
53 | @Max(value = 1000000, message = "sellingPrice最高为1000000")
54 | private Integer sellingPrice;
55 |
56 | @ApiModelProperty("库存")
57 | @NotNull(message = "库存不能为空")
58 | @Min(value = 1, message = "库存最低为1")
59 | @Max(value = 100000, message = "库存最高为100000")
60 | private Integer stockNum;
61 |
62 | @ApiModelProperty("商品标签")
63 | @NotEmpty(message = "商品标签不能为空")
64 | private String tag;
65 |
66 | private Byte goodsSellStatus;
67 |
68 | @ApiModelProperty("商品详情")
69 | @NotEmpty(message = "商品详情不能为空")
70 | private String goodsDetailContent;
71 | }
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/service/NewBeeMallShoppingCartService.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.service;
10 |
11 | import ltd.newbee.mall.api.mall.param.SaveCartItemParam;
12 | import ltd.newbee.mall.api.mall.param.UpdateCartItemParam;
13 | import ltd.newbee.mall.api.mall.vo.NewBeeMallShoppingCartItemVO;
14 | import ltd.newbee.mall.entity.NewBeeMallShoppingCartItem;
15 | import ltd.newbee.mall.util.PageQueryUtil;
16 | import ltd.newbee.mall.util.PageResult;
17 |
18 | import java.util.List;
19 |
20 | public interface NewBeeMallShoppingCartService {
21 |
22 | /**
23 | * 保存商品至购物车中
24 | *
25 | * @param saveCartItemParam
26 | * @param userId
27 | * @return
28 | */
29 | String saveNewBeeMallCartItem(SaveCartItemParam saveCartItemParam, Long userId);
30 |
31 | /**
32 | * 修改购物车中的属性
33 | *
34 | * @param updateCartItemParam
35 | * @param userId
36 | * @return
37 | */
38 | String updateNewBeeMallCartItem(UpdateCartItemParam updateCartItemParam, Long userId);
39 |
40 | /**
41 | * 获取购物项详情
42 | *
43 | * @param newBeeMallShoppingCartItemId
44 | * @return
45 | */
46 | NewBeeMallShoppingCartItem getNewBeeMallCartItemById(Long newBeeMallShoppingCartItemId);
47 |
48 | /**
49 | * 删除购物车中的商品
50 | *
51 | * @param newBeeMallShoppingCartItemId
52 | * @return
53 | */
54 | Boolean deleteById(Long newBeeMallShoppingCartItemId);
55 |
56 | /**
57 | * 获取我的购物车中的列表数据
58 | *
59 | * @param newBeeMallUserId
60 | * @return
61 | */
62 | List getMyShoppingCartItems(Long newBeeMallUserId);
63 |
64 | /**
65 | * 根据userId和cartItemIds获取对应的购物项记录
66 | *
67 | * @param cartItemIds
68 | * @param newBeeMallUserId
69 | * @return
70 | */
71 | List getCartItemsForSettle(List cartItemIds, Long newBeeMallUserId);
72 |
73 | /**
74 | * 我的购物车(分页数据)
75 | *
76 | * @param pageUtil
77 | * @return
78 | */
79 | PageResult getMyShoppingCartItems(PageQueryUtil pageUtil);
80 | }
81 |
--------------------------------------------------------------------------------
/mall-vue3-app/src/views/Setting.vue:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
保存
20 |
退出登录
21 |
22 |
23 |
24 |
76 |
77 |
85 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/config/NeeBeeMallWebMvcConfigurer.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.config;
10 |
11 | import ltd.newbee.mall.common.Constants;
12 | import ltd.newbee.mall.config.handler.TokenToAdminUserMethodArgumentResolver;
13 | import ltd.newbee.mall.config.handler.TokenToMallUserMethodArgumentResolver;
14 | import org.springframework.beans.factory.annotation.Autowired;
15 | import org.springframework.context.annotation.Configuration;
16 | import org.springframework.web.method.support.HandlerMethodArgumentResolver;
17 | import org.springframework.web.servlet.config.annotation.CorsRegistry;
18 | import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
19 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
20 |
21 | import java.util.List;
22 |
23 | @Configuration
24 | public class NeeBeeMallWebMvcConfigurer implements WebMvcConfigurer {
25 |
26 | @Autowired
27 | private TokenToMallUserMethodArgumentResolver tokenToMallUserMethodArgumentResolver;
28 | @Autowired
29 | private TokenToAdminUserMethodArgumentResolver tokenToAdminUserMethodArgumentResolver;
30 |
31 | /**
32 | * @param argumentResolvers
33 | * @tip @TokenToMallUser @TokenToAdminUser 注解处理方法
34 | */
35 | public void addArgumentResolvers(List argumentResolvers) {
36 | argumentResolvers.add(tokenToMallUserMethodArgumentResolver);
37 | argumentResolvers.add(tokenToAdminUserMethodArgumentResolver);
38 | }
39 |
40 | public void addResourceHandlers(ResourceHandlerRegistry registry) {
41 | registry.addResourceHandler("/upload/**").addResourceLocations("file:" + Constants.FILE_UPLOAD_DIC);
42 | registry.addResourceHandler("/goods-img/**").addResourceLocations("file:" + Constants.FILE_UPLOAD_DIC);
43 | }
44 |
45 | /**
46 | * 跨域配置
47 | *
48 | * @param registry
49 | */
50 | @Override
51 | public void addCorsMappings(CorsRegistry registry) {
52 | registry.addMapping("/**").allowedOrigins("*")
53 | .allowedMethods("GET", "HEAD", "POST", "PUT", "DELETE", "OPTIONS")
54 | .allowCredentials(true).maxAge(3600);
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/mall-vue3-app/src/components/ListScroll.vue:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
94 |
95 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/util/NewBeeMallUtils.java:
--------------------------------------------------------------------------------
1 | package ltd.newbee.mall.util;
2 |
3 | import org.springframework.util.StringUtils;
4 |
5 | import java.net.URI;
6 |
7 | /**
8 | * @author 13
9 | */
10 | public class NewBeeMallUtils {
11 |
12 | public static URI getHost(URI uri) {
13 | URI effectiveURI = null;
14 | try {
15 | effectiveURI = new URI(uri.getScheme(), uri.getUserInfo(), uri.getHost(), uri.getPort(), null, null, null);
16 | } catch (Throwable var4) {
17 | effectiveURI = null;
18 | }
19 | return effectiveURI;
20 | }
21 |
22 | public static String cleanString(String value) {
23 | if (StringUtils.isEmpty(value)) {
24 | return "";
25 | }
26 | value = value.toLowerCase();
27 | value = value.replaceAll("<", "& lt;").replaceAll(">", "& gt;");
28 | value = value.replaceAll("\\(", "& #40;").replaceAll("\\)", "& #41;");
29 | value = value.replaceAll("'", "& #39;");
30 | value = value.replaceAll("onload", "0nl0ad");
31 | value = value.replaceAll("xml", "xm1");
32 | value = value.replaceAll("window", "wind0w");
33 | value = value.replaceAll("click", "cl1ck");
34 | value = value.replaceAll("var", "v0r");
35 | value = value.replaceAll("let", "1et");
36 | value = value.replaceAll("function", "functi0n");
37 | value = value.replaceAll("return", "retu1n");
38 | value = value.replaceAll("$", "");
39 | value = value.replaceAll("document", "d0cument");
40 | value = value.replaceAll("const", "c0nst");
41 | value = value.replaceAll("eval\\((.*)\\)", "");
42 | value = value.replaceAll("[\\\"\\\'][\\s]*javascript:(.*)[\\\"\\\']", "\"\"");
43 | value = value.replaceAll("script", "scr1pt");
44 | value = value.replaceAll("insert", "1nsert");
45 | value = value.replaceAll("drop", "dr0p");
46 | value = value.replaceAll("create", "cre0ate");
47 | value = value.replaceAll("update", "upd0ate");
48 | value = value.replaceAll("alter", "a1ter");
49 | value = value.replaceAll("from", "fr0m");
50 | value = value.replaceAll("where", "wh1re");
51 | value = value.replaceAll("database", "data1base");
52 | value = value.replaceAll("table", "tab1e");
53 | value = value.replaceAll("tb", "tb0");
54 | return value;
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/config/Swagger2Config.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.config;
10 |
11 | import ltd.newbee.mall.entity.AdminUserToken;
12 | import ltd.newbee.mall.entity.MallUser;
13 | import org.springframework.context.annotation.Bean;
14 | import org.springframework.context.annotation.Configuration;
15 | import springfox.documentation.builders.ApiInfoBuilder;
16 | import springfox.documentation.builders.ParameterBuilder;
17 | import springfox.documentation.builders.PathSelectors;
18 | import springfox.documentation.builders.RequestHandlerSelectors;
19 | import springfox.documentation.schema.ModelRef;
20 | import springfox.documentation.service.ApiInfo;
21 | import springfox.documentation.service.Parameter;
22 | import springfox.documentation.spi.DocumentationType;
23 | import springfox.documentation.spring.web.plugins.Docket;
24 | import springfox.documentation.swagger2.annotations.EnableSwagger2;
25 |
26 | import java.util.ArrayList;
27 | import java.util.List;
28 |
29 | @Configuration
30 | @EnableSwagger2
31 | public class Swagger2Config {
32 |
33 | @Bean
34 | public Docket api() {
35 |
36 | ParameterBuilder tokenParam = new ParameterBuilder();
37 | List swaggerParams = new ArrayList();
38 | tokenParam.name("token").description("用户认证信息")
39 | .modelRef(new ModelRef("string")).parameterType("header")
40 | .required(false).build(); //header中的ticket参数非必填,传空也可以
41 | swaggerParams.add(tokenParam.build()); //根据每个方法名也知道当前方法在设置什么参数
42 |
43 | return new Docket(DocumentationType.SWAGGER_2)
44 | .apiInfo(apiInfo())
45 | .ignoredParameterTypes(MallUser.class, AdminUserToken.class)
46 | .select()
47 | .apis(RequestHandlerSelectors.basePackage("ltd.newbee.mall.api"))// 修改为自己的 controller 包路径
48 | .paths(PathSelectors.any())
49 | .build()
50 | .globalOperationParameters(swaggerParams);
51 | }
52 |
53 | private ApiInfo apiInfo() {
54 | return new ApiInfoBuilder()
55 | .title("商城接口文档")
56 | .description("swagger接口文档")
57 | .version("2.0")
58 | .build();
59 | }
60 | }
--------------------------------------------------------------------------------
/mall-vue3-app/src/App.vue:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
47 |
48 |
104 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/api/mall/NewBeeMallIndexAPI.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.api.mall;
10 |
11 | import io.swagger.annotations.Api;
12 | import io.swagger.annotations.ApiOperation;
13 | import ltd.newbee.mall.common.Constants;
14 | import ltd.newbee.mall.common.IndexConfigTypeEnum;
15 | import ltd.newbee.mall.api.mall.vo.IndexInfoVO;
16 | import ltd.newbee.mall.api.mall.vo.NewBeeMallIndexCarouselVO;
17 | import ltd.newbee.mall.api.mall.vo.NewBeeMallIndexConfigGoodsVO;
18 | import ltd.newbee.mall.service.NewBeeMallCarouselService;
19 | import ltd.newbee.mall.service.NewBeeMallIndexConfigService;
20 | import ltd.newbee.mall.util.Result;
21 | import ltd.newbee.mall.util.ResultGenerator;
22 | import org.springframework.web.bind.annotation.GetMapping;
23 | import org.springframework.web.bind.annotation.RequestMapping;
24 | import org.springframework.web.bind.annotation.RestController;
25 |
26 | import javax.annotation.Resource;
27 | import java.util.List;
28 |
29 | @RestController
30 | @Api(value = "v1", tags = "1.商城首页接口")
31 | @RequestMapping("/api/v1")
32 | public class NewBeeMallIndexAPI {
33 |
34 | @Resource
35 | private NewBeeMallCarouselService newBeeMallCarouselService;
36 |
37 | @Resource
38 | private NewBeeMallIndexConfigService newBeeMallIndexConfigService;
39 |
40 | @GetMapping("/index-infos")
41 | @ApiOperation(value = "获取首页数据", notes = "轮播图、新品、推荐等")
42 | public Result indexInfo() {
43 | IndexInfoVO indexInfoVO = new IndexInfoVO();
44 | List carousels = newBeeMallCarouselService.getCarouselsForIndex(Constants.INDEX_CAROUSEL_NUMBER);
45 | List hotGoodses = newBeeMallIndexConfigService.getConfigGoodsesForIndex(IndexConfigTypeEnum.INDEX_GOODS_HOT.getType(), Constants.INDEX_GOODS_HOT_NUMBER);
46 | List newGoodses = newBeeMallIndexConfigService.getConfigGoodsesForIndex(IndexConfigTypeEnum.INDEX_GOODS_NEW.getType(), Constants.INDEX_GOODS_NEW_NUMBER);
47 | List recommendGoodses = newBeeMallIndexConfigService.getConfigGoodsesForIndex(IndexConfigTypeEnum.INDEX_GOODS_RECOMMOND.getType(), Constants.INDEX_GOODS_RECOMMOND_NUMBER);
48 | indexInfoVO.setCarousels(carousels);
49 | indexInfoVO.setHotGoodses(hotGoodses);
50 | indexInfoVO.setNewGoodses(newGoodses);
51 | indexInfoVO.setRecommendGoodses(recommendGoodses);
52 | return ResultGenerator.genSuccessResult(indexInfoVO);
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/config/handler/TokenToAdminUserMethodArgumentResolver.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.config.handler;
10 |
11 | import ltd.newbee.mall.common.Constants;
12 | import ltd.newbee.mall.common.NewBeeMallException;
13 | import ltd.newbee.mall.common.ServiceResultEnum;
14 | import ltd.newbee.mall.config.annotation.TokenToAdminUser;
15 | import ltd.newbee.mall.dao.NewBeeAdminUserTokenMapper;
16 | import ltd.newbee.mall.entity.AdminUserToken;
17 | import org.springframework.beans.factory.annotation.Autowired;
18 | import org.springframework.core.MethodParameter;
19 | import org.springframework.stereotype.Component;
20 | import org.springframework.web.bind.support.WebDataBinderFactory;
21 | import org.springframework.web.context.request.NativeWebRequest;
22 | import org.springframework.web.method.support.HandlerMethodArgumentResolver;
23 | import org.springframework.web.method.support.ModelAndViewContainer;
24 |
25 | @Component
26 | public class TokenToAdminUserMethodArgumentResolver implements HandlerMethodArgumentResolver {
27 |
28 | @Autowired
29 | private NewBeeAdminUserTokenMapper newBeeAdminUserTokenMapper;
30 |
31 | public TokenToAdminUserMethodArgumentResolver() {
32 | }
33 |
34 | public boolean supportsParameter(MethodParameter parameter) {
35 | if (parameter.hasParameterAnnotation(TokenToAdminUser.class)) {
36 | return true;
37 | }
38 | return false;
39 | }
40 |
41 | public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer, NativeWebRequest webRequest, WebDataBinderFactory binderFactory) {
42 | if (parameter.getParameterAnnotation(TokenToAdminUser.class) instanceof TokenToAdminUser) {
43 | String token = webRequest.getHeader("token");
44 | if (null != token && !"".equals(token) && token.length() == Constants.TOKEN_LENGTH) {
45 | AdminUserToken adminUserToken = newBeeAdminUserTokenMapper.selectByToken(token);
46 | if (adminUserToken == null) {
47 | NewBeeMallException.fail(ServiceResultEnum.ADMIN_NOT_LOGIN_ERROR.getResult());
48 | } else if (adminUserToken.getExpireTime().getTime() <= System.currentTimeMillis()) {
49 | NewBeeMallException.fail(ServiceResultEnum.ADMIN_TOKEN_EXPIRE_ERROR.getResult());
50 | }
51 | return adminUserToken;
52 | } else {
53 | NewBeeMallException.fail(ServiceResultEnum.ADMIN_NOT_LOGIN_ERROR.getResult());
54 | }
55 | }
56 | return null;
57 | }
58 |
59 | }
60 |
--------------------------------------------------------------------------------
/vue3-admin/src/main.js:
--------------------------------------------------------------------------------
1 | import { createApp } from 'vue'
2 | import { ElButton, ElContainer, ElAside, ElHeader, ElMain, ElFooter, ElMenu, ElSubmenu, ElMenuItemGroup, ElMenuItem, ElForm, ElFormItem, ElInput, ElPopover, ElTag, ElCard, ElTable, ElTableColumn, ElPagination, ElDialog, ElPopconfirm, ElUpload, ElLoading, ElSelect, ElOption, ElRadioGroup, ElRadio, ElCascader, ElCheckbox, ElInputNumber } from 'element-plus'
3 | import * as Sentry from "@sentry/browser";
4 | import { Integrations } from "@sentry/tracing";
5 | import App from './App.vue'
6 | import router from './router/index'
7 |
8 | // import 'element-plus/lib/theme-chalk/index.css'
9 |
10 | // 修改后的主题样式必须放在最后面
11 | import '../theme/index.css'
12 |
13 | const orderStatus = {
14 | 0: '待支付',
15 | 1: '已支付',
16 | 2: '配货完成',
17 | 3: '出库成功',
18 | 4: '交易成功',
19 | '-1': '手动关闭',
20 | '-2': '超时关闭',
21 | '-3': '商家关闭'
22 | }
23 |
24 | const app = createApp(App)
25 | // 全局过滤器
26 | app.config.globalProperties.$filters = {
27 | orderMap(status) {
28 | return orderStatus[status] || '未知状态'
29 | },
30 | prefix(url) {
31 | if (url && url.startsWith('http')) {
32 | return url
33 | } else {
34 | url = `http://backend-api-02.newbee.ltd:28019${url}`
35 | return url
36 | }
37 | },
38 | resetImgUrl(imgObj, imgSrc, maxErrorNum) {
39 | if (maxErrorNum > 0) {
40 | imgObj.onerror = function() {
41 | resetImgUrl(imgObj, imgSrc, maxErrorNum - 1)
42 | }
43 | setTimeout(function() {
44 | imgObj.src = imgSrc
45 | }, 500)
46 | } else {
47 | imgObj.onerror = null
48 | imgObj.src = imgSrc
49 | }
50 | }
51 | }
52 |
53 | app.use(router)
54 |
55 | app.use(ElButton)
56 | .use(ElContainer)
57 | .use(ElAside)
58 | .use(ElHeader)
59 | .use(ElMain)
60 | .use(ElFooter)
61 | .use(ElMenu)
62 | .use(ElSubmenu)
63 | .use(ElMenuItemGroup)
64 | .use(ElMenuItem)
65 | .use(ElForm)
66 | .use(ElFormItem)
67 | .use(ElInput)
68 | .use(ElPopover)
69 | .use(ElTag)
70 | .use(ElCard)
71 | .use(ElTable)
72 | .use(ElTableColumn)
73 | .use(ElPagination)
74 | .use(ElDialog)
75 | .use(ElPopconfirm)
76 | .use(ElUpload)
77 | .use(ElLoading)
78 | .use(ElSelect)
79 | .use(ElOption)
80 | .use(ElRadioGroup)
81 | .use(ElRadio)
82 | .use(ElCascader)
83 | .use(ElCheckbox)
84 | .use(ElInputNumber)
85 |
86 | Sentry.init({
87 | dsn: "https://f866b695d21d467ba523f1adf14e0a24@o584908.ingest.sentry.io/5737358",
88 | integrations: [new Integrations.BrowserTracing()],
89 |
90 | // Set tracesSampleRate to 1.0 to capture 100%
91 | // of transactions for performance monitoring.
92 | // We recommend adjusting this value in production
93 | tracesSampleRate: 1.0,
94 | });
95 |
96 | app.mount('#app')
97 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/config/NewBeeMallExceptionHandler.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.config;
10 |
11 | import ltd.newbee.mall.common.NewBeeMallException;
12 | import ltd.newbee.mall.common.ServiceResultEnum;
13 | import ltd.newbee.mall.util.Result;
14 | import org.springframework.validation.BindException;
15 | import org.springframework.validation.BindingResult;
16 | import org.springframework.web.bind.MethodArgumentNotValidException;
17 | import org.springframework.web.bind.annotation.ExceptionHandler;
18 | import org.springframework.web.bind.annotation.RestControllerAdvice;
19 | import org.springframework.web.servlet.ModelAndView;
20 |
21 | import javax.servlet.http.HttpServletRequest;
22 | import java.util.Objects;
23 |
24 | /**
25 | * newbee-mall全局异常处理
26 | */
27 | @RestControllerAdvice
28 | public class NewBeeMallExceptionHandler {
29 |
30 | @ExceptionHandler(BindException.class)
31 | public Object bindException(BindException e) {
32 | Result result = new Result();
33 | result.setResultCode(510);
34 | BindingResult bindingResult = e.getBindingResult();
35 | result.setMessage(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
36 | return result;
37 | }
38 |
39 | @ExceptionHandler(MethodArgumentNotValidException.class)
40 | public Object bindException(MethodArgumentNotValidException e) {
41 | Result result = new Result();
42 | result.setResultCode(510);
43 | BindingResult bindingResult = e.getBindingResult();
44 | result.setMessage(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
45 | return result;
46 | }
47 |
48 | @ExceptionHandler(Exception.class)
49 | public Object handleException(Exception e, HttpServletRequest req) {
50 | Result result = new Result();
51 | result.setResultCode(500);
52 | //区分是否为自定义异常
53 | if (e instanceof NewBeeMallException) {
54 | result.setMessage(e.getMessage());
55 | if (e.getMessage().equals(ServiceResultEnum.NOT_LOGIN_ERROR.getResult()) || e.getMessage().equals(ServiceResultEnum.TOKEN_EXPIRE_ERROR.getResult())) {
56 | result.setResultCode(416);
57 | } else if (e.getMessage().equals(ServiceResultEnum.ADMIN_NOT_LOGIN_ERROR.getResult()) || e.getMessage().equals(ServiceResultEnum.ADMIN_TOKEN_EXPIRE_ERROR.getResult())) {
58 | result.setResultCode(419);
59 | }
60 | } else {
61 | e.printStackTrace();
62 | result.setMessage("未知异常,请查看控制台日志并检查配置文件。");
63 | }
64 | return result;
65 |
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/service/NewBeeMallOrderService.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.service;
10 |
11 | import ltd.newbee.mall.api.mall.vo.NewBeeMallOrderDetailVO;
12 | import ltd.newbee.mall.api.mall.vo.NewBeeMallOrderItemVO;
13 | import ltd.newbee.mall.api.mall.vo.NewBeeMallShoppingCartItemVO;
14 | import ltd.newbee.mall.entity.MallUser;
15 | import ltd.newbee.mall.entity.MallUserAddress;
16 | import ltd.newbee.mall.entity.NewBeeMallOrder;
17 | import ltd.newbee.mall.util.PageQueryUtil;
18 | import ltd.newbee.mall.util.PageResult;
19 |
20 | import java.util.List;
21 |
22 | public interface NewBeeMallOrderService {
23 | /**
24 | * 获取订单详情
25 | *
26 | * @param orderId
27 | * @return
28 | */
29 | NewBeeMallOrderDetailVO getOrderDetailByOrderId(Long orderId);
30 |
31 | /**
32 | * 获取订单详情
33 | *
34 | * @param orderNo
35 | * @param userId
36 | * @return
37 | */
38 | NewBeeMallOrderDetailVO getOrderDetailByOrderNo(String orderNo, Long userId);
39 |
40 | /**
41 | * 我的订单列表
42 | *
43 | * @param pageUtil
44 | * @return
45 | */
46 | PageResult getMyOrders(PageQueryUtil pageUtil);
47 |
48 | /**
49 | * 手动取消订单
50 | *
51 | * @param orderNo
52 | * @param userId
53 | * @return
54 | */
55 | String cancelOrder(String orderNo, Long userId);
56 |
57 | /**
58 | * 确认收货
59 | *
60 | * @param orderNo
61 | * @param userId
62 | * @return
63 | */
64 | String finishOrder(String orderNo, Long userId);
65 |
66 | String paySuccess(String orderNo, int payType);
67 |
68 | String saveOrder(MallUser loginMallUser, MallUserAddress address, List itemsForSave);
69 |
70 | /**
71 | * 后台分页
72 | *
73 | * @param pageUtil
74 | * @return
75 | */
76 | PageResult getNewBeeMallOrdersPage(PageQueryUtil pageUtil);
77 |
78 | /**
79 | * 订单信息修改
80 | *
81 | * @param newBeeMallOrder
82 | * @return
83 | */
84 | String updateOrderInfo(NewBeeMallOrder newBeeMallOrder);
85 |
86 | /**
87 | * 配货
88 | *
89 | * @param ids
90 | * @return
91 | */
92 | String checkDone(Long[] ids);
93 |
94 | /**
95 | * 出库
96 | *
97 | * @param ids
98 | * @return
99 | */
100 | String checkOut(Long[] ids);
101 |
102 | /**
103 | * 关闭订单
104 | *
105 | * @param ids
106 | * @return
107 | */
108 | String closeOrder(Long[] ids);
109 |
110 | List getOrderItems(Long orderId);
111 | }
112 |
--------------------------------------------------------------------------------
/mall-vue3-app/src/views/Address.vue:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
23 |
31 |
32 |
33 |
34 |
35 |
91 |
92 |
106 |
--------------------------------------------------------------------------------
/mall-vue3-app/src/components/NavBar.vue:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | 首页
17 |
18 |
19 |
20 | 分类
21 |
22 |
23 |
24 | 购物车
25 |
26 |
27 |
28 | 我的
29 |
30 |
31 |
32 |
33 |
34 |
60 |
61 |
102 |
--------------------------------------------------------------------------------
/vue3-admin/theme/element-variables.css:
--------------------------------------------------------------------------------
1 | /* Element Chalk Variables */
2 | /* Transition
3 | -------------------------- */
4 | /* Color
5 | -------------------------- */
6 | /* 53a8ff */
7 | /* 66b1ff */
8 | /* 79bbff */
9 | /* 8cc5ff */
10 | /* a0cfff */
11 | /* b3d8ff */
12 | /* c6e2ff */
13 | /* d9ecff */
14 | /* ecf5ff */
15 | /* Link
16 | -------------------------- */
17 | /* Border
18 | -------------------------- */
19 | /* Fill
20 | -------------------------- */
21 | /* Typography
22 | -------------------------- */
23 | /* Size
24 | -------------------------- */
25 | /* z-index
26 | -------------------------- */
27 | /* Disable base
28 | -------------------------- */
29 | /* Icon
30 | -------------------------- */
31 | /* Checkbox
32 | -------------------------- */
33 | /* Radio
34 | -------------------------- */
35 | /* Select
36 | -------------------------- */
37 | /* Alert
38 | -------------------------- */
39 | /* MessageBox
40 | -------------------------- */
41 | /* Message
42 | -------------------------- */
43 | /* Notification
44 | -------------------------- */
45 | /* Input
46 | -------------------------- */
47 | /* Cascader
48 | -------------------------- */
49 | /* Group
50 | -------------------------- */
51 | /* Tab
52 | -------------------------- */
53 | /* Button
54 | -------------------------- */
55 | /* cascader
56 | -------------------------- */
57 | /* Switch
58 | -------------------------- */
59 | /* Dialog
60 | -------------------------- */
61 | /* Table
62 | -------------------------- */
63 | /* Pagination
64 | -------------------------- */
65 | /* Popup
66 | -------------------------- */
67 | /* Popover
68 | -------------------------- */
69 | /* Tooltip
70 | -------------------------- */
71 | /* Tag
72 | -------------------------- */
73 | /* Tree
74 | -------------------------- */
75 | /* Dropdown
76 | -------------------------- */
77 | /* Badge
78 | -------------------------- */
79 | /* Card
80 | --------------------------*/
81 | /* Slider
82 | --------------------------*/
83 | /* Steps
84 | --------------------------*/
85 | /* Menu
86 | --------------------------*/
87 | /* Rate
88 | --------------------------*/
89 | /* DatePicker
90 | --------------------------*/
91 | /* Loading
92 | --------------------------*/
93 | /* Scrollbar
94 | --------------------------*/
95 | /* Carousel
96 | --------------------------*/
97 | /* Collapse
98 | --------------------------*/
99 | /* Transfer
100 | --------------------------*/
101 | /* Header
102 | --------------------------*/
103 | /* Footer
104 | --------------------------*/
105 | /* Main
106 | --------------------------*/
107 | /* Timeline
108 | --------------------------*/
109 | /* Backtop
110 | --------------------------*/
111 | /* Link
112 | --------------------------*/
113 | /* Calendar
114 | --------------------------*/
115 | /* Form
116 | -------------------------- */
117 | /* Avatar
118 | --------------------------*/
119 | /* Break-point
120 | --------------------------*/
121 |
--------------------------------------------------------------------------------
/vue3-admin/src/router/index.js:
--------------------------------------------------------------------------------
1 | import { createRouter, createWebHashHistory } from 'vue-router'
2 |
3 | const router = createRouter({
4 | history: createWebHashHistory(), // hash模式:createWebHashHistory,history模式:createWebHistory
5 | routes: [
6 | {
7 | path: '/',
8 | redirect: '/dashboard'
9 | },
10 | {
11 | path: '/introduce',
12 | name: 'introduce',
13 | component: () => import(/* webpackChunkName: "introduce" */ '../views/Introduce.vue')
14 | },
15 | {
16 | path: '/dashboard',
17 | name: 'dashboard',
18 | component: () => import(/* webpackChunkName: "dashboard" */ '../views/Index.vue')
19 | },
20 | {
21 | path: '/login',
22 | name: 'login',
23 | component: () => import(/* webpackChunkName: "login" */ '../views/Login.vue')
24 | },
25 | {
26 | path: '/add',
27 | name: 'add',
28 | component: () => import(/* webpackChunkName: "add" */ '../views/AddGood.vue')
29 | },
30 | {
31 | path: '/swiper',
32 | name: 'swiper',
33 | component: () => import(/* webpackChunkName: "swiper" */ '../views/Swiper.vue')
34 | },
35 | {
36 | path: '/hot',
37 | name: 'hot',
38 | component: () => import(/* webpackChunkName: "hot" */ '../views/IndexConfig.vue')
39 | },
40 | {
41 | path: '/new',
42 | name: 'new',
43 | component: () => import(/* webpackChunkName: "new" */ '../views/IndexConfig.vue')
44 | },
45 | {
46 | path: '/recommend',
47 | name: 'recommend',
48 | component: () => import(/* webpackChunkName: "recommend" */ '../views/IndexConfig.vue')
49 | },
50 | {
51 | path: '/category',
52 | name: 'category',
53 | component: () => import(/* webpackChunkName: "category" */ '../views/Category.vue'),
54 | children: [
55 | {
56 | path: '/category/level2',
57 | name: 'level2',
58 | component: () => import(/* webpackChunkName: "level2" */ '../views/Category.vue'),
59 | },
60 | {
61 | path: '/category/level3',
62 | name: 'level3',
63 | component: () => import(/* webpackChunkName: "level3" */ '../views/Category.vue'),
64 | }
65 | ]
66 | },
67 | {
68 | path: '/good',
69 | name: 'good',
70 | component: () => import(/* webpackChunkName: "new" */ '../views/Good.vue')
71 | },
72 | {
73 | path: '/guest',
74 | name: 'guest',
75 | component: () => import(/* webpackChunkName: "guest" */ '../views/Guest.vue')
76 | },
77 | {
78 | path: '/order',
79 | name: 'order',
80 | component: () => import(/* webpackChunkName: "order" */ '../views/Order.vue')
81 | },
82 | {
83 | path: '/order_detail',
84 | name: 'order_detail',
85 | component: () => import(/* webpackChunkName: "order_detail" */ '../views/OrderDetail.vue')
86 | },
87 | {
88 | path: '/account',
89 | name: 'account',
90 | component: () => import(/* webpackChunkName: "account" */ '../views/Account.vue')
91 | }
92 | ]
93 | })
94 |
95 | export default router
--------------------------------------------------------------------------------
/mall-api/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
12 | 4.0.0
13 | jar
14 | ltd.newbee.mall
15 | newbee-mall-api
16 | 3.0.0-SNAPSHOT
17 | newbee-mall-api
18 | NEWBEE商城 API
19 |
20 |
21 | org.springframework.boot
22 | spring-boot-starter-parent
23 | 2.3.7.RELEASE
24 |
25 |
26 |
27 |
28 | UTF-8
29 | UTF-8
30 | 1.8
31 |
32 |
33 |
34 |
35 | org.springframework.boot
36 | spring-boot-starter-web
37 |
38 |
39 | org.springframework.boot
40 | spring-boot-starter-validation
41 |
42 |
43 | org.mybatis.spring.boot
44 | mybatis-spring-boot-starter
45 | 2.1.3
46 |
47 |
48 |
49 | org.projectlombok
50 | lombok
51 | 1.18.8
52 | provided
53 |
54 |
55 |
56 | io.springfox
57 | springfox-swagger2
58 | 2.8.0
59 |
60 |
61 | io.springfox
62 | springfox-swagger-ui
63 | 2.8.0
64 |
65 |
66 |
67 | mysql
68 | mysql-connector-java
69 | runtime
70 |
71 |
72 |
73 | org.springframework.boot
74 | spring-boot-starter-test
75 | test
76 |
77 |
78 |
79 |
80 |
81 |
82 | org.springframework.boot
83 | spring-boot-maven-plugin
84 |
85 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/vue3-admin/theme/aside.css:
--------------------------------------------------------------------------------
1 | /* BEM support Func
2 | -------------------------- */
3 | /* Element Chalk Variables */
4 | /* Transition
5 | -------------------------- */
6 | /* Color
7 | -------------------------- */
8 | /* 53a8ff */
9 | /* 66b1ff */
10 | /* 79bbff */
11 | /* 8cc5ff */
12 | /* a0cfff */
13 | /* b3d8ff */
14 | /* c6e2ff */
15 | /* d9ecff */
16 | /* ecf5ff */
17 | /* Link
18 | -------------------------- */
19 | /* Border
20 | -------------------------- */
21 | /* Fill
22 | -------------------------- */
23 | /* Typography
24 | -------------------------- */
25 | /* Size
26 | -------------------------- */
27 | /* z-index
28 | -------------------------- */
29 | /* Disable base
30 | -------------------------- */
31 | /* Icon
32 | -------------------------- */
33 | /* Checkbox
34 | -------------------------- */
35 | /* Radio
36 | -------------------------- */
37 | /* Select
38 | -------------------------- */
39 | /* Alert
40 | -------------------------- */
41 | /* MessageBox
42 | -------------------------- */
43 | /* Message
44 | -------------------------- */
45 | /* Notification
46 | -------------------------- */
47 | /* Input
48 | -------------------------- */
49 | /* Cascader
50 | -------------------------- */
51 | /* Group
52 | -------------------------- */
53 | /* Tab
54 | -------------------------- */
55 | /* Button
56 | -------------------------- */
57 | /* cascader
58 | -------------------------- */
59 | /* Switch
60 | -------------------------- */
61 | /* Dialog
62 | -------------------------- */
63 | /* Table
64 | -------------------------- */
65 | /* Pagination
66 | -------------------------- */
67 | /* Popup
68 | -------------------------- */
69 | /* Popover
70 | -------------------------- */
71 | /* Tooltip
72 | -------------------------- */
73 | /* Tag
74 | -------------------------- */
75 | /* Tree
76 | -------------------------- */
77 | /* Dropdown
78 | -------------------------- */
79 | /* Badge
80 | -------------------------- */
81 | /* Card
82 | --------------------------*/
83 | /* Slider
84 | --------------------------*/
85 | /* Steps
86 | --------------------------*/
87 | /* Menu
88 | --------------------------*/
89 | /* Rate
90 | --------------------------*/
91 | /* DatePicker
92 | --------------------------*/
93 | /* Loading
94 | --------------------------*/
95 | /* Scrollbar
96 | --------------------------*/
97 | /* Carousel
98 | --------------------------*/
99 | /* Collapse
100 | --------------------------*/
101 | /* Transfer
102 | --------------------------*/
103 | /* Header
104 | --------------------------*/
105 | /* Footer
106 | --------------------------*/
107 | /* Main
108 | --------------------------*/
109 | /* Timeline
110 | --------------------------*/
111 | /* Backtop
112 | --------------------------*/
113 | /* Link
114 | --------------------------*/
115 | /* Calendar
116 | --------------------------*/
117 | /* Form
118 | -------------------------- */
119 | /* Avatar
120 | --------------------------*/
121 | /* Break-point
122 | --------------------------*/
123 | /* Break-points
124 | -------------------------- */
125 | /* Scrollbar
126 | -------------------------- */
127 | /* Placeholder
128 | -------------------------- */
129 | /* BEM
130 | -------------------------- */
131 | .el-aside {
132 | overflow: auto;
133 | -webkit-box-sizing: border-box;
134 | box-sizing: border-box;
135 | -ms-flex-negative: 0;
136 | flex-shrink: 0; }
137 |
--------------------------------------------------------------------------------
/vue3-admin/src/views/Introduce.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 | 系统简介
4 |
5 | vue3-admin 是一套企业级后台管理系统,基于 Spring Boot 、Vue 3.0 相关技术栈开发,供各位开发者们体验和学习,一定给你最好的学习体验。
6 |
7 |
10 | 开发及部署文档
11 |
14 |
15 | - 开篇词:通关Vue3.0 企业级项目开发,升职加薪快人一步
16 | - 项目须知与课程约定
17 | - 大势所趋:“前后端分离”开发模式
18 | - Vue 3.0 简介及开发环境搭建
19 | - Vue 3.0 组合 API 入口 Setup 浅析
20 | - Vue 3.0 之响应式系统 API
21 | - Vue 3.0 之生命周期钩子函数、提供注入
22 | - Vue 3.0 性能和业务层面上的提升
23 | - Vite 2.0 原理分析及简单插件编写
24 | - Vue-Router 4.x 使用方法及路由原理
25 | - Vue 3.0 实战项目启动篇
26 | - 技术选型之 Spring Boot
27 | - 后端开发环境搭建
28 | - 快速搭建一个 Spring Boot 项目
29 | - Spring Boot 实践之 Web 功能开发
30 | - Spring Boot 实践之文件上传处理
31 | - Spring Boot 实践之整合 MyBatis 操作数据库
32 | - Spring Boot 实践之整合 Lombok
33 | - Spring Boot 实践之整合 Swagger 生成接口文档
34 | - 后端 API 项目启动和运行注意事项
35 |
36 |
37 | - 接口参数处理和统一响应结果处理
38 | - API 接口开发实战之用户登录接口开发
39 | - API 接口开发实战之用户身份认证详解
40 | - API 接口开发实战之轮播图管理模块接口开发
41 | - API 接口开发实战之商品分类管理模块接口开发
42 | - API 接口开发实战之商品管理模块接口开发
43 | - API 接口开发实战之商品配置管理模块接口开发
44 | - API 接口开发实战之订单管理模块接口开发
45 | - 成为一名有独立开发能力的前端工程师
46 | - Vite 2.0 + Vue 3.0 + Element-plus 搭建管理后台项目
47 | - Vue 3.0 实战之管理后台左右栏目布局(Menu 菜单组件)
48 | - Vue 3.0 实战之登录鉴权(Form 表单组件)
49 | - Vue 3.0 实战之首页大盘数据(Echart 5.x)
50 | - Vue 3.0 实战之首页配置 Table
51 | - Vue 3.0 实战之分类管理(多级共用 Table)
52 | - Vue 3.0 实战之商品管理
53 | - Vue 3.0 实战之订单管理(操作多级判断)
54 | - Vue 3.0 实战之会员管理、账户修改
55 | - pm2 实现一键部署云端服务器
56 | - 常见问题汇总讲解
57 |
58 | 技术选型
59 |
60 | - Vue 3.x
61 | - Vite 2.x
62 | - Vue-Router 4.x
63 | - Element-Plus(适配全新 Vue 3.x 的 PC 端组件库)
64 | - Echarts 5.0
65 | - axios
66 | - wangEditor
67 |
68 | 联系作者
69 |
70 | - 我的邮箱:2449207463@qq.com
71 | - QQ技术交流群:932227898、707779034
72 |
73 |
74 |
75 |
76 |
91 |
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/service/impl/NewBeeMallCarouselServiceImpl.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本软件已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.service.impl;
10 |
11 | import ltd.newbee.mall.api.mall.vo.NewBeeMallIndexCarouselVO;
12 | import ltd.newbee.mall.common.ServiceResultEnum;
13 | import ltd.newbee.mall.dao.CarouselMapper;
14 | import ltd.newbee.mall.entity.Carousel;
15 | import ltd.newbee.mall.service.NewBeeMallCarouselService;
16 | import ltd.newbee.mall.util.BeanUtil;
17 | import ltd.newbee.mall.util.PageQueryUtil;
18 | import ltd.newbee.mall.util.PageResult;
19 | import org.springframework.beans.factory.annotation.Autowired;
20 | import org.springframework.stereotype.Service;
21 | import org.springframework.util.CollectionUtils;
22 |
23 | import java.util.ArrayList;
24 | import java.util.Date;
25 | import java.util.List;
26 |
27 | @Service
28 | public class NewBeeMallCarouselServiceImpl implements NewBeeMallCarouselService {
29 |
30 | @Autowired
31 | private CarouselMapper carouselMapper;
32 |
33 |
34 | @Override
35 | public PageResult getCarouselPage(PageQueryUtil pageUtil) {
36 | List carousels = carouselMapper.findCarouselList(pageUtil);
37 | int total = carouselMapper.getTotalCarousels(pageUtil);
38 | PageResult pageResult = new PageResult(carousels, total, pageUtil.getLimit(), pageUtil.getPage());
39 | return pageResult;
40 | }
41 |
42 | @Override
43 | public String saveCarousel(Carousel carousel) {
44 | if (carouselMapper.insertSelective(carousel) > 0) {
45 | return ServiceResultEnum.SUCCESS.getResult();
46 | }
47 | return ServiceResultEnum.DB_ERROR.getResult();
48 | }
49 |
50 | @Override
51 | public String updateCarousel(Carousel carousel) {
52 | Carousel temp = carouselMapper.selectByPrimaryKey(carousel.getCarouselId());
53 | if (temp == null) {
54 | return ServiceResultEnum.DATA_NOT_EXIST.getResult();
55 | }
56 | temp.setCarouselRank(carousel.getCarouselRank());
57 | temp.setRedirectUrl(carousel.getRedirectUrl());
58 | temp.setCarouselUrl(carousel.getCarouselUrl());
59 | temp.setUpdateTime(new Date());
60 | if (carouselMapper.updateByPrimaryKeySelective(temp) > 0) {
61 | return ServiceResultEnum.SUCCESS.getResult();
62 | }
63 | return ServiceResultEnum.DB_ERROR.getResult();
64 | }
65 |
66 | @Override
67 | public Carousel getCarouselById(Integer id) {
68 | return carouselMapper.selectByPrimaryKey(id);
69 | }
70 |
71 | @Override
72 | public Boolean deleteBatch(Long[] ids) {
73 | if (ids.length < 1) {
74 | return false;
75 | }
76 | //删除数据
77 | return carouselMapper.deleteBatch(ids) > 0;
78 | }
79 |
80 | @Override
81 | public List getCarouselsForIndex(int number) {
82 | List newBeeMallIndexCarouselVOS = new ArrayList<>(number);
83 | List carousels = carouselMapper.findCarouselsByNum(number);
84 | if (!CollectionUtils.isEmpty(carousels)) {
85 | newBeeMallIndexCarouselVOS = BeanUtil.copyList(carousels, NewBeeMallIndexCarouselVO.class);
86 | }
87 | return newBeeMallIndexCarouselVOS;
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/mall-vue3-app/src/router/index.js:
--------------------------------------------------------------------------------
1 | import { createRouter, createWebHashHistory } from 'vue-router'
2 |
3 | const router = createRouter({
4 | history: createWebHashHistory(), // hash模式:createWebHashHistory,history模式:createWebHistory
5 | routes: [
6 | {
7 | path: '/',
8 | redirect: '/home'
9 | },
10 | {
11 | path: '/home',
12 | name: 'home',
13 | component: () => import(/* webpackChunkName: "home" */ '@/views/Home.vue'),
14 | meta: {
15 | index: 1
16 | }
17 | },
18 | {
19 | path: '/login',
20 | name: 'login',
21 | component: () => import(/* webpackChunkName: "login" */ '@/views/Login.vue'),
22 | meta: {
23 | index: 1
24 | }
25 | },
26 | {
27 | path: '/about',
28 | name: 'about',
29 | component: () => import(/* webpackChunkName: "about" */ '@/views/About.vue'),
30 | meta: {
31 | index: 2
32 | }
33 | },
34 | {
35 | path: '/category',
36 | name: 'category',
37 | component: () => import(/* webpackChunkName: "category" */ '@/views/Category.vue'),
38 | meta: {
39 | index: 1
40 | }
41 | },
42 | {
43 | path: '/product-list',
44 | name: 'product-list',
45 | component: () => import(/* webpackChunkName: "product-list" */ '@/views/ProductList.vue'),
46 | meta: {
47 | index: 2
48 | }
49 | },
50 | {
51 | path: '/product/:id',
52 | name: 'product',
53 | component: () => import(/* webpackChunkName: "product" */ '@/views/ProductDetail.vue'),
54 | meta: {
55 | index: 3
56 | }
57 | },
58 | {
59 | path: '/cart',
60 | name: 'cart',
61 | component: () => import(/* webpackChunkName: "cart" */ '@/views/Cart.vue'),
62 | meta: {
63 | index: 1
64 | }
65 | },
66 | {
67 | path: '/create-order',
68 | name: 'create-order',
69 | component: () => import(/* webpackChunkName: "create-order" */ '@/views/CreateOrder.vue'),
70 | meta: {
71 | index: 2
72 | }
73 | },
74 | {
75 | path: '/order',
76 | name: 'order',
77 | component: () => import(/* webpackChunkName: "order" */ '@/views/Order.vue'),
78 | meta: {
79 | index: 2
80 | }
81 | },
82 | {
83 | path: '/order-detail',
84 | name: 'order-detail',
85 | component: () => import(/* webpackChunkName: "order-detail" */ '@/views/OrderDetail.vue'),
86 | meta: {
87 | index: 3
88 | }
89 | },
90 | {
91 | path: '/user',
92 | name: 'user',
93 | component: () => import(/* webpackChunkName: "user" */ '@/views/User.vue'),
94 | meta: {
95 | index: 1
96 | }
97 | },
98 | {
99 | path: '/setting',
100 | name: 'setting',
101 | component: () => import(/* webpackChunkName: "setting" */ '@/views/Setting.vue'),
102 | meta: {
103 | index: 2
104 | }
105 | },
106 | {
107 | path: '/address',
108 | name: 'address',
109 | component: () => import(/* webpackChunkName: "address" */ '@/views/Address.vue'),
110 | meta: {
111 | index: 2
112 | }
113 | },
114 | {
115 | path: '/address-edit',
116 | name: 'address-edit',
117 | component: () => import(/* webpackChunkName: "address-edit" */ '@/views/AddressEdit.vue'),
118 | meta: {
119 | index: 3
120 | }
121 | },
122 | ]
123 | })
124 |
125 | export default router
--------------------------------------------------------------------------------
/mall-api/src/main/java/ltd/newbee/mall/api/admin/NewBeeAdminRegisteUserAPI.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 严肃声明:
3 | * 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
4 | * 本系统已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
5 | * 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
6 | * Copyright (c) 2019-2021 十三 all rights reserved.
7 | * 版权所有,侵权必究!
8 | */
9 | package ltd.newbee.mall.api.admin;
10 |
11 | import io.swagger.annotations.Api;
12 | import io.swagger.annotations.ApiOperation;
13 | import io.swagger.annotations.ApiParam;
14 | import ltd.newbee.mall.api.admin.param.BatchIdParam;
15 | import ltd.newbee.mall.config.annotation.TokenToAdminUser;
16 | import ltd.newbee.mall.entity.AdminUserToken;
17 | import ltd.newbee.mall.service.NewBeeMallUserService;
18 | import ltd.newbee.mall.util.PageQueryUtil;
19 | import ltd.newbee.mall.util.Result;
20 | import ltd.newbee.mall.util.ResultGenerator;
21 | import org.slf4j.Logger;
22 | import org.slf4j.LoggerFactory;
23 | import org.springframework.web.bind.annotation.*;
24 |
25 | import javax.annotation.Resource;
26 | import java.util.HashMap;
27 | import java.util.Map;
28 |
29 | /**
30 | * @author 13
31 | *
32 | * @email
33 | * @link
34 | */
35 | @RestController
36 | @Api(value = "v1", tags = "8-6.后台管理系统注册用户模块接口")
37 | @RequestMapping("/manage-api/v1")
38 | public class NewBeeAdminRegisteUserAPI {
39 |
40 | private static final Logger logger = LoggerFactory.getLogger(NewBeeAdminRegisteUserAPI.class);
41 |
42 | @Resource
43 | private NewBeeMallUserService newBeeMallUserService;
44 |
45 | /**
46 | * 列表
47 | */
48 | @RequestMapping(value = "/users", method = RequestMethod.GET)
49 | @ApiOperation(value = "商城注册用户列表", notes = "商城注册用户列表")
50 | public Result list(@RequestParam(required = false) @ApiParam(value = "页码") Integer pageNumber,
51 | @RequestParam(required = false) @ApiParam(value = "每页条数") Integer pageSize,
52 | @RequestParam(required = false) @ApiParam(value = "用户状态") Integer lockStatus, @TokenToAdminUser AdminUserToken adminUser) {
53 | logger.info("adminUser:{}", adminUser.toString());
54 | if (pageNumber == null || pageNumber < 1 || pageSize == null || pageSize < 10) {
55 | return ResultGenerator.genFailResult("参数异常!");
56 | }
57 | Map params = new HashMap(8);
58 | params.put("page", pageNumber);
59 | params.put("limit", pageSize);
60 | if (lockStatus != null) {
61 | params.put("orderStatus", lockStatus);
62 | }
63 | PageQueryUtil pageUtil = new PageQueryUtil(params);
64 | return ResultGenerator.genSuccessResult(newBeeMallUserService.getNewBeeMallUsersPage(pageUtil));
65 | }
66 |
67 | /**
68 | * 用户禁用与解除禁用(0-未锁定 1-已锁定)
69 | */
70 | @RequestMapping(value = "/users/{lockStatus}", method = RequestMethod.PUT)
71 | @ApiOperation(value = "修改用户状态", notes = "批量修改,用户禁用与解除禁用(0-未锁定 1-已锁定)")
72 | public Result lockUser(@RequestBody BatchIdParam batchIdParam, @PathVariable int lockStatus, @TokenToAdminUser AdminUserToken adminUser) {
73 | logger.info("adminUser:{}", adminUser.toString());
74 | if (batchIdParam==null||batchIdParam.getIds().length < 1) {
75 | return ResultGenerator.genFailResult("参数异常!");
76 | }
77 | if (lockStatus != 0 && lockStatus != 1) {
78 | return ResultGenerator.genFailResult("操作非法!");
79 | }
80 | if (newBeeMallUserService.lockUsers(batchIdParam.getIds(), lockStatus)) {
81 | return ResultGenerator.genSuccessResult();
82 | } else {
83 | return ResultGenerator.genFailResult("禁用失败");
84 | }
85 | }
86 | }
--------------------------------------------------------------------------------
/vue3-admin/src/components/Header.vue:
--------------------------------------------------------------------------------
1 |
2 |
29 |
30 |
31 |
81 |
82 |
106 |
--------------------------------------------------------------------------------