├── .gitattributes
├── .gitignore
├── README.md
├── admin
└── stucompla-front-admin-feature-v0.0.1
│ ├── .editorconfig
│ ├── .env.development
│ ├── .env.production
│ ├── .env.staging
│ ├── .eslintignore
│ ├── .eslintrc.js
│ ├── .gitignore
│ ├── .travis.yml
│ ├── LICENSE
│ ├── README-zh.md
│ ├── README.md
│ ├── babel.config.js
│ ├── build
│ └── index.js
│ ├── jest.config.js
│ ├── jsconfig.json
│ ├── mock
│ ├── index.js
│ ├── mock-server.js
│ ├── table.js
│ ├── user.js
│ └── utils.js
│ ├── package-lock.json
│ ├── package.json
│ ├── postcss.config.js
│ ├── public
│ ├── favicon.ico
│ └── index.html
│ ├── tests
│ └── unit
│ │ ├── .eslintrc.js
│ │ ├── components
│ │ ├── Breadcrumb.spec.js
│ │ ├── Hamburger.spec.js
│ │ └── SvgIcon.spec.js
│ │ └── utils
│ │ ├── formatTime.spec.js
│ │ ├── param2Obj.spec.js
│ │ ├── parseTime.spec.js
│ │ └── validate.spec.js
│ └── vue.config.js
├── picture
├── picture1.png
├── picture10.png
├── picture11.png
├── picture12.png
├── picture13.png
├── picture14.png
├── picture15.png
├── picture16.png
├── picture17.png
├── picture18.png
├── picture19.png
├── picture2.png
├── picture20.png
├── picture21.png
├── picture22.png
├── picture3.png
├── picture4.png
├── picture5.png
├── picture6.png
├── picture7.png
├── picture8.png
└── picture9.png
├── stucompla-front-feature-v0.0.1
├── .editorconfig
├── .eslintignore
├── .eslintrc.js
├── .gitignore
├── LICENSE
├── README.md
├── babel.config.js
├── package-lock.json
├── package.json
├── public
│ ├── index.html
│ └── xanadu.ico
└── vue.config.js
└── stucompla-rear2-feature-v0.0.1
├── .gitignore
├── HELP.md
├── LICENSE
├── README.md
├── pom.xml
└── src
├── main
├── java
│ └── com
│ │ └── mrxu
│ │ └── stucomplarear2
│ │ ├── StucomplaRear2Application.java
│ │ ├── controller
│ │ ├── CategoryController.java
│ │ ├── CollectController.java
│ │ ├── CommentController.java
│ │ ├── GoodsCategoryController.java
│ │ ├── GoodsController.java
│ │ ├── ImageController.java
│ │ ├── LetterController.java
│ │ ├── MarketOrderController.java
│ │ ├── PostController.java
│ │ ├── UserController.java
│ │ ├── WallController.java
│ │ └── admin
│ │ │ └── AdminController.java
│ │ ├── dto
│ │ ├── AdminFindDto.java
│ │ ├── CollectDto.java
│ │ ├── CollectFindDto.java
│ │ ├── CommentDto.java
│ │ ├── CommentFindDto.java
│ │ ├── CommentVo.java
│ │ ├── GoodsAddDto.java
│ │ ├── GoodsCategoryDto.java
│ │ ├── GoodsEditDto.java
│ │ ├── GoodsFindDto.java
│ │ ├── GoodsVo.java
│ │ ├── ImgResult.java
│ │ ├── LetterAddDto.java
│ │ ├── LetterVo.java
│ │ ├── LoginDto.java
│ │ ├── MarketOrderFindDto.java
│ │ ├── MarketOrderVo.java
│ │ ├── OrderAddDto.java
│ │ ├── PostEditDto.java
│ │ ├── PostFindDto.java
│ │ ├── PostPublishDto.java
│ │ ├── PostVo.java
│ │ ├── RegisterDto.java
│ │ ├── UserEditDto.java
│ │ ├── UserFindDto.java
│ │ ├── WallApplyDto.java
│ │ ├── WallAuditDto.java
│ │ └── WallFindDto.java
│ │ └── mapper
│ │ ├── AdminMapper.java
│ │ ├── CategoryMapper.java
│ │ ├── CollectMapper.java
│ │ ├── CommentMapper.java
│ │ ├── GoodsCategoryMapper.java
│ │ ├── GoodsMapper.java
│ │ ├── ImageMapper.java
│ │ ├── LetterMapper.java
│ │ ├── MarketOrderMapper.java
│ │ ├── PostMapper.java
│ │ ├── RoleMapper.java
│ │ ├── UserMapper.java
│ │ └── WallMapper.java
└── resources
│ ├── application.properties
│ └── mapper
│ ├── AdminMapper.xml
│ ├── CategoryMapper.xml
│ ├── CollectMapper.xml
│ ├── CommentMapper.xml
│ ├── GoodsCategoryMapper.xml
│ ├── GoodsMapper.xml
│ ├── ImageMapper.xml
│ ├── ImagesMapper.xml
│ ├── LetterMapper.xml
│ ├── MarketOrderMapper.xml
│ ├── PermissionMapper.xml
│ ├── PostMapper.xml
│ └── WallMapper.xml
└── test
└── java
└── com
└── mrxu
└── stucomplarear2
└── StucomplaRear2ApplicationTests.java
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.js linguist-language=java
2 | *.css linguist-language=java
3 | *.html linguist-language=java
4 | *.vue linguist-language=java
5 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /stucompla-rear2-feature-v0.0.1/target/
2 | /classes/
3 | /out/
4 | !.mvn/wrapper/maven-wrapper.jar
5 | *.zip
6 | /admin/stucompla-front-admin-feature-v0.0.1/node_modules/
7 | /stucompla-front-feature-v0.0.1/node_modules/
8 | ### STS ###
9 | .apt_generated
10 | .classpath
11 | .factorypath
12 | .project
13 | .settings
14 | .springBeans
15 | .sts4-cache
16 |
17 | ### IntelliJ IDEA ###
18 | .idea
19 | *.iws
20 | *.iml
21 | *.ipr
22 | .mvn
23 | mvnw
24 | mvnw.cmd
25 |
26 | ### NetBeans ###
27 | /nbproject/private/
28 | /build/
29 | /nbbuild/
30 | /dist/
31 | /nbdist/
32 | /.nb-gradle/
33 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | **完整代码收费 可以加qq 931708230 或者加微信ynwwxid 咨询**
2 |
3 | **接毕业设计和论文**
4 |
5 | **博客地址:[https://blog.csdn.net/2303_76227485/article/details/128663581](https://blog.csdn.net/2303_76227485/article/details/128663581)**
6 |
7 | **视频演示:[https://www.bilibili.com/video/BV12a4y1w7EN/](https://www.bilibili.com/video/BV12a4y1w7EN/)**
8 |
9 | **毕业设计所有选题地址:[https://github.com/ynwynw/allProject](https://github.com/ynwynw/allProject)**
10 |
11 | ## 基于Springboot+vue的校园二手交易和交流论坛系统(源代码+数据库)
12 |
13 | ## 一、系统介绍
14 |
15 | 这是集校园二手交易、校园交流论坛、校园表白墙为一体的项目。分为用户和管理员
16 |
17 | 学生登录
18 | - 校园交流论坛
19 | 发帖、查看帖子、评论帖子、修改删除帖子 、收藏帖子
20 | - 表白墙
21 | 申请上墙、查看别人的表白贴
22 | - 二手交易
23 | 搜索商品、购买商品、发布闲置商品
24 | - 个人中心
25 | 我的帖子、我的回复、我的收藏、我的墙列表、我的二手商品、我的购买订单、销售订单
26 | 后台管理
27 | - 首页统计商品、帖子、用户、表白墙、订单、评论数据
28 | - 人员管理
29 | 用户管理、管理员管理
30 | - 帖子管理
31 | 查看、删除、导出帖子
32 | - 评论管理
33 | 查看、删除评论
34 | - 表白墙管理
35 | 表白墙审核
36 | - 二手交易管理
37 | 商品管理、订单管理
38 |
39 | ## 二、所用技术
40 |
41 | 后端技术栈:
42 |
43 | - springboot
44 | - mybatis-plus
45 | - mysql
46 | - shiro
47 | - redis
48 | - jwt
49 |
50 | 前端技术栈:
51 |
52 | - vue全家桶
53 | - elment-ui
54 | - echarts
55 | - axios
56 |
57 | ## 三、环境介绍
58 |
59 | 基础环境 :IDEA/eclipse, JDK 1.8, Mysql5.7及以上,Node.js,Maven
60 |
61 | 所有项目以及源代码本人均调试运行无问题 可支持远程调试运行
62 |
63 | ## 四、页面截图
64 |
65 | 
66 |
67 | 
68 |
69 | 
70 |
71 | 
72 |
73 | 
74 |
75 | 
76 |
77 | 
78 |
79 | 
80 |
81 | 
82 |
83 | 
84 |
85 | 
86 |
87 | 
88 |
89 | 
90 |
91 | 
92 |
93 | 
94 |
95 | 
96 |
97 | 
98 |
99 | 
100 |
101 | 
102 |
103 | 
104 |
105 | 
106 |
107 | 
108 |
109 |
110 | ## 五、浏览地址
111 |
112 | 前端访问地址:http://localhost:8080/
113 |
114 | 用户账号/密码:test1/123456
115 |
116 | 后台管理地址:http://localhost:9528/
117 |
118 | 管理员账号/密码:xzj4/123456
119 |
120 | ## 六、安装教程
121 |
122 | 1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
123 | 2. 使用IDEA/Eclipse/MyEclipse导入项目stucompla-rear2-feature-v0.0.1,Eclipse/MyEclipse导入时,若为maven项目请选择maven;
124 | 若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行;
125 | 3. 修改application.yml 里面的数据库配置和redis配置和文件路径配置
126 | 4. 启动项目后端项目
127 | 5. vscode打开admin和stucompla-front-feature-v0.0.1项目,
128 | 6. 打开终端,执行npm install 依赖下载完成后执行 npm run dev,执行成功后会显示访问地址
129 | 7. 分别访问 后台管理http://localhost:9528/ 和 前台页面http://localhost:8080/
130 |
131 | **完整代码收费 可以加qq 931708230 或者加微信ynwwxid 咨询**
132 |
133 | **接毕业设计和论文**
134 |
--------------------------------------------------------------------------------
/admin/stucompla-front-admin-feature-v0.0.1/.editorconfig:
--------------------------------------------------------------------------------
1 | # http://editorconfig.org
2 | root = true
3 |
4 | [*]
5 | charset = utf-8
6 | indent_style = space
7 | indent_size = 2
8 | end_of_line = lf
9 | insert_final_newline = true
10 | trim_trailing_whitespace = true
11 |
12 | [*.md]
13 | insert_final_newline = false
14 | trim_trailing_whitespace = false
15 |
--------------------------------------------------------------------------------
/admin/stucompla-front-admin-feature-v0.0.1/.env.development:
--------------------------------------------------------------------------------
1 | # just a flag
2 | ENV = 'development'
3 |
4 | # base api
5 | VUE_APP_BASE_API = ''
6 |
--------------------------------------------------------------------------------
/admin/stucompla-front-admin-feature-v0.0.1/.env.production:
--------------------------------------------------------------------------------
1 | # just a flag
2 | ENV = 'production'
3 |
4 | # base api
5 | VUE_APP_BASE_API = ''
6 |
7 |
--------------------------------------------------------------------------------
/admin/stucompla-front-admin-feature-v0.0.1/.env.staging:
--------------------------------------------------------------------------------
1 | NODE_ENV = production
2 |
3 | # just a flag
4 | ENV = 'staging'
5 |
6 | # base api
7 | VUE_APP_BASE_API = '/stage-api'
8 |
9 |
--------------------------------------------------------------------------------
/admin/stucompla-front-admin-feature-v0.0.1/.eslintignore:
--------------------------------------------------------------------------------
1 | build/*.js
2 | src/assets
3 | public
4 | dist
5 |
--------------------------------------------------------------------------------
/admin/stucompla-front-admin-feature-v0.0.1/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | parserOptions: {
4 | parser: 'babel-eslint',
5 | sourceType: 'module'
6 | },
7 | env: {
8 | browser: true,
9 | node: true,
10 | es6: true,
11 | },
12 | extends: ['plugin:vue/recommended', 'eslint:recommended'],
13 |
14 | // add your custom rules here
15 | //it is base on https://github.com/vuejs/eslint-config-vue
16 | rules: {
17 | "vue/max-attributes-per-line": [2, {
18 | "singleline": 10,
19 | "multiline": {
20 | "max": 1,
21 | "allowFirstLine": false
22 | }
23 | }],
24 | "vue/singleline-html-element-content-newline": "off",
25 | "vue/multiline-html-element-content-newline":"off",
26 | "vue/name-property-casing": ["error", "PascalCase"],
27 | "vue/no-v-html": "off",
28 | 'accessor-pairs': 2,
29 | 'arrow-spacing': [2, {
30 | 'before': true,
31 | 'after': true
32 | }],
33 | 'block-spacing': [2, 'always'],
34 | 'brace-style': [2, '1tbs', {
35 | 'allowSingleLine': true
36 | }],
37 | 'camelcase': [0, {
38 | 'properties': 'always'
39 | }],
40 | 'comma-dangle': [2, 'never'],
41 | 'comma-spacing': [2, {
42 | 'before': false,
43 | 'after': true
44 | }],
45 | 'comma-style': [2, 'last'],
46 | 'constructor-super': 2,
47 | 'curly': [2, 'multi-line'],
48 | 'dot-location': [2, 'property'],
49 | 'eol-last': 2,
50 | 'eqeqeq': ["error", "always", {"null": "ignore"}],
51 | 'generator-star-spacing': [2, {
52 | 'before': true,
53 | 'after': true
54 | }],
55 | 'handle-callback-err': [2, '^(err|error)$'],
56 | 'indent': [2, 2, {
57 | 'SwitchCase': 1
58 | }],
59 | 'jsx-quotes': [2, 'prefer-single'],
60 | 'key-spacing': [2, {
61 | 'beforeColon': false,
62 | 'afterColon': true
63 | }],
64 | 'keyword-spacing': [2, {
65 | 'before': true,
66 | 'after': true
67 | }],
68 | 'new-cap': [2, {
69 | 'newIsCap': true,
70 | 'capIsNew': false
71 | }],
72 | 'new-parens': 2,
73 | 'no-array-constructor': 2,
74 | 'no-caller': 2,
75 | 'no-console': 'off',
76 | 'no-class-assign': 2,
77 | 'no-cond-assign': 2,
78 | 'no-const-assign': 2,
79 | 'no-control-regex': 0,
80 | 'no-delete-var': 2,
81 | 'no-dupe-args': 2,
82 | 'no-dupe-class-members': 2,
83 | 'no-dupe-keys': 2,
84 | 'no-duplicate-case': 2,
85 | 'no-empty-character-class': 2,
86 | 'no-empty-pattern': 2,
87 | 'no-eval': 2,
88 | 'no-ex-assign': 2,
89 | 'no-extend-native': 2,
90 | 'no-extra-bind': 2,
91 | 'no-extra-boolean-cast': 2,
92 | 'no-extra-parens': [2, 'functions'],
93 | 'no-fallthrough': 2,
94 | 'no-floating-decimal': 2,
95 | 'no-func-assign': 2,
96 | 'no-implied-eval': 2,
97 | 'no-inner-declarations': [2, 'functions'],
98 | 'no-invalid-regexp': 2,
99 | 'no-irregular-whitespace': 2,
100 | 'no-iterator': 2,
101 | 'no-label-var': 2,
102 | 'no-labels': [2, {
103 | 'allowLoop': false,
104 | 'allowSwitch': false
105 | }],
106 | 'no-lone-blocks': 2,
107 | 'no-mixed-spaces-and-tabs': 2,
108 | 'no-multi-spaces': 2,
109 | 'no-multi-str': 2,
110 | 'no-multiple-empty-lines': [2, {
111 | 'max': 1
112 | }],
113 | 'no-native-reassign': 2,
114 | 'no-negated-in-lhs': 2,
115 | 'no-new-object': 2,
116 | 'no-new-require': 2,
117 | 'no-new-symbol': 2,
118 | 'no-new-wrappers': 2,
119 | 'no-obj-calls': 2,
120 | 'no-octal': 2,
121 | 'no-octal-escape': 2,
122 | 'no-path-concat': 2,
123 | 'no-proto': 2,
124 | 'no-redeclare': 2,
125 | 'no-regex-spaces': 2,
126 | 'no-return-assign': [2, 'except-parens'],
127 | 'no-self-assign': 2,
128 | 'no-self-compare': 2,
129 | 'no-sequences': 2,
130 | 'no-shadow-restricted-names': 2,
131 | 'no-spaced-func': 2,
132 | 'no-sparse-arrays': 2,
133 | 'no-this-before-super': 2,
134 | 'no-throw-literal': 2,
135 | 'no-trailing-spaces': 2,
136 | 'no-undef': 2,
137 | 'no-undef-init': 2,
138 | 'no-unexpected-multiline': 2,
139 | 'no-unmodified-loop-condition': 2,
140 | 'no-unneeded-ternary': [2, {
141 | 'defaultAssignment': false
142 | }],
143 | 'no-unreachable': 2,
144 | 'no-unsafe-finally': 2,
145 | 'no-unused-vars': [2, {
146 | 'vars': 'all',
147 | 'args': 'none'
148 | }],
149 | 'no-useless-call': 2,
150 | 'no-useless-computed-key': 2,
151 | 'no-useless-constructor': 2,
152 | 'no-useless-escape': 0,
153 | 'no-whitespace-before-property': 2,
154 | 'no-with': 2,
155 | 'one-var': [2, {
156 | 'initialized': 'never'
157 | }],
158 | 'operator-linebreak': [2, 'after', {
159 | 'overrides': {
160 | '?': 'before',
161 | ':': 'before'
162 | }
163 | }],
164 | 'padded-blocks': [2, 'never'],
165 | 'quotes': [2, 'single', {
166 | 'avoidEscape': true,
167 | 'allowTemplateLiterals': true
168 | }],
169 | 'semi': [2, 'never'],
170 | 'semi-spacing': [2, {
171 | 'before': false,
172 | 'after': true
173 | }],
174 | 'space-before-blocks': [2, 'always'],
175 | 'space-before-function-paren': [2, 'never'],
176 | 'space-in-parens': [2, 'never'],
177 | 'space-infix-ops': 2,
178 | 'space-unary-ops': [2, {
179 | 'words': true,
180 | 'nonwords': false
181 | }],
182 | 'spaced-comment': [2, 'always', {
183 | 'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ',']
184 | }],
185 | 'template-curly-spacing': [2, 'never'],
186 | 'use-isnan': 2,
187 | 'valid-typeof': 2,
188 | 'wrap-iife': [2, 'any'],
189 | 'yield-star-spacing': [2, 'both'],
190 | 'yoda': [2, 'never'],
191 | 'prefer-const': 2,
192 | 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
193 | 'object-curly-spacing': [2, 'always', {
194 | objectsInObjects: false
195 | }],
196 | 'array-bracket-spacing': [2, 'never']
197 | }
198 | }
199 |
--------------------------------------------------------------------------------
/admin/stucompla-front-admin-feature-v0.0.1/.gitignore:
--------------------------------------------------------------------------------
1 | # Compiled class file
2 | *.class
3 |
4 | # Log file
5 | *.log
6 |
7 | # BlueJ files
8 | *.ctxt
9 |
10 | # Mobile Tools for Java (J2ME)
11 | .mtj.tmp/
12 |
13 | # Package Files #
14 | *.jar
15 | *.war
16 | *.nar
17 | *.ear
18 | *.zip
19 | *.tar.gz
20 | *.rar
21 |
22 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
23 | hs_err_pid*
24 |
25 | #忽略所有.idea目录
26 | .idea/
27 |
28 | #忽略所有node_modules目录
29 | node_modules/
--------------------------------------------------------------------------------
/admin/stucompla-front-admin-feature-v0.0.1/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js: 10
3 | script: npm run test
4 | notifications:
5 | email: false
6 |
--------------------------------------------------------------------------------
/admin/stucompla-front-admin-feature-v0.0.1/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022 Zakiro
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/admin/stucompla-front-admin-feature-v0.0.1/README-zh.md:
--------------------------------------------------------------------------------
1 | # vue-admin-template
2 |
3 | > 这是一个极简的 vue admin 管理后台。它只包含了 Element UI & axios & iconfont & permission control & lint,这些搭建后台必要的东西。
4 |
5 | [线上地址](http://panjiachen.github.io/vue-admin-template)
6 |
7 | [国内访问](https://panjiachen.gitee.io/vue-admin-template)
8 |
9 | 目前版本为 `v4.0+` 基于 `vue-cli` 进行构建,若你想使用旧版本,可以切换分支到[tag/3.11.0](https://github.com/PanJiaChen/vue-admin-template/tree/tag/3.11.0),它不依赖 `vue-cli`。
10 |
11 |
12 | SPONSORED BY
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | ## Extra
21 |
22 | 如果你想要根据用户角色来动态生成侧边栏和 router,你可以使用该分支[permission-control](https://github.com/PanJiaChen/vue-admin-template/tree/permission-control)
23 |
24 | ## 相关项目
25 |
26 | - [vue-element-admin](https://github.com/PanJiaChen/vue-element-admin)
27 |
28 | - [electron-vue-admin](https://github.com/PanJiaChen/electron-vue-admin)
29 |
30 | - [vue-typescript-admin-template](https://github.com/Armour/vue-typescript-admin-template)
31 |
32 | - [awesome-project](https://github.com/PanJiaChen/vue-element-admin/issues/2312)
33 |
34 | 写了一个系列的教程配套文章,如何从零构建后一个完整的后台项目:
35 |
36 | - [手摸手,带你用 vue 撸后台 系列一(基础篇)](https://juejin.im/post/59097cd7a22b9d0065fb61d2)
37 | - [手摸手,带你用 vue 撸后台 系列二(登录权限篇)](https://juejin.im/post/591aa14f570c35006961acac)
38 | - [手摸手,带你用 vue 撸后台 系列三 (实战篇)](https://juejin.im/post/593121aa0ce4630057f70d35)
39 | - [手摸手,带你用 vue 撸后台 系列四(vueAdmin 一个极简的后台基础模板,专门针对本项目的文章,算作是一篇文档)](https://juejin.im/post/595b4d776fb9a06bbe7dba56)
40 | - [手摸手,带你封装一个 vue component](https://segmentfault.com/a/1190000009090836)
41 |
42 | ## Build Setup
43 |
44 | ```bash
45 | # 克隆项目
46 | git clone https://github.com/PanJiaChen/vue-admin-template.git
47 |
48 | # 进入项目目录
49 | cd vue-admin-template
50 |
51 | # 安装依赖
52 | npm install
53 |
54 | # 建议不要直接使用 cnpm 安装以来,会有各种诡异的 bug。可以通过如下操作解决 npm 下载速度慢的问题
55 | npm install --registry=https://registry.npm.taobao.org
56 |
57 | # 启动服务
58 | npm run dev
59 | ```
60 |
61 | 浏览器访问 [http://localhost:9528](http://localhost:9528)
62 |
63 | ## 发布
64 |
65 | ```bash
66 | # 构建测试环境
67 | npm run build:stage
68 |
69 | # 构建生产环境
70 | npm run build:prod
71 | ```
72 |
73 | ## 其它
74 |
75 | ```bash
76 | # 预览发布环境效果
77 | npm run preview
78 |
79 | # 预览发布环境效果 + 静态资源分析
80 | npm run preview -- --report
81 |
82 | # 代码格式检查
83 | npm run lint
84 |
85 | # 代码格式检查并自动修复
86 | npm run lint -- --fix
87 | ```
88 |
89 | 更多信息请参考 [使用文档](https://panjiachen.github.io/vue-element-admin-site/zh/)
90 |
91 | ## 购买贴纸
92 |
93 | 你也可以通过 购买[官方授权的贴纸](https://smallsticker.com/product/vue-element-admin) 的方式来支持 vue-element-admin - 每售出一张贴纸,我们将获得 2 元的捐赠。
94 |
95 | ## Demo
96 |
97 | 
98 |
99 | ## Browsers support
100 |
101 | Modern browsers and Internet Explorer 10+.
102 |
103 | | [
](http://godban.github.io/browsers-support-badges/)IE / Edge | [
](http://godban.github.io/browsers-support-badges/)Firefox | [
](http://godban.github.io/browsers-support-badges/)Chrome | [
](http://godban.github.io/browsers-support-badges/)Safari |
104 | | --------- | --------- | --------- | --------- |
105 | | IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions
106 |
107 | ## License
108 |
109 | [MIT](https://github.com/PanJiaChen/vue-admin-template/blob/master/LICENSE) license.
110 |
111 | Copyright (c) 2017-present PanJiaChen
112 |
--------------------------------------------------------------------------------
/admin/stucompla-front-admin-feature-v0.0.1/README.md:
--------------------------------------------------------------------------------
1 | 基于 Springboot 的 stucompla 后台管理系统前端项目
2 |
3 | # 简介
4 |
5 | 这是集校园二手交易、校园交流论坛、校园表白墙为一体的项目。
6 |
7 | # 前端项目地址
8 |
9 | ## 基于 Springboot 的 stucompla 后端项目
10 |
11 | https://github.com/ynwynw/stucompla-rear
12 |
13 | ## 基于 Springboot+Vue 的 stucompla 前台项目
14 |
15 | https://github.com/ynwynw/stucompla-front
16 |
--------------------------------------------------------------------------------
/admin/stucompla-front-admin-feature-v0.0.1/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: [
3 | // https://github.com/vuejs/vue-cli/tree/master/packages/@vue/babel-preset-app
4 | '@vue/cli-plugin-babel/preset'
5 | ],
6 | 'env': {
7 | 'development': {
8 | // babel-plugin-dynamic-import-node plugin only does one thing by converting all import() to require().
9 | // This plugin can significantly increase the speed of hot updates, when you have a large number of pages.
10 | // https://panjiachen.github.io/vue-element-admin-site/guide/advanced/lazy-loading.html
11 | 'plugins': ['dynamic-import-node']
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/admin/stucompla-front-admin-feature-v0.0.1/build/index.js:
--------------------------------------------------------------------------------
1 | const { run } = require('runjs')
2 | const chalk = require('chalk')
3 | const config = require('../vue.config.js')
4 | const rawArgv = process.argv.slice(2)
5 | const args = rawArgv.join(' ')
6 |
7 | if (process.env.npm_config_preview || rawArgv.includes('--preview')) {
8 | const report = rawArgv.includes('--report')
9 |
10 | run(`vue-cli-service build ${args}`)
11 |
12 | const port = 9526
13 | const publicPath = config.publicPath
14 |
15 | var connect = require('connect')
16 | var serveStatic = require('serve-static')
17 | const app = connect()
18 |
19 | app.use(
20 | publicPath,
21 | serveStatic('./dist', {
22 | index: ['index.html', '/']
23 | })
24 | )
25 |
26 | app.listen(port, function () {
27 | console.log(chalk.green(`> Preview at http://localhost:${port}${publicPath}`))
28 | if (report) {
29 | console.log(chalk.green(`> Report at http://localhost:${port}${publicPath}report.html`))
30 | }
31 |
32 | })
33 | } else {
34 | run(`vue-cli-service build ${args}`)
35 | }
36 |
--------------------------------------------------------------------------------
/admin/stucompla-front-admin-feature-v0.0.1/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | moduleFileExtensions: ['js', 'jsx', 'json', 'vue'],
3 | transform: {
4 | '^.+\\.vue$': 'vue-jest',
5 | '.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$':
6 | 'jest-transform-stub',
7 | '^.+\\.jsx?$': 'babel-jest'
8 | },
9 | moduleNameMapper: {
10 | '^@/(.*)$': '/src/$1'
11 | },
12 | snapshotSerializers: ['jest-serializer-vue'],
13 | testMatch: [
14 | '**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)'
15 | ],
16 | collectCoverageFrom: ['src/utils/**/*.{js,vue}', '!src/utils/auth.js', '!src/utils/request.js', 'src/components/**/*.{js,vue}'],
17 | coverageDirectory: '/tests/unit/coverage',
18 | // 'collectCoverage': true,
19 | 'coverageReporters': [
20 | 'lcov',
21 | 'text-summary'
22 | ],
23 | testURL: 'http://localhost/'
24 | }
25 |
--------------------------------------------------------------------------------
/admin/stucompla-front-admin-feature-v0.0.1/jsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "baseUrl": "./",
4 | "paths": {
5 | "@/*": ["src/*"]
6 | }
7 | },
8 | "exclude": ["node_modules", "dist"]
9 | }
10 |
--------------------------------------------------------------------------------
/admin/stucompla-front-admin-feature-v0.0.1/mock/index.js:
--------------------------------------------------------------------------------
1 | const Mock = require('mockjs')
2 | const { param2Obj } = require('./utils')
3 |
4 | const user = require('./user')
5 | const table = require('./table')
6 |
7 | const mocks = [
8 | ...user,
9 | ...table
10 | ]
11 |
12 | // for front mock
13 | // please use it cautiously, it will redefine XMLHttpRequest,
14 | // which will cause many of your third-party libraries to be invalidated(like progress event).
15 | function mockXHR() {
16 | // mock patch
17 | // https://github.com/nuysoft/Mock/issues/300
18 | Mock.XHR.prototype.proxy_send = Mock.XHR.prototype.send
19 | Mock.XHR.prototype.send = function() {
20 | if (this.custom.xhr) {
21 | this.custom.xhr.withCredentials = this.withCredentials || false
22 |
23 | if (this.responseType) {
24 | this.custom.xhr.responseType = this.responseType
25 | }
26 | }
27 | this.proxy_send(...arguments)
28 | }
29 |
30 | function XHR2ExpressReqWrap(respond) {
31 | return function(options) {
32 | let result = null
33 | if (respond instanceof Function) {
34 | const { body, type, url } = options
35 | // https://expressjs.com/en/4x/api.html#req
36 | result = respond({
37 | method: type,
38 | body: JSON.parse(body),
39 | query: param2Obj(url)
40 | })
41 | } else {
42 | result = respond
43 | }
44 | return Mock.mock(result)
45 | }
46 | }
47 |
48 | for (const i of mocks) {
49 | Mock.mock(new RegExp(i.url), i.type || 'get', XHR2ExpressReqWrap(i.response))
50 | }
51 | }
52 |
53 | module.exports = {
54 | mocks,
55 | mockXHR
56 | }
57 |
58 |
--------------------------------------------------------------------------------
/admin/stucompla-front-admin-feature-v0.0.1/mock/mock-server.js:
--------------------------------------------------------------------------------
1 | const chokidar = require('chokidar')
2 | const bodyParser = require('body-parser')
3 | const chalk = require('chalk')
4 | const path = require('path')
5 | const Mock = require('mockjs')
6 |
7 | const mockDir = path.join(process.cwd(), 'mock')
8 |
9 | function registerRoutes(app) {
10 | let mockLastIndex
11 | const { mocks } = require('./index.js')
12 | const mocksForServer = mocks.map(route => {
13 | return responseFake(route.url, route.type, route.response)
14 | })
15 | for (const mock of mocksForServer) {
16 | app[mock.type](mock.url, mock.response)
17 | mockLastIndex = app._router.stack.length
18 | }
19 | const mockRoutesLength = Object.keys(mocksForServer).length
20 | return {
21 | mockRoutesLength: mockRoutesLength,
22 | mockStartIndex: mockLastIndex - mockRoutesLength
23 | }
24 | }
25 |
26 | function unregisterRoutes() {
27 | Object.keys(require.cache).forEach(i => {
28 | if (i.includes(mockDir)) {
29 | delete require.cache[require.resolve(i)]
30 | }
31 | })
32 | }
33 |
34 | // for mock server
35 | const responseFake = (url, type, respond) => {
36 | return {
37 | url: new RegExp(`${process.env.VUE_APP_BASE_API}${url}`),
38 | type: type || 'get',
39 | response(req, res) {
40 | console.log('request invoke:' + req.path)
41 | res.json(Mock.mock(respond instanceof Function ? respond(req, res) : respond))
42 | }
43 | }
44 | }
45 |
46 | module.exports = app => {
47 | // parse app.body
48 | // https://expressjs.com/en/4x/api.html#req.body
49 | app.use(bodyParser.json())
50 | app.use(bodyParser.urlencoded({
51 | extended: true
52 | }))
53 |
54 | const mockRoutes = registerRoutes(app)
55 | var mockRoutesLength = mockRoutes.mockRoutesLength
56 | var mockStartIndex = mockRoutes.mockStartIndex
57 |
58 | // watch files, hot reload mock server
59 | chokidar.watch(mockDir, {
60 | ignored: /mock-server/,
61 | ignoreInitial: true
62 | }).on('all', (event, path) => {
63 | if (event === 'change' || event === 'add') {
64 | try {
65 | // remove mock routes stack
66 | app._router.stack.splice(mockStartIndex, mockRoutesLength)
67 |
68 | // clear routes cache
69 | unregisterRoutes()
70 |
71 | const mockRoutes = registerRoutes(app)
72 | mockRoutesLength = mockRoutes.mockRoutesLength
73 | mockStartIndex = mockRoutes.mockStartIndex
74 |
75 | console.log(chalk.magentaBright(`\n > Mock Server hot reload success! changed ${path}`))
76 | } catch (error) {
77 | console.log(chalk.redBright(error))
78 | }
79 | }
80 | })
81 | }
82 |
--------------------------------------------------------------------------------
/admin/stucompla-front-admin-feature-v0.0.1/mock/table.js:
--------------------------------------------------------------------------------
1 | const Mock = require('mockjs')
2 |
3 | const data = Mock.mock({
4 | 'items|30': [{
5 | id: '@id',
6 | title: '@sentence(10, 20)',
7 | 'status|1': ['published', 'draft', 'deleted'],
8 | author: 'name',
9 | display_time: '@datetime',
10 | pageviews: '@integer(300, 5000)'
11 | }]
12 | })
13 |
14 | module.exports = [
15 | {
16 | url: '/vue-admin-template/table/list',
17 | type: 'get',
18 | response: config => {
19 | const items = data.items
20 | return {
21 | code: 20000,
22 | data: {
23 | total: items.length,
24 | items: items
25 | }
26 | }
27 | }
28 | }
29 | ]
30 |
--------------------------------------------------------------------------------
/admin/stucompla-front-admin-feature-v0.0.1/mock/user.js:
--------------------------------------------------------------------------------
1 |
2 | const tokens = {
3 | admin: {
4 | token: 'admin-token'
5 | },
6 | editor: {
7 | token: 'editor-token'
8 | }
9 | }
10 |
11 | const users = {
12 | 'admin-token': {
13 | roles: ['admin'],
14 | introduction: 'I am a super administrator',
15 | avatar: 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif',
16 | name: 'Super Admin'
17 | },
18 | 'editor-token': {
19 | roles: ['editor'],
20 | introduction: 'I am an editor',
21 | avatar: 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif',
22 | name: 'Normal Editor'
23 | }
24 | }
25 |
26 | module.exports = [
27 | // user login
28 | {
29 | url: '/vue-admin-template/user/login',
30 | type: 'post',
31 | response: config => {
32 | const { username } = config.body
33 | const token = tokens[username]
34 |
35 | // mock error
36 | if (!token) {
37 | return {
38 | code: 60204,
39 | message: 'Account and password are incorrect.'
40 | }
41 | }
42 |
43 | return {
44 | code: 20000,
45 | data: token
46 | }
47 | }
48 | },
49 |
50 | // get user info
51 | {
52 | url: '/vue-admin-template/user/info\.*',
53 | type: 'get',
54 | response: config => {
55 | const { token } = config.query
56 | const info = users[token]
57 |
58 | // mock error
59 | if (!info) {
60 | return {
61 | code: 50008,
62 | message: 'Login failed, unable to get user details.'
63 | }
64 | }
65 |
66 | return {
67 | code: 20000,
68 | data: info
69 | }
70 | }
71 | },
72 |
73 | // user logout
74 | {
75 | url: '/vue-admin-template/user/logout',
76 | type: 'post',
77 | response: _ => {
78 | return {
79 | code: 20000,
80 | data: 'success'
81 | }
82 | }
83 | }
84 | ]
85 |
--------------------------------------------------------------------------------
/admin/stucompla-front-admin-feature-v0.0.1/mock/utils.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @param {string} url
3 | * @returns {Object}
4 | */
5 | function param2Obj(url) {
6 | const search = decodeURIComponent(url.split('?')[1]).replace(/\+/g, ' ')
7 | if (!search) {
8 | return {}
9 | }
10 | const obj = {}
11 | const searchArr = search.split('&')
12 | searchArr.forEach(v => {
13 | const index = v.indexOf('=')
14 | if (index !== -1) {
15 | const name = v.substring(0, index)
16 | const val = v.substring(index + 1, v.length)
17 | obj[name] = val
18 | }
19 | })
20 | return obj
21 | }
22 |
23 | module.exports = {
24 | param2Obj
25 | }
26 |
--------------------------------------------------------------------------------
/admin/stucompla-front-admin-feature-v0.0.1/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "vue-admin-template",
3 | "version": "4.4.0",
4 | "description": "A vue admin template with Element UI & axios & iconfont & permission control & lint",
5 | "author": "Pan ",
6 | "scripts": {
7 | "dev": "vue-cli-service serve",
8 | "build:prod": "vue-cli-service build",
9 | "build:stage": "vue-cli-service build --mode staging",
10 | "preview": "node build/index.js --preview",
11 | "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml",
12 | "lint": "eslint --ext .js,.vue src",
13 | "test:unit": "jest --clearCache && vue-cli-service test:unit",
14 | "test:ci": "npm run lint && npm run test:unit"
15 | },
16 | "dependencies": {
17 | "axios": "^0.27.2",
18 | "core-js": "3.6.5",
19 | "echarts": "4.2.1",
20 | "element-ui": "2.13.2",
21 | "file-saver": "2.0.1",
22 | "js-cookie": "2.2.0",
23 | "normalize.css": "7.0.0",
24 | "nprogress": "0.2.0",
25 | "path-to-regexp": "2.4.0",
26 | "vue": "2.6.10",
27 | "vue-router": "3.0.6",
28 | "vuex": "3.1.0",
29 | "xlsx": "0.14.1"
30 | },
31 | "devDependencies": {
32 | "@vue/cli-plugin-babel": "4.4.4",
33 | "@vue/cli-plugin-eslint": "4.4.4",
34 | "@vue/cli-plugin-unit-jest": "4.4.4",
35 | "@vue/cli-service": "4.4.4",
36 | "@vue/test-utils": "1.0.0-beta.29",
37 | "autoprefixer": "9.5.1",
38 | "babel-eslint": "10.1.0",
39 | "babel-jest": "23.6.0",
40 | "babel-plugin-dynamic-import-node": "2.3.3",
41 | "chalk": "2.4.2",
42 | "connect": "3.6.6",
43 | "eslint": "6.7.2",
44 | "eslint-plugin-vue": "6.2.2",
45 | "html-webpack-plugin": "3.2.0",
46 | "mockjs": "1.0.1-beta3",
47 | "runjs": "4.3.2",
48 | "less": "^3.0.4",
49 | "less-loader": "^5.0.0",
50 | "sass": "1.26.8",
51 | "sass-loader": "8.0.2",
52 | "script-ext-html-webpack-plugin": "2.1.3",
53 | "serve-static": "1.13.2",
54 | "svg-sprite-loader": "4.1.3",
55 | "svgo": "1.2.2",
56 | "vue-template-compiler": "2.6.10"
57 | },
58 | "browserslist": [
59 | "> 1%",
60 | "last 2 versions"
61 | ],
62 | "engines": {
63 | "node": ">=8.9",
64 | "npm": ">= 3.0.0"
65 | },
66 | "license": "MIT"
67 | }
68 |
--------------------------------------------------------------------------------
/admin/stucompla-front-admin-feature-v0.0.1/postcss.config.js:
--------------------------------------------------------------------------------
1 | // https://github.com/michael-ciniawsky/postcss-load-config
2 |
3 | module.exports = {
4 | 'plugins': {
5 | // to edit target browsers: use "browserslist" field in package.json
6 | 'autoprefixer': {}
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/admin/stucompla-front-admin-feature-v0.0.1/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ynwynw/stuSecond-public/20873a887926959a7f5e41c7f76d0eb7f0bc21eb/admin/stucompla-front-admin-feature-v0.0.1/public/favicon.ico
--------------------------------------------------------------------------------
/admin/stucompla-front-admin-feature-v0.0.1/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | <%= webpackConfig.name %>
9 |
10 |
11 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/admin/stucompla-front-admin-feature-v0.0.1/tests/unit/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | env: {
3 | jest: true
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/admin/stucompla-front-admin-feature-v0.0.1/tests/unit/components/Breadcrumb.spec.js:
--------------------------------------------------------------------------------
1 | import { mount, createLocalVue } from '@vue/test-utils'
2 | import VueRouter from 'vue-router'
3 | import ElementUI from 'element-ui'
4 | import Breadcrumb from '@/components/Breadcrumb/index.vue'
5 |
6 | const localVue = createLocalVue()
7 | localVue.use(VueRouter)
8 | localVue.use(ElementUI)
9 |
10 | const routes = [
11 | {
12 | path: '/',
13 | name: 'home',
14 | children: [{
15 | path: 'dashboard',
16 | name: 'dashboard'
17 | }]
18 | },
19 | {
20 | path: '/menu',
21 | name: 'menu',
22 | children: [{
23 | path: 'menu1',
24 | name: 'menu1',
25 | meta: { title: 'menu1' },
26 | children: [{
27 | path: 'menu1-1',
28 | name: 'menu1-1',
29 | meta: { title: 'menu1-1' }
30 | },
31 | {
32 | path: 'menu1-2',
33 | name: 'menu1-2',
34 | redirect: 'noredirect',
35 | meta: { title: 'menu1-2' },
36 | children: [{
37 | path: 'menu1-2-1',
38 | name: 'menu1-2-1',
39 | meta: { title: 'menu1-2-1' }
40 | },
41 | {
42 | path: 'menu1-2-2',
43 | name: 'menu1-2-2'
44 | }]
45 | }]
46 | }]
47 | }]
48 |
49 | const router = new VueRouter({
50 | routes
51 | })
52 |
53 | describe('Breadcrumb.vue', () => {
54 | const wrapper = mount(Breadcrumb, {
55 | localVue,
56 | router
57 | })
58 | it('dashboard', () => {
59 | router.push('/dashboard')
60 | const len = wrapper.findAll('.el-breadcrumb__inner').length
61 | expect(len).toBe(1)
62 | })
63 | it('normal route', () => {
64 | router.push('/menu/menu1')
65 | const len = wrapper.findAll('.el-breadcrumb__inner').length
66 | expect(len).toBe(2)
67 | })
68 | it('nested route', () => {
69 | router.push('/menu/menu1/menu1-2/menu1-2-1')
70 | const len = wrapper.findAll('.el-breadcrumb__inner').length
71 | expect(len).toBe(4)
72 | })
73 | it('no meta.title', () => {
74 | router.push('/menu/menu1/menu1-2/menu1-2-2')
75 | const len = wrapper.findAll('.el-breadcrumb__inner').length
76 | expect(len).toBe(3)
77 | })
78 | // it('click link', () => {
79 | // router.push('/menu/menu1/menu1-2/menu1-2-2')
80 | // const breadcrumbArray = wrapper.findAll('.el-breadcrumb__inner')
81 | // const second = breadcrumbArray.at(1)
82 | // console.log(breadcrumbArray)
83 | // const href = second.find('a').attributes().href
84 | // expect(href).toBe('#/menu/menu1')
85 | // })
86 | // it('noRedirect', () => {
87 | // router.push('/menu/menu1/menu1-2/menu1-2-1')
88 | // const breadcrumbArray = wrapper.findAll('.el-breadcrumb__inner')
89 | // const redirectBreadcrumb = breadcrumbArray.at(2)
90 | // expect(redirectBreadcrumb.contains('a')).toBe(false)
91 | // })
92 | it('last breadcrumb', () => {
93 | router.push('/menu/menu1/menu1-2/menu1-2-1')
94 | const breadcrumbArray = wrapper.findAll('.el-breadcrumb__inner')
95 | const redirectBreadcrumb = breadcrumbArray.at(3)
96 | expect(redirectBreadcrumb.contains('a')).toBe(false)
97 | })
98 | })
99 |
--------------------------------------------------------------------------------
/admin/stucompla-front-admin-feature-v0.0.1/tests/unit/components/Hamburger.spec.js:
--------------------------------------------------------------------------------
1 | import { shallowMount } from '@vue/test-utils'
2 | import Hamburger from '@/components/Hamburger/index.vue'
3 | describe('Hamburger.vue', () => {
4 | it('toggle click', () => {
5 | const wrapper = shallowMount(Hamburger)
6 | const mockFn = jest.fn()
7 | wrapper.vm.$on('toggleClick', mockFn)
8 | wrapper.find('.hamburger').trigger('click')
9 | expect(mockFn).toBeCalled()
10 | })
11 | it('prop isActive', () => {
12 | const wrapper = shallowMount(Hamburger)
13 | wrapper.setProps({ isActive: true })
14 | expect(wrapper.contains('.is-active')).toBe(true)
15 | wrapper.setProps({ isActive: false })
16 | expect(wrapper.contains('.is-active')).toBe(false)
17 | })
18 | })
19 |
--------------------------------------------------------------------------------
/admin/stucompla-front-admin-feature-v0.0.1/tests/unit/components/SvgIcon.spec.js:
--------------------------------------------------------------------------------
1 | import { shallowMount } from '@vue/test-utils'
2 | import SvgIcon from '@/components/SvgIcon/index.vue'
3 | describe('SvgIcon.vue', () => {
4 | it('iconClass', () => {
5 | const wrapper = shallowMount(SvgIcon, {
6 | propsData: {
7 | iconClass: 'test'
8 | }
9 | })
10 | expect(wrapper.find('use').attributes().href).toBe('#icon-test')
11 | })
12 | it('className', () => {
13 | const wrapper = shallowMount(SvgIcon, {
14 | propsData: {
15 | iconClass: 'test'
16 | }
17 | })
18 | expect(wrapper.classes().length).toBe(1)
19 | wrapper.setProps({ className: 'test' })
20 | expect(wrapper.classes().includes('test')).toBe(true)
21 | })
22 | })
23 |
--------------------------------------------------------------------------------
/admin/stucompla-front-admin-feature-v0.0.1/tests/unit/utils/formatTime.spec.js:
--------------------------------------------------------------------------------
1 | import { formatTime } from '@/utils/index.js'
2 |
3 | describe('Utils:formatTime', () => {
4 | const d = new Date('2018-07-13 17:54:01') // "2018-07-13 17:54:01"
5 | const retrofit = 5 * 1000
6 |
7 | it('ten digits timestamp', () => {
8 | expect(formatTime((d / 1000).toFixed(0))).toBe('7月13日17时54分')
9 | })
10 | it('test now', () => {
11 | expect(formatTime(+new Date() - 1)).toBe('刚刚')
12 | })
13 | it('less two minute', () => {
14 | expect(formatTime(+new Date() - 60 * 2 * 1000 + retrofit)).toBe('2分钟前')
15 | })
16 | it('less two hour', () => {
17 | expect(formatTime(+new Date() - 60 * 60 * 2 * 1000 + retrofit)).toBe('2小时前')
18 | })
19 | it('less one day', () => {
20 | expect(formatTime(+new Date() - 60 * 60 * 24 * 1 * 1000)).toBe('1天前')
21 | })
22 | it('more than one day', () => {
23 | expect(formatTime(d)).toBe('7月13日17时54分')
24 | })
25 | it('format', () => {
26 | expect(formatTime(d, '{y}-{m}-{d} {h}:{i}')).toBe('2018-07-13 17:54')
27 | expect(formatTime(d, '{y}-{m}-{d}')).toBe('2018-07-13')
28 | expect(formatTime(d, '{y}/{m}/{d} {h}-{i}')).toBe('2018/07/13 17-54')
29 | })
30 | })
31 |
--------------------------------------------------------------------------------
/admin/stucompla-front-admin-feature-v0.0.1/tests/unit/utils/param2Obj.spec.js:
--------------------------------------------------------------------------------
1 | import { param2Obj } from '@/utils/index.js'
2 | describe('Utils:param2Obj', () => {
3 | const url = 'https://github.com/PanJiaChen/vue-element-admin?name=bill&age=29&sex=1&field=dGVzdA==&key=%E6%B5%8B%E8%AF%95'
4 |
5 | it('param2Obj test', () => {
6 | expect(param2Obj(url)).toEqual({
7 | name: 'bill',
8 | age: '29',
9 | sex: '1',
10 | field: window.btoa('test'),
11 | key: '测试'
12 | })
13 | })
14 | })
15 |
--------------------------------------------------------------------------------
/admin/stucompla-front-admin-feature-v0.0.1/tests/unit/utils/parseTime.spec.js:
--------------------------------------------------------------------------------
1 | import { parseTime } from '@/utils/index.js'
2 |
3 | describe('Utils:parseTime', () => {
4 | const d = new Date('2018-07-13 17:54:01') // "2018-07-13 17:54:01"
5 | it('timestamp', () => {
6 | expect(parseTime(d)).toBe('2018-07-13 17:54:01')
7 | })
8 | it('timestamp string', () => {
9 | expect(parseTime((d + ''))).toBe('2018-07-13 17:54:01')
10 | })
11 | it('ten digits timestamp', () => {
12 | expect(parseTime((d / 1000).toFixed(0))).toBe('2018-07-13 17:54:01')
13 | })
14 | it('new Date', () => {
15 | expect(parseTime(new Date(d))).toBe('2018-07-13 17:54:01')
16 | })
17 | it('format', () => {
18 | expect(parseTime(d, '{y}-{m}-{d} {h}:{i}')).toBe('2018-07-13 17:54')
19 | expect(parseTime(d, '{y}-{m}-{d}')).toBe('2018-07-13')
20 | expect(parseTime(d, '{y}/{m}/{d} {h}-{i}')).toBe('2018/07/13 17-54')
21 | })
22 | it('get the day of the week', () => {
23 | expect(parseTime(d, '{a}')).toBe('五') // 星期五
24 | })
25 | it('get the day of the week', () => {
26 | expect(parseTime(+d + 1000 * 60 * 60 * 24 * 2, '{a}')).toBe('日') // 星期日
27 | })
28 | it('empty argument', () => {
29 | expect(parseTime()).toBeNull()
30 | })
31 |
32 | it('null', () => {
33 | expect(parseTime(null)).toBeNull()
34 | })
35 | })
36 |
--------------------------------------------------------------------------------
/admin/stucompla-front-admin-feature-v0.0.1/tests/unit/utils/validate.spec.js:
--------------------------------------------------------------------------------
1 | import { validUsername, isExternal } from '@/utils/validate.js'
2 |
3 | describe('Utils:validate', () => {
4 | it('validUsername', () => {
5 | expect(validUsername('admin')).toBe(true)
6 | expect(validUsername('editor')).toBe(true)
7 | expect(validUsername('xxxx')).toBe(false)
8 | })
9 | it('isExternal', () => {
10 | expect(isExternal('https://github.com/PanJiaChen/vue-element-admin')).toBe(true)
11 | expect(isExternal('http://github.com/PanJiaChen/vue-element-admin')).toBe(true)
12 | expect(isExternal('github.com/PanJiaChen/vue-element-admin')).toBe(false)
13 | expect(isExternal('/dashboard')).toBe(false)
14 | expect(isExternal('./dashboard')).toBe(false)
15 | expect(isExternal('dashboard')).toBe(false)
16 | })
17 | })
18 |
--------------------------------------------------------------------------------
/admin/stucompla-front-admin-feature-v0.0.1/vue.config.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | const path = require('path')
3 | const defaultSettings = require('./src/settings.js')
4 |
5 | function resolve(dir) {
6 | return path.join(__dirname, dir)
7 | }
8 |
9 | const name = defaultSettings.title || 'vue Admin Template' // page title
10 |
11 | // If your port is set to 80,
12 | // use administrator privileges to execute the command line.
13 | // For example, Mac: sudo npm run
14 | // You can change the port by the following methods:
15 | // port = 9528 npm run dev OR npm run dev --port = 9528
16 | const port = process.env.port || process.env.npm_config_port || 9528 // dev port
17 |
18 | // All configuration item explanations can be find in https://cli.vuejs.org/config/
19 | module.exports = {
20 | /**
21 | * You will need to set publicPath if you plan to deploy your site under a sub path,
22 | * for example GitHub Pages. If you plan to deploy your site to https://foo.github.io/bar/,
23 | * then publicPath should be set to "/bar/".
24 | * In most cases please use '/' !!!
25 | * Detail: https://cli.vuejs.org/config/#publicpath
26 | */
27 | publicPath: '/',
28 | outputDir: 'dist',
29 | assetsDir: 'static',
30 | // 关闭协同开发
31 | // lintOnSave: process.env.NODE_ENV === 'development',
32 | lintOnSave: false,
33 | productionSourceMap: false,
34 | devServer: {
35 | port: port,
36 | open: true,
37 | overlay: {
38 | warnings: false,
39 | errors: true
40 | },
41 | proxy: {
42 | // 配置跨域
43 | [process.env.VUE_APP_BASE_API]: {
44 | target: 'http://localhost:8086',
45 | // ws: true,
46 | changeOrigin: true,
47 | pathRewrite: {
48 | ['^' + process.env.VUE_APP_BASE_API]: ''
49 | }
50 | }
51 | }
52 | // 关闭mock
53 | // before: require('./mock/mock-server.js')
54 | },
55 | configureWebpack: {
56 | // provide the app's title in webpack's name field, so that
57 | // it can be accessed in index.html to inject the correct title.
58 | name: name,
59 | resolve: {
60 | alias: {
61 | '@': resolve('src')
62 | }
63 | }
64 | },
65 | chainWebpack(config) {
66 | // it can improve the speed of the first screen, it is recommended to turn on preload
67 | config.plugin('preload').tap(() => [
68 | {
69 | rel: 'preload',
70 | // to ignore runtime.js
71 | // https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/cli-service/lib/config/app.js#L171
72 | fileBlacklist: [/\.map$/, /hot-update\.js$/, /runtime\..*\.js$/],
73 | include: 'initial'
74 | }
75 | ])
76 |
77 | // when there are many pages, it will cause too many meaningless requests
78 | config.plugins.delete('prefetch')
79 |
80 | // set svg-sprite-loader
81 | config.module
82 | .rule('svg')
83 | .exclude.add(resolve('src/icons'))
84 | .end()
85 | config.module
86 | .rule('icons')
87 | .test(/\.svg$/)
88 | .include.add(resolve('src/icons'))
89 | .end()
90 | .use('svg-sprite-loader')
91 | .loader('svg-sprite-loader')
92 | .options({
93 | symbolId: 'icon-[name]'
94 | })
95 | .end()
96 |
97 | config
98 | .when(process.env.NODE_ENV !== 'development',
99 | config => {
100 | config
101 | .plugin('ScriptExtHtmlWebpackPlugin')
102 | .after('html')
103 | .use('script-ext-html-webpack-plugin', [{
104 | // `runtime` must same as runtimeChunk name. default is `runtime`
105 | inline: /runtime\..*\.js$/
106 | }])
107 | .end()
108 | config
109 | .optimization.splitChunks({
110 | chunks: 'all',
111 | cacheGroups: {
112 | libs: {
113 | name: 'chunk-libs',
114 | test: /[\\/]node_modules[\\/]/,
115 | priority: 10,
116 | chunks: 'initial' // only package third parties that are initially dependent
117 | },
118 | elementUI: {
119 | name: 'chunk-elementUI', // split elementUI into a single package
120 | priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
121 | test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm
122 | },
123 | commons: {
124 | name: 'chunk-commons',
125 | test: resolve('src/components'), // can customize your rules
126 | minChunks: 3, // minimum common number
127 | priority: 5,
128 | reuseExistingChunk: true
129 | }
130 | }
131 | })
132 | // https:// webpack.js.org/configuration/optimization/#optimizationruntimechunk
133 | config.optimization.runtimeChunk('single')
134 | }
135 | )
136 | }
137 | }
138 |
--------------------------------------------------------------------------------
/picture/picture1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ynwynw/stuSecond-public/20873a887926959a7f5e41c7f76d0eb7f0bc21eb/picture/picture1.png
--------------------------------------------------------------------------------
/picture/picture10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ynwynw/stuSecond-public/20873a887926959a7f5e41c7f76d0eb7f0bc21eb/picture/picture10.png
--------------------------------------------------------------------------------
/picture/picture11.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ynwynw/stuSecond-public/20873a887926959a7f5e41c7f76d0eb7f0bc21eb/picture/picture11.png
--------------------------------------------------------------------------------
/picture/picture12.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ynwynw/stuSecond-public/20873a887926959a7f5e41c7f76d0eb7f0bc21eb/picture/picture12.png
--------------------------------------------------------------------------------
/picture/picture13.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ynwynw/stuSecond-public/20873a887926959a7f5e41c7f76d0eb7f0bc21eb/picture/picture13.png
--------------------------------------------------------------------------------
/picture/picture14.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ynwynw/stuSecond-public/20873a887926959a7f5e41c7f76d0eb7f0bc21eb/picture/picture14.png
--------------------------------------------------------------------------------
/picture/picture15.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ynwynw/stuSecond-public/20873a887926959a7f5e41c7f76d0eb7f0bc21eb/picture/picture15.png
--------------------------------------------------------------------------------
/picture/picture16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ynwynw/stuSecond-public/20873a887926959a7f5e41c7f76d0eb7f0bc21eb/picture/picture16.png
--------------------------------------------------------------------------------
/picture/picture17.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ynwynw/stuSecond-public/20873a887926959a7f5e41c7f76d0eb7f0bc21eb/picture/picture17.png
--------------------------------------------------------------------------------
/picture/picture18.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ynwynw/stuSecond-public/20873a887926959a7f5e41c7f76d0eb7f0bc21eb/picture/picture18.png
--------------------------------------------------------------------------------
/picture/picture19.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ynwynw/stuSecond-public/20873a887926959a7f5e41c7f76d0eb7f0bc21eb/picture/picture19.png
--------------------------------------------------------------------------------
/picture/picture2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ynwynw/stuSecond-public/20873a887926959a7f5e41c7f76d0eb7f0bc21eb/picture/picture2.png
--------------------------------------------------------------------------------
/picture/picture20.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ynwynw/stuSecond-public/20873a887926959a7f5e41c7f76d0eb7f0bc21eb/picture/picture20.png
--------------------------------------------------------------------------------
/picture/picture21.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ynwynw/stuSecond-public/20873a887926959a7f5e41c7f76d0eb7f0bc21eb/picture/picture21.png
--------------------------------------------------------------------------------
/picture/picture22.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ynwynw/stuSecond-public/20873a887926959a7f5e41c7f76d0eb7f0bc21eb/picture/picture22.png
--------------------------------------------------------------------------------
/picture/picture3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ynwynw/stuSecond-public/20873a887926959a7f5e41c7f76d0eb7f0bc21eb/picture/picture3.png
--------------------------------------------------------------------------------
/picture/picture4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ynwynw/stuSecond-public/20873a887926959a7f5e41c7f76d0eb7f0bc21eb/picture/picture4.png
--------------------------------------------------------------------------------
/picture/picture5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ynwynw/stuSecond-public/20873a887926959a7f5e41c7f76d0eb7f0bc21eb/picture/picture5.png
--------------------------------------------------------------------------------
/picture/picture6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ynwynw/stuSecond-public/20873a887926959a7f5e41c7f76d0eb7f0bc21eb/picture/picture6.png
--------------------------------------------------------------------------------
/picture/picture7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ynwynw/stuSecond-public/20873a887926959a7f5e41c7f76d0eb7f0bc21eb/picture/picture7.png
--------------------------------------------------------------------------------
/picture/picture8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ynwynw/stuSecond-public/20873a887926959a7f5e41c7f76d0eb7f0bc21eb/picture/picture8.png
--------------------------------------------------------------------------------
/picture/picture9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ynwynw/stuSecond-public/20873a887926959a7f5e41c7f76d0eb7f0bc21eb/picture/picture9.png
--------------------------------------------------------------------------------
/stucompla-front-feature-v0.0.1/.editorconfig:
--------------------------------------------------------------------------------
1 | [*.{js,jsx,ts,tsx,vue}]
2 | indent_style = space
3 | indent_size = 2
4 | trim_trailing_whitespace = true
5 | insert_final_newline = true
6 |
--------------------------------------------------------------------------------
/stucompla-front-feature-v0.0.1/.eslintignore:
--------------------------------------------------------------------------------
1 | build/*.js
2 | config/*.js
3 |
--------------------------------------------------------------------------------
/stucompla-front-feature-v0.0.1/.eslintrc.js:
--------------------------------------------------------------------------------
1 | // http://eslint.org/docs/user-guide/configuring
2 |
3 | module.exports = {
4 | root: true,
5 | parser: "babel-eslint",
6 | parserOptions: {
7 | sourceType: "module"
8 | },
9 | env: {
10 | browser: true
11 | },
12 | // https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
13 | extends: ["plugin:vue/recommended"],
14 | // required to lint *.vue files
15 | plugins: ["Vue"],
16 | // add your custom rules here
17 | rules: {
18 | // allow paren-less arrow functions
19 | "arrow-parens": 0,
20 | // allow async-await
21 | "generator-star-spacing": 0,
22 | // allow debugger during development
23 | "no-debugger": process.env.NODE_ENV === "production" ? 2 : 0,
24 | "no-trailing-spaces": 1,
25 | quotes: "off",
26 | semi: "off",
27 | "comma-dangle": "off"
28 | }
29 | };
30 | // module.exports = {
31 | // extends: ["plugin:vue/recommended"]
32 | // };
33 |
--------------------------------------------------------------------------------
/stucompla-front-feature-v0.0.1/.gitignore:
--------------------------------------------------------------------------------
1 | # Compiled class file
2 | *.class
3 |
4 | # Log file
5 | *.log
6 |
7 | # BlueJ files
8 | *.ctxt
9 |
10 | # Mobile Tools for Java (J2ME)
11 | .mtj.tmp/
12 |
13 | # Package Files #
14 | *.jar
15 | *.war
16 | *.nar
17 | *.ear
18 | *.zip
19 | *.tar.gz
20 | *.rar
21 |
22 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
23 | hs_err_pid*
24 |
25 | #忽略所有.idea目录
26 | .idea/
27 |
28 | #忽略所有node_modules目录
29 | node_modules/
--------------------------------------------------------------------------------
/stucompla-front-feature-v0.0.1/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022 Zakiro
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/stucompla-front-feature-v0.0.1/README.md:
--------------------------------------------------------------------------------
1 | # stucompla-front
2 |
3 | 基于 Springboot+Vue 的 stucompla 前台项目
4 |
5 | # 简介
6 |
7 | 这是集校园二手交易、校园交流论坛、校园表白墙为一体的项目。
8 |
9 | # 分支
10 |
11 | 分支见“feature-v0.0.1”
12 |
13 | # 前端项目地址
14 |
15 | ## 基于 Springboot 的 stucompla 后端项目
16 |
17 | https://github.com/ynwynw/stucompla-rear2
18 |
19 | ## 基于 Springboot 的 stucompla 后台管理系统前端项目
20 |
21 | https://github.com/ynwynw/stucompla-front-admin
22 |
--------------------------------------------------------------------------------
/stucompla-front-feature-v0.0.1/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: [
3 | '@vue/cli-plugin-babel/preset'
4 | ],
5 | plugins: [
6 | // [
7 | // 'component',
8 | // {
9 | // libraryName: 'element-ui',
10 | // styleLibraryName: 'theme-chalk'
11 | // }
12 | // ],
13 | // 路由懒加载
14 | '@babel/plugin-syntax-dynamic-import'
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/stucompla-front-feature-v0.0.1/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "stucompla-front",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "dev": "vue-cli-service serve",
7 | "build": "vue-cli-service build",
8 | "lint": "vue-cli-service lint"
9 | },
10 | "dependencies": {
11 | "animate.css": "^4.1.1",
12 | "axios": "^0.21.4",
13 | "core-js": "^3.6.5",
14 | "element-ui": "^2.15.6",
15 | "js-cookie": "^2.2.0",
16 | "mavon-editor": "^2.10.4",
17 | "vue": "^2.6.11",
18 | "vue-router": "^3.2.0",
19 | "vue-scrollto": "^2.20.0",
20 | "vuex": "^3.4.0",
21 | "wangeditor": "^4.7.11"
22 | },
23 | "devDependencies": {
24 | "@babel/plugin-syntax-dynamic-import": "^7.8.3",
25 | "@vue/cli-plugin-babel": "~4.5.0",
26 | "@vue/cli-plugin-eslint": "~4.5.0",
27 | "@vue/cli-plugin-router": "~4.5.0",
28 | "@vue/cli-plugin-vuex": "~4.5.0",
29 | "@vue/cli-service": "~4.5.0",
30 | "@vue/eslint-config-standard": "^5.1.2",
31 | "babel-eslint": "^10.1.0",
32 | "compression-webpack-plugin": "^6.1.1",
33 | "eslint": "^6.7.2",
34 | "eslint-plugin-import": "^2.20.2",
35 | "eslint-plugin-node": "^11.1.0",
36 | "eslint-plugin-promise": "^4.2.1",
37 | "eslint-plugin-standard": "^4.0.0",
38 | "eslint-plugin-vue": "^6.2.2",
39 | "image-webpack-loader": "^7.0.1",
40 | "less": "^3.0.4",
41 | "less-loader": "^5.0.0",
42 | "sass": "1.26.8",
43 | "sass-loader": "8.0.2",
44 | "style-resources-loader": "^1.4.1",
45 | "uglifyjs-webpack-plugin": "^2.2.0",
46 | "vue-cli-plugin-style-resources-loader": "~0.1.5",
47 | "vue-template-compiler": "^2.6.11"
48 | },
49 | "eslintConfig": {
50 | "root": true,
51 | "env": {
52 | "node": true
53 | },
54 | "extends": [
55 | "plugin:vue/essential",
56 | "@vue/standard"
57 | ],
58 | "parserOptions": {
59 | "parser": "babel-eslint"
60 | },
61 | "rules": {}
62 | },
63 | "browserslist": [
64 | "> 1%",
65 | "last 2 versions",
66 | "not dead"
67 | ]
68 | }
69 |
--------------------------------------------------------------------------------
/stucompla-front-feature-v0.0.1/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | <%= htmlWebpackPlugin.options.title %>
9 |
10 | <% for (var i in
11 | htmlWebpackPlugin.options.cdn&&htmlWebpackPlugin.options.cdn.css) { %>
12 |
13 |
14 | <% } %>
15 |
16 | <% for (var i in
17 | htmlWebpackPlugin.options.cdn&&htmlWebpackPlugin.options.cdn.js) { %>
18 |
19 | <% } %>
20 |
21 |
22 |
23 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/stucompla-front-feature-v0.0.1/public/xanadu.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ynwynw/stuSecond-public/20873a887926959a7f5e41c7f76d0eb7f0bc21eb/stucompla-front-feature-v0.0.1/public/xanadu.ico
--------------------------------------------------------------------------------
/stucompla-front-feature-v0.0.1/vue.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path')
2 | const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
3 | const CompressionWebpackPlugin = require('compression-webpack-plugin') // 开启压缩
4 | const isProduction = process.env.NODE_ENV === 'production'
5 |
6 | // 优化打包
7 | // externals
8 | const externals = {
9 | vue: 'Vue',
10 | 'vue-router': 'VueRouter',
11 | vuex: 'Vuex',
12 | 'element-ui': 'ElementUI',
13 | // 'mavon-editor': 'mavonEditor',
14 | axios: 'axios'
15 | }
16 | const cdn = {
17 | // 开发环境
18 | dev: {
19 | css: [],
20 | js: []
21 | },
22 | // 生产环境
23 | build: {
24 | css: [
25 | 'https://cdn.jsdelivr.net/npm/element-ui@2.15.1/lib/theme-chalk/index.css',
26 | 'https://cdn.jsdelivr.net/npm/element-ui@2.15.1/lib/theme-chalk/display.css',
27 | 'https://cdn.jsdelivr.net/npm/mavon-editor@2.9.1/dist/css/index.css'
28 | ],
29 | js: [
30 | 'https://cdn.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js',
31 | 'https://cdn.jsdelivr.net/npm/vue-router@3.2.0/dist/vue-router.min.js',
32 | 'https://cdn.jsdelivr.net/npm/vuex@3.4.0/dist/vuex.min.js',
33 | 'https://cdn.jsdelivr.net/npm/element-ui@2.15.1/lib/index.js',
34 | // 'https://cdn.jsdelivr.net/npm/mavon-editor@2.9.1/dist/mavon-editor.min.js',
35 | 'https://cdn.jsdelivr.net/npm/axios@0.18.0/dist/axios.min.js'
36 | // 'https://unpkg.com/element-ui/lib/index.js'
37 | ]
38 | }
39 | }
40 |
41 | module.exports = {
42 | publicPath: '/',
43 | devServer: {
44 | // 修改完配置文件后,一定要记得重启项目,否则修改不会生效
45 | proxy: {
46 | '/dev_api': {
47 | target: 'http://localhost:8086/',
48 | // ws: true,
49 | changeOrigin: true,
50 | pathRewrite: {
51 | '^/dev_api': ''
52 | }
53 | }
54 | }
55 | },
56 | // 优化打包
57 | // 去除生产环境的productionSourceMap
58 | productionSourceMap: false,
59 | configureWebpack: config => {
60 | // 为生产环境修改配置...
61 | // 去除console.log打印以及注释
62 | const plugins = []
63 | if (isProduction) {
64 | plugins.push(
65 | new UglifyJsPlugin({
66 | uglifyOptions: {
67 | output: {
68 | comments: false // 去掉注释
69 | },
70 | warnings: false,
71 | compress: {
72 | drop_console: true,
73 | drop_debugger: false,
74 | pure_funcs: ['console.log']// 移除console
75 | }
76 | }
77 | })
78 | )
79 | plugins.push(
80 | new CompressionWebpackPlugin({
81 | algorithm: 'gzip',
82 | test: /\.(js|css)$/, // 匹配文件名
83 | threshold: 10000, // 对超过10k的数据压缩
84 | deleteOriginalAssets: false, // 不删除源文件
85 | minRatio: 0.8 // 压缩比
86 | })
87 | )
88 | // 打包时npm包转CDN
89 | config.externals = externals
90 | }
91 | return { plugins }
92 | },
93 | chainWebpack: config => {
94 | config.when(process.env.NODE_ENV === 'production', config => {
95 | config.entry('app').clear().add('./src/main-prod.js')
96 | /**
97 | * 添加CDN参数到htmlWebpackPlugin配置中
98 | */
99 | config.plugin('html').tap(args => {
100 | args[0].cdn = cdn.build
101 | args[0].title = 'Xanadu'
102 | return args
103 | })
104 | // 压缩图片
105 | config.module
106 | .rule('images')
107 | .use('image-webpack-loader')
108 | .loader('image-webpack-loader')
109 | .options({ bypassOnDebug: true })
110 | .end()
111 | })
112 | // 开发阶段
113 | config.when(process.env.NODE_ENV === 'development', config => {
114 | config.entry('app').clear().add('./src/main-dev.js')
115 | config.plugin('html').tap(args => {
116 | args[0].cdn = cdn.dev
117 | args[0].title = 'Dev-Xanadu'
118 | return args
119 | })
120 | })
121 | },
122 | pluginOptions: {
123 | 'style-resources-loader': {
124 | preProcessor: 'less',
125 | patterns: [
126 | path.resolve(__dirname, 'src/assets/style/variable.less')
127 | ]
128 | }
129 | }
130 | }
131 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/.gitignore:
--------------------------------------------------------------------------------
1 | # Compiled class file
2 | *.class
3 |
4 | # Log file
5 | *.log
6 |
7 | # BlueJ files
8 | *.ctxt
9 |
10 | # Mobile Tools for Java (J2ME)
11 | .mtj.tmp/
12 |
13 | # Package Files #
14 | *.jar
15 | *.war
16 | *.nar
17 | *.ear
18 | *.zip
19 | *.tar.gz
20 | *.rar
21 |
22 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
23 | hs_err_pid*
24 |
25 | #忽略所有.svn目录
26 | .svn/
27 | #忽略所有target目录
28 | target/
29 | #忽略所有.idea目录
30 | .idea/
31 | #忽略所有.iml文件
32 | *.iml
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/HELP.md:
--------------------------------------------------------------------------------
1 | # Getting Started
2 |
3 | ### Reference Documentation
4 |
5 | For further reference, please consider the following sections:
6 |
7 | * [Official Apache Maven documentation](https://maven.apache.org/guides/index.html)
8 | * [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.5.7/maven-plugin/reference/html/)
9 | * [Create an OCI image](https://docs.spring.io/spring-boot/docs/2.5.7/maven-plugin/reference/html/#build-image)
10 | * [Spring Web](https://docs.spring.io/spring-boot/docs/2.6.1/reference/htmlsingle/#boot-features-developing-web-applications)
11 |
12 | ### Guides
13 |
14 | The following guides illustrate how to use some features concretely:
15 |
16 | * [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/)
17 | * [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/)
18 | * [Building REST services with Spring](https://spring.io/guides/tutorials/bookmarks/)
19 |
20 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022 1452162669
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/README.md:
--------------------------------------------------------------------------------
1 | **需要完整代码可以加扣扣 931708230 或者加卫星 ynwwxid**
2 | **需要完整代码可以加扣扣 931708230 或者加卫星 ynwwxid**
3 |
4 | #校园二手交易和交流论坛系统 #java web #java #毕业设计 #课程设计 #mybatis #Springboot #vue #mysql #源代码
5 |
6 | ## 基于Springboot+vue的校园二手交易和交流论坛系统(源代码+数据库)
7 |
8 | ## 一、系统介绍
9 |
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 | ## 二、所用技术
35 |
36 | 后端技术栈:
37 |
38 | - springboot
39 | - mybatis-plus
40 | - mysql
41 | - shiro
42 | - redis
43 | - jwt
44 |
45 | 前端技术栈:
46 |
47 | - vue全家桶
48 | - elment-ui
49 | - echarts
50 | - axios
51 |
52 | ## 三、环境介绍
53 |
54 | 基础环境 :IDEA/eclipse, JDK 1.8, Mysql5.7及以上,Node.js,Maven
55 |
56 | 所有项目以及源代码本人均调试运行无问题 可支持远程调试运行
57 |
58 | ## 四、页面截图
59 |
60 | 
61 |
62 | 
63 |
64 | 
65 |
66 | 
67 |
68 | 
69 |
70 | 
71 |
72 | 
73 |
74 | 
75 |
76 | 
77 |
78 | 
79 |
80 | 
81 |
82 | 
83 |
84 | 
85 |
86 | 
87 |
88 | 
89 |
90 | 
91 |
92 | 
93 |
94 | 
95 |
96 | 
97 |
98 | 
99 |
100 | 
101 |
102 | 
103 |
104 |
105 | ## 五、浏览地址
106 |
107 | 前端访问地址:http://localhost:8080/
108 |
109 | 用户账号/密码:test1/123456
110 |
111 | 后台管理地址:http://localhost:9528/
112 |
113 | 管理员账号/密码:xzj4/123456
114 |
115 | ## 六、安装教程
116 |
117 | 1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
118 | 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;
119 | 若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行;
120 | 3. 修改application.yml 里面的数据库配置和redis配置和文件路径配置
121 | 4. 启动项目后端项目
122 | 5. vscode打开admin和stucompla-front-feature-v0.0.1项目,
123 | 6. 打开终端,执行npm install 依赖下载完成后执行 npm run dev,执行成功后会显示访问地址
124 | 7. 分别访问 后台管理http://localhost:9528/ 和 前台页面http://localhost:8080/
125 |
126 | **需要完整代码可以加扣扣 931708230 或者加卫星 ynwwxid**
127 |
128 | **需要完整代码可以加扣扣 931708230 或者加卫星 ynwwxid**
129 |
130 |
131 |
132 |
133 |
134 |
135 | # 前端项目地址
136 | ## 基于Springboot+Vue的stucompla前台项目前端
137 | https://github.com/ynwynw/stuSecond-public/tree/master/stucompla-front-feature-v0.0.1
138 | ## 基于Springboot的stucompla后台管理系统前端项目
139 | https://github.com/ynwynw/stuSecond-public/tree/master/admin/stucompla-front-admin-feature-v0.0.1
140 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 | org.springframework.boot
7 | spring-boot-starter-parent
8 | 2.5.7
9 |
10 |
11 | com.mrxu
12 | stucompla-rear2
13 | 0.0.1-SNAPSHOT
14 | stucompla-rear2
15 | Demo project for Spring Boot
16 |
17 | 1.8
18 |
19 |
20 |
21 |
22 |
23 | com.alibaba
24 | fastjson
25 | 1.2.4
26 |
27 |
28 |
29 |
30 | org.springframework.boot
31 | spring-boot-starter-data-redis
32 |
33 |
34 |
35 |
36 | org.springframework.boot
37 | spring-boot-devtools
38 | runtime
39 | true
40 |
41 |
42 |
43 |
44 | mysql
45 | mysql-connector-java
46 | runtime
47 |
48 |
49 |
50 |
51 | org.projectlombok
52 | lombok
53 | true
54 |
55 |
56 |
57 |
58 | org.apache.shiro
59 | shiro-spring
60 | 1.3.2
61 |
62 |
63 |
64 |
65 | com.auth0
66 | java-jwt
67 | 3.4.1
68 |
69 |
70 |
71 |
72 | com.baomidou
73 | mybatis-plus-boot-starter
74 | 3.4.3.4
75 |
76 |
77 |
78 |
79 | com.baomidou
80 | mybatis-plus-generator
81 | 3.4.1
82 |
83 |
84 |
85 | org.freemarker
86 | freemarker
87 |
88 |
89 |
90 |
91 | io.springfox
92 | springfox-boot-starter
93 | 3.0.0
94 |
95 |
96 |
103 |
104 | commons-lang
105 | commons-lang
106 | 2.6
107 |
108 |
109 |
110 | org.springframework.boot
111 | spring-boot-starter-web
112 |
113 |
114 |
115 | org.springframework.boot
116 | spring-boot-starter-test
117 | test
118 |
119 |
120 |
121 |
122 |
123 |
124 | org.springframework.boot
125 | spring-boot-maven-plugin
126 |
127 |
128 |
129 |
130 |
131 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/StucomplaRear2Application.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2;
2 |
3 | import com.mrxu.stucomplarear2.utils.IdWorker;
4 | import lombok.extern.slf4j.Slf4j;
5 | import org.mybatis.spring.annotation.MapperScan;
6 | import org.springframework.boot.SpringApplication;
7 | import org.springframework.boot.autoconfigure.SpringBootApplication;
8 | import org.springframework.context.annotation.Bean;
9 |
10 | @Slf4j
11 | @SpringBootApplication
12 | @MapperScan("com.mrxu.stucomplarear2.mapper")
13 | public class StucomplaRear2Application {
14 |
15 | public static void main(String[] args) {
16 | SpringApplication.run(StucomplaRear2Application.class, args);
17 | }
18 |
19 | @Bean
20 | public IdWorker createIdWorker(){
21 | return new IdWorker(0,1);
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/controller/CategoryController.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.controller;
2 |
3 |
4 | import com.mrxu.stucomplarear2.service.CategoryService;
5 | import com.mrxu.stucomplarear2.utils.response.Result;
6 | import io.swagger.annotations.ApiOperation;
7 | import org.springframework.beans.factory.annotation.Autowired;
8 | import org.springframework.web.bind.annotation.GetMapping;
9 | import org.springframework.web.bind.annotation.RequestMapping;
10 | import org.springframework.web.bind.annotation.RestController;
11 |
12 | /**
13 | *
14 | * 前端控制器
15 | *
16 | *
17 | * @author Mr.Xu
18 | * @since 2021-12-27
19 | */
20 | @RestController
21 | @RequestMapping("/category")
22 | public class CategoryController {
23 |
24 | @Autowired
25 | private CategoryService categoryService;
26 |
27 | @ApiOperation("种类列表")
28 | @GetMapping("/list")
29 | public Result listCategories() {
30 | return categoryService.listCategories();
31 | }
32 |
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/controller/CollectController.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.controller;
2 |
3 |
4 | import com.mrxu.stucomplarear2.dto.CollectFindDto;
5 | import com.mrxu.stucomplarear2.mapper.PostMapper;
6 | import com.mrxu.stucomplarear2.service.CollectService;
7 | import com.mrxu.stucomplarear2.utils.response.Result;
8 | import io.swagger.annotations.ApiOperation;
9 | import org.apache.shiro.authz.annotation.RequiresRoles;
10 | import org.springframework.web.bind.annotation.*;
11 |
12 | import javax.annotation.Resource;
13 | import javax.servlet.http.HttpServletRequest;
14 |
15 | /**
16 | *
17 | * 前端控制器
18 | *
19 | *
20 | * @author Mr.Xu
21 | * @since 2022-04-09
22 | */
23 | @RestController
24 | @RequestMapping("/collect")
25 | public class CollectController {
26 |
27 | @Resource
28 | private CollectService collectService;
29 | @Resource
30 | private PostMapper postMapper;
31 |
32 | @ApiOperation("查看是否收藏")
33 | @RequiresRoles("user")
34 | @GetMapping("/check/{postId}")
35 | public Result check(@PathVariable("postId") Integer postId, HttpServletRequest request) {
36 |
37 | Result result = collectService.checkCollect(postId, request);
38 | return result;
39 | }
40 |
41 | @ApiOperation("收藏帖子")
42 | @RequiresRoles("user")
43 | @PostMapping("/add/{postId}")
44 | public Result add(@PathVariable("postId") Integer postId, HttpServletRequest request) {
45 | Result result = collectService.add(postId, request);
46 | return result;
47 | }
48 |
49 | @ApiOperation("取消收藏")
50 | @RequiresRoles("user")
51 | @DeleteMapping("/delete/{postId}")
52 | public Result delete(@PathVariable("postId") Integer postId, HttpServletRequest request) {
53 | Result result = collectService.deleteCollect(postId, request);
54 | return result;
55 | }
56 |
57 | @ApiOperation("获取收藏列表")
58 | // @RequiresRoles("user")
59 | @GetMapping("/list")
60 | public Result listCollect(CollectFindDto collectFindDto) {
61 | Result result = collectService.listCollect(collectFindDto);
62 | return result;
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/controller/CommentController.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.controller;
2 |
3 |
4 | import com.mrxu.stucomplarear2.dto.CommentDto;
5 | import com.mrxu.stucomplarear2.dto.CommentFindDto;
6 | import com.mrxu.stucomplarear2.service.CommentService;
7 | import com.mrxu.stucomplarear2.utils.response.Result;
8 | import io.swagger.annotations.ApiOperation;
9 | import org.apache.shiro.authz.annotation.Logical;
10 | import org.apache.shiro.authz.annotation.RequiresRoles;
11 | import org.springframework.beans.factory.annotation.Autowired;
12 | import org.springframework.web.bind.annotation.*;
13 |
14 | import javax.servlet.http.HttpServletRequest;
15 |
16 | /**
17 | *
18 | * 前端控制器
19 | *
20 | *
21 | * @author Mr.Xu
22 | * @since 2021-12-27
23 | */
24 | @RestController
25 | @RequestMapping("/comment")
26 | public class CommentController {
27 |
28 | @Autowired
29 | private CommentService commentService;
30 |
31 | @ApiOperation("评论")
32 | @RequiresRoles("user")
33 | @PostMapping("/create")
34 | public Result createComment(HttpServletRequest request, @RequestBody CommentDto commentDto) {
35 | return commentService.createComment(request, commentDto);
36 | }
37 |
38 | @ApiOperation("用户删除评论")
39 | @RequiresRoles("user")
40 | @DeleteMapping("/{commentId}")
41 | public Result deleteCommentByUser(@PathVariable("commentId") Integer commentId, HttpServletRequest request) {
42 | return commentService.deleteCommentByUser(commentId, request);
43 | }
44 |
45 | @ApiOperation("管理员删除评论")
46 | @RequiresRoles(value = {"admin", "super"}, logical = Logical.OR)
47 | @DeleteMapping("deleteByAdmin")
48 | public Result deleteCommentByAdmin(Integer commentId, String cause) {
49 | return commentService.deleteCommentByAdmin(commentId, cause);
50 | }
51 |
52 | @ApiOperation("帖子的评论列表")
53 | @GetMapping("/list/{postId}/{page}/{size}")
54 | public Result listComment(@PathVariable("postId") Integer postId, @PathVariable("page") int page, @PathVariable("size") int size) {
55 |
56 | return commentService.listCommentFromPost(postId, page, size);
57 | }
58 |
59 | @ApiOperation("评论列表(管理员页面)")
60 | @RequiresRoles(value = {"admin", "super"}, logical = Logical.OR)
61 | @GetMapping("/listByAdmin")
62 | public Result listCommentByAdmin(CommentFindDto commentFindDto) {
63 | return commentService.listComment(commentFindDto);
64 | }
65 |
66 | @ApiOperation("我的评论列表")
67 | @RequiresRoles("user")
68 | @GetMapping("/myList/{page}/{size}")
69 | public Result getMyList(@PathVariable("page") Integer page, @PathVariable("size") Integer size, HttpServletRequest request) {
70 |
71 | return commentService.getMyList(page, size, request);
72 | }
73 |
74 | @ApiOperation("获取评论总数")
75 | @RequiresRoles(value = {"admin", "super"}, logical = Logical.OR)
76 | @GetMapping("/getCommentTotal")
77 | public Result getCommentTotal() {
78 | Result result = commentService.getCommentTotal();
79 | return result;
80 | }
81 |
82 | }
83 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/controller/GoodsCategoryController.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.controller;
2 |
3 |
4 | import com.mrxu.stucomplarear2.dto.GoodsCategoryDto;
5 | import com.mrxu.stucomplarear2.service.GoodsCategoryService;
6 | import com.mrxu.stucomplarear2.utils.response.Result;
7 | import io.swagger.annotations.ApiOperation;
8 | import org.springframework.web.bind.annotation.GetMapping;
9 | import org.springframework.web.bind.annotation.RequestMapping;
10 | import org.springframework.web.bind.annotation.RestController;
11 |
12 | import javax.annotation.Resource;
13 |
14 | /**
15 | *
16 | * 前端控制器
17 | *
18 | *
19 | * @author Mr.Xu
20 | * @since 2022-04-15
21 | */
22 | @RestController
23 | @RequestMapping("/goods-category")
24 | public class GoodsCategoryController {
25 | @Resource
26 | private GoodsCategoryService goodsCategoryService;
27 |
28 | @ApiOperation("获取二手商品分类列表")
29 | @GetMapping("/list")
30 | public Result list(GoodsCategoryDto goodsCategoryDto) {
31 | Result result = goodsCategoryService.getGoodsCategoryList(goodsCategoryDto);
32 | return result;
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/controller/GoodsController.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.controller;
2 |
3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4 | import com.mrxu.stucomplarear2.dto.GoodsAddDto;
5 | import com.mrxu.stucomplarear2.dto.GoodsEditDto;
6 | import com.mrxu.stucomplarear2.dto.GoodsFindDto;
7 | import com.mrxu.stucomplarear2.dto.GoodsVo;
8 | import com.mrxu.stucomplarear2.entity.Goods;
9 | import com.mrxu.stucomplarear2.entity.GoodsCategory;
10 | import com.mrxu.stucomplarear2.entity.User;
11 | import com.mrxu.stucomplarear2.mapper.GoodsCategoryMapper;
12 | import com.mrxu.stucomplarear2.mapper.UserMapper;
13 | import com.mrxu.stucomplarear2.service.GoodsService;
14 | import com.mrxu.stucomplarear2.service.LetterService;
15 | import com.mrxu.stucomplarear2.utils.response.Result;
16 | import io.swagger.annotations.ApiOperation;
17 | import org.apache.shiro.authz.annotation.Logical;
18 | import org.apache.shiro.authz.annotation.RequiresRoles;
19 | import org.springframework.beans.BeanUtils;
20 | import org.springframework.beans.factory.annotation.Autowired;
21 | import org.springframework.web.bind.annotation.*;
22 |
23 | import javax.annotation.Resource;
24 | import javax.servlet.http.HttpServletRequest;
25 |
26 | /**
27 | *
28 | * 前端控制器
29 | *
30 | *
31 | * @author Mr.Xu
32 | * @since 2022-04-15
33 | */
34 | @RestController
35 | @RequestMapping("/goods")
36 | public class GoodsController {
37 |
38 | @Resource
39 | private GoodsService goodsService;
40 | @Autowired
41 | private UserMapper userMapper;
42 | @Autowired
43 | private GoodsCategoryMapper goodsCategoryMapper;
44 |
45 | @ApiOperation("发布二手商品")
46 | @RequiresRoles("user")
47 | @PostMapping("/add")
48 | public Result add(@RequestBody GoodsAddDto goodsDto, HttpServletRequest request) {
49 | // 这个@RequestBody有两个包,别导错了!!
50 | Result result = goodsService.add(goodsDto, request);
51 | return result;
52 | }
53 |
54 | @ApiOperation("修改二手商品")
55 | @RequiresRoles("user")
56 | @PostMapping("/edit")
57 | public Result edit(@RequestBody GoodsEditDto goodsEditDto, HttpServletRequest request) {
58 | Result result = goodsService.editGoods(goodsEditDto, request);
59 | return result;
60 | }
61 |
62 | @ApiOperation("删除自己的二手商品")
63 | @RequiresRoles("user")
64 | @DeleteMapping("/{goodsId}")
65 | public Result deleteMyGoods(@PathVariable("goodsId") Integer goodsId, HttpServletRequest request) {
66 | Result result = goodsService.deleteMyGoods(goodsId, request);
67 | return result;
68 | }
69 |
70 | @ApiOperation("重新上架自己的二手商品")
71 | @RequiresRoles("user")
72 | @PostMapping("/putMyGoods/{goodsId}")
73 | public Result putMyGoods(@PathVariable("goodsId") Integer goodsId, HttpServletRequest request) {
74 | Result result = goodsService.putMyGoods(goodsId, request);
75 | return result;
76 | }
77 |
78 | @ApiOperation("下架自己的商品")
79 | @RequiresRoles("user")
80 | @PostMapping("/unShelveMyGoods/{goodsId}")
81 | public Result unShelveMyGoods(@PathVariable("goodsId") Integer goodsId, HttpServletRequest request) {
82 | Result result = goodsService.unShelveMyGoods(goodsId, request);
83 | return result;
84 | }
85 |
86 | @ApiOperation("管理员下架商品")
87 | @RequiresRoles(value = {"admin", "super"}, logical = Logical.OR)
88 | @PostMapping("/unShelve/{goodsId}")
89 | public Result unShelveGoods(@PathVariable("goodsId") Integer goodsId) {
90 | Result result = goodsService.unShelveGoods(goodsId);
91 | return result;
92 | }
93 |
94 | @ApiOperation("管理员删除商品")
95 | @RequiresRoles(value = {"admin", "super"}, logical = Logical.OR)
96 | @PostMapping("/deleteGoods/{goodsId}")
97 | public Result deleteGoods(@PathVariable("goodsId") Integer goodsId) {
98 | Result result = goodsService.deleteGoods(goodsId);
99 | return result;
100 | }
101 |
102 | @ApiOperation("获取二手商品列表")
103 | @GetMapping("/getList")
104 | public Result getList(GoodsFindDto goodsFindDto) {
105 | System.out.println(goodsFindDto);
106 | Result result = goodsService.findGoods(goodsFindDto);
107 | return result;
108 | }
109 |
110 | @ApiOperation("获取商品总数")
111 | @RequiresRoles(value = {"admin", "super"}, logical = Logical.OR)
112 | @GetMapping("/getGoodsTotal")
113 | public Result getGoodsTotal() {
114 | Result result = goodsService.getGoodsTotal();
115 | return result;
116 | }
117 |
118 | @ApiOperation("二手上架分类统计")
119 | @RequiresRoles(value = {"admin", "super"}, logical = Logical.OR)
120 | @GetMapping("/getGoodsByCategory")
121 | public Result getGoodsByCategory() {
122 | Result result = goodsService.getGoodsByCategory();
123 | return result;
124 | }
125 |
126 | @ApiOperation("商品详情")
127 | @GetMapping("/{goodsId}")
128 | public Result getGoodsDetail(@PathVariable("goodsId") Integer goodsId) {
129 | try {
130 | QueryWrapper queryWrapper = new QueryWrapper<>();
131 | queryWrapper.eq("goods_id", goodsId);
132 | Goods goods = goodsService.getOne(queryWrapper);
133 |
134 | goods = goodsService.updateViewNum(goods);
135 | GoodsVo goodsVo = new GoodsVo();
136 | BeanUtils.copyProperties(goods, goodsVo);
137 | //查对应的发布人信息
138 | User user = userMapper.selectById(goods.getUserId());
139 | goodsVo.setUser(user);
140 | //查对应的帖子类型信息
141 | GoodsCategory goodsCategory = goodsCategoryMapper.selectById(goods.getGoodsCategoryId());
142 | goodsVo.setGoodsCategory(goodsCategory);
143 |
144 | return Result.succ(goodsVo);
145 | } catch (Exception e) {
146 | e.printStackTrace();
147 | return Result.fail(e.getMessage());
148 | }
149 | }
150 | }
151 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/controller/ImageController.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.controller;
2 |
3 |
4 | import com.alibaba.fastjson.JSONObject;
5 | import com.mrxu.stucomplarear2.service.ImageService;
6 | import com.mrxu.stucomplarear2.utils.response.Result;
7 | import io.swagger.annotations.ApiOperation;
8 | import lombok.extern.slf4j.Slf4j;
9 | import org.apache.shiro.authz.annotation.RequiresRoles;
10 | import org.springframework.beans.factory.annotation.Autowired;
11 | import org.springframework.web.bind.annotation.*;
12 | import org.springframework.web.multipart.MultipartFile;
13 |
14 | import javax.servlet.http.HttpServletRequest;
15 | import javax.servlet.http.HttpServletResponse;
16 | import java.io.IOException;
17 |
18 | /**
19 | *
20 | * 前端控制器
21 | *
22 | *
23 | * @author Mr.Xu
24 | * @since 2022-01-23
25 | */
26 | @Slf4j
27 | @CrossOrigin
28 | @RestController
29 | @RequestMapping("/image")
30 | public class ImageController {
31 |
32 | @Autowired
33 | private ImageService imageService;
34 |
35 | /**
36 | * 关于图片(文件)上传
37 | * 一般来说,现在比较常用的是对象存储--->很简单,看文档就可以学会了
38 | * 使用 Nginx + fastDFS == > fastDFS -- > 处理文件上传, Nginx -- > 负责处理文件访问
39 | *
40 | * @param files
41 | * @return
42 | */
43 | @ApiOperation("上传图片")
44 | @RequiresRoles("user")
45 | @PostMapping("/upload")
46 | public String uploadImage(HttpServletRequest request, @RequestPart("files") MultipartFile[] files) {
47 | //使用@RequestPart -- 解决(Swagger 3.0.0)——【文件上传,接收file类型时显示string】
48 |
49 | Result uploadResult = imageService.uploadImage(request, files);
50 | return JSONObject.toJSONString(uploadResult);
51 | }
52 |
53 | @ApiOperation("显示图片")
54 | @GetMapping("/{imageId}")
55 | public void getImage(HttpServletResponse response, @PathVariable("imageId") String imageId) {
56 | try {
57 | imageService.viewImage(response, imageId);
58 | } catch (IOException e) {
59 | e.printStackTrace();
60 | }
61 | }
62 |
63 | @ApiOperation("图片列表")
64 | //@RequiresRoles("user")
65 | @GetMapping("/list/{page}/{size}")
66 | public Result listImages(@PathVariable("page") int page, @PathVariable("size") int size) {
67 | return imageService.listImages(page, size);
68 | }
69 |
70 | @ApiOperation("删除图片")
71 | //@RequiresRoles("user")
72 | @DeleteMapping("/{imageId}")
73 | public Result DeleteImage(@PathVariable("imageId") String imageId) {
74 | return imageService.deleteById(imageId);
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/controller/LetterController.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.controller;
2 |
3 |
4 | import com.mrxu.stucomplarear2.dto.LetterAddDto;
5 | import com.mrxu.stucomplarear2.service.LetterService;
6 | import com.mrxu.stucomplarear2.utils.response.Result;
7 | import io.swagger.annotations.ApiOperation;
8 | import org.apache.shiro.authz.annotation.RequiresRoles;
9 | import org.springframework.web.bind.annotation.*;
10 |
11 | import javax.annotation.Resource;
12 | import javax.servlet.http.HttpServletRequest;
13 |
14 | /**
15 | *
16 | * 前端控制器
17 | *
18 | *
19 | * @author Mr.Xu
20 | * @since 2022-04-28
21 | */
22 | @RestController
23 | @RequestMapping("/letter")
24 | public class LetterController {
25 |
26 | @Resource
27 | private LetterService letterService;
28 |
29 | @ApiOperation("发送私信")
30 | @RequiresRoles("user")
31 | @PostMapping("/send")
32 | public Result add(@RequestBody LetterAddDto letterAddDto, HttpServletRequest request) {
33 | Result result = letterService.add(letterAddDto, request);
34 | return result;
35 | }
36 | //
37 | // @ApiOperation("系统发送通知")
38 | // @PostMapping("/sendNotice")
39 | // public Result addNotice(@RequestBody LetterAddDto letterAddDto) {
40 | // Result result = letterService.addNotice(letterAddDto);
41 | // return result;
42 | // }
43 |
44 | @ApiOperation("获取我的私信列表")
45 | @RequiresRoles("user")
46 | @PostMapping("/mySessionList")
47 | public Result getMySessionList(HttpServletRequest request) {
48 | Result result = letterService.getMySessionList(request);
49 | return result;
50 | }
51 |
52 | @ApiOperation("获取当前会话的私信列表")
53 | @RequiresRoles("user")
54 | @GetMapping("/letterList/{sessionId}")
55 | public Result getLetterListBySessionId(@PathVariable("sessionId") String sessionId, HttpServletRequest request) {
56 | Result result = letterService.getLetterListBySessionId(sessionId, request);
57 | return result;
58 | }
59 |
60 | @ApiOperation("获取我的通知列表")
61 | @RequiresRoles("user")
62 | @PostMapping("/myNoticeList")
63 | public Result getMyNoticeList(HttpServletRequest request) {
64 | Result result = letterService.getMyNoticeList(request);
65 | return result;
66 | }
67 |
68 | @ApiOperation("获取我的未读总数")
69 | @RequiresRoles("user")
70 | @PostMapping("/myUnReadTotal")
71 | public Result getMyUnReadTotal(HttpServletRequest request) {
72 | Result result = letterService.getMyUnReadTotal(request);
73 | return result;
74 | }
75 |
76 | @ApiOperation("获取我的私信未读数")
77 | @RequiresRoles("user")
78 | @PostMapping("/myUnReadLetterTotal")
79 | public Result getMyUnReadLetterTotal(HttpServletRequest request) {
80 | Result result = letterService.getMyUnReadLetterTotal(request);
81 | return result;
82 | }
83 |
84 | @ApiOperation("获取我的通知未读数")
85 | @RequiresRoles("user")
86 | @PostMapping("/myUnReadNoticeTotal")
87 | public Result getMyUnReadNoticeTotal(HttpServletRequest request) {
88 | Result result = letterService.getMyUnReadNoticeTotal(request);
89 | return result;
90 | }
91 |
92 | }
93 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/controller/MarketOrderController.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.controller;
2 |
3 |
4 | import com.mrxu.stucomplarear2.dto.MarketOrderFindDto;
5 | import com.mrxu.stucomplarear2.dto.OrderAddDto;
6 | import com.mrxu.stucomplarear2.service.MarketOrderService;
7 | import com.mrxu.stucomplarear2.utils.response.Result;
8 | import io.swagger.annotations.ApiOperation;
9 | import org.apache.shiro.authz.annotation.Logical;
10 | import org.apache.shiro.authz.annotation.RequiresRoles;
11 | import org.springframework.web.bind.annotation.*;
12 |
13 | import javax.annotation.Resource;
14 | import javax.servlet.http.HttpServletRequest;
15 |
16 | /**
17 | *
18 | * 前端控制器
19 | *
20 | *
21 | * @author Mr.Xu
22 | * @since 2022-04-20
23 | */
24 | @RestController
25 | @RequestMapping("/market-order")
26 | public class MarketOrderController {
27 | @Resource
28 | private MarketOrderService marketOrderService;
29 |
30 | @ApiOperation("添加订单")
31 | @RequiresRoles("user")
32 | @PostMapping("/addOrder")
33 | public Result addOrder(@RequestBody OrderAddDto orderAddDto, HttpServletRequest request) {
34 | Result result = marketOrderService.addOrder(orderAddDto, request);
35 | return result;
36 | }
37 |
38 | // @ApiOperation("删除订单")
39 | // @RequiresRoles("user")
40 | // @DeleteMapping("/{orderId}")
41 | // public Result deleteOrder(@PathVariable("orderId") Integer orderId, HttpServletRequest request) {
42 | // Result result = marketOrderService.deleteOrder(orderId, request);
43 | // return result;
44 | // }
45 |
46 | @ApiOperation("订单支付")
47 | @RequiresRoles("user")
48 | @PostMapping("/payOrder/{orderId}")
49 | public Result payOrder(@PathVariable("orderId") Integer orderId) {
50 | Result result = marketOrderService.payOrder(orderId);
51 | return result;
52 | }
53 |
54 | @ApiOperation("订单发货")
55 | @RequiresRoles("user")
56 | @GetMapping("/sendGoods/{orderId}")
57 | public Result sendGoods(@PathVariable("orderId") Integer orderId, HttpServletRequest request) {
58 | Result result = marketOrderService.sendGoods(orderId, request);
59 | return result;
60 | }
61 |
62 | @ApiOperation("订单签收")
63 | @RequiresRoles("user")
64 | @PostMapping("/receipt/{orderId}")
65 | public Result receipt(@PathVariable("orderId") Integer orderId, HttpServletRequest request) {
66 | Result result = marketOrderService.receipt(orderId, request);
67 | return result;
68 | }
69 |
70 | @ApiOperation("申请退货")
71 | @RequiresRoles("user")
72 | @PostMapping("/applyReturn/{orderId}")
73 | public Result applyReturn(@PathVariable("orderId") Integer orderId, HttpServletRequest request) {
74 | Result result = marketOrderService.applyReturn(orderId, request);
75 | return result;
76 | }
77 |
78 | @ApiOperation("审核退货")
79 | @RequiresRoles("user")
80 | @PostMapping("/auditReturn")
81 | public Result auditReturn(Integer orderId, Integer auditState, String cause, HttpServletRequest request) {
82 | Result result = marketOrderService.auditReturn(orderId, auditState, cause, request);
83 | return result;
84 | }
85 |
86 | @ApiOperation("获取我的订单")
87 | @RequiresRoles("user")
88 | @GetMapping("/myOrder")
89 | public Result getMyOrder(MarketOrderFindDto marketOrderFindDto, HttpServletRequest request) {
90 | Result result = marketOrderService.getMyOrder(marketOrderFindDto, request);
91 | return result;
92 | }
93 |
94 | @ApiOperation("获取我的销售订单")
95 | @RequiresRoles("user")
96 | @GetMapping("/mySalesOrders")
97 | public Result getMySalesOrders(MarketOrderFindDto marketOrderFindDto, HttpServletRequest request) {
98 | Result result = marketOrderService.getMySalesOrders(marketOrderFindDto, request);
99 | return result;
100 | }
101 |
102 |
103 | @ApiOperation("管理员获取订单列表")
104 | @RequiresRoles(value = {"admin", "super"}, logical = Logical.OR)
105 | @GetMapping("/orderList")
106 | public Result getOrderList(MarketOrderFindDto marketOrderFindDto) {
107 | Result result = marketOrderService.getOrderList(marketOrderFindDto);
108 | return result;
109 | }
110 |
111 |
112 | @ApiOperation("获取订单总数")
113 | @RequiresRoles(value = {"admin", "super"}, logical = Logical.OR)
114 | @GetMapping("/getOrderTotal")
115 | public Result getOrderTotal() {
116 | Result result = marketOrderService.getOrderTotal();
117 | return result;
118 | }
119 |
120 |
121 | }
122 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/controller/PostController.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.controller;
2 |
3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4 | import com.mrxu.stucomplarear2.dto.PostEditDto;
5 | import com.mrxu.stucomplarear2.dto.PostFindDto;
6 | import com.mrxu.stucomplarear2.dto.PostPublishDto;
7 | import com.mrxu.stucomplarear2.dto.PostVo;
8 | import com.mrxu.stucomplarear2.entity.Category;
9 | import com.mrxu.stucomplarear2.entity.Post;
10 | import com.mrxu.stucomplarear2.entity.User;
11 | import com.mrxu.stucomplarear2.mapper.CategoryMapper;
12 | import com.mrxu.stucomplarear2.mapper.UserMapper;
13 | import com.mrxu.stucomplarear2.service.PostService;
14 | import com.mrxu.stucomplarear2.utils.response.Result;
15 | import io.swagger.annotations.ApiOperation;
16 | import org.apache.shiro.authz.annotation.Logical;
17 | import org.apache.shiro.authz.annotation.RequiresRoles;
18 | import org.springframework.beans.BeanUtils;
19 | import org.springframework.beans.factory.annotation.Autowired;
20 | import org.springframework.web.bind.annotation.*;
21 |
22 | import javax.servlet.http.HttpServletRequest;
23 | import java.util.Map;
24 |
25 | /**
26 | *
27 | * 前端控制器
28 | *
29 | *
30 | * @author Mr.Xu
31 | * @since 2021-12-27
32 | */
33 | @CrossOrigin
34 | @RestController
35 | @RequestMapping("/post")
36 | public class PostController {
37 |
38 | @Autowired
39 | private CategoryMapper categoryMapper;
40 | @Autowired
41 | private UserMapper userMapper;
42 | @Autowired
43 | private PostService postService;
44 |
45 | @ApiOperation("发帖")
46 | @RequiresRoles("user")
47 | @PostMapping("/publish")
48 | public Result publish(HttpServletRequest request, @RequestBody PostPublishDto postDto) {
49 | //System.out.println(postDto);
50 | QueryWrapper queryWrapper = new QueryWrapper<>();
51 | queryWrapper.eq("category_id", postDto.getCategoryId());
52 | if (categoryMapper.selectOne(queryWrapper) == null || postDto.getTitle().isEmpty() || postDto.getDetail().isEmpty()) {
53 | return Result.fail("参数错误");
54 | }
55 | if (postDto.getTitle().length() < 1 || postDto.getTitle().length() > 30) {
56 | return Result.fail("标题长度只能在1-30位");
57 | }
58 | postService.publishPost(request, postDto);
59 | return Result.succ(postDto);
60 | }
61 |
62 | @ApiOperation("修改帖子")
63 | @RequiresRoles("user")
64 | @PostMapping("/edit")
65 | public Result edit(HttpServletRequest request, @RequestBody PostEditDto postEditDto) {
66 | //System.out.println(postDto);
67 | QueryWrapper queryWrapper = new QueryWrapper<>();
68 | queryWrapper.eq("category_id", postEditDto.getCategoryId());
69 | if (categoryMapper.selectOne(queryWrapper) == null || postEditDto.getTitle().isEmpty() || postEditDto.getDetail().isEmpty()) {
70 | return Result.fail("种类参数错误");
71 | }
72 | Result result = postService.editPost(request, postEditDto);
73 | return result;
74 | }
75 |
76 | @ApiOperation("用户删除帖子")
77 | @RequiresRoles("user")
78 | @DeleteMapping("/{postId}")
79 | public Result deleteMyPost(@PathVariable("postId") Integer postId, HttpServletRequest request) {
80 | Result result = postService.deleteMyPost(postId, request);
81 | return result;
82 | }
83 |
84 | @ApiOperation("管理员锁定帖子")
85 | @RequiresRoles(value = {"admin", "super"}, logical = Logical.OR)
86 | @PostMapping("/lockedPost")
87 | public Result lockedPost(Integer postId, String cause) {
88 | Result result = postService.lockedPost(postId, cause);
89 | return result;
90 | }
91 |
92 | @ApiOperation("解锁帖子")
93 | @RequiresRoles(value = {"admin", "super"}, logical = Logical.OR)
94 | @PostMapping("/unLockPost")
95 | public Result unLockPost(Integer postId) {
96 | Result result = postService.unLockPost(postId);
97 | return result;
98 | }
99 |
100 | @ApiOperation("管理员删除帖子")
101 | @RequiresRoles(value = {"admin", "super"}, logical = Logical.OR)
102 | @DeleteMapping("/deleteByAdmin")
103 | public Result deleteByAdmin(Integer postId, String cause) {
104 | Result result = postService.deleteByAdmin(postId, cause);
105 | return result;
106 | }
107 |
108 | @ApiOperation("帖子详情")
109 | @GetMapping("/{postId}")
110 | public Result getPost(@PathVariable("postId") Integer postId) {
111 | try {
112 | QueryWrapper queryWrapper = new QueryWrapper<>();
113 | queryWrapper.eq("post_id", postId);
114 | Post post = postService.getOne(queryWrapper);
115 | if (post == null) {
116 | return Result.fail("帖子不存在");
117 | }
118 | //这里还是交给前端处理,因为就算锁定了,按逻辑要给用户修改的权利
119 | // if (post.getPostStatus()==1) {
120 | // return Result.fail("该贴已被锁定,如需申诉请联系管理员1452162669@qq.com");
121 | // }
122 | post = postService.updateViewNum(post);
123 | PostVo postVo = new PostVo();
124 | BeanUtils.copyProperties(post, postVo);
125 | //查对应的发布人信息
126 | User user = userMapper.selectById(post.getUserId());
127 | postVo.setUser(user);
128 | //查对应的帖子类型信息
129 | Category category = categoryMapper.selectById(post.getCategoryId());
130 | postVo.setCategory(category);
131 |
132 | return Result.succ(postVo);
133 | } catch (Exception e) {
134 | e.printStackTrace();
135 | return Result.fail(e.getMessage());
136 | }
137 | }
138 |
139 | @ApiOperation("获取帖子列表")
140 | // @RequiresRoles(value = {"admin", "super","user"}, logical = Logical.OR)
141 | @GetMapping("/list")
142 | public Result listPost(PostFindDto postFindDto) {
143 | Map map = postService.findPostList(postFindDto);
144 | return Result.succ(map);
145 | }
146 | //
147 | // @ApiOperation("获取帖子收藏数量")
148 | // @GetMapping("/getCollectNum")
149 | // public Result getCollectNum(Integer postId) {
150 | //// int collectNum = postService.getCollectNum(postId);
151 | // return null;
152 | // }
153 |
154 | @ApiOperation("获取帖子总数")
155 | @RequiresRoles(value = {"admin", "super"}, logical = Logical.OR)
156 | @GetMapping("/getPostTotal")
157 | public Result getPostTotal() {
158 | Result result = postService.getPostTotal();
159 | return result;
160 | }
161 |
162 | @ApiOperation("帖子分类统计")
163 | @RequiresRoles(value = {"admin", "super"}, logical = Logical.OR)
164 | @GetMapping("/getPostData")
165 | public Result getPostData() {
166 | Result result = postService.getPostData();
167 | return result;
168 | }
169 |
170 |
171 | }
172 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/controller/UserController.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.controller;
2 |
3 | import com.mrxu.stucomplarear2.dto.LoginDto;
4 | import com.mrxu.stucomplarear2.dto.RegisterDto;
5 | import com.mrxu.stucomplarear2.dto.UserEditDto;
6 | import com.mrxu.stucomplarear2.dto.UserFindDto;
7 | import com.mrxu.stucomplarear2.entity.User;
8 | import com.mrxu.stucomplarear2.service.UserService;
9 | import com.mrxu.stucomplarear2.utils.jwt.JWTUtil;
10 | import com.mrxu.stucomplarear2.utils.redis.RedisUtil;
11 | import com.mrxu.stucomplarear2.utils.response.Result;
12 | import io.swagger.annotations.ApiOperation;
13 | import org.apache.shiro.authz.annotation.Logical;
14 | import org.apache.shiro.authz.annotation.RequiresAuthentication;
15 | import org.apache.shiro.authz.annotation.RequiresRoles;
16 | import org.apache.shiro.crypto.hash.SimpleHash;
17 | import org.springframework.beans.factory.annotation.Autowired;
18 | import org.springframework.web.bind.annotation.*;
19 |
20 | import javax.annotation.Resource;
21 | import javax.servlet.ServletRequest;
22 | import javax.servlet.ServletResponse;
23 | import javax.servlet.http.HttpServletRequest;
24 | import javax.servlet.http.HttpServletResponse;
25 | import java.util.Map;
26 |
27 | @RestController
28 | @RequestMapping("/user")
29 | public class UserController {
30 |
31 | @Resource
32 | private UserService userService;
33 | @Autowired
34 | private RedisUtil redisUtil;
35 |
36 | @ApiOperation("注册")
37 | @PostMapping("/register")
38 | public Object register(@RequestBody RegisterDto registerDto) {
39 | //初始化返回值
40 | String regResult = userService.register(registerDto);
41 | if (regResult.equals("注册成功")) {
42 | return Result.succ(200, regResult, null);
43 | } else {
44 | return Result.fail(regResult);
45 | }
46 | }
47 |
48 | @ApiOperation("修改密码")
49 | @RequiresRoles("user")
50 | @PostMapping("/changePassword")
51 | public Result changePassword(String oldPassword, String inPassword, String secondPassword, ServletRequest request) {
52 | String regResult = userService.changePassword(request, oldPassword, inPassword, secondPassword);
53 | if (regResult.equals("密码修改成功")) {
54 | return Result.succ(200, regResult, null);
55 | } else {
56 | return Result.fail(regResult);
57 | }
58 | }
59 |
60 | @ApiOperation("重置用户密码")
61 | @RequiresRoles(value = {"admin", "super"}, logical = Logical.OR)
62 | @PostMapping("/changePwdByAdmin")
63 | public Result changePwdByAdmin(String newPassword, String secondPassword, Integer userId) {
64 | Result result = userService.changePwdByAdmin(newPassword, secondPassword, userId);
65 | return result;
66 | }
67 |
68 | @ApiOperation("锁定用户")
69 | @RequiresRoles(value = {"admin", "super"}, logical = Logical.OR)
70 | @PostMapping("/lockedUser")
71 | public Result lockedUser(Integer userId, String cause) {
72 | Result result = userService.lockedUser(userId, cause);
73 | return result;
74 | }
75 |
76 | @ApiOperation("解锁用户")
77 | @RequiresRoles(value = {"admin", "super"}, logical = Logical.OR)
78 | @PostMapping("/unLockUser")
79 | public Result unLockUser(Integer userId) {
80 | Result result = userService.unLockUser(userId);
81 | return result;
82 | }
83 |
84 | @ApiOperation("编辑个人信息")
85 | @RequiresRoles("user")
86 | @PostMapping("/editUserInfo")
87 | public Result editUserInfo(@RequestBody UserEditDto userEditDto, HttpServletRequest request) {
88 | Result result = userService.editUserInfo(userEditDto, request);
89 | return result;
90 | }
91 |
92 | @ApiOperation("登录")
93 | @PostMapping("/login")
94 | public Result login(@RequestBody LoginDto loginDto, ServletResponse response) {
95 | // 查询数据库获取用户信息
96 | User userFromDb = userService.getUserByUsername(loginDto.getUsername());
97 | // 用户不存在
98 | if (userFromDb == null) {
99 | return Result.fail("用户不存在!");
100 | // throw new UnknownAccountException("用户不存在!");
101 | }
102 | // 用户被锁定
103 | if (userFromDb.getLocked()) {
104 | return Result.fail("该用户已被锁定,暂时无法登录!请联系管理员1452162669@qq.com");
105 | // throw new LockedAccountException("该用户已被锁定,暂时无法登录!");
106 | }
107 | String inPassword = loginDto.getPassword()/*String.valueOf(new SimpleHash("SHA-1",
108 | loginDto.getPassword(), //输入的原始密码
109 | userFromDb.getUserId().toString(),//用户Id当盐值
110 | 16))*/;
111 | if (!inPassword.equals(userFromDb.getPassword())) {
112 | return Result.fail("用户名或密码错误!");
113 | // throw new IllegalArgumentException("用户名或密码错误!");
114 | }
115 | long currentTimeMillis = System.currentTimeMillis();
116 | String token = JWTUtil.createToken(String.valueOf(userFromDb.getUserId()), currentTimeMillis, "User");
117 | redisUtil.set("User" + userFromDb.getUserId(), currentTimeMillis, 60 * 30);//redis里存30分钟
118 | ((HttpServletResponse) response).setHeader("Authorization", token);
119 | ((HttpServletResponse) response).setHeader("Access-Control-Expose-Headers", "Authorization");//前端可以拿到这个响应头
120 | return Result.succ(200, "登陆成功", token);
121 | }
122 |
123 | @ApiOperation("无权限")
124 | @GetMapping(path = "/unauthorized/{message}")
125 | public Result unauthorized(@PathVariable String message) {
126 | return Result.fail(message);
127 | }
128 |
129 | @ApiOperation("登出")
130 | @DeleteMapping("/logout")
131 | @RequiresAuthentication
132 | public Result logout(HttpServletRequest request) {
133 | String token = request.getHeader("Authorization");
134 | String userId = JWTUtil.getUserId(token);
135 | redisUtil.del(userId);
136 | return Result.succ("退出成功");
137 | }
138 |
139 | @ApiOperation("获取用户列表")
140 | @RequiresRoles(value = {"admin", "super"}, logical = Logical.OR)
141 | @GetMapping("/list")
142 | public Result listUser(UserFindDto userFindDto) {
143 | Map map = userService.findUserList(userFindDto);
144 | return Result.succ(map);
145 | }
146 |
147 | @ApiOperation("获取用户总数")
148 | @RequiresRoles(value = {"admin", "super"}, logical = Logical.OR)
149 | @GetMapping("/getUserTotal")
150 | public Result getUserTotal() {
151 | Result result = userService.getUserTotal();
152 | return result;
153 | }
154 |
155 | @ApiOperation("获取个人信息")
156 | @RequiresRoles("user")
157 | @GetMapping("/info")
158 | public Result getInfo(HttpServletRequest request) {
159 | String jwt = request.getHeader("Authorization");
160 | String userId = JWTUtil.getUserId(jwt);
161 | User user = userService.getUserByUserId(userId);
162 | if (user == null) {
163 | return Result.fail("用户不存在");
164 | }
165 | return Result.succ(user);
166 | }
167 |
168 | }
169 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/controller/WallController.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.controller;
2 |
3 | import com.mrxu.stucomplarear2.dto.WallApplyDto;
4 | import com.mrxu.stucomplarear2.dto.WallAuditDto;
5 | import com.mrxu.stucomplarear2.dto.WallFindDto;
6 | import com.mrxu.stucomplarear2.service.WallService;
7 | import com.mrxu.stucomplarear2.utils.response.Result;
8 | import io.swagger.annotations.ApiOperation;
9 | import org.apache.shiro.authz.annotation.Logical;
10 | import org.apache.shiro.authz.annotation.RequiresRoles;
11 | import org.springframework.web.bind.annotation.*;
12 |
13 | import javax.annotation.Resource;
14 | import javax.servlet.http.HttpServletRequest;
15 | import java.util.Map;
16 |
17 | /**
18 | *
19 | * 前端控制器
20 | *
21 | *
22 | * @author Mr.Xu
23 | * @since 2021-12-15
24 | */
25 | @RestController
26 | @RequestMapping("/wall")
27 | public class WallController {
28 |
29 | @Resource
30 | private WallService wallService;
31 |
32 | @ApiOperation("申请上墙")
33 | @RequiresRoles("user")
34 | @PostMapping("/apply")
35 | public Result apply(@RequestBody WallApplyDto wallApplyDto, HttpServletRequest request) {
36 | String applyResult = wallService.apply(wallApplyDto, request);
37 | if (applyResult.equals("申请成功")) {
38 | return Result.succ(200, applyResult, null);
39 | } else {
40 | return Result.fail(applyResult);
41 | }
42 | }
43 |
44 | @ApiOperation("上墙审核")
45 | @RequiresRoles(value = {"admin", "super"}, logical = Logical.OR)
46 | @PostMapping("/audit")
47 | public Result audit(@RequestBody WallAuditDto wallAuditDto, HttpServletRequest request) {
48 | String auditResult = wallService.audit(wallAuditDto, request);
49 | if (auditResult.equals("审核成功")) {
50 | return Result.succ(200, auditResult, null);
51 | }
52 | return Result.fail(auditResult);
53 | }
54 |
55 | @ApiOperation("墙列表(用户页面)")
56 | // @RequiresRoles("user")
57 | @GetMapping("/wallList")
58 | public Result wallList(Integer pageNum, Integer pageSize) {
59 | WallFindDto wallFindDto = new WallFindDto();
60 | wallFindDto.setAuditState(1);//已审核的内容
61 | wallFindDto.setPageNum(pageNum);
62 | wallFindDto.setPageSize(pageSize);
63 | Map map = wallService.findWall(wallFindDto);
64 | return Result.succ(map);
65 | }
66 |
67 |
68 | @ApiOperation("我的墙列表")
69 | @RequiresRoles("user")
70 | @GetMapping("/myWallList")
71 | public Result getmyWallList(Integer pageNum, Integer pageSize, HttpServletRequest request) {
72 | WallFindDto wallFindDto = new WallFindDto();
73 | // wallFindDto.setAuditState(1);//已审核的内容
74 | wallFindDto.setPageNum(pageNum);
75 | wallFindDto.setPageSize(pageSize);
76 | Result result = wallService.findMyWall(wallFindDto, request);
77 | return result;
78 | }
79 |
80 |
81 | @ApiOperation("获取表白墙总数")
82 | @RequiresRoles(value = {"admin", "super"}, logical = Logical.OR)
83 | @GetMapping("/getWallTotal")
84 | public Result getWallTotal() {
85 | Result result = wallService.getWallTotal();
86 | return result;
87 | }
88 |
89 |
90 | @ApiOperation("表白墙分类统计")
91 | @RequiresRoles(value = {"admin", "super"}, logical = Logical.OR)
92 | @GetMapping("/getWallData")
93 | public Result getWallData() {
94 | Result result = wallService.getWallData();
95 | return result;
96 | }
97 |
98 | //
99 | // @ApiOperation("个人墙列表")
100 | // @RequiresRoles("user")
101 | // @GetMapping("/myWallList")
102 | // public Result myWallList(ServletRequest request, Integer auditState, Integer pageNum, Integer pageSize) {
103 | // HttpServletRequest req = (HttpServletRequest) request;
104 | // //获取传递过来的accessToken
105 | // String accessToken = req.getHeader("Authorization");
106 | // //获取token里面的用户ID
107 | // String userId = JWTUtil.getUserId(accessToken);
108 | //
109 | // WallFindDto wallFindDto = new WallFindDto();
110 | // wallFindDto.setUserId(Integer.valueOf(userId));
111 | // wallFindDto.setAuditState(auditState);
112 | // wallFindDto.setPageNum(pageNum);
113 | // wallFindDto.setPageSize(pageSize);
114 | // Map map = wallService.findWall(wallFindDto);
115 | // return Result.succ(map);
116 | // }
117 |
118 | @ApiOperation("墙列表(管理员页面)")
119 | @RequiresRoles(value = {"admin", "super"}, logical = Logical.OR)
120 | @GetMapping("/auditWallList")
121 | public Result auditWallList(WallFindDto wallFindDto) {
122 | Map map = wallService.findWall(wallFindDto);
123 | return Result.succ(map);
124 | }
125 | }
126 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/controller/admin/AdminController.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.controller.admin;
2 |
3 |
4 | import com.mrxu.stucomplarear2.dto.AdminFindDto;
5 | import com.mrxu.stucomplarear2.dto.LoginDto;
6 | import com.mrxu.stucomplarear2.entity.Admin;
7 | import com.mrxu.stucomplarear2.service.AdminService;
8 | import com.mrxu.stucomplarear2.utils.jwt.JWTUtil;
9 | import com.mrxu.stucomplarear2.utils.redis.RedisUtil;
10 | import com.mrxu.stucomplarear2.utils.response.Result;
11 | import io.swagger.annotations.ApiOperation;
12 | import org.apache.shiro.authz.annotation.Logical;
13 | import org.apache.shiro.authz.annotation.RequiresAuthentication;
14 | import org.apache.shiro.authz.annotation.RequiresRoles;
15 | import org.springframework.beans.factory.annotation.Autowired;
16 | import org.springframework.web.bind.annotation.*;
17 |
18 | import javax.annotation.Resource;
19 | import javax.servlet.http.HttpServletRequest;
20 | import javax.servlet.http.HttpServletResponse;
21 | import java.util.Map;
22 |
23 | /**
24 | *
25 | * 前端控制器
26 | *
27 | *
28 | * @author Mr.Xu
29 | * @since 2022-04-02
30 | */
31 | @RestController
32 | @RequestMapping("/admin/info")
33 | public class AdminController {
34 |
35 | @Resource
36 | private AdminService adminService;
37 | @Autowired
38 | private RedisUtil redisUtil;
39 |
40 | @ApiOperation("获取当前管理员信息")
41 | @RequiresRoles(value = {"admin", "super"}, logical = Logical.OR)
42 | @GetMapping
43 | public Result getInfo(HttpServletRequest request) {
44 | String accessToken = request.getHeader("Authorization");
45 | //获取token里面的用户ID
46 | String adminId = JWTUtil.getUserId(accessToken);
47 | Admin admin = adminService.getAdminByAdminId(adminId);
48 | return Result.succ(admin);
49 | }
50 |
51 | @ApiOperation("获取管理员列表")
52 | @RequiresRoles("super")
53 | @GetMapping("/list")
54 | public Result listAdmin(AdminFindDto adminFindDto) {
55 | Map map = adminService.findAdminList(adminFindDto);
56 | return Result.succ(map);
57 | }
58 |
59 | @ApiOperation("添加管理员")
60 | @RequiresRoles("super")
61 | @PostMapping("/add")
62 | public Result addAdmin(String username, String password, Integer roleId) {
63 | return adminService.addAdmin(username, password, roleId);
64 | }
65 |
66 | @ApiOperation("管理员登录")
67 | @PostMapping("/login")
68 | public Result login(@RequestBody LoginDto loginDto, HttpServletResponse response) {
69 | String username = loginDto.getUsername();
70 | String password = loginDto.getPassword();
71 | return adminService.login(username, password, response);
72 | }
73 |
74 | @ApiOperation("管理员登出")
75 | @RequiresRoles(value = {"admin", "super"}, logical = Logical.OR)
76 | @DeleteMapping("/logout")
77 | @RequiresAuthentication
78 | public Result logout(HttpServletRequest request) {
79 | String token = request.getHeader("Authorization");
80 | String adminId = JWTUtil.getUserId(token);
81 | redisUtil.del("Admin" + adminId);
82 | return Result.succ("退出成功");
83 | }
84 |
85 |
86 | @ApiOperation("修改密码")
87 | @RequiresRoles(value = {"admin", "super"}, logical = Logical.OR)
88 | @PostMapping("/changePassword")
89 | public Result changePassword(String oldPassword, String inPassword, String secondPassword, HttpServletRequest request) {
90 | return adminService.changePassword(oldPassword, inPassword, secondPassword, request);
91 | }
92 |
93 | @ApiOperation("修改我的用户名")
94 | @RequiresRoles(value = {"admin", "super"}, logical = Logical.OR)
95 | @PostMapping("/changeMyUsername")
96 | public Result changeMyUsername(String username, HttpServletRequest request) {
97 | return adminService.changeMyUsername(username, request);
98 | }
99 |
100 | @ApiOperation("修改角色")
101 | @RequiresRoles(value = {"super"})
102 | @PostMapping("/changeRole")
103 | public Result changeRole(Integer roleId, Integer adminId) {
104 | return adminService.changeRole(adminId, roleId);
105 | }
106 |
107 | @ApiOperation("删除管理员")
108 | @RequiresRoles(value = {"super"})
109 | @DeleteMapping("/deleteAdmin")
110 | public Result deleteAdmin(Integer adminId) {
111 | return adminService.deleteAdmin(adminId);
112 | }
113 | }
114 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/dto/AdminFindDto.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.dto;
2 |
3 | import lombok.Data;
4 |
5 | @Data
6 | public class AdminFindDto {
7 | /**
8 | * 管理员ID
9 | */
10 | private Integer adminId;
11 |
12 | /**
13 | * 账号
14 | */
15 | private String username;
16 |
17 | /**
18 | * 角色ID
19 | */
20 | private Integer roleId;
21 |
22 | /**
23 | * 当前页
24 | */
25 | private Integer pageNum;
26 |
27 | /**
28 | * 页面大小
29 | */
30 | private Integer pageSize;
31 |
32 | private String sort;
33 | }
34 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/dto/CollectDto.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.dto;
2 |
3 | import lombok.Data;
4 |
5 | @Data
6 | public class CollectDto {
7 | private Integer userId;
8 |
9 | private Integer postId;
10 |
11 | }
12 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/dto/CollectFindDto.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.dto;
2 |
3 | import lombok.Data;
4 |
5 | @Data
6 | public class CollectFindDto {
7 | private Integer userId;
8 | private Integer pageNum;
9 | private Integer pageSize;
10 | }
11 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/dto/CommentDto.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.dto;
2 |
3 | import lombok.Data;
4 |
5 | @Data
6 | public class CommentDto {
7 | private Integer postId;
8 | private Integer parentId;
9 | private String text;
10 | private String images;
11 | }
12 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/dto/CommentFindDto.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.dto;
2 |
3 | import lombok.Data;
4 |
5 | @Data
6 | public class CommentFindDto {
7 |
8 | /**
9 | * 评论ID
10 | */
11 | private Integer commentId;
12 |
13 | /**
14 | * 内容
15 | */
16 | private String text;
17 |
18 | /**
19 | * 帖子ID
20 | */
21 | private Integer postId;
22 |
23 | /**
24 | * 评论人ID
25 | */
26 | private Integer userId;
27 |
28 | /**
29 | * 当前页
30 | */
31 | private Integer pageNum;
32 |
33 | /**
34 | * 页面大小
35 | */
36 | private Integer pageSize;
37 |
38 | private String sort;
39 | }
40 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/dto/CommentVo.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.dto;
2 |
3 | import com.fasterxml.jackson.annotation.JsonFormat;
4 | import com.mrxu.stucomplarear2.entity.User;
5 | import lombok.Data;
6 |
7 | import java.util.Date;
8 |
9 | @Data
10 | public class CommentVo {
11 |
12 | /**
13 | * 评论ID
14 | */
15 | private Integer commentId;
16 |
17 | /**
18 | * 内容
19 | */
20 | private String text;
21 |
22 | /**
23 | * 图片
24 | */
25 | private String images;
26 |
27 | /**
28 | * 帖子ID
29 | */
30 | private Integer postId;
31 | private PostVo postVo;
32 |
33 | /**
34 | * 父评论ID
35 | */
36 | private CommentVo parentCommentVo;
37 |
38 | /**
39 | * 评论人ID
40 | */
41 | private Integer userId;
42 | private User user;
43 |
44 | /**
45 | * 评论时间
46 | */
47 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
48 | private Date createTime;}
49 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/dto/GoodsAddDto.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.dto;
2 |
3 | import lombok.Data;
4 |
5 | @Data
6 | public class GoodsAddDto {
7 |
8 | /**
9 | * 二手商品名称
10 | */
11 | private String goodsName;
12 |
13 | /**
14 | * 二手商品详情
15 | */
16 | private String goodsDetail;
17 |
18 | /**
19 | * 二手商品图片
20 | */
21 | private String goodsImages;
22 |
23 | /**
24 | * 二手商品定价
25 | */
26 | private Double goodsPrice;
27 |
28 | /**
29 | * 二手商品分类id
30 | */
31 | private Integer goodsCategoryId;
32 |
33 | /**
34 | * 二手商品数量
35 | */
36 | private Integer goodsCount;
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/dto/GoodsCategoryDto.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.dto;
2 |
3 | import lombok.Data;
4 |
5 | @Data
6 | public class GoodsCategoryDto {
7 | private Integer categoryId;
8 |
9 | /**
10 | * 二手商品分类级别(1-一级分类 2-二级分类 3-三级分类)
11 | */
12 | private Integer categoryLevel;
13 |
14 | /**
15 | * 二手商品父分类id
16 | */
17 | private Integer parentId;
18 |
19 | /**
20 | * 二手商品分类名称
21 | */
22 | private String categoryName;
23 |
24 | /**
25 | * 当前页
26 | */
27 | private Integer pageNum;
28 |
29 | /**
30 | * 页面大小
31 | */
32 | private Integer pageSize;
33 | private String sort;
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/dto/GoodsEditDto.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.dto;
2 |
3 | import lombok.Data;
4 |
5 | @Data
6 | public class GoodsEditDto {
7 |
8 | private Integer goodsId;
9 |
10 | /**
11 | * 二手商品名称
12 | */
13 | private String goodsName;
14 |
15 | /**
16 | * 二手商品详情
17 | */
18 | private String goodsDetail;
19 |
20 | /**
21 | * 二手商品图片
22 | */
23 | private String goodsImages;
24 |
25 | /**
26 | * 二手商品定价
27 | */
28 | private Double goodsPrice;
29 |
30 | /**
31 | * 二手商品分类id
32 | */
33 | private Integer goodsCategoryId;
34 |
35 | /**
36 | * 二手商品数量
37 | */
38 | private Integer goodsCount;
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/dto/GoodsFindDto.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.dto;
2 |
3 | import lombok.Data;
4 |
5 | @Data
6 | public class GoodsFindDto {
7 |
8 | /**
9 | * 二手商品id
10 | */
11 | private Integer goodsId;
12 |
13 | /**
14 | * 查询关键词
15 | */
16 | private String keyName;
17 |
18 | /**
19 | * 二手商品分类id
20 | */
21 | private Integer goodsCategoryId;
22 |
23 | /**
24 | * 二手商品上架状态:0-下架 1-上架
25 | */
26 | private Boolean goodsStatus;
27 |
28 |
29 | /**
30 | * 发布人id
31 | */
32 | private Integer userId;
33 |
34 | /**
35 | * 当前页
36 | */
37 | private Integer pageNum;
38 |
39 | /**
40 | * 页面大小
41 | */
42 | private Integer pageSize;
43 |
44 | private String sort;
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/dto/GoodsVo.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.dto;
2 |
3 | import com.fasterxml.jackson.annotation.JsonFormat;
4 | import com.mrxu.stucomplarear2.entity.GoodsCategory;
5 | import com.mrxu.stucomplarear2.entity.User;
6 | import lombok.Data;
7 |
8 | import java.util.Date;
9 |
10 | @Data
11 | public class GoodsVo {
12 | /**
13 | * 二手商品id
14 | */
15 | private Integer goodsId;
16 |
17 | /**
18 | * 二手商品名称
19 | */
20 | private String goodsName;
21 |
22 | /**
23 | * 二手商品详情
24 | */
25 | private String goodsDetail;
26 |
27 | /**
28 | * 二手商品图片
29 | */
30 | private String goodsImages;
31 |
32 | /**
33 | * 二手商品定价
34 | */
35 | private Double goodsPrice;
36 |
37 | /**
38 | * 二手商品分类id
39 | */
40 | private GoodsCategory goodsCategory;
41 |
42 | /**
43 | * 二手商品数量
44 | */
45 | private Integer goodsCount;
46 |
47 | /**
48 | * 二手商品上架状态:0-下架 1-上架
49 | */
50 | private boolean goodsStatus;
51 |
52 | /**
53 | * 二手商品发布时间
54 | */
55 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
56 | private Date createTime;
57 |
58 | /**
59 | * 二手商品信息更新时间
60 | */
61 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
62 | private Date updateTime;
63 |
64 | /**
65 | * 发布人id
66 | */
67 | private User user;
68 |
69 | /*
70 | 点击数
71 | */
72 | private Integer viewNum;
73 |
74 | }
75 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/dto/ImgResult.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.dto;
2 |
3 | import lombok.Data;
4 |
5 | @Data
6 | public class ImgResult {
7 | private String url;
8 | private String alt;
9 | }
10 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/dto/LetterAddDto.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.dto;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Data;
5 |
6 | @Data
7 | @AllArgsConstructor
8 | public class LetterAddDto {
9 |
10 | /**
11 | * 接收方ID
12 | */
13 | private Integer receiverId;
14 |
15 | /**
16 | * 私信内容
17 | */
18 | private String letterDetail;
19 | }
20 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/dto/LetterVo.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.dto;
2 |
3 | import com.fasterxml.jackson.annotation.JsonFormat;
4 | import com.mrxu.stucomplarear2.entity.User;
5 | import lombok.Data;
6 |
7 | import java.util.Date;
8 |
9 | @Data
10 | public class LetterVo {
11 |
12 | /**
13 | * 私信ID
14 | */
15 | private Integer letterId;
16 |
17 | /**
18 | * 接收方ID
19 | */
20 | private Integer receiverId;
21 | private User receiver;
22 |
23 | /**
24 | * 发送方ID
25 | */
26 | private Integer senderId;
27 | private User sender;
28 |
29 |
30 | /**
31 | * 私信内容
32 | */
33 | private String letterDetail;
34 |
35 | /**
36 | * 私信状态 0-未读 1-已读
37 | */
38 | private Integer letterStatus;
39 |
40 | /**
41 | * 创建时间
42 | */
43 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
44 | private Date createTime;
45 |
46 | /**
47 | * 更新时间
48 | */
49 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
50 | private Date updateTime;
51 |
52 | /**
53 | * 双方对话的标识 用户ID小的在前 如“2_3”
54 | */
55 | private String sessionId;
56 | }
57 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/dto/LoginDto.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.dto;
2 |
3 | import lombok.Data;
4 |
5 | @Data
6 | public class LoginDto {
7 | private String username;
8 | private String password;
9 | }
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/dto/MarketOrderFindDto.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.dto;
2 |
3 | import lombok.Data;
4 |
5 | @Data
6 | public class MarketOrderFindDto {
7 |
8 | /**
9 | * 订单id
10 | */
11 | private Integer orderId;
12 |
13 | /**
14 | * 卖家id
15 | */
16 | private Integer sellerId;
17 |
18 | /**
19 | * 买家id
20 | */
21 | private Integer buyerId;
22 |
23 | /**
24 | * 商品id
25 | */
26 | private Integer goodsId;
27 |
28 | /**
29 | * 订单状态:0-未付 1-已付 2-已发货 3-已签收 4-已退货 5-订单完成
30 | */
31 | private Integer orderStatus;
32 |
33 | /**
34 | * 当前页
35 | */
36 | private Integer pageNum;
37 |
38 | /**
39 | * 页面大小
40 | */
41 | private Integer pageSize;
42 |
43 | private String sort;
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/dto/MarketOrderVo.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.dto;
2 |
3 | import com.fasterxml.jackson.annotation.JsonFormat;
4 | import com.mrxu.stucomplarear2.entity.Goods;
5 | import com.mrxu.stucomplarear2.entity.User;
6 | import lombok.Data;
7 |
8 | import java.util.Date;
9 |
10 | @Data
11 | public class MarketOrderVo {
12 |
13 | /**
14 | * 订单id
15 | */
16 | private Integer orderId;
17 |
18 | /**
19 | * 卖家信息
20 | */
21 | private User seller;
22 |
23 | /**
24 | * 买家信息
25 | */
26 | private User buyer;
27 |
28 | /**
29 | * 商品信息
30 | */
31 | private Integer goodsId;
32 |
33 | /**
34 | * 商品信息
35 | */
36 | private Goods goods;
37 |
38 | /**
39 | * 购买数量
40 | */
41 | private Integer buyCount;
42 |
43 | /**
44 | * 订单总价
45 | */
46 | private Double totalPrice;
47 |
48 | /**
49 | * 订单生成时间
50 | */
51 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
52 | private Date createTime;
53 |
54 | /**
55 | * 更新时间
56 | */
57 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
58 | private Date updateTime;
59 |
60 | /**
61 | * 订单状态:0-未付 1-已付 2-已发货 3-已签收 4-已退货 5-订单完成
62 | */
63 | private Integer orderStatus;
64 |
65 |
66 | /**
67 | * 二手商品名称
68 | */
69 | private String goodsName;
70 |
71 | /**
72 | * 二手商品图片
73 | */
74 | private String goodsImages;
75 |
76 | /**
77 | * 二手商品定价
78 | */
79 | private Double goodsPrice;
80 |
81 | /**
82 | * 二手商品分类id
83 | */
84 | private Integer goodsCategoryId;
85 | }
86 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/dto/OrderAddDto.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.dto;
2 |
3 | import lombok.Data;
4 |
5 | @Data
6 | public class OrderAddDto {
7 | /**
8 | * 商品id
9 | */
10 | private Integer goodsId;
11 |
12 | /**
13 | * 购买数量
14 | */
15 | private Integer buyCount;
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/dto/PostEditDto.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.dto;
2 |
3 | import lombok.Data;
4 |
5 | @Data
6 | public class PostEditDto {
7 |
8 | private Integer postId;
9 | /**
10 | * 标题
11 | */
12 | private String title;
13 |
14 | /**
15 | * 内容
16 | */
17 | private String detail;
18 |
19 | /**
20 | * 图片
21 | */
22 | private String images;
23 |
24 | /**
25 | * 种类ID
26 | */
27 | private Integer categoryId;
28 | }
29 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/dto/PostFindDto.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.dto;
2 |
3 | import lombok.Data;
4 |
5 | @Data
6 | public class PostFindDto {
7 |
8 | /**
9 | * 帖子ID
10 | */
11 | private Integer postId;
12 |
13 | /**
14 | * 标题
15 | */
16 | private String title;
17 |
18 | /**
19 | * 内容
20 | */
21 | private String detail;
22 |
23 | /**
24 | * 评论数
25 | */
26 | private Integer commentNum;
27 |
28 | /**
29 | * 点击数
30 | */
31 | private Integer viewNum;
32 |
33 | /**
34 | * 发布人ID
35 | */
36 | private Integer userId;
37 |
38 | /**
39 | * 种类ID
40 | */
41 | private Integer categoryId;
42 |
43 | /**
44 | * 当前页
45 | */
46 | private Integer pageNum;
47 |
48 | /**
49 | * 页面大小
50 | */
51 | private Integer pageSize;
52 |
53 | private String sort;
54 |
55 | /**
56 | * 是否精帖
57 | */
58 | private Boolean bestPost;
59 |
60 | /**
61 | * 帖子状态
62 | */
63 | private Integer postStatus;
64 | }
65 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/dto/PostPublishDto.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.dto;
2 |
3 | import lombok.Data;
4 |
5 | @Data
6 | public class PostPublishDto {
7 |
8 | /**
9 | * 标题
10 | */
11 | private String title;
12 |
13 | /**
14 | * 内容
15 | */
16 | private String detail;
17 |
18 | /**
19 | * 图片
20 | */
21 | private String images;
22 |
23 | /**
24 | * 种类ID
25 | */
26 | private Integer categoryId;
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/dto/PostVo.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.dto;
2 |
3 | import com.fasterxml.jackson.annotation.JsonFormat;
4 | import com.mrxu.stucomplarear2.entity.Category;
5 | import com.mrxu.stucomplarear2.entity.User;
6 | import lombok.Data;
7 |
8 | import java.util.Date;
9 |
10 | @Data
11 | public class PostVo {
12 |
13 | /**
14 | * 帖子ID
15 | */
16 | private Integer postId;
17 |
18 | /**
19 | * 标题
20 | */
21 | private String title;
22 |
23 | /**
24 | * 内容
25 | */
26 | private String detail;
27 |
28 | /**
29 | * 图片
30 | */
31 | private String images;
32 |
33 | /**
34 | * 评论数
35 | */
36 | private Integer commentNum;
37 |
38 | /**
39 | * 点击数
40 | */
41 | private Integer viewNum;
42 |
43 | /**
44 | * 发布时间
45 | */
46 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
47 | private Date createTime;
48 |
49 | /**
50 | * 发布人信息
51 | */
52 | private User user;
53 |
54 | /**
55 | * 种类ID
56 | */
57 | private Category category;
58 |
59 | /**
60 | * 更新时间
61 | */
62 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
63 | private Date updateTime;
64 |
65 | /**
66 | * 是否精帖
67 | */
68 | private Boolean bestPost;
69 |
70 | /**
71 | * 收藏数
72 | */
73 | private Integer collectNum;
74 |
75 | /**
76 | *帖子状态 0-正常 1-锁定
77 | */
78 | private Integer postStatus;
79 |
80 | }
81 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/dto/RegisterDto.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.dto;
2 |
3 | import lombok.Data;
4 |
5 | @Data
6 | public class RegisterDto {
7 |
8 | private String username;
9 | private String password;
10 | private String secondPassword;
11 | private String sex;
12 | }
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/dto/UserEditDto.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.dto;
2 |
3 |
4 | import lombok.Data;
5 |
6 | @Data
7 | public class UserEditDto {
8 | /**
9 | * 用户ID
10 | */
11 | private Integer userId;
12 |
13 | /**
14 | * 账号
15 | */
16 | private String username;
17 |
18 | /**
19 | * 性别
20 | */
21 | private String sex;
22 |
23 | /**
24 | * 头像
25 | */
26 | private String avatar;
27 |
28 | /**
29 | * 个性签名
30 | */
31 | private String signature;
32 | }
33 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/dto/UserFindDto.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.dto;
2 |
3 | import lombok.Data;
4 |
5 | @Data
6 | public class UserFindDto {
7 |
8 | /**
9 | * 用户ID
10 | */
11 | private Integer userId;
12 |
13 | /**
14 | * 账号
15 | */
16 | private String username;
17 |
18 | /**
19 | * 性别
20 | */
21 | private String sex;
22 |
23 | /**
24 | * 状态 1锁定 0正常
25 | */
26 | private Integer status;
27 |
28 | /**
29 | * 当前页
30 | */
31 | private Integer pageNum;
32 |
33 | /**
34 | * 页面大小
35 | */
36 | private Integer pageSize;
37 |
38 | private String sort;
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/dto/WallApplyDto.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.dto;
2 |
3 | import lombok.Data;
4 |
5 | @Data
6 | public class WallApplyDto {
7 | /**
8 | * 墙内容
9 | */
10 | private String wallContent;
11 |
12 | /**
13 | * 墙图片
14 | */
15 | private String wallImages;
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/dto/WallAuditDto.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.dto;
2 |
3 | import lombok.Data;
4 |
5 | @Data
6 | public class WallAuditDto {
7 | /**
8 | * 墙ID
9 | */
10 | private Integer wallId;
11 |
12 | /**
13 | * 审核状态:0-待审 1-审核通过 2-未通过
14 | */
15 | private Integer auditState;
16 |
17 | /**
18 | * 审核不过原因
19 | */
20 | private String auditFailedCause;
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/dto/WallFindDto.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.dto;
2 |
3 | import lombok.Data;
4 |
5 | @Data
6 | public class WallFindDto {
7 | /**
8 | * 墙ID
9 | */
10 | private Integer wallId;
11 |
12 | /**
13 | * 审核人ID
14 | */
15 | private Integer adminId;
16 |
17 | /**
18 | * 审核状态:0-待审 1-审核通过 2-未通过
19 | */
20 | private Integer auditState;
21 |
22 | /**
23 | * 申请人ID
24 | */
25 | private Integer userId;
26 |
27 | /**
28 | * 当前页
29 | */
30 | private Integer pageNum;
31 |
32 | /**
33 | * 页面大小
34 | */
35 | private Integer pageSize;
36 |
37 | private String sort;
38 | }
39 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/mapper/AdminMapper.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.mapper;
2 |
3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 | import com.mrxu.stucomplarear2.entity.Admin;
5 | import org.springframework.stereotype.Component;
6 |
7 | /**
8 | *
9 | * Mapper 接口
10 | *
11 | *
12 | * @author Mr.Xu
13 | * @since 2022-04-02
14 | */
15 | @Component
16 | public interface AdminMapper extends BaseMapper {
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/mapper/CategoryMapper.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.mapper;
2 |
3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 | import com.mrxu.stucomplarear2.entity.Category;
5 | import org.springframework.stereotype.Component;
6 |
7 | /**
8 | *
9 | * Mapper 接口
10 | *
11 | *
12 | * @author Mr.Xu
13 | * @since 2021-12-27
14 | */
15 | @Component
16 | public interface CategoryMapper extends BaseMapper {
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/mapper/CollectMapper.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.mapper;
2 |
3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 | import com.mrxu.stucomplarear2.entity.Collect;
5 | import org.springframework.stereotype.Component;
6 |
7 | /**
8 | *
9 | * Mapper 接口
10 | *
11 | *
12 | * @author Mr.Xu
13 | * @since 2022-04-09
14 | */
15 | @Component
16 | public interface CollectMapper extends BaseMapper {
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/mapper/CommentMapper.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.mapper;
2 |
3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 | import com.mrxu.stucomplarear2.entity.Comment;
5 | import org.springframework.stereotype.Component;
6 |
7 | /**
8 | *
9 | * Mapper 接口
10 | *
11 | *
12 | * @author Mr.Xu
13 | * @since 2021-12-27
14 | */
15 | @Component
16 | public interface CommentMapper extends BaseMapper {
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/mapper/GoodsCategoryMapper.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.mapper;
2 |
3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 | import com.mrxu.stucomplarear2.entity.GoodsCategory;
5 | import org.springframework.stereotype.Component;
6 |
7 | /**
8 | *
9 | * Mapper 接口
10 | *
11 | *
12 | * @author Mr.Xu
13 | * @since 2022-04-15
14 | */
15 | @Component
16 | public interface GoodsCategoryMapper extends BaseMapper {
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/mapper/GoodsMapper.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.mapper;
2 |
3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 | import com.mrxu.stucomplarear2.entity.Goods;
5 | import org.springframework.stereotype.Component;
6 |
7 | /**
8 | *
9 | * Mapper 接口
10 | *
11 | *
12 | * @author Mr.Xu
13 | * @since 2022-04-15
14 | */
15 | @Component
16 | public interface GoodsMapper extends BaseMapper {
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/mapper/ImageMapper.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.mapper;
2 |
3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 | import com.mrxu.stucomplarear2.entity.Image;
5 | import org.apache.ibatis.annotations.Update;
6 | import org.springframework.stereotype.Component;
7 |
8 | /**
9 | *
10 | * Mapper 接口
11 | *
12 | *
13 | * @author Mr.Xu
14 | * @since 2022-01-23
15 | */
16 | @Component
17 | public interface ImageMapper extends BaseMapper {
18 |
19 | @Update("update image set state = '0' where id = #{imageId}")
20 | int deleteImageByUpdateSteta(String imageId);
21 | }
22 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/mapper/LetterMapper.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.mapper;
2 |
3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 | import com.mrxu.stucomplarear2.entity.Letter;
5 | import org.springframework.stereotype.Component;
6 |
7 | /**
8 | *
9 | * Mapper 接口
10 | *
11 | *
12 | * @author Mr.Xu
13 | * @since 2022-04-28
14 | */
15 | @Component
16 | public interface LetterMapper extends BaseMapper {
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/mapper/MarketOrderMapper.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.mapper;
2 |
3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 | import com.mrxu.stucomplarear2.entity.MarketOrder;
5 | import org.springframework.stereotype.Component;
6 |
7 | /**
8 | *
9 | * Mapper 接口
10 | *
11 | *
12 | * @author Mr.Xu
13 | * @since 2022-04-20
14 | */
15 | @Component
16 | public interface MarketOrderMapper extends BaseMapper {
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/mapper/PostMapper.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.mapper;
2 |
3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 | import com.mrxu.stucomplarear2.entity.Post;
5 | import org.springframework.stereotype.Component;
6 |
7 | /**
8 | *
9 | * Mapper 接口
10 | *
11 | *
12 | * @author Mr.Xu
13 | * @since 2021-12-27
14 | */
15 | @Component
16 | public interface PostMapper extends BaseMapper {
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/mapper/RoleMapper.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.mapper;
2 |
3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 | import com.mrxu.stucomplarear2.entity.Role;
5 | import org.apache.ibatis.annotations.Select;
6 | import org.springframework.stereotype.Component;
7 |
8 | import java.util.Set;
9 |
10 | /**
11 | *
12 | * Mapper 接口
13 | *
14 | *
15 | * @author Mr.Xu
16 | * @since 2021-12-01
17 | */
18 | @Component
19 | public interface RoleMapper extends BaseMapper {
20 |
21 | @Select("select role_name from user natural join role where user_id = #{userId}")
22 | Set selectRolesByUserId(Integer userId);
23 |
24 | @Select("select role_name from admin natural join role where admin_id = #{adminId}")
25 | Set selectRolesByAdminId(Integer adminId);
26 | }
27 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/mapper/UserMapper.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.mapper;
2 |
3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 | import com.mrxu.stucomplarear2.entity.User;
5 | import org.apache.ibatis.annotations.Select;
6 | import org.springframework.stereotype.Component;
7 |
8 | /**
9 | *
10 | * Mapper 接口
11 | *
12 | *
13 | * @author Mr.Xu
14 | * @since 2021-12-01
15 | */
16 | @Component
17 | public interface UserMapper extends BaseMapper {
18 |
19 | @Select("select user_id from user where username = #{username}")
20 | String selectUserIdByUsername(String username);
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/java/com/mrxu/stucomplarear2/mapper/WallMapper.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2.mapper;
2 |
3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 | import com.mrxu.stucomplarear2.entity.Wall;
5 | import org.springframework.stereotype.Component;
6 |
7 | /**
8 | *
9 | * Mapper 接口
10 | *
11 | *
12 | * @author Mr.Xu
13 | * @since 2021-12-15
14 | */
15 | @Component
16 | public interface WallMapper extends BaseMapper {
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 |
2 | #运行端口号
3 | server.port=8086
4 | #配置项目路径
5 | server.servlet.context-path=/
6 |
7 | #数据库连接配置信息 Ctrl+/ 注释
8 | #mysql8驱动
9 | spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
10 | #mysql5驱动 记得把连接地址换成本机ip地址
11 | #spring.datasource.driver-class-name=com.mysql.jdbc.Driver
12 | #spring.datasource.url=jdbc:mysql://ip地址:3306/数据库名?characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
13 | spring.datasource.url=jdbc:mysql://localhost:3306/stucompla_db?characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
14 | spring.datasource.username=root
15 | spring.datasource.password=root
16 |
17 | spring.servlet.multipart.max-file-size=100MB
18 | spring.servlet.multipart.max-request-size=100MB
19 | #mybatis配置 【这里需要配置】
20 | mybatis.type-aliases-package=com.mrxu.stucomplarear2.entity
21 | #显示mybatis日志 【这里需要配置】
22 | logging.level.com.mrxu.stucomplarear2.mapper=debug
23 | #mybatis中的xml文件存放位置
24 | mybatis-plus.mapper-locations=classpath:mapper/*.xml
25 |
26 | #redis配置
27 | spring.redis.host=127.0.0.1
28 | spring.redis.port=6379
29 | spring.redis.password=
30 | #配置图片存储路径
31 | mrxu.stucomplarear2.image.save-path=E:\\picture\\stucompla
32 | #5*1024*1024 2MB
33 | mrxu.stucomplarear2.image.max-size=5242880
34 |
35 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/resources/mapper/AdminMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/resources/mapper/CategoryMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/resources/mapper/CollectMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/resources/mapper/CommentMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/resources/mapper/GoodsCategoryMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/resources/mapper/GoodsMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/resources/mapper/ImageMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/resources/mapper/ImagesMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/resources/mapper/LetterMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/resources/mapper/MarketOrderMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/resources/mapper/PermissionMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/resources/mapper/PostMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/main/resources/mapper/WallMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/stucompla-rear2-feature-v0.0.1/src/test/java/com/mrxu/stucomplarear2/StucomplaRear2ApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.mrxu.stucomplarear2;
2 |
3 | import org.junit.jupiter.api.Test;
4 | import org.springframework.boot.test.context.SpringBootTest;
5 |
6 | @SpringBootTest
7 | class StucomplaRear2ApplicationTests {
8 |
9 | @Test
10 | void contextLoads() {
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------