@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [2018-2024] [macrozheng]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
@ -0,0 +1,61 @@
|
||||
## app-design
|
||||
|
||||
### 原型尺寸
|
||||
|
||||
名称 | 尺寸
|
||||
----|----
|
||||
android|360x640
|
||||
ios|375x667
|
||||
|
||||
### 尺寸
|
||||
|
||||
#### 字体大小
|
||||
|
||||
名称 | 尺寸
|
||||
----|----
|
||||
标题栏标题|17
|
||||
标题栏编辑|15
|
||||
标题字体1|17
|
||||
标题字体2|15
|
||||
正文字体|13
|
||||
|
||||
#### 中继器尺寸
|
||||
|
||||
名称 | 尺寸
|
||||
----|----
|
||||
单列宽度|375
|
||||
双列宽度|150
|
||||
双列左右填充|30
|
||||
双列水平垂直边距|15
|
||||
|
||||
#### 图标尺寸
|
||||
|
||||
名称 | 尺寸
|
||||
----|----
|
||||
图标|24x24
|
||||
|
||||
#### 通用尺寸
|
||||
|
||||
名称 | 尺寸
|
||||
----|----
|
||||
标题栏高度|44
|
||||
单行列表高度|44或48
|
||||
矩形内部填充间距|20
|
||||
分隔条宽度|15
|
||||
分隔条宽度2|20
|
||||
|
||||
### 颜色
|
||||
|
||||
名称 | 尺寸
|
||||
----|----
|
||||
app主色|#2AB795
|
||||
屏幕背景色|#EEEEEE
|
||||
弹框背景色|#04040F(40%)
|
||||
醒目色1|#FB0017
|
||||
醒目色2|#FD994B
|
||||
文字颜色1|#333333
|
||||
文字颜色2|#666666
|
||||
文字颜色3|#999999
|
||||
边框及分隔线颜色|#CCCCCC
|
||||
图标颜色|#666666或主色
|
||||
半透明色|纯黑色调整透明度
|
@ -0,0 +1,42 @@
|
||||
version: '3'
|
||||
services:
|
||||
mall-admin:
|
||||
image: mall/mall-admin:1.0-SNAPSHOT
|
||||
container_name: mall-admin
|
||||
ports:
|
||||
- 8080:8080
|
||||
volumes:
|
||||
- /mydata/app/mall-admin/logs:/var/logs
|
||||
- /etc/localtime:/etc/localtime
|
||||
environment:
|
||||
- 'TZ="Asia/Shanghai"'
|
||||
external_links:
|
||||
- mysql:db #可以用db这个域名访问mysql服务
|
||||
mall-search:
|
||||
image: mall/mall-search:1.0-SNAPSHOT
|
||||
container_name: mall-search
|
||||
ports:
|
||||
- 8081:8081
|
||||
volumes:
|
||||
- /mydata/app/mall-search/logs:/var/logs
|
||||
- /etc/localtime:/etc/localtime
|
||||
environment:
|
||||
- 'TZ="Asia/Shanghai"'
|
||||
external_links:
|
||||
- elasticsearch:es #可以用es这个域名访问elasticsearch服务
|
||||
- mysql:db #可以用db这个域名访问mysql服务
|
||||
mall-portal:
|
||||
image: mall/mall-portal:1.0-SNAPSHOT
|
||||
container_name: mall-portal
|
||||
ports:
|
||||
- 8085:8085
|
||||
volumes:
|
||||
- /mydata/app/mall-portal/logs:/var/logs
|
||||
- /etc/localtime:/etc/localtime
|
||||
environment:
|
||||
- 'TZ="Asia/Shanghai"'
|
||||
external_links:
|
||||
- redis:redis #可以用redis这个域名访问redis服务
|
||||
- mongo:mongo #可以用mongo这个域名访问mongo服务
|
||||
- mysql:db #可以用db这个域名访问mysql服务
|
||||
- rabbitmq:rabbit #可以用rabbit这个域名访问rabbitmq服务
|
@ -0,0 +1,99 @@
|
||||
version: '3'
|
||||
services:
|
||||
mysql:
|
||||
image: mysql:5.7
|
||||
container_name: mysql
|
||||
command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
|
||||
restart: always
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: root #设置root帐号密码
|
||||
ports:
|
||||
- 3306:3306
|
||||
volumes:
|
||||
- /mydata/mysql/data:/var/lib/mysql #数据文件目录挂载
|
||||
- /mydata/mysql/conf:/etc/mysql #配置文件目录挂载
|
||||
- /mydata/mysql/log:/var/log/mysql #日志文件目录挂载
|
||||
redis:
|
||||
image: redis:7
|
||||
container_name: redis
|
||||
command: redis-server --appendonly yes
|
||||
volumes:
|
||||
- /mydata/redis/data:/data #数据文件目录挂载
|
||||
ports:
|
||||
- 6379:6379
|
||||
nginx:
|
||||
image: nginx:1.22
|
||||
container_name: nginx
|
||||
volumes:
|
||||
- /mydata/nginx/conf:/etc/nginx #配置文件目录挂载
|
||||
- /mydata/nginx/html:/usr/share/nginx/html #静态资源根目录挂载
|
||||
- /mydata/nginx/logs:/var/log/nginx #日志文件目录挂载
|
||||
ports:
|
||||
- 80:80
|
||||
rabbitmq:
|
||||
image: rabbitmq:3.9.11-management
|
||||
container_name: rabbitmq
|
||||
volumes:
|
||||
- /mydata/rabbitmq/data:/var/lib/rabbitmq #数据文件目录挂载
|
||||
ports:
|
||||
- 5672:5672
|
||||
- 15672:15672
|
||||
elasticsearch:
|
||||
image: elasticsearch:7.17.3
|
||||
container_name: elasticsearch
|
||||
environment:
|
||||
- "cluster.name=elasticsearch" #设置集群名称为elasticsearch
|
||||
- "discovery.type=single-node" #以单一节点模式启动
|
||||
- "ES_JAVA_OPTS=-Xms512m -Xmx1024m" #设置es使用的jvm内存大小
|
||||
volumes:
|
||||
- /mydata/elasticsearch/plugins:/usr/share/elasticsearch/plugins #插件文件目录挂载
|
||||
- /mydata/elasticsearch/data:/usr/share/elasticsearch/data #数据文件目录挂载
|
||||
ports:
|
||||
- 9200:9200
|
||||
- 9300:9300
|
||||
logstash:
|
||||
image: logstash:7.17.3
|
||||
container_name: logstash
|
||||
environment:
|
||||
- TZ=Asia/Shanghai
|
||||
volumes:
|
||||
- /mydata/logstash/logstash.conf:/usr/share/logstash/pipeline/logstash.conf #配置文件挂载
|
||||
depends_on:
|
||||
- elasticsearch #kibana在elasticsearch启动之后再启动
|
||||
links:
|
||||
- elasticsearch:es #可以用es这个域名访问elasticsearch服务
|
||||
ports:
|
||||
- 4560:4560
|
||||
- 4561:4561
|
||||
- 4562:4562
|
||||
- 4563:4563
|
||||
kibana:
|
||||
image: kibana:7.17.3
|
||||
container_name: kibana
|
||||
links:
|
||||
- elasticsearch:es #可以用es这个域名访问elasticsearch服务
|
||||
depends_on:
|
||||
- elasticsearch #kibana在elasticsearch启动之后再启动
|
||||
environment:
|
||||
- "elasticsearch.hosts=http://es:9200" #设置访问elasticsearch的地址
|
||||
ports:
|
||||
- 5601:5601
|
||||
mongo:
|
||||
image: mongo:4
|
||||
container_name: mongo
|
||||
volumes:
|
||||
- /mydata/mongo/db:/data/db #数据文件目录挂载
|
||||
ports:
|
||||
- 27017:27017
|
||||
minio:
|
||||
image: minio/minio
|
||||
container_name: minio
|
||||
command: server /data --console-address ":9001" #指定数据目录及console运行端口启动
|
||||
volumes:
|
||||
- /mydata/minio/data:/data #数据目录挂载
|
||||
environment:
|
||||
- "MINIO_ROOT_USER=minioadmin"
|
||||
- "MINIO_ROOT_PASSWORD=minioadmin"
|
||||
ports:
|
||||
- 9090:9000
|
||||
- 9001:9001
|
@ -0,0 +1,45 @@
|
||||
|
||||
user nginx;
|
||||
worker_processes 1;
|
||||
|
||||
error_log /var/log/nginx/error.log warn;
|
||||
pid /var/run/nginx.pid;
|
||||
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||
'$status $body_bytes_sent "$http_referer" '
|
||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||
|
||||
access_log /var/log/nginx/access.log main;
|
||||
|
||||
sendfile on;
|
||||
#tcp_nopush on;
|
||||
|
||||
keepalive_timeout 65;
|
||||
|
||||
#gzip on;
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html index.htm;
|
||||
}
|
||||
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root /usr/share/nginx/html;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
input {
|
||||
tcp {
|
||||
mode => "server"
|
||||
host => "0.0.0.0"
|
||||
port => 4560
|
||||
codec => json_lines
|
||||
type => "debug"
|
||||
}
|
||||
tcp {
|
||||
mode => "server"
|
||||
host => "0.0.0.0"
|
||||
port => 4561
|
||||
codec => json_lines
|
||||
type => "error"
|
||||
}
|
||||
tcp {
|
||||
mode => "server"
|
||||
host => "0.0.0.0"
|
||||
port => 4562
|
||||
codec => json_lines
|
||||
type => "business"
|
||||
}
|
||||
tcp {
|
||||
mode => "server"
|
||||
host => "0.0.0.0"
|
||||
port => 4563
|
||||
codec => json_lines
|
||||
type => "record"
|
||||
}
|
||||
}
|
||||
filter{
|
||||
if [type] == "record" {
|
||||
mutate {
|
||||
remove_field => "port"
|
||||
remove_field => "host"
|
||||
remove_field => "@version"
|
||||
}
|
||||
json {
|
||||
source => "message"
|
||||
remove_field => ["message"]
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
elasticsearch {
|
||||
hosts => "localhost:9200"
|
||||
index => "mall-%{type}-%{+YYYY.MM.dd}"
|
||||
}
|
||||
}
|
@ -0,0 +1 @@
|
||||
{"diagram":{"elements":{"leftChildren":[{"parent":"root","children":[{"parent":"9f28d62a5672","task":{"completion":"10"},"children":[],"id":"c68327c7119f","title":"首页门户","icons":[{"color":"rgb(0, 166, 80)","name":"completion","index":"117"}]},{"parent":"9f28d62a5672","task":{"completion":"35"},"children":[],"id":"03d7217100d9","title":"商品推荐","icons":[{"color":"rgb(0, 166, 80)","name":"completion","index":"117"}]},{"parent":"9f28d62a5672","task":{"completion":"50"},"children":[],"id":"f1fe1fc552ab","title":"商品搜索","icons":[{"color":"rgb(0, 166, 80)","name":"completion","index":"117"}]},{"parent":"9f28d62a5672","task":{"completion":"50"},"children":[],"id":"f6df7fb9d389","title":"商品展示","icons":[{"color":"rgb(0, 166, 80)","name":"completion","index":"117"}]},{"parent":"9f28d62a5672","task":{"completion":"50"},"children":[],"id":"ef9a76e89256","title":"购物车","icons":[{"color":"rgb(0, 166, 80)","name":"completion","index":"117"}]},{"parent":"9f28d62a5672","task":{"completion":"50"},"children":[],"id":"b172bea6db59","title":"订单流程","icons":[{"color":"rgb(0, 166, 80)","name":"completion","index":"117"}]},{"parent":"9f28d62a5672","task":{"completion":"10"},"children":[],"id":"5099daff583b","title":"会员中心","icons":[{"color":"rgb(68, 68, 68)","name":"completion","index":"114"}]},{"parent":"9f28d62a5672","task":{"completion":"10"},"children":[],"id":"d8485d715f62","title":"客户服务","icons":[{"color":"rgb(0, 166, 80)","name":"completion","index":"110"}]},{"parent":"9f28d62a5672","task":{"completion":"10"},"children":[],"id":"1766943525e6","title":"帮助中心","icons":[{"color":"rgb(0, 166, 80)","name":"completion","index":"110"}]}],"id":"9f28d62a5672","title":"前台"}],"children":[{"parent":"root","children":[{"parent":"90e923d09398","task":{"completion":"100"},"children":[],"id":"dff7f75a0ed4","title":"商品管理","icons":[{"color":"rgb(0, 166, 80)","name":"completion","index":"117"}]},{"parent":"90e923d09398","task":{"completion":"100"},"children":[],"id":"6e33db4f10c9","title":"订单管理","icons":[{"color":"rgb(0, 166, 80)","name":"completion","index":"117"}]},{"parent":"90e923d09398","task":{"completion":"100"},"children":[],"id":"6e37938e8956","title":"促销管理","icons":[{"color":"rgb(0, 166, 80)","name":"completion","index":"117"}]},{"parent":"90e923d09398","task":{"completion":"100"},"children":[],"id":"efe9e584bd7f","title":"运营管理","icons":[{"color":"rgb(0, 166, 80)","name":"completion","index":"117"}]},{"parent":"90e923d09398","task":{"completion":"50"},"children":[],"id":"1c2047f6a380","title":"权限管理","icons":[{"color":"rgb(0, 166, 80)","name":"completion","index":"117"}]},{"parent":"90e923d09398","task":{"completion":"10"},"children":[],"id":"27cc62ad6c28","title":"会员管理","icons":[{"color":"rgb(113, 203, 45)","name":"completion","index":"110"}]},{"parent":"90e923d09398","task":{"completion":"10"},"children":[],"id":"30b686fb8384","title":"内容管理","icons":[{"color":"rgb(0, 166, 80)","name":"completion","index":"110"}]},{"parent":"90e923d09398","task":{"completion":"10"},"children":[],"id":"885c0538496d","title":"统计报表","icons":[{"color":"rgb(0, 166, 80)","name":"completion","index":"110"}]},{"parent":"90e923d09398","task":{"completion":"10"},"children":[],"id":"e20400573fac","title":"财务管理","icons":[{"color":"rgb(0, 166, 80)","name":"completion","index":"110"}]},{"parent":"90e923d09398","task":{"completion":"10"},"children":[],"id":"75c14d3c2f50","title":"设置","icons":[{"color":"rgb(0, 166, 80)","name":"completion","index":"110"}]}],"id":"90e923d09398","title":"后台"}],"root":true,"theme":"theme3","showWatermark":false,"id":"root","isBackground":true,"title":"mall","version":141,"structure":"mind_free"}},"meta":{"exportTime":"2023-07-10 10:30:52","member":"","diagramInfo":{"creator":"","created":"2018-11-27 10:37:22","modified":"2023-05-20 15:19:14","title":"项目开发进度图","category":"mind_free"},"id":"5bfcade2e4b0ef094cbe3658","type":"ProcessOn Schema File","version":"1.0"}}
|
@ -0,0 +1,188 @@
|
||||
{
|
||||
"variables": [],
|
||||
"info": {
|
||||
"name": "mall-admin",
|
||||
"_postman_id": "f4a4382c-ee6c-975f-99ac-7645532458ba",
|
||||
"description": "",
|
||||
"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
|
||||
},
|
||||
"item": [
|
||||
{
|
||||
"name": "添加优惠券",
|
||||
"request": {
|
||||
"url": "{{admin.mall}}/coupon/add",
|
||||
"method": "POST",
|
||||
"header": [
|
||||
{
|
||||
"key": "Content-Type",
|
||||
"value": "application/json",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\r\n \"amount\": 50,\r\n \"count\": 100,\r\n \"enableTime\": \"2018-08-27T08:40:46.973Z\",\r\n \"endTime\": \"2018-08-31T08:40:46.973Z\",\r\n \"minPoint\": 500,\r\n \"name\": \"T恤分类专用优惠券\",\r\n \"note\": \"满500减50\",\r\n \"perLimit\": 1,\r\n \"platform\": 0,\r\n \"publishCount\": 100,\r\n \"receiveCount\": 0,\r\n \"startTime\": \"2018-08-27T08:40:46.973Z\",\r\n \"type\": 0,\r\n \"useCount\": 0,\r\n \"useType\": 1,\r\n \"productCategoryRelationList\": [\r\n {\r\n \"productCategoryId\": 8\r\n }\r\n ]\r\n}"
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "删除指定优惠券",
|
||||
"request": {
|
||||
"url": "{{admin.mall}}/coupon/delete/6",
|
||||
"method": "POST",
|
||||
"header": [],
|
||||
"body": {},
|
||||
"description": ""
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "修改指定优惠券",
|
||||
"request": {
|
||||
"url": "{{admin.mall}}/coupon/update/6",
|
||||
"method": "POST",
|
||||
"header": [
|
||||
{
|
||||
"key": "Content-Type",
|
||||
"value": "application/json",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\r\n \"amount\": 300,\r\n \"count\": 100,\r\n \"enableTime\": \"2018-08-27T08:40:46.973Z\",\r\n \"endTime\": \"2018-08-31T08:40:46.973Z\",\r\n \"minPoint\": 2000,\r\n \"name\": \"满2000减200\",\r\n \"note\": \"手机分类专用优惠券\",\r\n \"perLimit\": 1,\r\n \"platform\": 0,\r\n \"publishCount\": 100,\r\n \"receiveCount\": 0,\r\n \"startTime\": \"2018-08-27T08:40:46.973Z\",\r\n \"type\": 0,\r\n \"useCount\": 0,\r\n \"useType\": 1,\r\n \"productCategoryRelationList\": [\r\n {\r\n \"productCategoryId\": 18\r\n }\r\n ]\r\n}"
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "登录",
|
||||
"request": {
|
||||
"url": "{{admin.mall}}/admin/login",
|
||||
"method": "POST",
|
||||
"header": [
|
||||
{
|
||||
"key": "Content-Type",
|
||||
"value": "application/json",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\r\n \"password\": \"123456\",\r\n \"username\": \"admin\"\r\n}"
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "查看商品列表",
|
||||
"request": {
|
||||
"url": "{{admin.mall}}/product/list",
|
||||
"method": "GET",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsImNyZWF0ZWQiOjE1Mzg5OTExNzkwODAsImV4cCI6MTUzOTU5NTk3OX0.u_fUHf09ONw6CCQW0ERufOgfuGUY1g7hu-o9thMl6wsFlBlkn1QmOZJwlU1ejsc65-N3p3k1pb11vTeqrVnYIw",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"body": {},
|
||||
"description": ""
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "批量修改商品的删除状态",
|
||||
"request": {
|
||||
"url": "{{admin.mall}}/product/update/deleteStatus",
|
||||
"method": "POST",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsImNyZWF0ZWQiOjE1Mzg5OTExNzkwODAsImV4cCI6MTUzOTU5NTk3OX0.u_fUHf09ONw6CCQW0ERufOgfuGUY1g7hu-o9thMl6wsFlBlkn1QmOZJwlU1ejsc65-N3p3k1pb11vTeqrVnYIw",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"key": "Content-Type",
|
||||
"value": "application/x-www-form-urlencoded",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"mode": "urlencoded",
|
||||
"urlencoded": [
|
||||
{
|
||||
"key": "ids",
|
||||
"value": "1,2",
|
||||
"description": "",
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
"key": "deleteStatus",
|
||||
"value": "1",
|
||||
"description": "",
|
||||
"type": "text"
|
||||
}
|
||||
]
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "查询所有一级分类及子分类",
|
||||
"request": {
|
||||
"url": "{{admin.mall}}/productCategory/list/withChildren",
|
||||
"method": "GET",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsImNyZWF0ZWQiOjE1Mzg5OTExNzkwODAsImV4cCI6MTUzOTU5NTk3OX0.u_fUHf09ONw6CCQW0ERufOgfuGUY1g7hu-o9thMl6wsFlBlkn1QmOZJwlU1ejsc65-N3p3k1pb11vTeqrVnYIw",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"body": {},
|
||||
"description": ""
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "获取全部品牌列表",
|
||||
"request": {
|
||||
"url": "{{admin.mall}}/brand/listAll",
|
||||
"method": "GET",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsImNyZWF0ZWQiOjE1Mzg5OTExNzkwODAsImV4cCI6MTUzOTU5NTk3OX0.u_fUHf09ONw6CCQW0ERufOgfuGUY1g7hu-o9thMl6wsFlBlkn1QmOZJwlU1ejsc65-N3p3k1pb11vTeqrVnYIw",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"body": {},
|
||||
"description": ""
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "刷新token",
|
||||
"request": {
|
||||
"url": "{{admin.mall}}/admin/token/refresh",
|
||||
"method": "GET",
|
||||
"header": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"value": "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsImNyZWF0ZWQiOjE1NTIzNTYzNzg0NjUsImV4cCI6MTU1Mjk2MTE3OH0.cxT6ULWfA17_QOh5nAcdU8FVldrSxLC2yi3y4fiHetCCrNzBBF9k6iRN-gfFmYa1_Ptav4WjgUAspZDBQa7SsA",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"body": {},
|
||||
"description": ""
|
||||
},
|
||||
"response": []
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
# mall功能结构说明
|
||||
|
||||
## 后台管理系统
|
||||
|
||||
### 商品管理
|
||||
|
||||

|
||||
|
||||
### 订单管理
|
||||
|
||||

|
||||
|
||||
### 促销管理
|
||||
|
||||

|
||||
|
||||
### 内容管理
|
||||
|
||||

|
||||
|
||||
### 用户管理
|
||||
|
||||

|
||||
|
||||
## 前台商城系统
|
||||
|
||||

|
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 31 KiB |
After Width: | Height: | Size: 3.4 MiB |
After Width: | Height: | Size: 1.6 MiB |
After Width: | Height: | Size: 39 KiB |
After Width: | Height: | Size: 44 KiB |
After Width: | Height: | Size: 35 KiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 192 KiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 126 KiB |
After Width: | Height: | Size: 186 KiB |
After Width: | Height: | Size: 233 KiB |
After Width: | Height: | Size: 183 KiB |
After Width: | Height: | Size: 226 KiB |
After Width: | Height: | Size: 140 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 39 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 35 KiB |
After Width: | Height: | Size: 136 KiB |
After Width: | Height: | Size: 151 KiB |
After Width: | Height: | Size: 29 KiB |
After Width: | Height: | Size: 130 KiB |
@ -0,0 +1,10 @@
|
||||
# 该镜像需要依赖的基础镜像
|
||||
FROM openjdk:8
|
||||
# 将当前目录下的jar包复制到docker容器的/目录下
|
||||
ADD mall-admin-1.0-SNAPSHOT.jar /mall-admin-1.0-SNAPSHOT.jar
|
||||
# 声明服务运行在8080端口
|
||||
EXPOSE 8080
|
||||
# 指定docker容器启动时运行jar包
|
||||
ENTRYPOINT ["java", "-jar","/mall-admin-1.0-SNAPSHOT.jar"]
|
||||
# 指定维护者的名字
|
||||
MAINTAINER macro
|
@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
app_name='mall-admin'
|
||||
docker stop ${app_name}
|
||||
echo '----stop container----'
|
||||
docker rm ${app_name}
|
||||
echo '----rm container----'
|
||||
docker rmi `docker images | grep none | awk '{print $3}'`
|
||||
echo '----rm none images----'
|
||||
docker run -p 8080:8080 --name ${app_name} \
|
||||
--link mysql:db \
|
||||
--link redis:redis \
|
||||
-e TZ="Asia/Shanghai" \
|
||||
-v /etc/localtime:/etc/localtime \
|
||||
-v /mydata/app/${app_name}/logs:/var/logs \
|
||||
-d mall/${app_name}:1.0-SNAPSHOT
|
||||
echo '----start container----'
|
@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
app_name='mall-portal'
|
||||
docker stop ${app_name}
|
||||
echo '----stop container----'
|
||||
docker rm ${app_name}
|
||||
echo '----rm container----'
|
||||
docker rmi `docker images | grep none | awk '{print $3}'`
|
||||
echo '----rm none images----'
|
||||
docker run -p 8085:8085 --name ${app_name} \
|
||||
--link mysql:db \
|
||||
--link redis:redis \
|
||||
--link mongo:mongo \
|
||||
--link rabbitmq:rabbit \
|
||||
-e TZ="Asia/Shanghai" \
|
||||
-v /etc/localtime:/etc/localtime \
|
||||
-v /mydata/app/${app_name}/logs:/var/logs \
|
||||
-d mall/${app_name}:1.0-SNAPSHOT
|
||||
echo '----start container----'
|
@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
app_name='mall-search'
|
||||
docker stop ${app_name}
|
||||
echo '----stop container----'
|
||||
docker rm ${app_name}
|
||||
echo '----rm container----'
|
||||
docker rmi `docker images | grep none | awk '{print $3}'`
|
||||
echo '----rm none images----'
|
||||
docker run -p 8081:8081 --name ${app_name} \
|
||||
--link mysql:db \
|
||||
--link elasticsearch:es \
|
||||
-e TZ="Asia/Shanghai" \
|
||||
-v /etc/localtime:/etc/localtime \
|
||||
-v /mydata/app/${app_name}/logs:/var/logs \
|
||||
-d mall/${app_name}:1.0-SNAPSHOT
|
||||
echo '----start container----'
|
@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
# 定义应用组名
|
||||
group_name='mall'
|
||||
# 定义应用名称
|
||||
app_name='mall-admin'
|
||||
# 定义应用版本
|
||||
app_version='1.0-SNAPSHOT'
|
||||
# 定义应用环境
|
||||
profile_active='prod'
|
||||
echo '----copy jar----'
|
||||
docker stop ${app_name}
|
||||
echo '----stop container----'
|
||||
docker rm ${app_name}
|
||||
echo '----rm container----'
|
||||
docker rmi ${group_name}/${app_name}:${app_version}
|
||||
echo '----rm image----'
|
||||
# 打包编译docker镜像
|
||||
docker build -t ${group_name}/${app_name}:${app_version} .
|
||||
echo '----build image----'
|
||||
docker run -p 8080:8080 --name ${app_name} \
|
||||
--link mysql:db \
|
||||
--link redis:redis \
|
||||
-e 'spring.profiles.active'=${profile_active} \
|
||||
-e TZ="Asia/Shanghai" \
|
||||
-v /etc/localtime:/etc/localtime \
|
||||
-v /mydata/app/${app_name}/logs:/var/logs \
|
||||
-d ${group_name}/${app_name}:${app_version}
|
||||
echo '----start container----'
|
@ -0,0 +1,49 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.macro.mall</groupId>
|
||||
<artifactId>mall-admin</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>mall-admin</name>
|
||||
<description>mall-admin project for mall</description>
|
||||
|
||||
<parent>
|
||||
<groupId>com.macro.mall</groupId>
|
||||
<artifactId>mall</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.macro.mall</groupId>
|
||||
<artifactId>mall-mbg</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.macro.mall</groupId>
|
||||
<artifactId>mall-security</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.aliyun.oss</groupId>
|
||||
<artifactId>aliyun-sdk-oss</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.minio</groupId>
|
||||
<artifactId>minio</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>io.fabric8</groupId>
|
||||
<artifactId>docker-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
@ -0,0 +1,15 @@
|
||||
package com.macro.mall;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* 应用启动入口
|
||||
* Created by macro on 2018/4/26.
|
||||
*/
|
||||
@SpringBootApplication
|
||||
public class MallAdminApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(MallAdminApplication.class, args);
|
||||
}
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package com.macro.mall.bo;
|
||||
|
||||
import com.macro.mall.model.UmsAdmin;
|
||||
import com.macro.mall.model.UmsResource;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.authority.SimpleGrantedAuthority;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* SpringSecurity需要的用户信息封装类
|
||||
* Created by macro on 2018/4/26.
|
||||
*/
|
||||
public class AdminUserDetails implements UserDetails {
|
||||
//后台用户
|
||||
private final UmsAdmin umsAdmin;
|
||||
//拥有资源列表
|
||||
private final List<UmsResource> resourceList;
|
||||
|
||||
public AdminUserDetails(UmsAdmin umsAdmin,List<UmsResource> resourceList) {
|
||||
this.umsAdmin = umsAdmin;
|
||||
this.resourceList = resourceList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<? extends GrantedAuthority> getAuthorities() {
|
||||
//返回当前用户所拥有的资源
|
||||
return resourceList.stream()
|
||||
.map(resource ->new SimpleGrantedAuthority(resource.getId()+":"+resource.getName()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPassword() {
|
||||
return umsAdmin.getPassword();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUsername() {
|
||||
return umsAdmin.getUsername();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAccountNonExpired() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAccountNonLocked() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCredentialsNonExpired() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnabled() {
|
||||
return umsAdmin.getStatus().equals(1);
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.macro.mall.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.cors.CorsConfiguration;
|
||||
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
|
||||
import org.springframework.web.filter.CorsFilter;
|
||||
|
||||
/**
|
||||
* 全局跨域配置
|
||||
* Created by macro on 2019/7/27.
|
||||
*/
|
||||
@Configuration
|
||||
public class GlobalCorsConfig {
|
||||
|
||||
/**
|
||||
* 允许跨域调用的过滤器
|
||||
*/
|
||||
@Bean
|
||||
public CorsFilter corsFilter() {
|
||||
CorsConfiguration config = new CorsConfiguration();
|
||||
//允许所有域名进行跨域调用
|
||||
config.addAllowedOriginPattern("*");
|
||||
//允许跨越发送cookie
|
||||
config.setAllowCredentials(true);
|
||||
//放行全部原始头信息
|
||||
config.addAllowedHeader("*");
|
||||
//允许所有请求方法跨域调用
|
||||
config.addAllowedMethod("*");
|
||||
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
|
||||
source.registerCorsConfiguration("/**", config);
|
||||
return new CorsFilter(source);
|
||||
}
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
package com.macro.mall.config;
|
||||
|
||||
import com.macro.mall.model.UmsResource;
|
||||
import com.macro.mall.security.component.DynamicSecurityService;
|
||||
import com.macro.mall.service.UmsAdminService;
|
||||
import com.macro.mall.service.UmsResourceService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.security.access.ConfigAttribute;
|
||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
* mall-security模块相关配置
|
||||
* Created by macro on 2019/11/9.
|
||||
*/
|
||||
@Configuration
|
||||
public class MallSecurityConfig {
|
||||
|
||||
@Autowired
|
||||
private UmsAdminService adminService;
|
||||
@Autowired
|
||||
private UmsResourceService resourceService;
|
||||
|
||||
@Bean
|
||||
public UserDetailsService userDetailsService() {
|
||||
//获取登录用户信息
|
||||
return username -> adminService.loadUserByUsername(username);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public DynamicSecurityService dynamicSecurityService() {
|
||||
return new DynamicSecurityService() {
|
||||
@Override
|
||||
public Map<String, ConfigAttribute> loadDataSource() {
|
||||
Map<String, ConfigAttribute> map = new ConcurrentHashMap<>();
|
||||
List<UmsResource> resourceList = resourceService.listAll();
|
||||
for (UmsResource resource : resourceList) {
|
||||
map.put(resource.getUrl(), new org.springframework.security.access.SecurityConfig(resource.getId() + ":" + resource.getName()));
|
||||
}
|
||||
return map;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.macro.mall.config;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
|
||||
/**
|
||||
* MyBatis相关配置
|
||||
* Created by macro on 2019/4/8.
|
||||
*/
|
||||
@Configuration
|
||||
@EnableTransactionManagement
|
||||
@MapperScan({"com.macro.mall.mapper","com.macro.mall.dao"})
|
||||
public class MyBatisConfig {
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.macro.mall.config;
|
||||
|
||||
import com.aliyun.oss.OSSClient;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* OSS对象存储相关配置
|
||||
* Created by macro on 2018/5/17.
|
||||
*/
|
||||
@Configuration
|
||||
public class OssConfig {
|
||||
@Value("${aliyun.oss.endpoint}")
|
||||
private String ALIYUN_OSS_ENDPOINT;
|
||||
@Value("${aliyun.oss.accessKeyId}")
|
||||
private String ALIYUN_OSS_ACCESSKEYID;
|
||||
@Value("${aliyun.oss.accessKeySecret}")
|
||||
private String ALIYUN_OSS_ACCESSKEYSECRET;
|
||||
@Bean
|
||||
public OSSClient ossClient(){
|
||||
return new OSSClient(ALIYUN_OSS_ENDPOINT,ALIYUN_OSS_ACCESSKEYID,ALIYUN_OSS_ACCESSKEYSECRET);
|
||||
}
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package com.macro.mall.config;
|
||||
|
||||
import com.macro.mall.common.config.BaseSwaggerConfig;
|
||||
import com.macro.mall.common.domain.SwaggerProperties;
|
||||
import org.springframework.beans.factory.config.BeanPostProcessor;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
|
||||
/**
|
||||
* Swagger相关配置
|
||||
* Created by macro on 2018/4/26.
|
||||
*/
|
||||
@Configuration
|
||||
@EnableSwagger2
|
||||
public class SwaggerConfig extends BaseSwaggerConfig {
|
||||
|
||||
@Override
|
||||
public SwaggerProperties swaggerProperties() {
|
||||
return SwaggerProperties.builder()
|
||||
.apiBasePackage("com.macro.mall.controller")
|
||||
.title("mall后台系统")
|
||||
.description("mall后台相关接口文档")
|
||||
.contactName("macro")
|
||||
.version("1.0")
|
||||
.enableSecurity(true)
|
||||
.build();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public BeanPostProcessor springfoxHandlerProviderBeanPostProcessor() {
|
||||
return generateBeanPostProcessor();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package com.macro.mall.controller;
|
||||
|
||||
import com.macro.mall.common.api.CommonResult;
|
||||
import com.macro.mall.model.CmsPrefrenceArea;
|
||||
import com.macro.mall.service.CmsPrefrenceAreaService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品优选管理Controller
|
||||
* Created by macro on 2018/6/1.
|
||||
*/
|
||||
@Controller
|
||||
@Api(tags = "CmsPrefrenceAreaController")
|
||||
@Tag(name = "CmsPrefrenceAreaController", description = "商品优选管理")
|
||||
@RequestMapping("/prefrenceArea")
|
||||
public class CmsPrefrenceAreaController {
|
||||
@Autowired
|
||||
private CmsPrefrenceAreaService prefrenceAreaService;
|
||||
|
||||
@ApiOperation("获取所有商品优选")
|
||||
@RequestMapping(value = "/listAll", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<List<CmsPrefrenceArea>> listAll() {
|
||||
List<CmsPrefrenceArea> prefrenceAreaList = prefrenceAreaService.listAll();
|
||||
return CommonResult.success(prefrenceAreaList);
|
||||
}
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
package com.macro.mall.controller;
|
||||
|
||||
import com.macro.mall.common.api.CommonPage;
|
||||
import com.macro.mall.common.api.CommonResult;
|
||||
import com.macro.mall.model.CmsSubject;
|
||||
import com.macro.mall.service.CmsSubjectService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品专题管理Controller
|
||||
* Created by macro on 2018/6/1.
|
||||
*/
|
||||
@Controller
|
||||
@Api(tags = "CmsSubjectController")
|
||||
@Tag(name = "CmsSubjectController", description = "商品专题管理")
|
||||
@RequestMapping("/subject")
|
||||
public class CmsSubjectController {
|
||||
@Autowired
|
||||
private CmsSubjectService subjectService;
|
||||
|
||||
@ApiOperation("获取全部商品专题")
|
||||
@RequestMapping(value = "/listAll", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<List<CmsSubject>> listAll() {
|
||||
List<CmsSubject> subjectList = subjectService.listAll();
|
||||
return CommonResult.success(subjectList);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "根据专题名称分页获取商品专题")
|
||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<CommonPage<CmsSubject>> getList(@RequestParam(value = "keyword", required = false) String keyword,
|
||||
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize) {
|
||||
List<CmsSubject> subjectList = subjectService.list(keyword, pageNum, pageSize);
|
||||
return CommonResult.success(CommonPage.restPage(subjectList));
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package com.macro.mall.controller;
|
||||
|
||||
import com.macro.mall.common.api.CommonResult;
|
||||
import com.macro.mall.model.OmsCompanyAddress;
|
||||
import com.macro.mall.service.OmsCompanyAddressService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 收货地址管理Controller
|
||||
* Created by macro on 2018/10/18.
|
||||
*/
|
||||
@Controller
|
||||
@Api(tags = "OmsCompanyAddressController")
|
||||
@Tag(name = "OmsCompanyAddressController", description = "收货地址管理")
|
||||
@RequestMapping("/companyAddress")
|
||||
public class OmsCompanyAddressController {
|
||||
@Autowired
|
||||
private OmsCompanyAddressService companyAddressService;
|
||||
|
||||
@ApiOperation("获取所有收货地址")
|
||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<List<OmsCompanyAddress>> list() {
|
||||
List<OmsCompanyAddress> companyAddressList = companyAddressService.list();
|
||||
return CommonResult.success(companyAddressList);
|
||||
}
|
||||
}
|
@ -0,0 +1,114 @@
|
||||
package com.macro.mall.controller;
|
||||
|
||||
import com.macro.mall.common.api.CommonPage;
|
||||
import com.macro.mall.common.api.CommonResult;
|
||||
import com.macro.mall.dto.*;
|
||||
import com.macro.mall.model.OmsOrder;
|
||||
import com.macro.mall.service.OmsOrderService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单管理Controller
|
||||
* Created by macro on 2018/10/11.
|
||||
*/
|
||||
@Controller
|
||||
@Api(tags = "OmsOrderController")
|
||||
@Tag(name = "OmsOrderController", description = "订单管理")
|
||||
@RequestMapping("/order")
|
||||
public class OmsOrderController {
|
||||
@Autowired
|
||||
private OmsOrderService orderService;
|
||||
|
||||
@ApiOperation("查询订单")
|
||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<CommonPage<OmsOrder>> list(OmsOrderQueryParam queryParam,
|
||||
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
|
||||
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
|
||||
List<OmsOrder> orderList = orderService.list(queryParam, pageSize, pageNum);
|
||||
return CommonResult.success(CommonPage.restPage(orderList));
|
||||
}
|
||||
|
||||
@ApiOperation("批量发货")
|
||||
@RequestMapping(value = "/update/delivery", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult delivery(@RequestBody List<OmsOrderDeliveryParam> deliveryParamList) {
|
||||
int count = orderService.delivery(deliveryParamList);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("批量关闭订单")
|
||||
@RequestMapping(value = "/update/close", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult close(@RequestParam("ids") List<Long> ids, @RequestParam String note) {
|
||||
int count = orderService.close(ids, note);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除订单")
|
||||
@RequestMapping(value = "/delete", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult delete(@RequestParam("ids") List<Long> ids) {
|
||||
int count = orderService.delete(ids);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("获取订单详情:订单信息、商品信息、操作记录")
|
||||
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<OmsOrderDetail> detail(@PathVariable Long id) {
|
||||
OmsOrderDetail orderDetailResult = orderService.detail(id);
|
||||
return CommonResult.success(orderDetailResult);
|
||||
}
|
||||
|
||||
@ApiOperation("修改收货人信息")
|
||||
@RequestMapping(value = "/update/receiverInfo", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult updateReceiverInfo(@RequestBody OmsReceiverInfoParam receiverInfoParam) {
|
||||
int count = orderService.updateReceiverInfo(receiverInfoParam);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("修改订单费用信息")
|
||||
@RequestMapping(value = "/update/moneyInfo", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult updateReceiverInfo(@RequestBody OmsMoneyInfoParam moneyInfoParam) {
|
||||
int count = orderService.updateMoneyInfo(moneyInfoParam);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("备注订单")
|
||||
@RequestMapping(value = "/update/note", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult updateNote(@RequestParam("id") Long id,
|
||||
@RequestParam("note") String note,
|
||||
@RequestParam("status") Integer status) {
|
||||
int count = orderService.updateNote(id, note, status);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
package com.macro.mall.controller;
|
||||
|
||||
import com.macro.mall.common.api.CommonPage;
|
||||
import com.macro.mall.common.api.CommonResult;
|
||||
import com.macro.mall.dto.OmsOrderReturnApplyResult;
|
||||
import com.macro.mall.dto.OmsReturnApplyQueryParam;
|
||||
import com.macro.mall.dto.OmsUpdateStatusParam;
|
||||
import com.macro.mall.model.OmsOrderReturnApply;
|
||||
import com.macro.mall.service.OmsOrderReturnApplyService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单退货申请管理Controller
|
||||
* Created by macro on 2018/10/18.
|
||||
*/
|
||||
@Controller
|
||||
@Api(tags = "OmsOrderReturnApplyController")
|
||||
@Tag(name = "OmsOrderReturnApplyController", description = "订单退货申请管理")
|
||||
@RequestMapping("/returnApply")
|
||||
public class OmsOrderReturnApplyController {
|
||||
@Autowired
|
||||
private OmsOrderReturnApplyService returnApplyService;
|
||||
|
||||
@ApiOperation("分页查询退货申请")
|
||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<CommonPage<OmsOrderReturnApply>> list(OmsReturnApplyQueryParam queryParam,
|
||||
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
|
||||
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
|
||||
List<OmsOrderReturnApply> returnApplyList = returnApplyService.list(queryParam, pageSize, pageNum);
|
||||
return CommonResult.success(CommonPage.restPage(returnApplyList));
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除退货申请")
|
||||
@RequestMapping(value = "/delete", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult delete(@RequestParam("ids") List<Long> ids) {
|
||||
int count = returnApplyService.delete(ids);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("获取退货申请详情")
|
||||
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult getItem(@PathVariable Long id) {
|
||||
OmsOrderReturnApplyResult result = returnApplyService.getItem(id);
|
||||
return CommonResult.success(result);
|
||||
}
|
||||
|
||||
@ApiOperation("修改退货申请状态")
|
||||
@RequestMapping(value = "/update/status/{id}", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult updateStatus(@PathVariable Long id, @RequestBody OmsUpdateStatusParam statusParam) {
|
||||
int count = returnApplyService.updateStatus(id, statusParam);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,89 @@
|
||||
package com.macro.mall.controller;
|
||||
|
||||
import com.macro.mall.common.api.CommonPage;
|
||||
import com.macro.mall.common.api.CommonResult;
|
||||
import com.macro.mall.model.OmsOrderReturnReason;
|
||||
import com.macro.mall.service.OmsOrderReturnReasonService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 退货原因管理Controller
|
||||
* Created by macro on 2018/10/17.
|
||||
*/
|
||||
@Controller
|
||||
@Api(tags = "OmsOrderReturnReasonController")
|
||||
@Tag(name = "OmsOrderReturnReasonController", description = "退货原因管理")
|
||||
@RequestMapping("/returnReason")
|
||||
public class OmsOrderReturnReasonController {
|
||||
@Autowired
|
||||
private OmsOrderReturnReasonService orderReturnReasonService;
|
||||
|
||||
@ApiOperation("添加退货原因")
|
||||
@RequestMapping(value = "/create", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult create(@RequestBody OmsOrderReturnReason returnReason) {
|
||||
int count = orderReturnReasonService.create(returnReason);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("修改退货原因")
|
||||
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult update(@PathVariable Long id, @RequestBody OmsOrderReturnReason returnReason) {
|
||||
int count = orderReturnReasonService.update(id, returnReason);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除退货原因")
|
||||
@RequestMapping(value = "/delete", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult delete(@RequestParam("ids") List<Long> ids) {
|
||||
int count = orderReturnReasonService.delete(ids);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("分页查询退货原因")
|
||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<CommonPage<OmsOrderReturnReason>> list(@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
|
||||
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
|
||||
List<OmsOrderReturnReason> reasonList = orderReturnReasonService.list(pageSize, pageNum);
|
||||
return CommonResult.success(CommonPage.restPage(reasonList));
|
||||
}
|
||||
|
||||
@ApiOperation("获取单个退货原因详情信息")
|
||||
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<OmsOrderReturnReason> getItem(@PathVariable Long id) {
|
||||
OmsOrderReturnReason reason = orderReturnReasonService.getItem(id);
|
||||
return CommonResult.success(reason);
|
||||
}
|
||||
|
||||
@ApiOperation("修改退货原因启用状态")
|
||||
@RequestMapping(value = "/update/status", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult updateStatus(@RequestParam(value = "status") Integer status,
|
||||
@RequestParam("ids") List<Long> ids) {
|
||||
int count = orderReturnReasonService.updateStatus(ids, status);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package com.macro.mall.controller;
|
||||
|
||||
import com.macro.mall.common.api.CommonResult;
|
||||
import com.macro.mall.model.OmsOrderSetting;
|
||||
import com.macro.mall.service.OmsOrderSettingService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 订单设置管理Controller
|
||||
* Created by macro on 2018/10/16.
|
||||
*/
|
||||
@Controller
|
||||
@Api(tags = "OmsOrderSettingController")
|
||||
@Tag(name = "OmsOrderSettingController", description = "订单设置管理")
|
||||
@RequestMapping("/orderSetting")
|
||||
public class OmsOrderSettingController {
|
||||
@Autowired
|
||||
private OmsOrderSettingService orderSettingService;
|
||||
|
||||
@ApiOperation("获取指定订单设置")
|
||||
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<OmsOrderSetting> getItem(@PathVariable Long id) {
|
||||
OmsOrderSetting orderSetting = orderSettingService.getItem(id);
|
||||
return CommonResult.success(orderSetting);
|
||||
}
|
||||
|
||||
@ApiOperation("修改指定订单设置")
|
||||
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult update(@PathVariable Long id, @RequestBody OmsOrderSetting orderSetting) {
|
||||
int count = orderSettingService.update(id,orderSetting);
|
||||
if(count>0){
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
package com.macro.mall.controller;
|
||||
|
||||
|
||||
import com.macro.mall.common.api.CommonResult;
|
||||
import com.macro.mall.dto.OssCallbackResult;
|
||||
import com.macro.mall.dto.OssPolicyResult;
|
||||
import com.macro.mall.service.OssService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* Oss对象存储管理Controller
|
||||
* Created by macro on 2018/4/26.
|
||||
*/
|
||||
@Controller
|
||||
@Api(tags = "OssController")
|
||||
@Tag(name = "OssController", description = "Oss对象存储管理")
|
||||
@RequestMapping("/aliyun/oss")
|
||||
public class OssController {
|
||||
@Autowired
|
||||
private OssService ossService;
|
||||
|
||||
@ApiOperation(value = "Oss上传签名生成")
|
||||
@RequestMapping(value = "/policy", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<OssPolicyResult> policy() {
|
||||
OssPolicyResult result = ossService.policy();
|
||||
return CommonResult.success(result);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "Oss上传成功回调")
|
||||
@RequestMapping(value = "callback", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult<OssCallbackResult> callback(HttpServletRequest request) {
|
||||
OssCallbackResult ossCallbackResult = ossService.callback(request);
|
||||
return CommonResult.success(ossCallbackResult);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,133 @@
|
||||
package com.macro.mall.controller;
|
||||
|
||||
import com.macro.mall.common.api.CommonPage;
|
||||
import com.macro.mall.common.api.CommonResult;
|
||||
import com.macro.mall.dto.PmsBrandParam;
|
||||
import com.macro.mall.model.PmsBrand;
|
||||
import com.macro.mall.service.PmsBrandService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品品牌管理Controller
|
||||
* Created by macro on 2018/4/26.
|
||||
*/
|
||||
@Controller
|
||||
@Api(tags = "PmsBrandController")
|
||||
@Tag(name = "PmsBrandController", description = "商品品牌管理")
|
||||
@RequestMapping("/brand")
|
||||
public class PmsBrandController {
|
||||
@Autowired
|
||||
private PmsBrandService brandService;
|
||||
|
||||
@ApiOperation(value = "获取全部品牌列表")
|
||||
@RequestMapping(value = "/listAll", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<List<PmsBrand>> getList() {
|
||||
return CommonResult.success(brandService.listAllBrand());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "添加品牌")
|
||||
@RequestMapping(value = "/create", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult create(@Validated @RequestBody PmsBrandParam pmsBrand) {
|
||||
CommonResult commonResult;
|
||||
int count = brandService.createBrand(pmsBrand);
|
||||
if (count == 1) {
|
||||
commonResult = CommonResult.success(count);
|
||||
} else {
|
||||
commonResult = CommonResult.failed();
|
||||
}
|
||||
return commonResult;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "更新品牌")
|
||||
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult update(@PathVariable("id") Long id,
|
||||
@Validated @RequestBody PmsBrandParam pmsBrandParam) {
|
||||
CommonResult commonResult;
|
||||
int count = brandService.updateBrand(id, pmsBrandParam);
|
||||
if (count == 1) {
|
||||
commonResult = CommonResult.success(count);
|
||||
} else {
|
||||
commonResult = CommonResult.failed();
|
||||
}
|
||||
return commonResult;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除品牌")
|
||||
@RequestMapping(value = "/delete/{id}", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult delete(@PathVariable("id") Long id) {
|
||||
int count = brandService.deleteBrand(id);
|
||||
if (count == 1) {
|
||||
return CommonResult.success(null);
|
||||
} else {
|
||||
return CommonResult.failed();
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "根据品牌名称分页获取品牌列表")
|
||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<CommonPage<PmsBrand>> getList(@RequestParam(value = "keyword", required = false) String keyword,
|
||||
@RequestParam(value = "showStatus",required = false) Integer showStatus,
|
||||
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize) {
|
||||
List<PmsBrand> brandList = brandService.listBrand(keyword,showStatus,pageNum, pageSize);
|
||||
return CommonResult.success(CommonPage.restPage(brandList));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "根据编号查询品牌信息")
|
||||
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<PmsBrand> getItem(@PathVariable("id") Long id) {
|
||||
return CommonResult.success(brandService.getBrand(id));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "批量删除品牌")
|
||||
@RequestMapping(value = "/delete/batch", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult deleteBatch(@RequestParam("ids") List<Long> ids) {
|
||||
int count = brandService.deleteBrand(ids);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
} else {
|
||||
return CommonResult.failed();
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "批量更新显示状态")
|
||||
@RequestMapping(value = "/update/showStatus", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult updateShowStatus(@RequestParam("ids") List<Long> ids,
|
||||
@RequestParam("showStatus") Integer showStatus) {
|
||||
int count = brandService.updateShowStatus(ids, showStatus);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
} else {
|
||||
return CommonResult.failed();
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "批量更新厂家制造商状态")
|
||||
@RequestMapping(value = "/update/factoryStatus", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult updateFactoryStatus(@RequestParam("ids") List<Long> ids,
|
||||
@RequestParam("factoryStatus") Integer factoryStatus) {
|
||||
int count = brandService.updateFactoryStatus(ids, factoryStatus);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
} else {
|
||||
return CommonResult.failed();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,88 @@
|
||||
package com.macro.mall.controller;
|
||||
|
||||
import com.macro.mall.common.api.CommonPage;
|
||||
import com.macro.mall.common.api.CommonResult;
|
||||
import com.macro.mall.dto.PmsProductAttributeCategoryItem;
|
||||
import com.macro.mall.model.PmsProductAttributeCategory;
|
||||
import com.macro.mall.service.PmsProductAttributeCategoryService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品属性分类管理Controller
|
||||
* Created by macro on 2018/4/26.
|
||||
*/
|
||||
@Controller
|
||||
@Api(tags = "PmsProductAttributeCategoryController")
|
||||
@Tag(name = "PmsProductAttributeCategoryController", description = "商品属性分类管理")
|
||||
@RequestMapping("/productAttribute/category")
|
||||
public class PmsProductAttributeCategoryController {
|
||||
@Autowired
|
||||
private PmsProductAttributeCategoryService productAttributeCategoryService;
|
||||
|
||||
@ApiOperation("添加商品属性分类")
|
||||
@RequestMapping(value = "/create", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult create(@RequestParam String name) {
|
||||
int count = productAttributeCategoryService.create(name);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
} else {
|
||||
return CommonResult.failed();
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("修改商品属性分类")
|
||||
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult update(@PathVariable Long id, @RequestParam String name) {
|
||||
int count = productAttributeCategoryService.update(id, name);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
} else {
|
||||
return CommonResult.failed();
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("删除单个商品属性分类")
|
||||
@RequestMapping(value = "/delete/{id}", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult delete(@PathVariable Long id) {
|
||||
int count = productAttributeCategoryService.delete(id);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
} else {
|
||||
return CommonResult.failed();
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("获取单个商品属性分类信息")
|
||||
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<PmsProductAttributeCategory> getItem(@PathVariable Long id) {
|
||||
PmsProductAttributeCategory productAttributeCategory = productAttributeCategoryService.getItem(id);
|
||||
return CommonResult.success(productAttributeCategory);
|
||||
}
|
||||
|
||||
@ApiOperation("分页获取所有商品属性分类")
|
||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<CommonPage<PmsProductAttributeCategory>> getList(@RequestParam(defaultValue = "5") Integer pageSize, @RequestParam(defaultValue = "1") Integer pageNum) {
|
||||
List<PmsProductAttributeCategory> productAttributeCategoryList = productAttributeCategoryService.getList(pageSize, pageNum);
|
||||
return CommonResult.success(CommonPage.restPage(productAttributeCategoryList));
|
||||
}
|
||||
|
||||
@ApiOperation("获取所有商品属性分类及其下属性")
|
||||
@RequestMapping(value = "/list/withAttr", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<List<PmsProductAttributeCategoryItem>> getListWithAttr() {
|
||||
List<PmsProductAttributeCategoryItem> productAttributeCategoryResultList = productAttributeCategoryService.getListWithAttr();
|
||||
return CommonResult.success(productAttributeCategoryResultList);
|
||||
}
|
||||
}
|
@ -0,0 +1,118 @@
|
||||
package com.macro.mall.controller;
|
||||
|
||||
import com.macro.mall.common.api.CommonPage;
|
||||
import com.macro.mall.common.api.CommonResult;
|
||||
import com.macro.mall.dto.PmsProductCategoryParam;
|
||||
import com.macro.mall.dto.PmsProductCategoryWithChildrenItem;
|
||||
import com.macro.mall.model.PmsProductCategory;
|
||||
import com.macro.mall.service.PmsProductCategoryService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品分类管理Controller
|
||||
* Created by macro on 2018/4/26.
|
||||
*/
|
||||
@Controller
|
||||
@Api(tags = "PmsProductCategoryController")
|
||||
@Tag(name = "PmsProductCategoryController", description = "商品分类管理")
|
||||
@RequestMapping("/productCategory")
|
||||
public class PmsProductCategoryController {
|
||||
@Autowired
|
||||
private PmsProductCategoryService productCategoryService;
|
||||
|
||||
@ApiOperation("添加商品分类")
|
||||
@RequestMapping(value = "/create", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult create(@Validated @RequestBody PmsProductCategoryParam productCategoryParam) {
|
||||
int count = productCategoryService.create(productCategoryParam);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
} else {
|
||||
return CommonResult.failed();
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("修改商品分类")
|
||||
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult update(@PathVariable Long id,
|
||||
@Validated
|
||||
@RequestBody PmsProductCategoryParam productCategoryParam) {
|
||||
int count = productCategoryService.update(id, productCategoryParam);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
} else {
|
||||
return CommonResult.failed();
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("分页查询商品分类")
|
||||
@RequestMapping(value = "/list/{parentId}", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<CommonPage<PmsProductCategory>> getList(@PathVariable Long parentId,
|
||||
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
|
||||
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
|
||||
List<PmsProductCategory> productCategoryList = productCategoryService.getList(parentId, pageSize, pageNum);
|
||||
return CommonResult.success(CommonPage.restPage(productCategoryList));
|
||||
}
|
||||
|
||||
@ApiOperation("根据id获取商品分类")
|
||||
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<PmsProductCategory> getItem(@PathVariable Long id) {
|
||||
PmsProductCategory productCategory = productCategoryService.getItem(id);
|
||||
return CommonResult.success(productCategory);
|
||||
}
|
||||
|
||||
@ApiOperation("删除商品分类")
|
||||
@RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult delete(@PathVariable Long id) {
|
||||
int count = productCategoryService.delete(id);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
} else {
|
||||
return CommonResult.failed();
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("修改导航栏显示状态")
|
||||
@RequestMapping(value = "/update/navStatus", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult updateNavStatus(@RequestParam("ids") List<Long> ids, @RequestParam("navStatus") Integer navStatus) {
|
||||
int count = productCategoryService.updateNavStatus(ids, navStatus);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
} else {
|
||||
return CommonResult.failed();
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("修改显示状态")
|
||||
@RequestMapping(value = "/update/showStatus", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult updateShowStatus(@RequestParam("ids") List<Long> ids, @RequestParam("showStatus") Integer showStatus) {
|
||||
int count = productCategoryService.updateShowStatus(ids, showStatus);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
} else {
|
||||
return CommonResult.failed();
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("查询所有一级分类及子分类")
|
||||
@RequestMapping(value = "/list/withChildren", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<List<PmsProductCategoryWithChildrenItem>> listWithChildren() {
|
||||
List<PmsProductCategoryWithChildrenItem> list = productCategoryService.listWithChildren();
|
||||
return CommonResult.success(list);
|
||||
}
|
||||
}
|
@ -0,0 +1,146 @@
|
||||
package com.macro.mall.controller;
|
||||
|
||||
import com.macro.mall.common.api.CommonPage;
|
||||
import com.macro.mall.common.api.CommonResult;
|
||||
import com.macro.mall.dto.PmsProductParam;
|
||||
import com.macro.mall.dto.PmsProductQueryParam;
|
||||
import com.macro.mall.dto.PmsProductResult;
|
||||
import com.macro.mall.model.PmsProduct;
|
||||
import com.macro.mall.service.PmsProductService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品管理Controller
|
||||
* Created by macro on 2018/4/26.
|
||||
*/
|
||||
@Controller
|
||||
@Api(tags = "PmsProductController")
|
||||
@Tag(name = "PmsProductController", description = "商品管理")
|
||||
@RequestMapping("/product")
|
||||
public class PmsProductController {
|
||||
@Autowired
|
||||
private PmsProductService productService;
|
||||
|
||||
@ApiOperation("创建商品")
|
||||
@RequestMapping(value = "/create", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult create(@RequestBody PmsProductParam productParam) {
|
||||
int count = productService.create(productParam);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
} else {
|
||||
return CommonResult.failed();
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("根据商品id获取商品编辑信息")
|
||||
@RequestMapping(value = "/updateInfo/{id}", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<PmsProductResult> getUpdateInfo(@PathVariable Long id) {
|
||||
PmsProductResult productResult = productService.getUpdateInfo(id);
|
||||
return CommonResult.success(productResult);
|
||||
}
|
||||
|
||||
@ApiOperation("更新商品")
|
||||
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult update(@PathVariable Long id, @RequestBody PmsProductParam productParam) {
|
||||
int count = productService.update(id, productParam);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
} else {
|
||||
return CommonResult.failed();
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("查询商品")
|
||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<CommonPage<PmsProduct>> getList(PmsProductQueryParam productQueryParam,
|
||||
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
|
||||
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
|
||||
List<PmsProduct> productList = productService.list(productQueryParam, pageSize, pageNum);
|
||||
return CommonResult.success(CommonPage.restPage(productList));
|
||||
}
|
||||
|
||||
@ApiOperation("根据商品名称或货号模糊查询")
|
||||
@RequestMapping(value = "/simpleList", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<List<PmsProduct>> getList(String keyword) {
|
||||
List<PmsProduct> productList = productService.list(keyword);
|
||||
return CommonResult.success(productList);
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改审核状态")
|
||||
@RequestMapping(value = "/update/verifyStatus", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult updateVerifyStatus(@RequestParam("ids") List<Long> ids,
|
||||
@RequestParam("verifyStatus") Integer verifyStatus,
|
||||
@RequestParam("detail") String detail) {
|
||||
int count = productService.updateVerifyStatus(ids, verifyStatus, detail);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
} else {
|
||||
return CommonResult.failed();
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("批量上下架商品")
|
||||
@RequestMapping(value = "/update/publishStatus", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult updatePublishStatus(@RequestParam("ids") List<Long> ids,
|
||||
@RequestParam("publishStatus") Integer publishStatus) {
|
||||
int count = productService.updatePublishStatus(ids, publishStatus);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
} else {
|
||||
return CommonResult.failed();
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("批量推荐商品")
|
||||
@RequestMapping(value = "/update/recommendStatus", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult updateRecommendStatus(@RequestParam("ids") List<Long> ids,
|
||||
@RequestParam("recommendStatus") Integer recommendStatus) {
|
||||
int count = productService.updateRecommendStatus(ids, recommendStatus);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
} else {
|
||||
return CommonResult.failed();
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("批量设为新品")
|
||||
@RequestMapping(value = "/update/newStatus", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult updateNewStatus(@RequestParam("ids") List<Long> ids,
|
||||
@RequestParam("newStatus") Integer newStatus) {
|
||||
int count = productService.updateNewStatus(ids, newStatus);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
} else {
|
||||
return CommonResult.failed();
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改删除状态")
|
||||
@RequestMapping(value = "/update/deleteStatus", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult updateDeleteStatus(@RequestParam("ids") List<Long> ids,
|
||||
@RequestParam("deleteStatus") Integer deleteStatus) {
|
||||
int count = productService.updateDeleteStatus(ids, deleteStatus);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
} else {
|
||||
return CommonResult.failed();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
package com.macro.mall.controller;
|
||||
|
||||
import com.macro.mall.common.api.CommonResult;
|
||||
import com.macro.mall.model.PmsSkuStock;
|
||||
import com.macro.mall.service.PmsSkuStockService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品SKU库存管理Controller
|
||||
* Created by macro on 2018/4/27.
|
||||
*/
|
||||
@Controller
|
||||
@Api(tags = "PmsSkuStockController")
|
||||
@Tag(name = "PmsSkuStockController", description = "sku商品库存管理")
|
||||
@RequestMapping("/sku")
|
||||
public class PmsSkuStockController {
|
||||
@Autowired
|
||||
private PmsSkuStockService skuStockService;
|
||||
|
||||
@ApiOperation("根据商品ID及sku编码模糊搜索sku库存")
|
||||
@RequestMapping(value = "/{pid}", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<List<PmsSkuStock>> getList(@PathVariable Long pid, @RequestParam(value = "keyword",required = false) String keyword) {
|
||||
List<PmsSkuStock> skuStockList = skuStockService.getList(pid, keyword);
|
||||
return CommonResult.success(skuStockList);
|
||||
}
|
||||
@ApiOperation("批量更新sku库存信息")
|
||||
@RequestMapping(value ="/update/{pid}",method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult update(@PathVariable Long pid,@RequestBody List<PmsSkuStock> skuStockList){
|
||||
int count = skuStockService.update(pid,skuStockList);
|
||||
if(count>0){
|
||||
return CommonResult.success(count);
|
||||
}else{
|
||||
return CommonResult.failed();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,80 @@
|
||||
package com.macro.mall.controller;
|
||||
|
||||
import com.macro.mall.common.api.CommonPage;
|
||||
import com.macro.mall.common.api.CommonResult;
|
||||
import com.macro.mall.dto.SmsCouponParam;
|
||||
import com.macro.mall.model.SmsCoupon;
|
||||
import com.macro.mall.service.SmsCouponService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 优惠券管理Controller
|
||||
* Created by macro on 2018/8/28.
|
||||
*/
|
||||
@Controller
|
||||
@Api(tags = "SmsCouponController")
|
||||
@Tag(name = "SmsCouponController", description = "优惠券管理")
|
||||
@RequestMapping("/coupon")
|
||||
public class SmsCouponController {
|
||||
@Autowired
|
||||
private SmsCouponService couponService;
|
||||
@ApiOperation("添加优惠券")
|
||||
@RequestMapping(value = "/create", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult add(@RequestBody SmsCouponParam couponParam) {
|
||||
int count = couponService.create(couponParam);
|
||||
if(count>0){
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("删除优惠券")
|
||||
@RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult delete(@PathVariable Long id) {
|
||||
int count = couponService.delete(id);
|
||||
if(count>0){
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("修改优惠券")
|
||||
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult update(@PathVariable Long id,@RequestBody SmsCouponParam couponParam) {
|
||||
int count = couponService.update(id,couponParam);
|
||||
if(count>0){
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("根据优惠券名称和类型分页获取优惠券列表")
|
||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<CommonPage<SmsCoupon>> list(
|
||||
@RequestParam(value = "name",required = false) String name,
|
||||
@RequestParam(value = "type",required = false) Integer type,
|
||||
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
|
||||
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
|
||||
List<SmsCoupon> couponList = couponService.list(name,type,pageSize,pageNum);
|
||||
return CommonResult.success(CommonPage.restPage(couponList));
|
||||
}
|
||||
|
||||
@ApiOperation("获取单个优惠券的详细信息")
|
||||
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<SmsCouponParam> getItem(@PathVariable Long id) {
|
||||
SmsCouponParam couponParam = couponService.getItem(id);
|
||||
return CommonResult.success(couponParam);
|
||||
}
|
||||
}
|
@ -0,0 +1,89 @@
|
||||
package com.macro.mall.controller;
|
||||
|
||||
import com.macro.mall.common.api.CommonPage;
|
||||
import com.macro.mall.common.api.CommonResult;
|
||||
import com.macro.mall.model.SmsFlashPromotion;
|
||||
import com.macro.mall.service.SmsFlashPromotionService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 限时购活动管理Controller
|
||||
* Created by macro on 2018/11/16.
|
||||
*/
|
||||
@Controller
|
||||
@Api(tags = "SmsFlashPromotionController")
|
||||
@Tag(name = "SmsFlashPromotionController", description = "限时购活动管理")
|
||||
@RequestMapping("/flash")
|
||||
public class SmsFlashPromotionController {
|
||||
@Autowired
|
||||
private SmsFlashPromotionService flashPromotionService;
|
||||
|
||||
@ApiOperation("添加活动")
|
||||
@RequestMapping(value = "/create", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult create(@RequestBody SmsFlashPromotion flashPromotion) {
|
||||
int count = flashPromotionService.create(flashPromotion);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("编辑活动")
|
||||
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult update(@PathVariable Long id, @RequestBody SmsFlashPromotion flashPromotion) {
|
||||
int count = flashPromotionService.update(id, flashPromotion);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("删除活动")
|
||||
@RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult delete(@PathVariable Long id) {
|
||||
int count = flashPromotionService.delete(id);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("修改上下线状态")
|
||||
@RequestMapping(value = "/update/status/{id}", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult update(@PathVariable Long id, Integer status) {
|
||||
int count = flashPromotionService.updateStatus(id, status);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("获取活动详情")
|
||||
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<SmsFlashPromotion> getItem(@PathVariable Long id) {
|
||||
SmsFlashPromotion flashPromotion = flashPromotionService.getItem(id);
|
||||
return CommonResult.success(flashPromotion);
|
||||
}
|
||||
|
||||
@ApiOperation("根据活动名称分页查询")
|
||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<CommonPage<SmsFlashPromotion>> getItem(@RequestParam(value = "keyword", required = false) String keyword,
|
||||
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
|
||||
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
|
||||
List<SmsFlashPromotion> flashPromotionList = flashPromotionService.list(keyword, pageSize, pageNum);
|
||||
return CommonResult.success(CommonPage.restPage(flashPromotionList));
|
||||
}
|
||||
}
|
@ -0,0 +1,80 @@
|
||||
package com.macro.mall.controller;
|
||||
|
||||
import com.macro.mall.common.api.CommonPage;
|
||||
import com.macro.mall.common.api.CommonResult;
|
||||
import com.macro.mall.dto.SmsFlashPromotionProduct;
|
||||
import com.macro.mall.model.SmsFlashPromotionProductRelation;
|
||||
import com.macro.mall.service.SmsFlashPromotionProductRelationService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 限时购和商品关系管理Controller
|
||||
* Created by macro on 2018/11/16.
|
||||
*/
|
||||
@Controller
|
||||
@Api(tags = "SmsFlashPromotionProductRelationController")
|
||||
@Tag(name = "SmsFlashPromotionProductRelationController", description = "限时购和商品关系管理")
|
||||
@RequestMapping("/flashProductRelation")
|
||||
public class SmsFlashPromotionProductRelationController {
|
||||
@Autowired
|
||||
private SmsFlashPromotionProductRelationService relationService;
|
||||
|
||||
@ApiOperation("批量选择商品添加关联")
|
||||
@RequestMapping(value = "/create", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult create(@RequestBody List<SmsFlashPromotionProductRelation> relationList) {
|
||||
int count = relationService.create(relationList);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("修改关联信息")
|
||||
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult update(@PathVariable Long id, @RequestBody SmsFlashPromotionProductRelation relation) {
|
||||
int count = relationService.update(id, relation);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("删除关联")
|
||||
@RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult delete(@PathVariable Long id) {
|
||||
int count = relationService.delete(id);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("获取关联商品促销信息")
|
||||
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<SmsFlashPromotionProductRelation> getItem(@PathVariable Long id) {
|
||||
SmsFlashPromotionProductRelation relation = relationService.getItem(id);
|
||||
return CommonResult.success(relation);
|
||||
}
|
||||
|
||||
@ApiOperation("分页查询不同场次关联及商品信息")
|
||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<CommonPage<SmsFlashPromotionProduct>> list(@RequestParam(value = "flashPromotionId") Long flashPromotionId,
|
||||
@RequestParam(value = "flashPromotionSessionId") Long flashPromotionSessionId,
|
||||
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
|
||||
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
|
||||
List<SmsFlashPromotionProduct> flashPromotionProductList = relationService.list(flashPromotionId, flashPromotionSessionId, pageSize, pageNum);
|
||||
return CommonResult.success(CommonPage.restPage(flashPromotionProductList));
|
||||
}
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
package com.macro.mall.controller;
|
||||
|
||||
import com.macro.mall.common.api.CommonResult;
|
||||
import com.macro.mall.dto.SmsFlashPromotionSessionDetail;
|
||||
import com.macro.mall.model.SmsFlashPromotionSession;
|
||||
import com.macro.mall.service.SmsFlashPromotionSessionService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 限时购场次管理Controller
|
||||
* Created by macro on 2018/11/16.
|
||||
*/
|
||||
@Controller
|
||||
@Api(tags = "SmsFlashPromotionSessionController")
|
||||
@Tag(name = "SmsFlashPromotionSessionController", description = "限时购场次管理")
|
||||
@RequestMapping("/flashSession")
|
||||
public class SmsFlashPromotionSessionController {
|
||||
@Autowired
|
||||
private SmsFlashPromotionSessionService flashPromotionSessionService;
|
||||
|
||||
@ApiOperation("添加场次")
|
||||
@RequestMapping(value = "/create", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult create(@RequestBody SmsFlashPromotionSession promotionSession) {
|
||||
int count = flashPromotionSessionService.create(promotionSession);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("修改场次")
|
||||
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult update(@PathVariable Long id, @RequestBody SmsFlashPromotionSession promotionSession) {
|
||||
int count = flashPromotionSessionService.update(id, promotionSession);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("修改启用状态")
|
||||
@RequestMapping(value = "/update/status/{id}", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult updateStatus(@PathVariable Long id, Integer status) {
|
||||
int count = flashPromotionSessionService.updateStatus(id, status);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("删除场次")
|
||||
@RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult delete(@PathVariable Long id) {
|
||||
int count = flashPromotionSessionService.delete(id);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("获取场次详情")
|
||||
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<SmsFlashPromotionSession> getItem(@PathVariable Long id) {
|
||||
SmsFlashPromotionSession promotionSession = flashPromotionSessionService.getItem(id);
|
||||
return CommonResult.success(promotionSession);
|
||||
}
|
||||
|
||||
@ApiOperation("获取全部场次")
|
||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<List<SmsFlashPromotionSession>> list() {
|
||||
List<SmsFlashPromotionSession> promotionSessionList = flashPromotionSessionService.list();
|
||||
return CommonResult.success(promotionSessionList);
|
||||
}
|
||||
|
||||
@ApiOperation("获取全部可选场次及其数量")
|
||||
@RequestMapping(value = "/selectList", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<List<SmsFlashPromotionSessionDetail>> selectList(Long flashPromotionId) {
|
||||
List<SmsFlashPromotionSessionDetail> promotionSessionList = flashPromotionSessionService.selectList(flashPromotionId);
|
||||
return CommonResult.success(promotionSessionList);
|
||||
}
|
||||
}
|
@ -0,0 +1,87 @@
|
||||
package com.macro.mall.controller;
|
||||
|
||||
import com.macro.mall.common.api.CommonPage;
|
||||
import com.macro.mall.common.api.CommonResult;
|
||||
import com.macro.mall.model.SmsHomeAdvertise;
|
||||
import com.macro.mall.service.SmsHomeAdvertiseService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 首页轮播广告管理Controller
|
||||
* Created by macro on 2018/11/7.
|
||||
*/
|
||||
@Controller
|
||||
@Api(tags = "SmsHomeAdvertiseController")
|
||||
@Tag(name = "SmsHomeAdvertiseController", description = "首页轮播广告管理")
|
||||
@RequestMapping("/home/advertise")
|
||||
public class SmsHomeAdvertiseController {
|
||||
@Autowired
|
||||
private SmsHomeAdvertiseService advertiseService;
|
||||
|
||||
@ApiOperation("添加广告")
|
||||
@RequestMapping(value = "/create", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult create(@RequestBody SmsHomeAdvertise advertise) {
|
||||
int count = advertiseService.create(advertise);
|
||||
if (count > 0)
|
||||
return CommonResult.success(count);
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("删除广告")
|
||||
@RequestMapping(value = "/delete", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult delete(@RequestParam("ids") List<Long> ids) {
|
||||
int count = advertiseService.delete(ids);
|
||||
if (count > 0)
|
||||
return CommonResult.success(count);
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("修改上下线状态")
|
||||
@RequestMapping(value = "/update/status/{id}", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult updateStatus(@PathVariable Long id, Integer status) {
|
||||
int count = advertiseService.updateStatus(id, status);
|
||||
if (count > 0)
|
||||
return CommonResult.success(count);
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("获取广告详情")
|
||||
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<SmsHomeAdvertise> getItem(@PathVariable Long id) {
|
||||
SmsHomeAdvertise advertise = advertiseService.getItem(id);
|
||||
return CommonResult.success(advertise);
|
||||
}
|
||||
|
||||
@ApiOperation("修改广告")
|
||||
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult update(@PathVariable Long id, @RequestBody SmsHomeAdvertise advertise) {
|
||||
int count = advertiseService.update(id, advertise);
|
||||
if (count > 0)
|
||||
return CommonResult.success(count);
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("分页查询广告")
|
||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<CommonPage<SmsHomeAdvertise>> list(@RequestParam(value = "name", required = false) String name,
|
||||
@RequestParam(value = "type", required = false) Integer type,
|
||||
@RequestParam(value = "endTime", required = false) String endTime,
|
||||
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
|
||||
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
|
||||
List<SmsHomeAdvertise> advertiseList = advertiseService.list(name, type, endTime, pageSize, pageNum);
|
||||
return CommonResult.success(CommonPage.restPage(advertiseList));
|
||||
}
|
||||
}
|
@ -0,0 +1,82 @@
|
||||
package com.macro.mall.controller;
|
||||
|
||||
import com.macro.mall.common.api.CommonPage;
|
||||
import com.macro.mall.common.api.CommonResult;
|
||||
import com.macro.mall.model.SmsHomeBrand;
|
||||
import com.macro.mall.service.SmsHomeBrandService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 首页品牌管理Controller
|
||||
* Created by macro on 2018/11/6.
|
||||
*/
|
||||
@Controller
|
||||
@Api(tags = "SmsHomeBrandController")
|
||||
@Tag(name = "SmsHomeBrandController", description = "首页品牌管理")
|
||||
@RequestMapping("/home/brand")
|
||||
public class SmsHomeBrandController {
|
||||
@Autowired
|
||||
private SmsHomeBrandService homeBrandService;
|
||||
|
||||
@ApiOperation("添加首页推荐品牌")
|
||||
@RequestMapping(value = "/create", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult create(@RequestBody List<SmsHomeBrand> homeBrandList) {
|
||||
int count = homeBrandService.create(homeBrandList);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("修改推荐品牌排序")
|
||||
@RequestMapping(value = "/update/sort/{id}", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult updateSort(@PathVariable Long id, Integer sort) {
|
||||
int count = homeBrandService.updateSort(id, sort);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除推荐品牌")
|
||||
@RequestMapping(value = "/delete", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult delete(@RequestParam("ids") List<Long> ids) {
|
||||
int count = homeBrandService.delete(ids);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改推荐品牌状态")
|
||||
@RequestMapping(value = "/update/recommendStatus", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult updateRecommendStatus(@RequestParam("ids") List<Long> ids, @RequestParam Integer recommendStatus) {
|
||||
int count = homeBrandService.updateRecommendStatus(ids, recommendStatus);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("分页查询推荐品牌")
|
||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<CommonPage<SmsHomeBrand>> list(@RequestParam(value = "brandName", required = false) String brandName,
|
||||
@RequestParam(value = "recommendStatus", required = false) Integer recommendStatus,
|
||||
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
|
||||
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
|
||||
List<SmsHomeBrand> homeBrandList = homeBrandService.list(brandName, recommendStatus, pageSize, pageNum);
|
||||
return CommonResult.success(CommonPage.restPage(homeBrandList));
|
||||
}
|
||||
}
|
@ -0,0 +1,82 @@
|
||||
package com.macro.mall.controller;
|
||||
|
||||
import com.macro.mall.common.api.CommonPage;
|
||||
import com.macro.mall.common.api.CommonResult;
|
||||
import com.macro.mall.model.SmsHomeNewProduct;
|
||||
import com.macro.mall.service.SmsHomeNewProductService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 首页新品管理Controller
|
||||
* Created by macro on 2018/11/6.
|
||||
*/
|
||||
@Controller
|
||||
@Api(tags = "SmsHomeNewProductController")
|
||||
@Tag(name = "SmsHomeNewProductController", description = "首页新品管理")
|
||||
@RequestMapping("/home/newProduct")
|
||||
public class SmsHomeNewProductController {
|
||||
@Autowired
|
||||
private SmsHomeNewProductService homeNewProductService;
|
||||
|
||||
@ApiOperation("添加首页新品")
|
||||
@RequestMapping(value = "/create", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult create(@RequestBody List<SmsHomeNewProduct> homeNewProductList) {
|
||||
int count = homeNewProductService.create(homeNewProductList);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("修改首页新品排序")
|
||||
@RequestMapping(value = "/update/sort/{id}", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult updateSort(@PathVariable Long id, Integer sort) {
|
||||
int count = homeNewProductService.updateSort(id, sort);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除首页新品")
|
||||
@RequestMapping(value = "/delete", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult delete(@RequestParam("ids") List<Long> ids) {
|
||||
int count = homeNewProductService.delete(ids);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改首页新品状态")
|
||||
@RequestMapping(value = "/update/recommendStatus", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult updateRecommendStatus(@RequestParam("ids") List<Long> ids, @RequestParam Integer recommendStatus) {
|
||||
int count = homeNewProductService.updateRecommendStatus(ids, recommendStatus);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("分页查询首页新品")
|
||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<CommonPage<SmsHomeNewProduct>> list(@RequestParam(value = "productName", required = false) String productName,
|
||||
@RequestParam(value = "recommendStatus", required = false) Integer recommendStatus,
|
||||
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
|
||||
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
|
||||
List<SmsHomeNewProduct> homeNewProductList = homeNewProductService.list(productName, recommendStatus, pageSize, pageNum);
|
||||
return CommonResult.success(CommonPage.restPage(homeNewProductList));
|
||||
}
|
||||
}
|
@ -0,0 +1,82 @@
|
||||
package com.macro.mall.controller;
|
||||
|
||||
import com.macro.mall.common.api.CommonPage;
|
||||
import com.macro.mall.common.api.CommonResult;
|
||||
import com.macro.mall.model.SmsHomeRecommendProduct;
|
||||
import com.macro.mall.service.SmsHomeRecommendProductService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 首页人气推荐管理Controller
|
||||
* Created by macro on 2018/11/6.
|
||||
*/
|
||||
@Controller
|
||||
@Api(tags = "SmsHomeRecommendProductController")
|
||||
@Tag(name = "SmsHomeRecommendProductController", description = "首页人气推荐管理")
|
||||
@RequestMapping("/home/recommendProduct")
|
||||
public class SmsHomeRecommendProductController {
|
||||
@Autowired
|
||||
private SmsHomeRecommendProductService recommendProductService;
|
||||
|
||||
@ApiOperation("添加首页推荐")
|
||||
@RequestMapping(value = "/create", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult create(@RequestBody List<SmsHomeRecommendProduct> homeRecommendProductList) {
|
||||
int count = recommendProductService.create(homeRecommendProductList);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("修改推荐排序")
|
||||
@RequestMapping(value = "/update/sort/{id}", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult updateSort(@PathVariable Long id, Integer sort) {
|
||||
int count = recommendProductService.updateSort(id, sort);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除推荐")
|
||||
@RequestMapping(value = "/delete", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult delete(@RequestParam("ids") List<Long> ids) {
|
||||
int count = recommendProductService.delete(ids);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改推荐状态")
|
||||
@RequestMapping(value = "/update/recommendStatus", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult updateRecommendStatus(@RequestParam("ids") List<Long> ids, @RequestParam Integer recommendStatus) {
|
||||
int count = recommendProductService.updateRecommendStatus(ids, recommendStatus);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("分页查询推荐")
|
||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<CommonPage<SmsHomeRecommendProduct>> list(@RequestParam(value = "productName", required = false) String productName,
|
||||
@RequestParam(value = "recommendStatus", required = false) Integer recommendStatus,
|
||||
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
|
||||
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
|
||||
List<SmsHomeRecommendProduct> homeRecommendProductList = recommendProductService.list(productName, recommendStatus, pageSize, pageNum);
|
||||
return CommonResult.success(CommonPage.restPage(homeRecommendProductList));
|
||||
}
|
||||
}
|
@ -0,0 +1,82 @@
|
||||
package com.macro.mall.controller;
|
||||
|
||||
import com.macro.mall.common.api.CommonPage;
|
||||
import com.macro.mall.common.api.CommonResult;
|
||||
import com.macro.mall.model.SmsHomeRecommendSubject;
|
||||
import com.macro.mall.service.SmsHomeRecommendSubjectService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 首页专题推荐管理Controller
|
||||
* Created by macro on 2018/11/6.
|
||||
*/
|
||||
@Controller
|
||||
@Api(tags = "SmsHomeRecommendSubjectController")
|
||||
@Tag(name = "SmsHomeRecommendSubjectController", description = "首页专题推荐管理")
|
||||
@RequestMapping("/home/recommendSubject")
|
||||
public class SmsHomeRecommendSubjectController {
|
||||
@Autowired
|
||||
private SmsHomeRecommendSubjectService recommendSubjectService;
|
||||
|
||||
@ApiOperation("添加首页专题推荐")
|
||||
@RequestMapping(value = "/create", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult create(@RequestBody List<SmsHomeRecommendSubject> homeRecommendSubjectList) {
|
||||
int count = recommendSubjectService.create(homeRecommendSubjectList);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("修改专题推荐排序")
|
||||
@RequestMapping(value = "/update/sort/{id}", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult updateSort(@PathVariable Long id, Integer sort) {
|
||||
int count = recommendSubjectService.updateSort(id, sort);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除专题推荐")
|
||||
@RequestMapping(value = "/delete", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult delete(@RequestParam("ids") List<Long> ids) {
|
||||
int count = recommendSubjectService.delete(ids);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改专题推荐状态")
|
||||
@RequestMapping(value = "/update/recommendStatus", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult updateRecommendStatus(@RequestParam("ids") List<Long> ids, @RequestParam Integer recommendStatus) {
|
||||
int count = recommendSubjectService.updateRecommendStatus(ids, recommendStatus);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("分页查询专题推荐")
|
||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<CommonPage<SmsHomeRecommendSubject>> list(@RequestParam(value = "subjectName", required = false) String subjectName,
|
||||
@RequestParam(value = "recommendStatus", required = false) Integer recommendStatus,
|
||||
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
|
||||
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
|
||||
List<SmsHomeRecommendSubject> homeRecommendSubjectList = recommendSubjectService.list(subjectName, recommendStatus, pageSize, pageNum);
|
||||
return CommonResult.success(CommonPage.restPage(homeRecommendSubjectList));
|
||||
}
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package com.macro.mall.controller;
|
||||
|
||||
import com.macro.mall.common.api.CommonResult;
|
||||
import com.macro.mall.model.UmsMemberLevel;
|
||||
import com.macro.mall.service.UmsMemberLevelService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会员等级管理Controller
|
||||
* Created by macro on 2018/4/26.
|
||||
*/
|
||||
@Controller
|
||||
@Api(tags = "UmsMemberLevelController")
|
||||
@Tag(name = "UmsMemberLevelController", description = "会员等级管理")
|
||||
@RequestMapping("/memberLevel")
|
||||
public class UmsMemberLevelController {
|
||||
@Autowired
|
||||
private UmsMemberLevelService memberLevelService;
|
||||
|
||||
@ApiOperation("查询所有会员等级")
|
||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<List<UmsMemberLevel>> list(@RequestParam("defaultStatus") Integer defaultStatus) {
|
||||
List<UmsMemberLevel> memberLevelList = memberLevelService.list(defaultStatus);
|
||||
return CommonResult.success(memberLevelList);
|
||||
}
|
||||
}
|
@ -0,0 +1,104 @@
|
||||
package com.macro.mall.controller;
|
||||
|
||||
import com.macro.mall.common.api.CommonPage;
|
||||
import com.macro.mall.common.api.CommonResult;
|
||||
import com.macro.mall.dto.UmsMenuNode;
|
||||
import com.macro.mall.model.UmsMenu;
|
||||
import com.macro.mall.service.UmsMenuService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 后台菜单管理Controller
|
||||
* Created by macro on 2020/2/4.
|
||||
*/
|
||||
@Controller
|
||||
@Api(tags = "UmsMenuController")
|
||||
@Tag(name = "UmsMenuController", description = "后台菜单管理")
|
||||
@RequestMapping("/menu")
|
||||
public class UmsMenuController {
|
||||
|
||||
@Autowired
|
||||
private UmsMenuService menuService;
|
||||
|
||||
@ApiOperation("添加后台菜单")
|
||||
@RequestMapping(value = "/create", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult create(@RequestBody UmsMenu umsMenu) {
|
||||
int count = menuService.create(umsMenu);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
} else {
|
||||
return CommonResult.failed();
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("修改后台菜单")
|
||||
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult update(@PathVariable Long id,
|
||||
@RequestBody UmsMenu umsMenu) {
|
||||
int count = menuService.update(id, umsMenu);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
} else {
|
||||
return CommonResult.failed();
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("根据ID获取菜单详情")
|
||||
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<UmsMenu> getItem(@PathVariable Long id) {
|
||||
UmsMenu umsMenu = menuService.getItem(id);
|
||||
return CommonResult.success(umsMenu);
|
||||
}
|
||||
|
||||
@ApiOperation("根据ID删除后台菜单")
|
||||
@RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult delete(@PathVariable Long id) {
|
||||
int count = menuService.delete(id);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
} else {
|
||||
return CommonResult.failed();
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("分页查询后台菜单")
|
||||
@RequestMapping(value = "/list/{parentId}", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<CommonPage<UmsMenu>> list(@PathVariable Long parentId,
|
||||
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
|
||||
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
|
||||
List<UmsMenu> menuList = menuService.list(parentId, pageSize, pageNum);
|
||||
return CommonResult.success(CommonPage.restPage(menuList));
|
||||
}
|
||||
|
||||
@ApiOperation("树形结构返回所有菜单列表")
|
||||
@RequestMapping(value = "/treeList", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<List<UmsMenuNode>> treeList() {
|
||||
List<UmsMenuNode> list = menuService.treeList();
|
||||
return CommonResult.success(list);
|
||||
}
|
||||
|
||||
@ApiOperation("修改菜单显示状态")
|
||||
@RequestMapping(value = "/updateHidden/{id}", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult updateHidden(@PathVariable Long id, @RequestParam("hidden") Integer hidden) {
|
||||
int count = menuService.updateHidden(id, hidden);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
} else {
|
||||
return CommonResult.failed();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
package com.macro.mall.controller;
|
||||
|
||||
import com.macro.mall.common.api.CommonResult;
|
||||
import com.macro.mall.model.UmsResourceCategory;
|
||||
import com.macro.mall.service.UmsResourceCategoryService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 后台资源分类管理Controller
|
||||
* Created by macro on 2020/2/5.
|
||||
*/
|
||||
@Controller
|
||||
@Api(tags = "UmsResourceCategoryController")
|
||||
@Tag(name = "UmsResourceCategoryController", description = "后台资源分类管理")
|
||||
@RequestMapping("/resourceCategory")
|
||||
public class UmsResourceCategoryController {
|
||||
@Autowired
|
||||
private UmsResourceCategoryService resourceCategoryService;
|
||||
|
||||
@ApiOperation("查询所有后台资源分类")
|
||||
@RequestMapping(value = "/listAll", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<List<UmsResourceCategory>> listAll() {
|
||||
List<UmsResourceCategory> resourceList = resourceCategoryService.listAll();
|
||||
return CommonResult.success(resourceList);
|
||||
}
|
||||
|
||||
@ApiOperation("添加后台资源分类")
|
||||
@RequestMapping(value = "/create", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult create(@RequestBody UmsResourceCategory umsResourceCategory) {
|
||||
int count = resourceCategoryService.create(umsResourceCategory);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
} else {
|
||||
return CommonResult.failed();
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("修改后台资源分类")
|
||||
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult update(@PathVariable Long id,
|
||||
@RequestBody UmsResourceCategory umsResourceCategory) {
|
||||
int count = resourceCategoryService.update(id, umsResourceCategory);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
} else {
|
||||
return CommonResult.failed();
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("根据ID删除后台资源分类")
|
||||
@RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult delete(@PathVariable Long id) {
|
||||
int count = resourceCategoryService.delete(id);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
} else {
|
||||
return CommonResult.failed();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,99 @@
|
||||
package com.macro.mall.controller;
|
||||
|
||||
import com.macro.mall.common.api.CommonPage;
|
||||
import com.macro.mall.common.api.CommonResult;
|
||||
import com.macro.mall.model.UmsResource;
|
||||
import com.macro.mall.security.component.DynamicSecurityMetadataSource;
|
||||
import com.macro.mall.service.UmsResourceService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 后台资源管理Controller
|
||||
* Created by macro on 2020/2/4.
|
||||
*/
|
||||
@Controller
|
||||
@Api(tags = "UmsResourceController")
|
||||
@Tag(name = "UmsResourceController", description = "后台资源管理")
|
||||
@RequestMapping("/resource")
|
||||
public class UmsResourceController {
|
||||
|
||||
@Autowired
|
||||
private UmsResourceService resourceService;
|
||||
@Autowired
|
||||
private DynamicSecurityMetadataSource dynamicSecurityMetadataSource;
|
||||
|
||||
@ApiOperation("添加后台资源")
|
||||
@RequestMapping(value = "/create", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult create(@RequestBody UmsResource umsResource) {
|
||||
int count = resourceService.create(umsResource);
|
||||
dynamicSecurityMetadataSource.clearDataSource();
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
} else {
|
||||
return CommonResult.failed();
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("修改后台资源")
|
||||
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult update(@PathVariable Long id,
|
||||
@RequestBody UmsResource umsResource) {
|
||||
int count = resourceService.update(id, umsResource);
|
||||
dynamicSecurityMetadataSource.clearDataSource();
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
} else {
|
||||
return CommonResult.failed();
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("根据ID获取资源详情")
|
||||
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<UmsResource> getItem(@PathVariable Long id) {
|
||||
UmsResource umsResource = resourceService.getItem(id);
|
||||
return CommonResult.success(umsResource);
|
||||
}
|
||||
|
||||
@ApiOperation("根据ID删除后台资源")
|
||||
@RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult delete(@PathVariable Long id) {
|
||||
int count = resourceService.delete(id);
|
||||
dynamicSecurityMetadataSource.clearDataSource();
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
} else {
|
||||
return CommonResult.failed();
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("分页模糊查询后台资源")
|
||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<CommonPage<UmsResource>> list(@RequestParam(required = false) Long categoryId,
|
||||
@RequestParam(required = false) String nameKeyword,
|
||||
@RequestParam(required = false) String urlKeyword,
|
||||
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
|
||||
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
|
||||
List<UmsResource> resourceList = resourceService.list(categoryId,nameKeyword, urlKeyword, pageSize, pageNum);
|
||||
return CommonResult.success(CommonPage.restPage(resourceList));
|
||||
}
|
||||
|
||||
@ApiOperation("查询所有后台资源")
|
||||
@RequestMapping(value = "/listAll", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<List<UmsResource>> listAll() {
|
||||
List<UmsResource> resourceList = resourceService.listAll();
|
||||
return CommonResult.success(resourceList);
|
||||
}
|
||||
}
|
@ -0,0 +1,124 @@
|
||||
package com.macro.mall.controller;
|
||||
|
||||
import com.macro.mall.common.api.CommonPage;
|
||||
import com.macro.mall.common.api.CommonResult;
|
||||
import com.macro.mall.model.*;
|
||||
import com.macro.mall.service.UmsRoleService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 后台用户角色管理Controller
|
||||
* Created by macro on 2018/9/30.
|
||||
*/
|
||||
@Controller
|
||||
@Api(tags = "UmsRoleController")
|
||||
@Tag(name = "UmsRoleController", description = "后台用户角色管理")
|
||||
@RequestMapping("/role")
|
||||
public class UmsRoleController {
|
||||
@Autowired
|
||||
private UmsRoleService roleService;
|
||||
|
||||
@ApiOperation("添加角色")
|
||||
@RequestMapping(value = "/create", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult create(@RequestBody UmsRole role) {
|
||||
int count = roleService.create(role);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("修改角色")
|
||||
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult update(@PathVariable Long id, @RequestBody UmsRole role) {
|
||||
int count = roleService.update(id, role);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除角色")
|
||||
@RequestMapping(value = "/delete", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult delete(@RequestParam("ids") List<Long> ids) {
|
||||
int count = roleService.delete(ids);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("获取所有角色")
|
||||
@RequestMapping(value = "/listAll", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<List<UmsRole>> listAll() {
|
||||
List<UmsRole> roleList = roleService.list();
|
||||
return CommonResult.success(roleList);
|
||||
}
|
||||
|
||||
@ApiOperation("根据角色名称分页获取角色列表")
|
||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<CommonPage<UmsRole>> list(@RequestParam(value = "keyword", required = false) String keyword,
|
||||
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
|
||||
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
|
||||
List<UmsRole> roleList = roleService.list(keyword, pageSize, pageNum);
|
||||
return CommonResult.success(CommonPage.restPage(roleList));
|
||||
}
|
||||
|
||||
@ApiOperation("修改角色状态")
|
||||
@RequestMapping(value = "/updateStatus/{id}", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult updateStatus(@PathVariable Long id, @RequestParam(value = "status") Integer status) {
|
||||
UmsRole umsRole = new UmsRole();
|
||||
umsRole.setStatus(status);
|
||||
int count = roleService.update(id, umsRole);
|
||||
if (count > 0) {
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
return CommonResult.failed();
|
||||
}
|
||||
|
||||
@ApiOperation("获取角色相关菜单")
|
||||
@RequestMapping(value = "/listMenu/{roleId}", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<List<UmsMenu>> listMenu(@PathVariable Long roleId) {
|
||||
List<UmsMenu> roleList = roleService.listMenu(roleId);
|
||||
return CommonResult.success(roleList);
|
||||
}
|
||||
|
||||
@ApiOperation("获取角色相关资源")
|
||||
@RequestMapping(value = "/listResource/{roleId}", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonResult<List<UmsResource>> listResource(@PathVariable Long roleId) {
|
||||
List<UmsResource> roleList = roleService.listResource(roleId);
|
||||
return CommonResult.success(roleList);
|
||||
}
|
||||
|
||||
@ApiOperation("给角色分配菜单")
|
||||
@RequestMapping(value = "/allocMenu", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult allocMenu(@RequestParam Long roleId, @RequestParam List<Long> menuIds) {
|
||||
int count = roleService.allocMenu(roleId, menuIds);
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
|
||||
@ApiOperation("给角色分配资源")
|
||||
@RequestMapping(value = "/allocResource", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public CommonResult allocResource(@RequestParam Long roleId, @RequestParam List<Long> resourceIds) {
|
||||
int count = roleService.allocResource(roleId, resourceIds);
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
|
||||
}
|