Compare commits

...

No commits in common. "master" and "sky-admin" have entirely different histories.

310 changed files with 34916 additions and 9335 deletions

4
.browserslistrc Normal file
View File

@ -0,0 +1,4 @@
> 1%
last 2 versions
not dead
not ie 11

14
.editorconfig Normal file
View File

@ -0,0 +1,14 @@
# http://editorconfig.org
root = true
[*] # 表示所有文件适用
charset = utf-8 # 设置文件字符集为 utf-8
end_of_line = lf # 控制换行类型(lf | cr | crlf)
insert_final_newline = false # 始终在文件末尾插入一个新行
indent_style = tab # 缩进风格tab | space
indent_size = 2 # 缩进大小
max_line_length = 130 # 最大行长度
[*.md] # 表示仅 md 文件适用以下规则
max_line_length = off # 关闭最大行长度限制
trim_trailing_whitespace = false # 关闭末尾空格修剪

5
.eslintignore Normal file
View File

@ -0,0 +1,5 @@
vue.config.js
list
.prettierrc.js
.stylelintrc.js
src/utils/request.js

17
.eslintrc.js Normal file
View File

@ -0,0 +1,17 @@
module.exports = {
root: true,
env: {
node: true,
},
extends: ['plugin:vue/vue3-essential', 'eslint:recommended', '@vue/typescript/recommended', 'plugin:prettier/recommended'],
parserOptions: {
ecmaVersion: 2020,
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'vue/multi-word-component-names': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'vue/no-mutating-props': 'off',
},
};

27
.gitignore vendored
View File

@ -1,6 +1,23 @@
**/target/
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
*.iml
*.class
*Test.java
**/test/
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

4
.husky/commit-msg Normal file
View File

@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
npx --no-install commitlint --edit $1

4
.husky/pre-commit Normal file
View File

@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
npm run lint:lint-staged

1
.prettierignore Normal file
View File

@ -0,0 +1 @@
list

39
.prettierrc.js Normal file
View File

@ -0,0 +1,39 @@
// @see: https://www.prettier.cn
module.exports = {
// 超过最大值换行
printWidth: 130,
// 缩进字节数
tabWidth: 1,
// 使用制表符而不是空格缩进行
useTabs: true,
// 结尾不用分号(true有false没有)
semi: true,
// 使用单引号(true单引号false双引号)
singleQuote: true,
// 更改引用对象属性的时间 可选值"<as-needed|consistent|preserve>"
quoteProps: 'as-needed',
// 在对象,数组括号与文字之间加空格 "{ foo: bar }"
bracketSpacing: true,
// 多行时尽可能打印尾随逗号。(例如,单行数组永远不会出现逗号结尾。) 可选值"<none|es5|all>"默认none
trailingComma: 'all',
// 在JSX中使用单引号而不是双引号
jsxSingleQuote: true,
// (x) => {} 箭头函数参数只有一个时是否要有小括号。avoid省略括号 ,always不省略括号
arrowParens: 'avoid',
// 如果文件顶部已经有一个 doclock这个选项将新建一行注释并打上@format标记。
insertPragma: false,
// 指定要使用的解析器,不需要写文件开头的 @prettier
requirePragma: false,
// 默认值。因为使用了一些折行敏感型的渲染器如GitHub comment而按照markdown文本样式进行折行
proseWrap: 'preserve',
// 在html中空格是否是敏感的 "css" - 遵守CSS显示属性的默认值 "strict" - 空格被认为是敏感的 "ignore" - 空格被认为是不敏感的
htmlWhitespaceSensitivity: 'css',
// 换行符使用 lf 结尾是 可选值"<auto|lf|crlf|cr>"
endOfLine: 'auto',
// 这两个选项可用于格式化以给定字符偏移量(分别包括和不包括)开始和结束的代码
rangeStart: 0,
rangeEnd: Infinity,
vueIndentScriptAndStyle: false, // Vue文件脚本和样式标签缩进
};

1
.stylelintignore Normal file
View File

@ -0,0 +1 @@
build

48
.stylelintrc.js Normal file
View File

@ -0,0 +1,48 @@
// npm i stylelint stylelint-config-html stylelint-config-recommended-scss stylelint-config-recommended-vue stylelint-config-standard stylelint-config-standard-scss stylelint-config-recess-order postcss postcss-html stylelint-config-prettier
// @see: https://stylelint.io
module.exports = {
/* 继承某些已有的规则 */
extends: [
'stylelint-config-standard', // 配置stylelint拓展插件
'stylelint-config-html/vue', // 配置 vue 中 template 样式格式化
'stylelint-config-standard-scss', // 配置stylelint scss插件
'stylelint-config-recommended-vue/scss', // 配置 vue 中 scss 样式格式化
'stylelint-config-recess-order', // 配置stylelint css属性书写顺序插件,
'stylelint-config-prettier', // 配置stylelint和prettier兼容
],
overrides: [
// 扫描 .vue/html 文件中的<style>标签内的样式
{
files: ['**/*.{vue,html}'],
customSyntax: 'postcss-html',
},
],
/**
* null => 关闭该规则
*/
rules: {
'value-keyword-case': null, // 在 css 中使用 v-bind不报错
'no-descending-specificity': null, // 禁止在具有较高优先级的选择器后出现被其覆盖的较低优先级的选择器
'function-url-quotes': 'always', // 要求或禁止 URL 的引号 "always(必须加上引号)"|"never(没有引号)"
'string-quotes': 'double', // 指定字符串使用单引号或双引号
'unit-case': null, // 指定单位的大小写 "lower(全小写)"|"upper(全大写)"
'color-hex-case': 'lower', // 指定 16 进制颜色的大小写 "lower(全小写)"|"upper(全大写)"
'color-hex-length': 'long', // 指定 16 进制颜色的简写或扩写 "short(16进制简写)"|"long(16进制扩写)"
'rule-empty-line-before': 'never', // 要求或禁止在规则之前的空行 "always(规则之前必须始终有一个空行)"|"never(规则前绝不能有空行)"|"always-multi-line(多行规则之前必须始终有一个空行)"|"never-multi-line(多行规则之前绝不能有空行。)"
'font-family-no-missing-generic-family-keyword': null, // 禁止在字体族名称列表中缺少通用字体族关键字
'block-opening-brace-space-before': 'always', // 要求在块的开大括号之前必须有一个空格或不能有空白符 "always(大括号前必须始终有一个空格)"|"never(左大括号之前绝不能有空格)"|"always-single-line(在单行块中的左大括号之前必须始终有一个空格)"|"never-single-line(在单行块中的左大括号之前绝不能有空格)"|"always-multi-line(在多行块中,左大括号之前必须始终有一个空格)"|"never-multi-line(多行块中的左大括号之前绝不能有空格)"
'property-no-unknown': null, // 禁止未知的属性(true 为不允许)
'no-empty-source': null, // 禁止空源码
'declaration-block-trailing-semicolon': null, // 要求或不允许在声明块中使用尾随分号 string"always(必须始终有一个尾随分号)"|"never(不得有尾随分号)"
'selector-class-pattern': null, // 强制选择器类名的格式
'scss/at-import-partial-extension': null, // 解决不能引入scss文件
'value-no-vendor-prefix': null, // 关闭 vendor-prefix(为了解决多行省略 -webkit-box)
'selector-pseudo-class-no-unknown': [
true,
{
ignorePseudoClasses: ['global', 'v-deep', 'deep'],
},
],
},
};

24
README.md Normal file
View File

@ -0,0 +1,24 @@
# vue_ts_pina
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Lints and fixes files
```
npm run lint
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).

9
auto-imports.d.ts vendored Normal file
View File

@ -0,0 +1,9 @@
/* eslint-disable */
/* prettier-ignore */
// @ts-nocheck
// noinspection JSUnusedGlobalSymbols
// Generated by unplugin-auto-import
export {}
declare global {
const ElMessage: typeof import('element-plus/es')['ElMessage'];
}

3
babel.config.js Normal file
View File

@ -0,0 +1,3 @@
module.exports = {
presets: ["@vue/cli-plugin-babel/preset"],
};

106
commitlint.config.js Normal file
View File

@ -0,0 +1,106 @@
// @see: https://cz-git.qbenben.com/zh/guide
/** @type {import('cz-git').UserConfig} */
module.exports = {
ignores: [commit => commit === 'init'],
extends: ['@commitlint/config-conventional'],
rules: {
// @see: https://commitlint.js.org/#/reference-rules
'body-leading-blank': [2, 'always'],
'footer-leading-blank': [1, 'always'],
'header-max-length': [2, 'always', 108],
'subject-empty': [2, 'never'],
'type-empty': [2, 'never'],
'subject-case': [0],
'type-enum': [
2,
'always',
[
'init',
'feat',
'page',
'completepage',
'fix',
'fixbug',
'docs',
'style',
'refactor',
'perf',
'test',
'build',
'ci',
'chore',
'revert',
'wip',
'workflow',
'types',
'release',
'optimize',
],
],
},
prompt: {
messages: {
type: '选择你要提交的类型 :',
scope: '选择一个提交范围(可选):',
customScope: '请输入自定义的提交范围 :',
subject: '填写简短精炼的变更描述 :\n',
body: '填写更加详细的变更描述(可选)。使用 "|" 换行 :\n',
breaking: '列举非兼容性重大的变更(可选)。使用 "|" 换行 :\n',
footerPrefixsSelect: '选择关联issue前缀可选:',
customFooterPrefixs: '输入自定义issue前缀 :',
footer: '列举关联issue (可选) 例如: #31, #I3244 :\n',
confirmCommit: '是否提交或修改commit ?',
},
types: [
{ value: 'init: 初始化', name: '初始化: ⏳ 初始化项目', emoji: '⏳' },
{ value: 'optimize: 优化代码', name: '优化代码: ♻️ 优化项目代码', emoji: '♻️' },
{ value: 'feat: 新增功能', name: '新增: 🚀 新增功能', emoji: '🚀' },
{ value: 'page: 新增页面', name: '页面: 📄 新增页面', emoji: '📄' },
{ value: 'completepage: 完成页面', name: '完成页面: 🍻 完成页面', emoji: '🍻' },
{ value: 'fixbug: 修改bug', name: 'bug: 🐛 修改bug', emoji: '🐛' },
{ value: 'fix: 修复', name: '修复: 🧩 修复缺陷', emoji: '🧩' },
{ value: 'docs: 文档', name: '文档: 📚 文档变更', emoji: '📚' },
{ value: 'style: 格式', name: '格式: 🎨 代码格式(不影响功能,例如空格、分号等格式修正)', emoji: '🎨' },
{ value: 'refactor: 重构', name: '重构: 〽️ 代码重构(不包括 bug 修复、功能新增)', emoji: '〽️' },
{ value: 'perf: 性能', name: '性能: ⚡️ 性能优化', emoji: '⚡️' },
{ value: 'test: 测试', name: '测试: ✅ 添加疏漏测试或已有测试改动', emoji: '✅' },
{
value: 'chore: 构建',
name: '构建: 📦️ 构建流程、外部依赖变更(如升级 npm 包、修改 webpack 配置等)',
emoji: '📦️',
},
{ value: 'ci: 集成', name: '集成: 🎡 修改 CI 配置、脚本', emoji: '🎡' },
{ value: 'revert: 回退', name: '回退: ⏪️ 回滚 commit', emoji: '⏪️' },
{ value: 'build: 打包', name: '打包: 🔨 项目打包发布', emoji: '🔨' },
],
useEmoji: true,
themeColorCode: '',
scopes: [],
allowCustomScopes: true,
allowEmptyScopes: true,
customScopesAlign: 'bottom',
customScopesAlias: 'custom',
emptyScopesAlias: 'empty',
upperCaseSubject: false,
allowBreakingChanges: ['feat', 'fix'],
breaklineNumber: 100,
breaklineChar: '|',
skipQuestions: [],
issuePrefixs: [{ value: 'closed', name: 'closed: ISSUES has been processed' }],
customIssuePrefixsAlign: 'top',
emptyIssuePrefixsAlias: 'skip',
customIssuePrefixsAlias: 'custom',
allowCustomIssuePrefixs: true,
allowEmptyIssuePrefixs: true,
confirmColorize: true,
maxHeaderLength: Infinity,
maxSubjectLength: Infinity,
minSubjectLength: 0,
scopeOverrides: undefined,
defaultBody: '',
defaultIssues: '',
defaultScope: '',
defaultSubject: '',
},
};

34
components.d.ts vendored Normal file
View File

@ -0,0 +1,34 @@
/* eslint-disable */
/* prettier-ignore */
// @ts-nocheck
// Generated by unplugin-vue-components
// Read more: https://github.com/vuejs/core/pull/3399
export {}
declare module 'vue' {
export interface GlobalComponents {
ElAside: typeof import('element-plus/es')['ElAside'];
ElButton: typeof import('element-plus/es')['ElButton'];
ElContainer: typeof import('element-plus/es')['ElContainer'];
ElDialog: typeof import('element-plus/es')['ElDialog'];
ElDropdown: typeof import('element-plus/es')['ElDropdown'];
ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem'];
ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu'];
ElForm: typeof import('element-plus/es')['ElForm'];
ElFormItem: typeof import('element-plus/es')['ElFormItem'];
ElHeader: typeof import('element-plus/es')['ElHeader'];
ElIcon: typeof import('element-plus/es')['ElIcon'];
ElInput: typeof import('element-plus/es')['ElInput'];
ElMain: typeof import('element-plus/es')['ElMain'];
ElMenu: typeof import('element-plus/es')['ElMenu'];
ElMenuItem: typeof import('element-plus/es')['ElMenuItem'];
ElPagination: typeof import('element-plus/es')['ElPagination'];
ElRadio: typeof import('element-plus/es')['ElRadio'];
ElRadioButton: typeof import('element-plus/es')['ElRadioButton'];
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup'];
ElTable: typeof import('element-plus/es')['ElTable'];
ElTableColumn: typeof import('element-plus/es')['ElTableColumn'];
RouterLink: typeof import('vue-router')['RouterLink'];
RouterView: typeof import('vue-router')['RouterView'];
}
}

8
lint-staged.config.js Normal file
View File

@ -0,0 +1,8 @@
module.exports = {
'*.{js,jsx,ts,tsx}': ['eslint --fix', 'prettier --write'],
'{!(package)*.json,*.code-snippets,.!(browserslist)*rc}': ['prettier --write--parser json'],
'package.json': ['prettier --write'],
'*.vue': ['eslint --fix', 'prettier --write'],
'*.{scss,less,styl,html}': ['prettier --write'],
'*.md': ['prettier --write'],
};

15627
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

71
package.json Normal file
View File

@ -0,0 +1,71 @@
{
"name": "sky-admin",
"version": "0.1.0",
"private": true,
"scripts": {
"start": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"lint:eslint": "eslint --fix --ext .js,.ts,.vue ./src",
"lint:prettier": "prettier --write --loglevel warn \"src/**/*.{js,ts,json,tsx,css,less,scss,vue,html,md}\"",
"lint:stylelint": "stylelint --cache --fix \"**/*.{vue,less,postcss,css,scss}\" --cache --cache-location node_modules/.cache/stylelint/",
"lint:lint-staged": "lint-staged",
"prepare": "husky install",
"release": "standard-version",
"commit": "git status && git add -A && git-cz"
},
"dependencies": {
"axios": "^1.6.2",
"core-js": "^3.8.3",
"dayjs": "^1.11.10",
"element-plus": "^2.5.5",
"js-cookie": "^3.0.5",
"loadsh": "^0.0.4",
"pinia": "^2.1.7",
"unplugin-element-plus": "^0.8.0",
"uuid": "^9.0.1",
"vue": "^3.4.19",
"vue-lazyload": "^3.0.0",
"vue-router": "^4.0.3",
"webpackbar": "^6.0.0"
},
"devDependencies": {
"@commitlint/cli": "^18.4.3",
"@commitlint/config-conventional": "^18.4.3",
"@typescript-eslint/eslint-plugin": "^5.4.0",
"@typescript-eslint/parser": "^5.4.0",
"@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-plugin-eslint": "~5.0.0",
"@vue/cli-plugin-router": "~5.0.0",
"@vue/cli-plugin-typescript": "~5.0.0",
"@vue/cli-service": "~5.0.0",
"@vue/eslint-config-typescript": "^9.1.0",
"commitizen": "^4.3.0",
"cz-git": "^1.8.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-vue": "^8.0.3",
"husky": "^8.0.3",
"lint-staged": "^11.2.6",
"postcss": "^8.4.32",
"postcss-html": "^1.5.0",
"prettier": "^2.4.1",
"sass": "^1.32.7",
"sass-loader": "^12.0.0",
"stylelint": "^14.16.1",
"stylelint-config-html": "^1.1.0",
"stylelint-config-prettier": "^9.0.5",
"typescript": "~4.5.5",
"unplugin-auto-import": "^0.16.6",
"unplugin-vue-components": "^0.25.2"
},
"gitHooks": {
"pre-commit": "lint-staged"
},
"config": {
"commitizen": {
"path": "node_modules/cz-git"
}
}
}

127
pom.xml
View File

@ -1,127 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>spring-boot-starter-parent</artifactId>
<groupId>org.springframework.boot</groupId>
<version>2.7.3</version>
</parent>
<groupId>com.sky</groupId>
<artifactId>sky-take-out</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<modules>
<module>sky-common</module>
<module>sky-pojo</module>
<module>sky-server</module>
</modules>
<properties>
<mybatis.spring>2.2.0</mybatis.spring>
<lombok>1.18.20</lombok>
<fastjson>1.2.76</fastjson>
<commons.lang>2.6</commons.lang>
<druid>1.2.1</druid>
<pagehelper>1.3.0</pagehelper>
<aliyun.sdk.oss>3.10.2</aliyun.sdk.oss>
<knife4j>3.0.2</knife4j>
<aspectj>1.9.4</aspectj>
<jjwt>0.9.1</jjwt>
<jaxb-api>2.3.1</jaxb-api>
<poi>3.16</poi>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>${mybatis.spring}</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok}</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjson}</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>${commons.lang}</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>${druid}</version>
</dependency>
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>${pagehelper}</version>
</dependency>
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-spring-boot-starter</artifactId>
<version>${knife4j}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${aspectj}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectj}</version>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>${jjwt}</version>
</dependency>
<dependency>
<groupId>com.aliyun.oss</groupId>
<artifactId>aliyun-sdk-oss</artifactId>
<version>${aliyun.sdk.oss}</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>${jaxb-api}</version>
</dependency>
<!-- poi -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>${poi}</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>${poi}</version>
</dependency>
<!--微信支付-->
<dependency>
<groupId>com.github.wechatpay-apiv3</groupId>
<artifactId>wechatpay-apache-httpclient</artifactId>
<version>0.4.8</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>

BIN
public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 803 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 964 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -0,0 +1,112 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="520.000000pt" height="520.000000pt" viewBox="0 0 520.000000 520.000000"
preserveAspectRatio="xMidYMid meet">
<metadata>
Created by potrace 1.11, written by Peter Selinger 2001-2013
</metadata>
<g transform="translate(0.000000,520.000000) scale(0.100000,-0.100000)"
fill="#000000" stroke="none">
<path d="M1897 4883 c-3 -3 -39 -7 -79 -9 -66 -4 -125 -10 -138 -14 -3 -1 -13
-2 -22 -1 -10 1 -18 -3 -18 -10 0 -9 -3 -9 -14 0 -11 9 -18 8 -30 -5 -10 -9
-20 -14 -23 -11 -3 4 -15 1 -27 -5 -11 -7 -24 -13 -28 -14 -5 -1 -9 -2 -10 -4
-2 -1 -10 -3 -19 -5 -10 -1 -40 -14 -67 -28 -28 -14 -53 -23 -56 -20 -3 3 -8
-2 -12 -11 -3 -9 -10 -14 -14 -11 -4 3 -13 -2 -20 -10 -7 -8 -16 -12 -21 -9
-5 3 -9 0 -9 -6 0 -6 -4 -8 -10 -5 -5 3 -10 2 -10 -3 0 -5 -16 -17 -35 -28
-19 -10 -35 -23 -35 -28 0 -5 -3 -7 -6 -3 -6 6 -36 -16 -62 -45 -9 -9 -19 -15
-24 -12 -4 3 -8 1 -8 -5 0 -5 -9 -13 -20 -16 -11 -4 -18 -10 -15 -15 3 -4 -10
-17 -28 -29 -17 -11 -27 -21 -22 -21 6 0 -3 -9 -20 -20 -16 -11 -25 -20 -20
-20 6 -1 -1 -7 -15 -15 -14 -8 -21 -14 -16 -15 5 0 -3 -11 -18 -25 -14 -13
-26 -29 -26 -35 0 -6 -4 -8 -10 -5 -5 3 -10 3 -10 -2 0 -4 -13 -22 -28 -39
-60 -70 -72 -84 -72 -90 0 -4 -11 -17 -26 -30 -14 -13 -21 -24 -17 -24 4 0 3
-4 -2 -8 -18 -12 -66 -82 -58 -82 4 0 0 -5 -9 -11 -10 -5 -18 -14 -18 -20 0
-9 -8 -21 -38 -54 -7 -8 -10 -15 -6 -15 3 0 1 -6 -5 -13 -6 -8 -7 -18 -3 -23
4 -5 3 -6 -2 -2 -10 9 -46 -44 -46 -67 0 -8 -6 -18 -13 -22 -7 -4 -19 -23 -26
-40 -8 -18 -18 -33 -23 -33 -5 0 -7 -4 -3 -9 3 -5 -2 -17 -11 -25 -8 -9 -12
-16 -9 -16 4 0 0 -11 -9 -25 -9 -14 -13 -25 -9 -25 5 0 3 -4 -2 -8 -6 -4 -25
-41 -44 -82 -18 -41 -37 -84 -41 -95 -33 -73 -59 -136 -60 -143 -3 -28 -14
-52 -23 -52 -6 0 -8 -3 -4 -6 3 -3 -4 -31 -15 -62 -11 -32 -21 -61 -22 -67 -1
-5 -4 -14 -8 -20 -3 -5 -9 -26 -14 -45 -11 -49 -11 -49 -14 -55 -1 -3 -4 -9
-5 -15 -1 -5 -4 -12 -5 -15 -1 -3 -4 -9 -5 -15 -1 -5 -3 -11 -5 -12 -1 -2 -3
-12 -5 -23 -4 -23 -10 -46 -24 -93 -5 -18 -10 -35 -10 -37 -1 -3 -1 -6 -2 -7
0 -2 -2 -19 -5 -37 -2 -19 -10 -39 -17 -43 -7 -4 -8 -8 -1 -8 7 0 5 -23 -7
-67 -9 -38 -19 -90 -23 -118 -3 -27 -8 -68 -11 -90 -3 -22 -7 -53 -10 -70 -27
-163 -27 -652 0 -813 3 -17 7 -46 10 -62 11 -66 17 -93 29 -134 7 -23 12 -50
10 -59 -1 -9 3 -17 9 -17 5 0 7 -3 4 -7 -4 -3 -2 -12 3 -19 6 -6 10 -16 9 -20
-1 -5 1 -18 5 -29 31 -81 36 -98 32 -103 -3 -2 3 -17 14 -32 11 -15 17 -30 13
-34 -3 -3 0 -6 7 -6 7 0 10 -3 7 -6 -3 -4 -1 -16 5 -28 7 -11 13 -23 13 -26 0
-3 7 -16 15 -30 8 -14 15 -27 15 -30 4 -18 30 -60 37 -60 4 0 7 -3 6 -7 -3 -9
62 -106 74 -111 4 -2 8 -9 8 -16 0 -6 9 -18 20 -26 11 -8 20 -20 20 -27 0 -7
7 -13 15 -13 8 0 15 -4 15 -9 0 -13 58 -70 64 -63 3 3 6 -2 6 -11 0 -10 7 -17
15 -17 8 0 15 -4 15 -10 0 -5 4 -10 10 -10 5 0 23 -14 40 -31 16 -18 30 -28
30 -23 0 5 5 1 11 -8 5 -10 17 -18 24 -18 8 0 15 -4 15 -8 0 -5 16 -14 35 -22
19 -8 35 -17 35 -22 0 -4 6 -8 13 -9 6 0 34 -11 62 -24 27 -13 53 -21 57 -19
5 3 8 1 8 -3 0 -8 77 -35 105 -38 6 0 15 -4 22 -8 6 -4 23 -8 37 -9 14 -1 26
-5 26 -8 0 -6 33 -11 78 -13 12 -1 22 -3 22 -6 0 -4 19 -7 43 -9 55 -3 69 -6
85 -15 6 -5 12 -5 12 0 0 4 14 8 30 8 17 0 30 -2 30 -5 0 -7 96 -3 109 4 5 3
12 0 14 -6 4 -10 6 -9 6 1 1 11 4 11 16 1 8 -7 15 -8 15 -4 0 5 19 10 43 12
57 3 91 7 102 13 6 3 20 4 33 3 12 0 22 2 22 7 0 4 12 6 28 5 15 -2 31 -1 37
2 5 4 28 8 50 9 21 2 42 7 45 11 3 4 19 8 35 10 55 4 82 9 92 15 5 3 23 9 39
12 38 8 58 13 62 15 2 3 6 4 52 14 19 4 44 11 55 16 21 9 73 22 77 18 2 -1 14
5 28 12 14 8 30 15 35 16 6 2 20 5 32 8 11 2 35 12 52 20 17 9 33 16 36 16 19
1 199 74 207 85 4 5 8 6 8 2 0 -5 15 1 33 12 19 11 37 18 40 14 4 -3 7 -1 7 5
0 7 3 11 8 10 4 -2 73 30 153 70 80 39 149 72 153 72 4 0 14 7 23 15 8 8 19
13 24 10 5 -4 9 -1 9 5 0 7 6 10 12 8 7 -3 18 0 25 6 25 22 38 31 48 32 25 2
74 27 69 35 -3 5 -2 8 3 7 11 -3 56 12 72 25 7 6 20 12 29 13 8 2 18 6 21 11
11 15 45 38 37 26 -4 -7 -3 -13 2 -13 6 0 12 7 16 15 3 8 12 15 20 15 8 0 17
6 19 13 8 18 8 2 10 -373 l2 -345 88 -1 87 -1 0 126 c1 69 1 255 1 413 l-1
287 40 17 c21 10 37 21 34 26 -5 8 10 12 35 9 7 -2 10 2 6 8 -5 10 7 15 28 12
4 0 7 3 7 9 0 5 16 17 35 26 19 9 35 21 35 26 0 5 4 7 9 4 5 -4 11 -3 13 1 1
5 35 28 73 53 39 25 72 48 73 53 2 4 8 5 13 1 5 -3 12 2 15 10 3 9 10 14 14
11 4 -3 11 2 14 11 3 8 10 12 16 9 5 -3 10 1 10 10 0 9 4 14 9 11 5 -3 20 5
34 18 14 13 28 21 31 19 3 -3 8 2 12 11 3 9 15 16 26 16 10 0 16 5 13 10 -3 6
2 13 11 17 18 7 50 31 86 65 10 10 21 18 24 18 6 0 47 36 106 92 15 14 28 24
28 22 0 -3 48 43 108 103 108 109 252 281 252 302 0 6 4 11 9 11 9 0 32 37 78
130 16 30 31 57 35 58 5 2 8 12 8 21 0 10 3 21 7 24 13 13 45 113 67 208 40
176 22 407 -48 593 -32 85 -91 204 -113 228 -9 10 -13 18 -9 18 4 0 -4 15 -18
33 -15 19 -26 37 -26 40 0 11 -119 168 -179 236 -81 93 -142 151 -216 205 -22
17 -42 33 -45 36 -3 4 -21 15 -40 26 -19 10 -37 22 -40 25 -3 3 -20 14 -37 23
-18 9 -33 21 -33 26 0 6 -6 10 -14 10 -8 0 -21 6 -28 13 -7 7 -28 20 -45 28
-18 7 -33 17 -33 20 0 4 -11 10 -24 13 -14 3 -31 12 -38 19 -16 15 -70 41 -80
39 -5 -1 -8 2 -8 6 0 5 -16 14 -35 22 -19 8 -35 18 -35 24 0 5 -3 6 -7 3 -3
-4 -12 -2 -20 4 -7 6 -13 8 -13 3 0 -5 -4 -4 -8 3 -4 6 -14 13 -22 15 -8 2
-21 9 -28 16 -8 7 -17 10 -22 7 -5 -3 -10 -2 -12 2 -4 10 -80 47 -90 45 -5 -1
-8 3 -8 9 0 6 -7 9 -15 5 -8 -3 -15 -1 -15 4 0 6 -7 10 -15 10 -8 0 -15 5 -15
11 0 5 -5 7 -10 4 -6 -3 -10 -1 -10 6 0 7 -3 9 -7 6 -3 -4 -12 -2 -20 4 -7 6
-13 8 -13 3 0 -5 -4 -3 -9 4 -4 7 -18 14 -29 15 -12 1 -22 5 -22 10 0 4 -4 5
-10 2 -5 -3 -10 -1 -10 4 0 6 -7 11 -15 11 -15 0 -23 3 -81 33 -17 9 -34 14
-38 10 -3 -3 -6 -1 -6 6 0 7 -4 9 -10 6 -5 -3 -10 -2 -10 4 0 6 -7 7 -17 4
-10 -4 -14 -2 -9 5 4 7 -1 10 -14 7 -11 -2 -20 1 -20 6 0 6 -4 7 -10 4 -5 -3
-10 -1 -10 6 0 7 -3 9 -7 6 -3 -4 -12 -2 -20 4 -7 6 -13 8 -13 4 0 -4 -6 -2
-14 4 -8 7 -27 14 -42 17 -16 3 -33 9 -40 15 -6 5 -14 6 -17 2 -4 -3 -7 -2 -7
4 0 5 -7 10 -15 11 -8 1 -22 3 -30 4 -8 1 -15 5 -15 10 0 4 -8 8 -18 8 -10 0
-24 6 -31 13 -11 10 -12 9 -6 -3 7 -12 6 -13 -6 -4 -8 5 -48 21 -89 33 -41 13
-86 28 -100 34 -14 6 -29 9 -34 8 -5 -1 -21 2 -35 8 -14 5 -35 12 -46 17 -11
4 -31 9 -45 11 -14 2 -32 7 -40 10 -8 4 -19 8 -25 9 -5 1 -12 3 -15 4 -3 1
-12 3 -20 5 -8 1 -71 15 -139 30 -68 15 -137 28 -155 30 -17 2 -31 4 -31 5 0
1 -11 3 -25 5 -14 1 -43 5 -65 9 -22 4 -71 9 -110 12 -130 10 -154 12 -163 18
-5 3 -12 3 -15 -1z"/>
<path d="M4526 1543 c-2 -2 -12 -5 -23 -7 -37 -8 -111 -47 -151 -81 -43 -37
-92 -113 -95 -145 -1 -11 -4 -20 -8 -20 -13 0 -1 -156 16 -195 18 -42 108
-135 131 -135 8 0 14 -3 14 -8 0 -8 103 -58 160 -77 3 -1 18 -7 33 -13 16 -7
32 -12 36 -12 5 0 14 -7 21 -15 7 -8 16 -12 21 -9 5 3 9 2 9 -3 0 -4 12 -14
28 -21 32 -14 90 -67 113 -102 18 -28 24 -150 8 -150 -6 0 -8 -4 -5 -8 7 -11
-31 -72 -44 -72 -6 0 -9 -4 -6 -9 3 -5 -17 -18 -46 -30 -54 -23 -191 -30 -203
-11 -3 6 -15 10 -26 10 -10 0 -19 5 -19 10 0 6 -4 10 -10 10 -20 0 -63 56 -80
102 -9 26 -16 66 -15 88 1 22 -1 40 -4 41 -3 0 -43 1 -89 2 -66 2 -82 -1 -83
-13 -1 -8 -2 -22 -3 -30 -1 -8 2 -23 7 -32 5 -12 4 -18 -5 -18 -9 0 -9 -3 0
-12 7 -7 12 -21 12 -33 0 -36 48 -124 88 -162 52 -49 72 -65 72 -57 0 4 8 0
18 -9 10 -10 22 -14 25 -10 4 3 7 2 7 -4 0 -5 6 -10 13 -11 6 -1 28 -5 47 -9
31 -6 200 -9 248 -3 19 2 34 8 103 39 64 30 143 110 155 158 4 13 9 23 13 23
12 0 21 188 10 210 -4 8 -13 30 -19 48 -7 17 -17 32 -23 32 -6 0 -8 2 -5 6 7
7 -72 89 -94 97 -10 3 -18 11 -18 17 0 6 -4 8 -10 5 -5 -3 -10 -3 -10 2 0 4
-15 14 -32 22 -18 8 -36 18 -39 23 -3 5 -16 10 -27 11 -12 1 -22 4 -22 8 0 4
-10 10 -22 14 -31 10 -37 12 -43 15 -3 1 -8 3 -12 5 -47 12 -136 59 -168 87
-32 27 -58 75 -50 88 3 6 3 10 -2 10 -4 0 -8 14 -8 30 -1 17 3 30 8 30 4 0 5
4 2 10 -18 28 60 110 120 125 39 11 125 12 125 3 0 -5 9 -8 20 -8 26 0 86 -54
105 -94 9 -18 16 -48 17 -67 l1 -36 89 0 88 1 0 38 c0 21 -4 38 -8 38 -4 0 -9
11 -10 25 -7 93 -141 235 -221 235 -12 0 -21 4 -21 8 0 7 -197 12 -204 5z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 7.7 KiB

19
public/index.html Normal file
View File

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta content="IE=edge" http-equiv="X-UA-Compatible">
<meta content="width=device-width,initial-scale=1.0" name="viewport">
<link href="<%= BASE_URL %>favicon.ico" rel="icon">
<title>苍穹外卖</title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled.
Please enable
it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

View File

@ -1,53 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>sky-take-out</artifactId>
<groupId>com.sky</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>sky-common</artifactId>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-json</artifactId>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
</dependency>
<!--支持配置属性类yml文件中可以提示配置项-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.aliyun.oss</groupId>
<artifactId>aliyun-sdk-oss</artifactId>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</dependency>
<!--微信支付-->
<dependency>
<groupId>com.github.wechatpay-apiv3</groupId>
<artifactId>wechatpay-apache-httpclient</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -1,14 +0,0 @@
package com.sky.constant;
/**
* 公共字段自动填充相关常量
*/
public class AutoFillConstant {
/**
* 实体类中的方法名称
*/
public static final String SET_CREATE_TIME = "setCreateTime";
public static final String SET_UPDATE_TIME = "setUpdateTime";
public static final String SET_CREATE_USER = "setCreateUser";
public static final String SET_UPDATE_USER = "setUpdateUser";
}

View File

@ -1,11 +0,0 @@
package com.sky.constant;
public class JwtClaimsConstant {
public static final String EMP_ID = "empId";
public static final String USER_ID = "userId";
public static final String PHONE = "phone";
public static final String USERNAME = "username";
public static final String NAME = "name";
}

View File

@ -1,28 +0,0 @@
package com.sky.constant;
/**
* 信息提示常量类
*/
public class MessageConstant {
public static final String PASSWORD_ERROR = "密码错误";
public static final String ACCOUNT_NOT_FOUND = "账号不存在";
public static final String ACCOUNT_LOCKED = "账号被锁定";
public static final String UNKNOWN_ERROR = "未知错误";
public static final String USER_NOT_LOGIN = "用户未登录";
public static final String CATEGORY_BE_RELATED_BY_SETMEAL = "当前分类关联了套餐,不能删除";
public static final String CATEGORY_BE_RELATED_BY_DISH = "当前分类关联了菜品,不能删除";
public static final String SHOPPING_CART_IS_NULL = "购物车数据为空,不能下单";
public static final String ADDRESS_BOOK_IS_NULL = "用户地址为空,不能下单";
public static final String LOGIN_FAILED = "登录失败";
public static final String UPLOAD_FAILED = "文件上传失败";
public static final String SETMEAL_ENABLE_FAILED = "套餐内包含未启售菜品,无法启售";
public static final String PASSWORD_EDIT_FAILED = "密码修改失败";
public static final String DISH_ON_SALE = "起售中的菜品不能删除";
public static final String SETMEAL_ON_SALE = "起售中的套餐不能删除";
public static final String DISH_BE_RELATED_BY_SETMEAL = "当前菜品关联了套餐,不能删除";
public static final String ORDER_STATUS_ERROR = "订单状态错误";
public static final String ORDER_NOT_FOUND = "订单不存在";
public static final String ALREADY_EXISTS = "已存在了";
}

View File

@ -1,10 +0,0 @@
package com.sky.constant;
/**
* 密码常量
*/
public class PasswordConstant {
public static final String DEFAULT_PASSWORD = "123456";
}

View File

@ -1,13 +0,0 @@
package com.sky.constant;
/**
* 状态常量启用或者禁用
*/
public class StatusConstant {
//启用
public static final Integer ENABLE = 1;
//禁用
public static final Integer DISABLE = 0;
}

View File

@ -1,19 +0,0 @@
package com.sky.context;
public class BaseContext {
public static ThreadLocal<Long> threadLocal = new ThreadLocal<>();
public static void setCurrentId(Long id) {
threadLocal.set(id);
}
public static Long getCurrentId() {
return threadLocal.get();
}
public static void removeCurrentId() {
threadLocal.remove();
}
}

View File

@ -1,18 +0,0 @@
package com.sky.enumeration;
/**
* 数据库操作类型
*/
public enum OperationType {
/**
* 更新操作
*/
UPDATE,
/**
* 插入操作
*/
INSERT
}

View File

@ -1,15 +0,0 @@
package com.sky.exception;
/**
* 账号被锁定异常
*/
public class AccountLockedException extends BaseException {
public AccountLockedException() {
}
public AccountLockedException(String msg) {
super(msg);
}
}

View File

@ -1,15 +0,0 @@
package com.sky.exception;
/**
* 账号不存在异常
*/
public class AccountNotFoundException extends BaseException {
public AccountNotFoundException() {
}
public AccountNotFoundException(String msg) {
super(msg);
}
}

View File

@ -1,9 +0,0 @@
package com.sky.exception;
public class AddressBookBusinessException extends BaseException {
public AddressBookBusinessException(String msg) {
super(msg);
}
}

View File

@ -1,15 +0,0 @@
package com.sky.exception;
/**
* 业务异常
*/
public class BaseException extends RuntimeException {
public BaseException() {
}
public BaseException(String msg) {
super(msg);
}
}

View File

@ -1,9 +0,0 @@
package com.sky.exception;
public class DeletionNotAllowedException extends BaseException {
public DeletionNotAllowedException(String msg) {
super(msg);
}
}

View File

@ -1,10 +0,0 @@
package com.sky.exception;
/**
* 登录失败
*/
public class LoginFailedException extends BaseException{
public LoginFailedException(String msg){
super(msg);
}
}

View File

@ -1,9 +0,0 @@
package com.sky.exception;
public class OrderBusinessException extends BaseException {
public OrderBusinessException(String msg) {
super(msg);
}
}

View File

@ -1,12 +0,0 @@
package com.sky.exception;
/**
* 密码修改失败异常
*/
public class PasswordEditFailedException extends BaseException{
public PasswordEditFailedException(String msg){
super(msg);
}
}

View File

@ -1,15 +0,0 @@
package com.sky.exception;
/**
* 密码错误异常
*/
public class PasswordErrorException extends BaseException {
public PasswordErrorException() {
}
public PasswordErrorException(String msg) {
super(msg);
}
}

View File

@ -1,13 +0,0 @@
package com.sky.exception;
/**
* 套餐启用失败异常
*/
public class SetmealEnableFailedException extends BaseException {
public SetmealEnableFailedException(){}
public SetmealEnableFailedException(String msg){
super(msg);
}
}

View File

@ -1,9 +0,0 @@
package com.sky.exception;
public class ShoppingCartBusinessException extends BaseException {
public ShoppingCartBusinessException(String msg) {
super(msg);
}
}

View File

@ -1,12 +0,0 @@
package com.sky.exception;
public class UserNotLoginException extends BaseException {
public UserNotLoginException() {
}
public UserNotLoginException(String msg) {
super(msg);
}
}

View File

@ -1,51 +0,0 @@
package com.sky.json;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalTimeSerializer;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import static com.fasterxml.jackson.databind.DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES;
/**
* 对象映射器:基于jackson将Java对象转为json或者将json转为Java对象
* 将JSON解析为Java对象的过程称为 [从JSON反序列化Java对象]
* 从Java对象生成JSON的过程称为 [序列化Java对象到JSON]
*/
public class JacksonObjectMapper extends ObjectMapper {
public static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd";
//public static final String DEFAULT_DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
public static final String DEFAULT_DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm";
public static final String DEFAULT_TIME_FORMAT = "HH:mm:ss";
public JacksonObjectMapper() {
super();
//收到未知属性时不报异常
this.configure(FAIL_ON_UNKNOWN_PROPERTIES, false);
//反序列化时属性不存在的兼容处理
this.getDeserializationConfig().withoutFeatures(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
SimpleModule simpleModule = new SimpleModule()
.addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern(DEFAULT_DATE_TIME_FORMAT)))
.addDeserializer(LocalDate.class, new LocalDateDeserializer(DateTimeFormatter.ofPattern(DEFAULT_DATE_FORMAT)))
.addDeserializer(LocalTime.class, new LocalTimeDeserializer(DateTimeFormatter.ofPattern(DEFAULT_TIME_FORMAT)))
.addSerializer(LocalDateTime.class, new LocalDateTimeSerializer(DateTimeFormatter.ofPattern(DEFAULT_DATE_TIME_FORMAT)))
.addSerializer(LocalDate.class, new LocalDateSerializer(DateTimeFormatter.ofPattern(DEFAULT_DATE_FORMAT)))
.addSerializer(LocalTime.class, new LocalTimeSerializer(DateTimeFormatter.ofPattern(DEFAULT_TIME_FORMAT)));
//注册功能模块 例如可以添加自定义序列化器和反序列化器
this.registerModule(simpleModule);
}
}

View File

@ -1,17 +0,0 @@
package com.sky.properties;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
@Component
@ConfigurationProperties(prefix = "sky.alioss")
@Data
public class AliOssProperties {
private String endpoint;
private String accessKeyId;
private String accessKeySecret;
private String bucketName;
}

View File

@ -1,26 +0,0 @@
package com.sky.properties;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
@Component
@ConfigurationProperties(prefix = "sky.jwt")
@Data
public class JwtProperties {
/**
* 管理端员工生成jwt令牌相关配置
*/
private String adminSecretKey;
private long adminTtl;
private String adminTokenName;
/**
* 用户端微信用户生成jwt令牌相关配置
*/
private String userSecretKey;
private long userTtl;
private String userTokenName;
}

View File

@ -1,23 +0,0 @@
package com.sky.properties;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
@Component
@ConfigurationProperties(prefix = "sky.wechat")
@Data
public class WeChatProperties {
private String appid; //小程序的appid
private String secret; //小程序的秘钥
private String mchid; //商户号
private String mchSerialNo; //商户API证书的证书序列号
private String privateKeyFilePath; //商户私钥文件
private String apiV3Key; //证书解密的密钥
private String weChatPayCertFilePath; //平台证书
private String notifyUrl; //支付成功的回调地址
private String refundNotifyUrl; //退款成功的回调地址
}

View File

@ -1,22 +0,0 @@
package com.sky.result;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
/**
* 封装分页查询结果
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PageResult implements Serializable {
private long total; //总记录数
private List records; //当前页数据集合
}

View File

@ -1,38 +0,0 @@
package com.sky.result;
import lombok.Data;
import java.io.Serializable;
/**
* 后端统一返回结果
* @param <T>
*/
@Data
public class Result<T> implements Serializable {
private Integer code; //编码1成功0和其它数字为失败
private String msg; //错误信息
private T data; //数据
public static <T> Result<T> success() {
Result<T> result = new Result<T>();
result.code = 1;
return result;
}
public static <T> Result<T> success(T object) {
Result<T> result = new Result<T>();
result.data = object;
result.code = 1;
return result;
}
public static <T> Result<T> error(String msg) {
Result result = new Result();
result.msg = msg;
result.code = 0;
return result;
}
}

View File

@ -1,68 +0,0 @@
package com.sky.utils;
import com.aliyun.oss.ClientException;
import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import com.aliyun.oss.OSSException;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import java.io.ByteArrayInputStream;
@Data
@AllArgsConstructor
@Slf4j
public class AliOssUtil {
private String endpoint;
private String accessKeyId;
private String accessKeySecret;
private String bucketName;
/**
* 文件上传
*
* @param bytes
* @param objectName
* @return
*/
public String upload(byte[] bytes, String objectName) {
// 创建OSSClient实例
OSS ossClient = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
try {
// 创建PutObject请求
ossClient.putObject(bucketName, objectName, new ByteArrayInputStream(bytes));
} catch (OSSException oe) {
System.out.println("Caught an OSSException, which means your request made it to OSS, "
+ "but was rejected with an error response for some reason.");
System.out.println("Error Message:" + oe.getErrorMessage());
System.out.println("Error Code:" + oe.getErrorCode());
System.out.println("Request ID:" + oe.getRequestId());
System.out.println("Host ID:" + oe.getHostId());
} catch (ClientException ce) {
System.out.println("Caught an ClientException, which means the client encountered "
+ "a serious internal problem while trying to communicate with OSS, "
+ "such as not being able to access the network.");
System.out.println("Error Message:" + ce.getMessage());
} finally {
if (ossClient != null) {
ossClient.shutdown();
}
}
//文件访问路径规则 https://BucketName.Endpoint/ObjectName
StringBuilder stringBuilder = new StringBuilder("https://");
stringBuilder
.append(bucketName)
.append(".")
.append(endpoint)
.append("/")
.append(objectName);
log.info("文件上传到:{}", stringBuilder.toString());
return stringBuilder.toString();
}
}

View File

@ -1,179 +0,0 @@
package com.sky.utils;
import com.alibaba.fastjson.JSONObject;
import org.apache.http.NameValuePair;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;
import java.io.IOException;
import java.net.URI;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* Http工具类
*/
public class HttpClientUtil {
static final int TIMEOUT_MSEC = 5 * 1000;
/**
* 发送GET方式请求
* @param url
* @param paramMap
* @return
*/
public static String doGet(String url,Map<String,String> paramMap){
// 创建Httpclient对象
CloseableHttpClient httpClient = HttpClients.createDefault();
String result = "";
CloseableHttpResponse response = null;
try{
URIBuilder builder = new URIBuilder(url);
if(paramMap != null){
for (String key : paramMap.keySet()) {
builder.addParameter(key,paramMap.get(key));
}
}
URI uri = builder.build();
//创建GET请求
HttpGet httpGet = new HttpGet(uri);
//发送请求
response = httpClient.execute(httpGet);
//判断响应状态
if(response.getStatusLine().getStatusCode() == 200){
result = EntityUtils.toString(response.getEntity(),"UTF-8");
}
}catch (Exception e){
e.printStackTrace();
}finally {
try {
response.close();
httpClient.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return result;
}
/**
* 发送POST方式请求
* @param url
* @param paramMap
* @return
* @throws IOException
*/
public static String doPost(String url, Map<String, String> paramMap) throws IOException {
// 创建Httpclient对象
CloseableHttpClient httpClient = HttpClients.createDefault();
CloseableHttpResponse response = null;
String resultString = "";
try {
// 创建Http Post请求
HttpPost httpPost = new HttpPost(url);
// 创建参数列表
if (paramMap != null) {
List<NameValuePair> paramList = new ArrayList();
for (Map.Entry<String, String> param : paramMap.entrySet()) {
paramList.add(new BasicNameValuePair(param.getKey(), param.getValue()));
}
// 模拟表单
UrlEncodedFormEntity entity = new UrlEncodedFormEntity(paramList);
httpPost.setEntity(entity);
}
httpPost.setConfig(builderRequestConfig());
// 执行http请求
response = httpClient.execute(httpPost);
resultString = EntityUtils.toString(response.getEntity(), "UTF-8");
} catch (Exception e) {
throw e;
} finally {
try {
response.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return resultString;
}
/**
* 发送POST方式请求
* @param url
* @param paramMap
* @return
* @throws IOException
*/
public static String doPost4Json(String url, Map<String, String> paramMap) throws IOException {
// 创建Httpclient对象
CloseableHttpClient httpClient = HttpClients.createDefault();
CloseableHttpResponse response = null;
String resultString = "";
try {
// 创建Http Post请求
HttpPost httpPost = new HttpPost(url);
if (paramMap != null) {
//构造json格式数据
JSONObject jsonObject = new JSONObject();
for (Map.Entry<String, String> param : paramMap.entrySet()) {
jsonObject.put(param.getKey(),param.getValue());
}
StringEntity entity = new StringEntity(jsonObject.toString(),"utf-8");
//设置请求编码
entity.setContentEncoding("utf-8");
//设置数据类型
entity.setContentType("application/json");
httpPost.setEntity(entity);
}
httpPost.setConfig(builderRequestConfig());
// 执行http请求
response = httpClient.execute(httpPost);
resultString = EntityUtils.toString(response.getEntity(), "UTF-8");
} catch (Exception e) {
throw e;
} finally {
try {
response.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return resultString;
}
private static RequestConfig builderRequestConfig() {
return RequestConfig.custom()
.setConnectTimeout(TIMEOUT_MSEC)
.setConnectionRequestTimeout(TIMEOUT_MSEC)
.setSocketTimeout(TIMEOUT_MSEC).build();
}
}

View File

@ -1,58 +0,0 @@
package com.sky.utils;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.JwtBuilder;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm;
import java.nio.charset.StandardCharsets;
import java.util.Date;
import java.util.Map;
public class JwtUtil {
/**
* 生成jwt
* 使用Hs256算法, 私匙使用固定秘钥
*
* @param secretKey jwt秘钥
* @param ttlMillis jwt过期时间(毫秒)
* @param claims 设置的信息
* @return
*/
public static String createJWT(String secretKey, long ttlMillis, Map<String, Object> claims) {
// 指定签名的时候使用的签名算法也就是header那部分
SignatureAlgorithm signatureAlgorithm = SignatureAlgorithm.HS256;
// 生成JWT的时间
long expMillis = System.currentTimeMillis() + ttlMillis;
Date exp = new Date(expMillis);
// 设置jwt的body
JwtBuilder builder = Jwts.builder()
// 如果有私有声明一定要先设置这个自己创建的私有的声明这个是给builder的claim赋值一旦写在标准的声明赋值之后就是覆盖了那些标准的声明的
.setClaims(claims)
// 设置签名使用的签名算法和签名使用的秘钥
.signWith(signatureAlgorithm, secretKey.getBytes(StandardCharsets.UTF_8))
// 设置过期时间
.setExpiration(exp);
return builder.compact();
}
/**
* Token解密
*
* @param secretKey jwt秘钥 此秘钥一定要保留好在服务端, 不能暴露出去, 否则sign就可以被伪造, 如果对接多个客户端建议改造成多个
* @param token 加密后的token
* @return
*/
public static Claims parseJWT(String secretKey, String token) {
// 得到DefaultJwtParser
Claims claims = Jwts.parser()
// 设置签名的秘钥
.setSigningKey(secretKey.getBytes(StandardCharsets.UTF_8))
// 设置需要解析的jwt
.parseClaimsJws(token).getBody();
return claims;
}
}

View File

@ -1,235 +0,0 @@
package com.sky.utils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.sky.properties.WeChatProperties;
import com.wechat.pay.contrib.apache.httpclient.WechatPayHttpClientBuilder;
import com.wechat.pay.contrib.apache.httpclient.util.PemUtil;
import org.apache.commons.lang.RandomStringUtils;
import org.apache.http.HttpHeaders;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.util.EntityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.math.BigDecimal;
import java.security.PrivateKey;
import java.security.Signature;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Base64;
import java.util.List;
/**
* 微信支付工具类
*/
@Component
public class WeChatPayUtil {
//微信支付下单接口地址
public static final String JSAPI = "https://api.mch.weixin.qq.com/v3/pay/transactions/jsapi";
//申请退款接口地址
public static final String REFUNDS = "https://api.mch.weixin.qq.com/v3/refund/domestic/refunds";
@Autowired
private WeChatProperties weChatProperties;
/**
* 获取调用微信接口的客户端工具对象
*
* @return
*/
private CloseableHttpClient getClient() {
PrivateKey merchantPrivateKey = null;
try {
//merchantPrivateKey商户API私钥如何加载商户API私钥请看常见问题
merchantPrivateKey = PemUtil.loadPrivateKey(new FileInputStream(new File(weChatProperties.getPrivateKeyFilePath())));
//加载平台证书文件
X509Certificate x509Certificate = PemUtil.loadCertificate(new FileInputStream(new File(weChatProperties.getWeChatPayCertFilePath())));
//wechatPayCertificates微信支付平台证书列表你也可以使用后面章节提到的定时更新平台证书功能而不需要关心平台证书的来龙去脉
List<X509Certificate> wechatPayCertificates = Arrays.asList(x509Certificate);
WechatPayHttpClientBuilder builder = WechatPayHttpClientBuilder.create()
.withMerchant(weChatProperties.getMchid(), weChatProperties.getMchSerialNo(), merchantPrivateKey)
.withWechatPay(wechatPayCertificates);
// 通过WechatPayHttpClientBuilder构造的HttpClient会自动的处理签名和验签
CloseableHttpClient httpClient = builder.build();
return httpClient;
} catch (FileNotFoundException e) {
e.printStackTrace();
return null;
}
}
/**
* 发送post方式请求
*
* @param url
* @param body
* @return
*/
private String post(String url, String body) throws Exception {
CloseableHttpClient httpClient = getClient();
HttpPost httpPost = new HttpPost(url);
httpPost.addHeader(HttpHeaders.ACCEPT, ContentType.APPLICATION_JSON.toString());
httpPost.addHeader(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON.toString());
httpPost.addHeader("Wechatpay-Serial", weChatProperties.getMchSerialNo());
httpPost.setEntity(new StringEntity(body, "UTF-8"));
CloseableHttpResponse response = httpClient.execute(httpPost);
try {
String bodyAsString = EntityUtils.toString(response.getEntity());
return bodyAsString;
} finally {
httpClient.close();
response.close();
}
}
/**
* 发送get方式请求
*
* @param url
* @return
*/
private String get(String url) throws Exception {
CloseableHttpClient httpClient = getClient();
HttpGet httpGet = new HttpGet(url);
httpGet.addHeader(HttpHeaders.ACCEPT, ContentType.APPLICATION_JSON.toString());
httpGet.addHeader(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON.toString());
httpGet.addHeader("Wechatpay-Serial", weChatProperties.getMchSerialNo());
CloseableHttpResponse response = httpClient.execute(httpGet);
try {
String bodyAsString = EntityUtils.toString(response.getEntity());
return bodyAsString;
} finally {
httpClient.close();
response.close();
}
}
/**
* jsapi下单
*
* @param orderNum 商户订单号
* @param total 总金额
* @param description 商品描述
* @param openid 微信用户的openid
* @return
*/
private String jsapi(String orderNum, BigDecimal total, String description, String openid) throws Exception {
JSONObject jsonObject = new JSONObject();
jsonObject.put("appid", weChatProperties.getAppid());
jsonObject.put("mchid", weChatProperties.getMchid());
jsonObject.put("description", description);
jsonObject.put("out_trade_no", orderNum);
jsonObject.put("notify_url", weChatProperties.getNotifyUrl());
JSONObject amount = new JSONObject();
amount.put("total", total.multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_HALF_UP).intValue());
amount.put("currency", "CNY");
jsonObject.put("amount", amount);
JSONObject payer = new JSONObject();
payer.put("openid", openid);
jsonObject.put("payer", payer);
String body = jsonObject.toJSONString();
return post(JSAPI, body);
}
/**
* 小程序支付
*
* @param orderNum 商户订单号
* @param total 金额单位
* @param description 商品描述
* @param openid 微信用户的openid
* @return
*/
public JSONObject pay(String orderNum, BigDecimal total, String description, String openid) throws Exception {
//统一下单生成预支付交易单
String bodyAsString = jsapi(orderNum, total, description, openid);
//解析返回结果
JSONObject jsonObject = JSON.parseObject(bodyAsString);
System.out.println(jsonObject);
String prepayId = jsonObject.getString("prepay_id");
if (prepayId != null) {
String timeStamp = String.valueOf(System.currentTimeMillis() / 1000);
String nonceStr = RandomStringUtils.randomNumeric(32);
ArrayList<Object> list = new ArrayList<>();
list.add(weChatProperties.getAppid());
list.add(timeStamp);
list.add(nonceStr);
list.add("prepay_id=" + prepayId);
//二次签名调起支付需要重新签名
StringBuilder stringBuilder = new StringBuilder();
for (Object o : list) {
stringBuilder.append(o).append("\n");
}
String signMessage = stringBuilder.toString();
byte[] message = signMessage.getBytes();
Signature signature = Signature.getInstance("SHA256withRSA");
signature.initSign(PemUtil.loadPrivateKey(new FileInputStream(new File(weChatProperties.getPrivateKeyFilePath()))));
signature.update(message);
String packageSign = Base64.getEncoder().encodeToString(signature.sign());
//构造数据给微信小程序用于调起微信支付
JSONObject jo = new JSONObject();
jo.put("timeStamp", timeStamp);
jo.put("nonceStr", nonceStr);
jo.put("package", "prepay_id=" + prepayId);
jo.put("signType", "RSA");
jo.put("paySign", packageSign);
return jo;
}
return jsonObject;
}
/**
* 申请退款
*
* @param outTradeNo 商户订单号
* @param outRefundNo 商户退款单号
* @param refund 退款金额
* @param total 原订单金额
* @return
*/
public String refund(String outTradeNo, String outRefundNo, BigDecimal refund, BigDecimal total) throws Exception {
JSONObject jsonObject = new JSONObject();
jsonObject.put("out_trade_no", outTradeNo);
jsonObject.put("out_refund_no", outRefundNo);
JSONObject amount = new JSONObject();
amount.put("refund", refund.multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_HALF_UP).intValue());
amount.put("total", total.multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_HALF_UP).intValue());
amount.put("currency", "CNY");
jsonObject.put("amount", amount);
jsonObject.put("notify_url", weChatProperties.getRefundNotifyUrl());
String body = jsonObject.toJSONString();
//调用申请退款接口
return post(REFUNDS, body);
}
}

View File

@ -1,27 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>sky-take-out</artifactId>
<groupId>com.sky</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>sky-pojo</artifactId>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.14.0-rc2</version>
</dependency>
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-spring-boot-starter</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -1,22 +0,0 @@
package com.sky.dto;
import lombok.Data;
import java.io.Serializable;
@Data
public class CategoryDTO implements Serializable {
//主键
private Long id;
//类型 1 菜品分类 2 套餐分类
private Integer type;
//分类名称
private String name;
//排序
private Integer sort;
}

View File

@ -1,13 +0,0 @@
package com.sky.dto;
import lombok.Data;
import java.io.Serializable;
@Data
public class CategoryPageQueryDTO implements Serializable {
private int page;// 页码
private int pageSize;// 每页记录数
private String name;// 分类名称
private Integer type;//分类类型 1菜品分类 2套餐分类
}

View File

@ -1,21 +0,0 @@
package com.sky.dto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.time.LocalDateTime;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class DataOverViewQueryDTO implements Serializable {
private LocalDateTime begin;
private LocalDateTime end;
}

View File

@ -1,29 +0,0 @@
package com.sky.dto;
import com.sky.entity.DishFlavor;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
@Data
public class DishDTO implements Serializable {
private Long id;
//菜品名称
private String name;
//菜品分类id
private Long categoryId;
//菜品价格
private BigDecimal price;
//图片
private String image;
//描述信息
private String description;
//0 停售 1 起售
private Integer status;
//口味
private List<DishFlavor> flavors = new ArrayList<>();
}

View File

@ -1,22 +0,0 @@
package com.sky.dto;
import lombok.Data;
import java.io.Serializable;
@Data
public class DishPageQueryDTO implements Serializable {
private int page;
private int pageSize;
private String name;
//分类id
private Integer categoryId;
//状态 0表示禁用 1表示启用
private Integer status;
}

View File

@ -1,22 +0,0 @@
package com.sky.dto;
import lombok.Data;
import java.io.Serializable;
@Data
public class EmployeeDTO implements Serializable {
private Long id;
private String username;
private String name;
private String phone;
private String sex;
private String idNumber;
}

View File

@ -1,19 +0,0 @@
package com.sky.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
@ApiModel(description = "员工登录时传递的数据模型")
public class EmployeeLoginDTO implements Serializable {
@ApiModelProperty("用户名")
private String username;
@ApiModelProperty("密码")
private String password;
}

View File

@ -1,19 +0,0 @@
package com.sky.dto;
import com.sky.entity.Employee;
import lombok.Data;
import java.io.Serializable;
@Data
public class EmployeePageQueryDTO implements Serializable {
//员工姓名
private String name;
//页码
private int page;
//每页显示记录数
private int pageSize;
}

View File

@ -1,20 +0,0 @@
package com.sky.dto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class GoodsSalesDTO implements Serializable {
//商品名称
private String name;
//销量
private Integer number;
}

View File

@ -1,14 +0,0 @@
package com.sky.dto;
import lombok.Data;
import java.io.Serializable;
@Data
public class OrdersCancelDTO implements Serializable {
private Long id;
//订单取消原因
private String cancelReason;
}

View File

@ -1,14 +0,0 @@
package com.sky.dto;
import lombok.Data;
import java.io.Serializable;
@Data
public class OrdersConfirmDTO implements Serializable {
private Long id;
//订单状态 1待付款 2待接单 3 已接单 4 派送中 5 已完成 6 已取消 7 退款
private Integer status;
}

View File

@ -1,56 +0,0 @@
package com.sky.dto;
import com.sky.entity.OrderDetail;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
@Data
public class OrdersDTO implements Serializable {
private Long id;
//订单号
private String number;
//订单状态 1待付款2待派送3已派送4已完成5已取消
private Integer status;
//下单用户id
private Long userId;
//地址id
private Long addressBookId;
//下单时间
private LocalDateTime orderTime;
//结账时间
private LocalDateTime checkoutTime;
//支付方式 1微信2支付宝
private Integer payMethod;
//实收金额
private BigDecimal amount;
//备注
private String remark;
//用户名
private String userName;
//手机号
private String phone;
//地址
private String address;
//收货人
private String consignee;
private List<OrderDetail> orderDetails;
}

View File

@ -1,30 +0,0 @@
package com.sky.dto;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.time.LocalDateTime;
@Data
public class OrdersPageQueryDTO implements Serializable {
private int page;
private int pageSize;
private String number;
private String phone;
private Integer status;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime beginTime;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime endTime;
private Long userId;
}

View File

@ -1,14 +0,0 @@
package com.sky.dto;
import lombok.Data;
import java.io.Serializable;
@Data
public class OrdersPaymentDTO implements Serializable {
//订单号
private String orderNumber;
//付款方式
private Integer payMethod;
}

View File

@ -1,15 +0,0 @@
package com.sky.dto;
import lombok.Data;
import java.io.Serializable;
@Data
public class OrdersRejectionDTO implements Serializable {
private Long id;
//订单拒绝原因
private String rejectionReason;
}

View File

@ -1,31 +0,0 @@
package com.sky.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@Data
public class OrdersSubmitDTO implements Serializable {
//地址簿id
private Long addressBookId;
//付款方式
private int payMethod;
//备注
private String remark;
//预计送达时间
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime estimatedDeliveryTime;
//配送状态 1立即送出 0选择具体时间
private Integer deliveryStatus;
//餐具数量
private Integer tablewareNumber;
//餐具数量状态 1按餐量提供 0选择具体数量
private Integer tablewareStatus;
//打包费
private Integer packAmount;
//总金额
private BigDecimal amount;
}

View File

@ -1,19 +0,0 @@
package com.sky.dto;
import lombok.Data;
import java.io.Serializable;
@Data
public class PasswordEditDTO implements Serializable {
//员工id
private Long empId;
//旧密码
private String oldPassword;
//新密码
private String newPassword;
}

View File

@ -1,30 +0,0 @@
package com.sky.dto;
import com.sky.entity.SetmealDish;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
@Data
public class SetmealDTO implements Serializable {
private Long id;
// 分类id
private Long categoryId;
// 套餐名称
private String name;
// 套餐价格
private BigDecimal price;
// 状态 0:停用 1:启用
private Integer status;
// 描述信息
private String description;
// 图片
private String image;
// 套餐菜品关系
private List<SetmealDish> setmealDishes = new ArrayList<>();
}

View File

@ -1,22 +0,0 @@
package com.sky.dto;
import lombok.Data;
import java.io.Serializable;
@Data
public class SetmealPageQueryDTO implements Serializable {
private int page;
private int pageSize;
private String name;
//分类id
private Integer categoryId;
//状态 0表示禁用 1表示启用
private Integer status;
}

View File

@ -1,13 +0,0 @@
package com.sky.dto;
import lombok.Data;
import java.io.Serializable;
@Data
public class ShoppingCartDTO implements Serializable {
private Long dishId;
private Long setmealId;
private String dishFlavor;
}

View File

@ -1,15 +0,0 @@
package com.sky.dto;
import lombok.Data;
import java.io.Serializable;
/**
* C端用户登录
*/
@Data
public class UserLoginDTO implements Serializable {
private String code;
}

View File

@ -1,61 +0,0 @@
package com.sky.entity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* 地址簿
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class AddressBook implements Serializable {
private static final long serialVersionUID = 1L;
private Long id;
//用户id
private Long userId;
//收货人
private String consignee;
//手机号
private String phone;
//性别 0 1
private String sex;
//省级区划编号
private String provinceCode;
//省级名称
private String provinceName;
//市级区划编号
private String cityCode;
//市级名称
private String cityName;
//区级区划编号
private String districtCode;
//区级名称
private String districtName;
//详细地址
private String detail;
//标签
private String label;
//是否默认 0否 1是
private Integer isDefault;
}

View File

@ -1,43 +0,0 @@
package com.sky.entity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.time.LocalDateTime;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Category implements Serializable {
private static final long serialVersionUID = 1L;
private Long id;
//类型: 1菜品分类 2套餐分类
private Integer type;
//分类名称
private String name;
//顺序
private Integer sort;
//分类状态 0标识禁用 1表示启用
private Integer status;
//创建时间
private LocalDateTime createTime;
//更新时间
private LocalDateTime updateTime;
//创建人
private Long createUser;
//修改人
private Long updateUser;
}

View File

@ -1,50 +0,0 @@
package com.sky.entity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* 菜品
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Dish implements Serializable {
private static final long serialVersionUID = 1L;
private Long id;
//菜品名称
private String name;
//菜品分类id
private Long categoryId;
//菜品价格
private BigDecimal price;
//图片
private String image;
//描述信息
private String description;
//0 停售 1 起售
private Integer status;
private LocalDateTime createTime;
private LocalDateTime updateTime;
private Long createUser;
private Long updateUser;
}

View File

@ -1,31 +0,0 @@
package com.sky.entity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* 菜品口味
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class DishFlavor implements Serializable {
private static final long serialVersionUID = 1L;
private Long id;
//菜品id
private Long dishId;
//口味名称
private String name;
//口味数据list
private String value;
}

View File

@ -1,42 +0,0 @@
package com.sky.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;
import java.io.Serializable;
import java.time.LocalDateTime;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Employee implements Serializable {
private static final long serialVersionUID = 1L;
private Long id;
private String username;
private String name;
private String password;
private String phone;
private String sex;
private String idNumber;
private Integer status;
@JsonFormat(pattern = "yyyy年MM月dd日 HH:mm:ss")
private LocalDateTime createTime;
//@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime updateTime;
private Long createUser;
private Long updateUser;
}

View File

@ -1,47 +0,0 @@
package com.sky.entity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 订单明细
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class OrderDetail implements Serializable {
private static final long serialVersionUID = 1L;
private Long id;
//名称
private String name;
//订单id
private Long orderId;
//菜品id
private Long dishId;
//套餐id
private Long setmealId;
//口味
private String dishFlavor;
//数量
private Integer number;
//金额
private BigDecimal amount;
//图片
private String image;
}

View File

@ -1,110 +0,0 @@
package com.sky.entity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* 订单
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Orders implements Serializable {
/**
* 订单状态 1待付款 2待接单 3已接单 4派送中 5已完成 6已取消
*/
public static final Integer PENDING_PAYMENT = 1;
public static final Integer TO_BE_CONFIRMED = 2;
public static final Integer CONFIRMED = 3;
public static final Integer DELIVERY_IN_PROGRESS = 4;
public static final Integer COMPLETED = 5;
public static final Integer CANCELLED = 6;
/**
* 支付状态 0未支付 1已支付 2退款
*/
public static final Integer UN_PAID = 0;
public static final Integer PAID = 1;
public static final Integer REFUND = 2;
private static final long serialVersionUID = 1L;
private Long id;
//订单号
private String number;
//订单状态 1待付款 2待接单 3已接单 4派送中 5已完成 6已取消 7退款
private Integer status;
//下单用户id
private Long userId;
//地址id
private Long addressBookId;
//下单时间
private LocalDateTime orderTime;
//结账时间
private LocalDateTime checkoutTime;
//支付方式 1微信2支付宝
private Integer payMethod;
//支付状态 0未支付 1已支付 2退款
private Integer payStatus;
//实收金额
private BigDecimal amount;
//备注
private String remark;
//用户名
private String userName;
//手机号
private String phone;
//地址
private String address;
//收货人
private String consignee;
//订单取消原因
private String cancelReason;
//订单拒绝原因
private String rejectionReason;
//订单取消时间
private LocalDateTime cancelTime;
//预计送达时间
private LocalDateTime estimatedDeliveryTime;
//配送状态 1立即送出 0选择具体时间
private Integer deliveryStatus;
//送达时间
private LocalDateTime deliveryTime;
//打包费
private int packAmount;
//餐具数量
private int tablewareNumber;
//餐具数量状态 1按餐量提供 0选择具体数量
private Integer tablewareStatus;
}

View File

@ -1,49 +0,0 @@
package com.sky.entity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* 套餐
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Setmeal implements Serializable {
private static final long serialVersionUID = 1L;
private Long id;
//分类id
private Long categoryId;
//套餐名称
private String name;
//套餐价格
private BigDecimal price;
//状态 0:停用 1:启用
private Integer status;
//描述信息
private String description;
//图片
private String image;
private LocalDateTime createTime;
private LocalDateTime updateTime;
private Long createUser;
private Long updateUser;
}

View File

@ -1,38 +0,0 @@
package com.sky.entity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 套餐菜品关系
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SetmealDish implements Serializable {
private static final long serialVersionUID = 1L;
private Long id;
//套餐id
private Long setmealId;
//菜品id
private Long dishId;
//菜品名称 冗余字段
private String name;
//菜品原价
private BigDecimal price;
//份数
private Integer copies;
}

View File

@ -1,50 +0,0 @@
package com.sky.entity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* 购物车
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ShoppingCart implements Serializable {
private static final long serialVersionUID = 1L;
private Long id;
//名称
private String name;
//用户id
private Long userId;
//菜品id
private Long dishId;
//套餐id
private Long setmealId;
//口味
private String dishFlavor;
//数量
private Integer number;
//金额
private BigDecimal amount;
//图片
private String image;
private LocalDateTime createTime;
}

View File

@ -1,42 +0,0 @@
package com.sky.entity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class User implements Serializable {
private static final long serialVersionUID = 1L;
private Long id;
//微信用户唯一标识
private String openid;
//姓名
private String name;
//手机号
private String phone;
//性别 0 1
private String sex;
//身份证号
private String idNumber;
//头像
private String avatar;
//注册时间
private LocalDateTime createTime;
}

View File

@ -1,29 +0,0 @@
package com.sky.vo;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* 数据概览
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class BusinessDataVO implements Serializable {
private Double turnover;//营业额
private Integer validOrderCount;//有效订单数
private Double orderCompletionRate;//订单完成率
private Double unitPrice;//平均客单价
private Integer newUsers;//新增用户数
}

View File

@ -1,27 +0,0 @@
package com.sky.vo;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class DishItemVO implements Serializable {
//菜品名称
private String name;
//份数
private Integer copies;
//菜品图片
private String image;
//菜品描述
private String description;
}

Some files were not shown because too many files have changed in this diff Show More