Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wwwanlingxiao
mall
Commits
b5800856
"src/main/git@ustchcs.com:gujinli1118/JSH_ERP.git" did not exist on "8c1213a696f00cf98f08c0d1ea93c0e7f4b35587"
Commit
b5800856
authored
Apr 20, 2019
by
macro
Browse files
项目结构改造
parent
cdd332a6
Changes
33
Hide whitespace changes
Inline
Side-by-side
mall-admin/pom.xml
View file @
b5800856
...
@@ -4,19 +4,12 @@
...
@@ -4,19 +4,12 @@
<groupId>
com.macro.mall
</groupId>
<groupId>
com.macro.mall
</groupId>
<artifactId>
mall-admin
</artifactId>
<artifactId>
mall-admin
</artifactId>
<version>
0
.0
.1
-SNAPSHOT
</version>
<version>
1
.0-SNAPSHOT
</version>
<packaging>
jar
</packaging>
<packaging>
jar
</packaging>
<name>
mall-admin
</name>
<name>
mall-admin
</name>
<description>
mall-admin project for mall
</description>
<description>
mall-admin project for mall
</description>
<parent>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
2.1.3.RELEASE
</version>
<relativePath/>
<!-- lookup parent from repository -->
</parent>
<properties>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<project.reporting.outputEncoding>
UTF-8
</project.reporting.outputEncoding>
<project.reporting.outputEncoding>
UTF-8
</project.reporting.outputEncoding>
...
@@ -24,50 +17,22 @@
...
@@ -24,50 +17,22 @@
<skipTests>
true
</skipTests>
<skipTests>
true
</skipTests>
</properties>
</properties>
<parent>
<groupId>
com.macro.mall
</groupId>
<artifactId>
mall
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</parent>
<dependencies>
<dependencies>
<dependency>
<dependency>
<groupId>
com.macro.mall
</groupId>
<groupId>
com.macro.mall
</groupId>
<artifactId>
mall-mbg
</artifactId>
<artifactId>
mall-mbg
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<version>
1.0-SNAPSHOT
</version>
</dependency>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-security
</artifactId>
<artifactId>
spring-boot-starter-security
</artifactId>
</dependency>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-actuator
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-aop
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
</dependency>
<!--MyBatis分页插件-->
<dependency>
<groupId>
com.github.pagehelper
</groupId>
<artifactId>
pagehelper-spring-boot-starter
</artifactId>
<version>
1.2.10
</version>
</dependency>
<!--Swagger-UI API文档生产工具-->
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger2
</artifactId>
<version>
2.6.1
</version>
</dependency>
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger-ui
</artifactId>
<version>
2.6.1
</version>
</dependency>
<!--JWT(Json Web Token)登录支持-->
<!--JWT(Json Web Token)登录支持-->
<dependency>
<dependency>
<groupId>
io.jsonwebtoken
</groupId>
<groupId>
io.jsonwebtoken
</groupId>
...
@@ -86,12 +51,6 @@
...
@@ -86,12 +51,6 @@
<artifactId>
logstash-logback-encoder
</artifactId>
<artifactId>
logstash-logback-encoder
</artifactId>
<version>
4.8
</version>
<version>
4.8
</version>
</dependency>
</dependency>
<!--集成druid连接池-->
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
druid-spring-boot-starter
</artifactId>
<version>
1.1.10
</version>
</dependency>
<!--lombok依赖-->
<!--lombok依赖-->
<dependency>
<dependency>
<groupId>
org.projectlombok
</groupId>
<groupId>
org.projectlombok
</groupId>
...
...
mall-common/pom.xml
0 → 100644
View file @
b5800856
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
com.macro.mall
</groupId>
<artifactId>
mall-common
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<packaging>
jar
</packaging>
<name>
mall-common
</name>
<description>
mall-common project for mall
</description>
<dependencies>
<dependency>
<groupId>
com.github.pagehelper
</groupId>
<artifactId>
pagehelper
</artifactId>
<version>
5.1.8
</version>
</dependency>
<!--Swagger-UI API文档生产工具-->
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger2
</artifactId>
<version>
2.7.0
</version>
</dependency>
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger-ui
</artifactId>
<version>
2.7.0
</version>
</dependency>
<dependency>
<groupId>
org.springframework.data
</groupId>
<artifactId>
spring-data-commons
</artifactId>
<version>
2.1.5.RELEASE
</version>
<scope>
compile
</scope>
</dependency>
</dependencies>
</project>
\ No newline at end of file
mall-
de
mo/src/main/java/com/macro/mall/
demo/dto
/CommonPage.java
→
mall-
com
mo
n
/src/main/java/com/macro/mall/
common/api
/CommonPage.java
View file @
b5800856
package
com.macro.mall.
demo.dto
;
package
com.macro.mall.
common.api
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
org.springframework.data.domain.Page
;
import
java.util.List
;
import
java.util.List
;
...
@@ -14,11 +15,11 @@ public class CommonPage<T> {
...
@@ -14,11 +15,11 @@ public class CommonPage<T> {
private
List
<
T
>
list
;
private
List
<
T
>
list
;
/**
/**
*
将PageHelper分页后的list转为分页信息
* 将PageHelper分页后的list转为分页信息
*/
*/
public
static
<
T
>
CommonPage
<
T
>
restPage
(
List
<
T
>
list
)
{
public
static
<
T
>
CommonPage
<
T
>
restPage
(
List
<
T
>
list
)
{
CommonPage
<
T
>
result
=
new
CommonPage
<>();
CommonPage
<
T
>
result
=
new
CommonPage
<
T
>();
PageInfo
<
T
>
pageInfo
=
new
PageInfo
<>(
list
);
PageInfo
<
T
>
pageInfo
=
new
PageInfo
<
T
>(
list
);
result
.
setTotalPage
(
pageInfo
.
getTotal
()
/
pageInfo
.
getPageSize
());
result
.
setTotalPage
(
pageInfo
.
getTotal
()
/
pageInfo
.
getPageSize
());
result
.
setPageNum
(
pageInfo
.
getPageNum
());
result
.
setPageNum
(
pageInfo
.
getPageNum
());
result
.
setPageSize
(
pageInfo
.
getPageSize
());
result
.
setPageSize
(
pageInfo
.
getPageSize
());
...
@@ -26,6 +27,18 @@ public class CommonPage<T> {
...
@@ -26,6 +27,18 @@ public class CommonPage<T> {
return
result
;
return
result
;
}
}
/**
* 将SpringData分页后的list转为分页信息
*/
public
static
<
T
>
CommonPage
<
T
>
restPage
(
Page
<
T
>
pageInfo
)
{
CommonPage
<
T
>
result
=
new
CommonPage
<
T
>();
result
.
setTotalPage
((
long
)
pageInfo
.
getTotalPages
());
result
.
setPageNum
(
pageInfo
.
getNumber
());
result
.
setPageSize
(
pageInfo
.
getSize
());
result
.
setList
(
pageInfo
.
getContent
());
return
result
;
}
public
Integer
getPageNum
()
{
public
Integer
getPageNum
()
{
return
pageNum
;
return
pageNum
;
}
}
...
...
mall-
de
mo/src/main/java/com/macro/mall/
demo/dto
/CommonResult.java
→
mall-
com
mo
n
/src/main/java/com/macro/mall/
common/api
/CommonResult.java
View file @
b5800856
package
com.macro.mall.
demo.dto
;
package
com.macro.mall.
common.api
;
/**
/**
* 通用返回对象
* 通用返回对象
*/
*/
public
class
CommonResult
<
T
>
{
public
class
CommonResult
<
T
>
{
public
static
final
int
SUCCESS
=
0
;
private
long
code
;
public
static
final
int
FAILED
=
1
;
public
static
final
int
VALIDATE_FAILED
=
2
;
private
int
code
;
private
String
message
;
private
String
message
;
private
T
data
;
private
T
data
;
...
@@ -18,38 +15,88 @@ public class CommonResult<T> {
...
@@ -18,38 +15,88 @@ public class CommonResult<T> {
*/
*/
public
static
<
T
>
CommonResult
<
T
>
success
(
T
data
)
{
public
static
<
T
>
CommonResult
<
T
>
success
(
T
data
)
{
CommonResult
<
T
>
result
=
new
CommonResult
<
T
>();
CommonResult
<
T
>
result
=
new
CommonResult
<
T
>();
result
.
setCode
(
SUCCESS
);
result
.
setCode
(
ResultCode
.
SUCCESS
.
getCode
());
result
.
setMessage
(
ResultCode
.
SUCCESS
.
getMsg
());
result
.
setData
(
data
);
result
.
setData
(
data
);
return
result
;
return
result
;
}
}
/**
* 普通成功返回
*
* @param data 获取的数据
*/
public
static
<
T
>
CommonResult
<
T
>
success
(
T
data
,
String
message
)
{
CommonResult
<
T
>
result
=
new
CommonResult
<
T
>();
result
.
setCode
(
ResultCode
.
SUCCESS
.
getCode
());
result
.
setMessage
(
message
);
result
.
setData
(
data
);
return
result
;
}
/**
* 通过错误码对象构造返回结果
*/
public
static
<
T
>
CommonResult
<
T
>
failed
(
IErrorCode
errorCode
)
{
CommonResult
<
T
>
result
=
new
CommonResult
<
T
>();
result
.
setCode
(
errorCode
.
getCode
());
result
.
setMessage
(
errorCode
.
getMsg
());
return
result
;
}
/**
/**
* 普通失败提示信息
* 普通失败提示信息
*/
*/
public
static
<
T
>
CommonResult
<
T
>
failed
(
String
message
)
{
public
static
<
T
>
CommonResult
<
T
>
failed
(
String
message
)
{
CommonResult
result
=
new
CommonResult
();
CommonResult
<
T
>
result
=
new
CommonResult
<
T
>
();
result
.
setCode
(
FAILED
);
result
.
setCode
(
ResultCode
.
FAILED
.
getCode
()
);
result
.
setMessage
(
message
);
result
.
setMessage
(
message
);
return
result
;
return
result
;
}
}
/**
* 普通操作失败
*/
public
static
<
T
>
CommonResult
<
T
>
failed
()
{
return
failed
(
ResultCode
.
FAILED
);
}
/**
* 参数验证失败使用
*/
public
static
<
T
>
CommonResult
<
T
>
validateFailed
()
{
return
failed
(
ResultCode
.
VALIDATE_FAILED
);
}
/**
/**
* 参数验证失败使用
* 参数验证失败使用
*
* @param message 错误信息
*/
*/
public
static
<
T
>
CommonResult
<
T
>
validateFailed
(
String
message
)
{
public
static
<
T
>
CommonResult
<
T
>
validateFailed
(
String
message
)
{
CommonResult
result
=
new
CommonResult
();
CommonResult
<
T
>
result
=
new
CommonResult
<
T
>
();
result
.
setCode
(
VALIDATE_FAILED
);
result
.
setCode
(
ResultCode
.
FAILED
.
getCode
()
);
result
.
setMessage
(
message
);
result
.
setMessage
(
message
);
return
result
;
return
result
;
}
}
public
int
getCode
()
{
/**
* 用户没有登录
*/
public
static
<
T
>
CommonResult
<
T
>
unauthorized
()
{
return
failed
(
ResultCode
.
UNAUTHORIZED
);
}
/**
* 用户没有相应权限
*/
public
static
<
T
>
CommonResult
<
T
>
forbidden
()
{
return
failed
(
ResultCode
.
UNAUTHORIZED
);
}
public
long
getCode
()
{
return
code
;
return
code
;
}
}
public
void
setCode
(
int
code
)
{
public
void
setCode
(
long
code
)
{
this
.
code
=
code
;
this
.
code
=
code
;
}
}
...
...
mall-common/src/main/java/com/macro/mall/common/api/IErrorCode.java
0 → 100644
View file @
b5800856
package
com.macro.mall.common.api
;
/**
* 封装API的错误码
* Created by macro on 2019/4/19.
*/
public
interface
IErrorCode
{
long
getCode
();
String
getMsg
();
}
mall-common/src/main/java/com/macro/mall/common/api/ResultCode.java
0 → 100644
View file @
b5800856
package
com.macro.mall.common.api
;
/**
* 枚举了一些常用API操作码
* Created by macro on 2019/4/19.
*/
public
enum
ResultCode
implements
IErrorCode
{
SUCCESS
(
200
,
"操作成功"
),
FAILED
(
500
,
"操作失败"
),
VALIDATE_FAILED
(
404
,
"参数检验失败"
),
UNAUTHORIZED
(
401
,
"暂未登录或token已经过期"
),
FORBIDDEN
(
403
,
"没有相关权限"
);
private
long
code
;
private
String
msg
;
private
ResultCode
(
long
code
,
String
msg
)
{
this
.
code
=
code
;
this
.
msg
=
msg
;
}
public
long
getCode
()
{
return
code
;
}
public
String
getMsg
()
{
return
msg
;
}
}
mall-demo/pom.xml
View file @
b5800856
...
@@ -5,35 +5,28 @@
...
@@ -5,35 +5,28 @@
<groupId>
com.macro.mall
</groupId>
<groupId>
com.macro.mall
</groupId>
<artifactId>
mall-demo
</artifactId>
<artifactId>
mall-demo
</artifactId>
<version>
0
.0
.1
-SNAPSHOT
</version>
<version>
1
.0-SNAPSHOT
</version>
<packaging>
jar
</packaging>
<packaging>
jar
</packaging>
<name>
mall-demo
</name>
<name>
mall-demo
</name>
<description>
Demo project for Spring Boot
</description>
<description>
Demo project for Spring Boot
</description>
<parent>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
2.1.3.RELEASE
</version>
<relativePath/>
<!-- lookup parent from repository -->
</parent>
<properties>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<project.reporting.outputEncoding>
UTF-8
</project.reporting.outputEncoding>
<project.reporting.outputEncoding>
UTF-8
</project.reporting.outputEncoding>
<java.version>
1.8
</java.version>
<java.version>
1.8
</java.version>
</properties>
</properties>
<parent>
<groupId>
com.macro.mall
</groupId>
<artifactId>
mall
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</parent>
<dependencies>
<dependencies>
<dependency>
<dependency>
<groupId>
com.macro.mall
</groupId>
<groupId>
com.macro.mall
</groupId>
<artifactId>
mall-mbg
</artifactId>
<artifactId>
mall-mbg
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<version>
1.0-SNAPSHOT
</version>
</dependency>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-thymeleaf
</artifactId>
<artifactId>
spring-boot-starter-thymeleaf
</artifactId>
...
@@ -42,36 +35,6 @@
...
@@ -42,36 +35,6 @@
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-security
</artifactId>
<artifactId>
spring-boot-starter-security
</artifactId>
</dependency>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-actuator
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-aop
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
</dependency>
<!--MyBatis分页插件-->
<dependency>
<groupId>
com.github.pagehelper
</groupId>
<artifactId>
pagehelper-spring-boot-starter
</artifactId>
<version>
1.2.10
</version>
</dependency>
<!--Swagger-UI API文档生产工具-->
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger2
</artifactId>
<version>
2.6.1
</version>
</dependency>
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger-ui
</artifactId>
<version>
2.6.1
</version>
</dependency>
<!--logstash日志收集插件-->
<!--logstash日志收集插件-->
<dependency>
<dependency>
<groupId>
net.logstash.logback
</groupId>
<groupId>
net.logstash.logback
</groupId>
...
...
mall-demo/src/main/java/com/macro/mall/demo/controller/DemoController.java
View file @
b5800856
package
com.macro.mall.demo.controller
;
package
com.macro.mall.demo.controller
;
import
com.macro.mall.
demo.dto
.CommonPage
;
import
com.macro.mall.
common.api
.CommonPage
;
import
com.macro.mall.
demo.dto
.CommonResult
;
import
com.macro.mall.
common.api
.CommonResult
;
import
com.macro.mall.demo.dto.PmsBrandDto
;
import
com.macro.mall.demo.dto.PmsBrandDto
;
import
com.macro.mall.demo.service.DemoService
;
import
com.macro.mall.demo.service.DemoService
;
import
com.macro.mall.model.PmsBrand
;
import
com.macro.mall.model.PmsBrand
;
...
@@ -11,7 +11,6 @@ import org.slf4j.Logger;
...
@@ -11,7 +11,6 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
...
mall-demo/src/main/java/com/macro/mall/demo/controller/RestTemplateDemoController.java
View file @
b5800856
package
com.macro.mall.demo.controller
;
package
com.macro.mall.demo.controller
;
import
com.macro.mall.
demo.dto
.CommonResult
;
import
com.macro.mall.
common.api
.CommonResult
;
import
com.macro.mall.model.PmsBrand
;
import
com.macro.mall.model.PmsBrand
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
...
...
mall-mbg/pom.xml
View file @
b5800856
...
@@ -13,6 +13,11 @@
...
@@ -13,6 +13,11 @@
<description>
mall-mbg project for mall
</description>
<description>
mall-mbg project for mall
</description>
<dependencies>
<dependencies>
<dependency>
<groupId>
com.macro.mall
</groupId>
<artifactId>
mall-common
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<!-- MyBatis 生成器 -->
<!-- MyBatis 生成器 -->
<dependency>
<dependency>
<groupId>
org.mybatis.generator
</groupId>
<groupId>
org.mybatis.generator
</groupId>
...
...
mall-portal/pom.xml
View file @
b5800856
...
@@ -5,19 +5,12 @@
...
@@ -5,19 +5,12 @@
<groupId>
com.macro.mall
</groupId>
<groupId>
com.macro.mall
</groupId>
<artifactId>
mall-portal
</artifactId>
<artifactId>
mall-portal
</artifactId>
<version>
0
.0
.1
-SNAPSHOT
</version>
<version>
1
.0-SNAPSHOT
</version>
<packaging>
jar
</packaging>
<packaging>
jar
</packaging>
<name>
mall-portal
</name>
<name>
mall-portal
</name>
<description>
Demo project for Spring Boot
</description>
<description>
Demo project for Spring Boot
</description>
<parent>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
2.1.3.RELEASE
</version>
<relativePath/>
<!-- lookup parent from repository -->
</parent>
<properties>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<project.reporting.outputEncoding>
UTF-8
</project.reporting.outputEncoding>
<project.reporting.outputEncoding>
UTF-8
</project.reporting.outputEncoding>
...
@@ -25,6 +18,13 @@
...
@@ -25,6 +18,13 @@
<skipTests>
true
</skipTests>
<skipTests>
true
</skipTests>
</properties>
</properties>
<parent>
<groupId>
com.macro.mall
</groupId>
<artifactId>
mall
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<relativePath/>
<!-- lookup parent from repository -->
</parent>
<dependencies>
<dependencies>
<dependency>
<dependency>
<groupId>
com.macro.mall
</groupId>
<groupId>
com.macro.mall
</groupId>
...
@@ -35,47 +35,15 @@
...
@@ -35,47 +35,15 @@
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-data-mongodb
</artifactId>
<artifactId>
spring-boot-starter-data-mongodb
</artifactId>
</dependency>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-security
</artifactId>
<artifactId>
spring-boot-starter-security
</artifactId>
</dependency>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
</dependency>
<!--MyBatis分页插件-->
<dependency>
<groupId>
com.github.pagehelper
</groupId>
<artifactId>
pagehelper-spring-boot-starter
</artifactId>
<version>
1.2.10
</version>
</dependency>
<!--Swagger-UI API文档生产工具-->
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger2
</artifactId>
<version>
2.6.1
</version>
</dependency>
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger-ui
</artifactId>
<version>
2.6.1
</version>
</dependency>
<!--redis依赖配置-->
<!--redis依赖配置-->
<dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-data-redis
</artifactId>
<artifactId>
spring-boot-starter-data-redis
</artifactId>
</dependency>
</dependency>
<!--集成druid连接池-->
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
druid-spring-boot-starter
</artifactId>
<version>
1.1.10
</version>
</dependency>
<!--集成消息队列-->
<!--集成消息队列-->
<dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
...
...
mall-portal/src/main/java/com/macro/mall/portal/component/OrderTimeOutCancelTask.java
View file @
b5800856
package
com.macro.mall.portal.component
;
package
com.macro.mall.portal.component
;
import
com.macro.mall.
portal.domain
.CommonResult
;
import
com.macro.mall.
common.api
.CommonResult
;
import
com.macro.mall.portal.service.OmsPortalOrderService
;
import
com.macro.mall.portal.service.OmsPortalOrderService
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
...
mall-portal/src/main/java/com/macro/mall/portal/controller/HomeController.java
View file @
b5800856
package
com.macro.mall.portal.controller
;
package
com.macro.mall.portal.controller
;
import
com.macro.mall.common.api.CommonResult
;
import
com.macro.mall.model.CmsSubject
;
import
com.macro.mall.model.CmsSubject
;
import
com.macro.mall.model.PmsProduct
;
import
com.macro.mall.model.PmsProduct
;
import
com.macro.mall.model.PmsProductCategory
;
import
com.macro.mall.model.PmsProductCategory
;
import
com.macro.mall.portal.domain.CommonResult
;
import
com.macro.mall.portal.domain.HomeContentResult
;
import
com.macro.mall.portal.domain.HomeContentResult
;
import
com.macro.mall.portal.service.HomeService
;
import
com.macro.mall.portal.service.HomeService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
@@ -28,35 +28,35 @@ public class HomeController {
...
@@ -28,35 +28,35 @@ public class HomeController {
@ApiOperation
(
"首页内容页信息展示"
)
@ApiOperation
(
"首页内容页信息展示"
)
@RequestMapping
(
value
=
"/content"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/content"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
@ResponseBody
public
Object
content
()
{
public
CommonResult
<
HomeContentResult
>
content
()
{
HomeContentResult
contentResult
=
homeService
.
content
();
HomeContentResult
contentResult
=
homeService
.
content
();
return
new
CommonResult
()
.
success
(
contentResult
);
return
CommonResult
.
success
(
contentResult
);
}
}
@ApiOperation
(
"分页获取推荐商品"
)
@ApiOperation
(
"分页获取推荐商品"
)
@RequestMapping
(
value
=
"/recommendProductList"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/recommendProductList"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
@ResponseBody
public
Object
recommendProductList
(
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"4"
)
Integer
pageSize
,
public
CommonResult
<
List
<
PmsProduct
>>
recommendProductList
(
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"4"
)
Integer
pageSize
,
@RequestParam
(
value
=
"pageNum"
,
defaultValue
=
"1"
)
Integer
pageNum
)
{
@RequestParam
(
value
=
"pageNum"
,
defaultValue
=
"1"
)
Integer
pageNum
)
{
List
<
PmsProduct
>
productList
=
homeService
.
recommendProductList
(
pageSize
,
pageNum
);
List
<
PmsProduct
>
productList
=
homeService
.
recommendProductList
(
pageSize
,
pageNum
);
return
new
CommonResult
()
.
success
(
productList
);
return
CommonResult
.
success
(
productList
);
}
}
@ApiOperation
(
"获取首页商品分类"
)
@ApiOperation
(
"获取首页商品分类"
)
@RequestMapping
(
value
=
"/productCateList/{parentId}"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/productCateList/{parentId}"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
@ResponseBody
public
Object
getProductCateList
(
@PathVariable
Long
parentId
)
{
public
CommonResult
<
List
<
PmsProductCategory
>>
getProductCateList
(
@PathVariable
Long
parentId
)
{
List
<
PmsProductCategory
>
productCategoryList
=
homeService
.
getProductCateList
(
parentId
);
List
<
PmsProductCategory
>
productCategoryList
=
homeService
.
getProductCateList
(
parentId
);
return
new
CommonResult
()
.
success
(
productCategoryList
);
return
CommonResult
.
success
(
productCategoryList
);
}
}
@ApiOperation
(
"根据分类获取专题"
)
@ApiOperation
(
"根据分类获取专题"
)
@RequestMapping
(
value
=
"/subjectList"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/subjectList"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
@ResponseBody
public
O
bject
getSubjectList
(
@RequestParam
(
required
=
false
)
Long
cateId
,
public
CommonResult
<
List
<
CmsSu
bject
>>
getSubjectList
(
@RequestParam
(
required
=
false
)
Long
cateId
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"4"
)
Integer
pageSize
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"4"
)
Integer
pageSize
,
@RequestParam
(
value
=
"pageNum"
,
defaultValue
=
"1"
)
Integer
pageNum
)
{
@RequestParam
(
value
=
"pageNum"
,
defaultValue
=
"1"
)
Integer
pageNum
)
{
List
<
CmsSubject
>
subjectList
=
homeService
.
getSubjectList
(
cateId
,
pageSize
,
pageNum
);
List
<
CmsSubject
>
subjectList
=
homeService
.
getSubjectList
(
cateId
,
pageSize
,
pageNum
);
return
new
CommonResult
()
.
success
(
subjectList
);
return
CommonResult
.
success
(
subjectList
);
}
}
}
}
mall-portal/src/main/java/com/macro/mall/portal/controller/MemberAttentionController.java
View file @
b5800856
package
com.macro.mall.portal.controller
;
package
com.macro.mall.portal.controller
;
import
com.macro.mall.
portal.domain
.CommonResult
;
import
com.macro.mall.
common.api
.CommonResult
;
import
com.macro.mall.portal.domain.MemberBrandAttention
;
import
com.macro.mall.portal.domain.MemberBrandAttention
;
import
com.macro.mall.portal.service.MemberAttentionService
;
import
com.macro.mall.portal.service.MemberAttentionService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
@@ -24,32 +24,32 @@ public class MemberAttentionController {
...
@@ -24,32 +24,32 @@ public class MemberAttentionController {
@ApiOperation
(
"添加品牌关注"
)
@ApiOperation
(
"添加品牌关注"
)
@RequestMapping
(
value
=
"/add"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/add"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
@ResponseBody
public
Objec
t
add
(
@RequestBody
MemberBrandAttention
memberBrandAttention
)
{
public
CommonResul
t
add
(
@RequestBody
MemberBrandAttention
memberBrandAttention
)
{
int
count
=
memberAttentionService
.
add
(
memberBrandAttention
);
int
count
=
memberAttentionService
.
add
(
memberBrandAttention
);
if
(
count
>
0
){
if
(
count
>
0
){
return
new
CommonResult
()
.
success
(
count
);
return
CommonResult
.
success
(
count
);
}
else
{
}
else
{
return
new
CommonResult
()
.
failed
();
return
CommonResult
.
failed
();
}
}
}
}
@ApiOperation
(
"取消关注"
)
@ApiOperation
(
"取消关注"
)
@RequestMapping
(
value
=
"/delete"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/delete"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
@ResponseBody
public
Objec
t
delete
(
Long
memberId
,
Long
brandId
)
{
public
CommonResul
t
delete
(
Long
memberId
,
Long
brandId
)
{
int
count
=
memberAttentionService
.
delete
(
memberId
,
brandId
);
int
count
=
memberAttentionService
.
delete
(
memberId
,
brandId
);
if
(
count
>
0
){
if
(
count
>
0
){
return
new
CommonResult
()
.
success
(
count
);
return
CommonResult
.
success
(
count
);
}
else
{
}
else
{
return
new
CommonResult
()
.
failed
();
return
CommonResult
.
failed
();
}
}
}
}
@ApiOperation
(
"显示关注列表"
)
@ApiOperation
(
"显示关注列表"
)
@RequestMapping
(
value
=
"/list/{memberId}"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/list/{memberId}"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
@ResponseBody
public
Object
list
(
@PathVariable
Long
memberId
)
{
public
CommonResult
<
List
<
MemberBrandAttention
>>
list
(
@PathVariable
Long
memberId
)
{
List
<
MemberBrandAttention
>
memberBrandAttentionList
=
memberAttentionService
.
list
(
memberId
);
List
<
MemberBrandAttention
>
memberBrandAttentionList
=
memberAttentionService
.
list
(
memberId
);
return
new
CommonResult
()
.
success
(
memberBrandAttentionList
);
return
CommonResult
.
success
(
memberBrandAttentionList
);
}
}
}
}
mall-portal/src/main/java/com/macro/mall/portal/controller/MemberCollectionController.java
View file @
b5800856
package
com.macro.mall.portal.controller
;
package
com.macro.mall.portal.controller
;
import
com.macro.mall.
portal.domain
.CommonResult
;
import
com.macro.mall.
common.api
.CommonResult
;
import
com.macro.mall.portal.domain.MemberProductCollection
;
import
com.macro.mall.portal.domain.MemberProductCollection
;
import
com.macro.mall.portal.service.MemberCollectionService
;
import
com.macro.mall.portal.service.MemberCollectionService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
@@ -21,35 +21,36 @@ import java.util.List;
...
@@ -21,35 +21,36 @@ import java.util.List;
public
class
MemberCollectionController
{
public
class
MemberCollectionController
{
@Autowired
@Autowired
private
MemberCollectionService
memberCollectionService
;
private
MemberCollectionService
memberCollectionService
;
@ApiOperation
(
"添加商品收藏"
)
@ApiOperation
(
"添加商品收藏"
)
@RequestMapping
(
value
=
"/addProduct"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/addProduct"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
@ResponseBody
public
Objec
t
addProduct
(
@RequestBody
MemberProductCollection
productCollection
)
{
public
CommonResul
t
addProduct
(
@RequestBody
MemberProductCollection
productCollection
)
{
int
count
=
memberCollectionService
.
addProduct
(
productCollection
);
int
count
=
memberCollectionService
.
addProduct
(
productCollection
);
if
(
count
>
0
){
if
(
count
>
0
)
{
return
new
CommonResult
()
.
success
(
count
);
return
CommonResult
.
success
(
count
);
}
else
{
}
else
{
return
new
CommonResult
()
.
failed
();
return
CommonResult
.
failed
();
}
}
}
}
@ApiOperation
(
"删除收藏商品"
)
@ApiOperation
(
"删除收藏商品"
)
@RequestMapping
(
value
=
"/deleteProduct"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/deleteProduct"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
@ResponseBody
public
Objec
t
deleteProduct
(
Long
memberId
,
Long
productId
)
{
public
CommonResul
t
deleteProduct
(
Long
memberId
,
Long
productId
)
{
int
count
=
memberCollectionService
.
deleteProduct
(
memberId
,
productId
);
int
count
=
memberCollectionService
.
deleteProduct
(
memberId
,
productId
);
if
(
count
>
0
){
if
(
count
>
0
)
{
return
new
CommonResult
()
.
success
(
count
);
return
CommonResult
.
success
(
count
);
}
else
{
}
else
{
return
new
CommonResult
()
.
failed
();
return
CommonResult
.
failed
();
}
}
}
}
@ApiOperation
(
"显示关注列表"
)
@ApiOperation
(
"显示关注列表"
)
@RequestMapping
(
value
=
"/listProduct/{memberId}"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/listProduct/{memberId}"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
@ResponseBody
public
Object
listProduct
(
@PathVariable
Long
memberId
)
{
public
CommonResult
<
List
<
MemberProductCollection
>>
listProduct
(
@PathVariable
Long
memberId
)
{
List
<
MemberProductCollection
>
memberProductCollectionList
=
memberCollectionService
.
listProduct
(
memberId
);
List
<
MemberProductCollection
>
memberProductCollectionList
=
memberCollectionService
.
listProduct
(
memberId
);
return
new
CommonResult
()
.
success
(
memberProductCollectionList
);
return
CommonResult
.
success
(
memberProductCollectionList
);
}
}
}
}
mall-portal/src/main/java/com/macro/mall/portal/controller/MemberReadHistoryController.java
View file @
b5800856
package
com.macro.mall.portal.controller
;
package
com.macro.mall.portal.controller
;
import
com.macro.mall.
portal.domain
.CommonResult
;
import
com.macro.mall.
common.api
.CommonResult
;
import
com.macro.mall.portal.domain.MemberReadHistory
;
import
com.macro.mall.portal.domain.MemberReadHistory
;
import
com.macro.mall.portal.service.MemberReadHistoryService
;
import
com.macro.mall.portal.service.MemberReadHistoryService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
@@ -25,32 +25,32 @@ public class MemberReadHistoryController {
...
@@ -25,32 +25,32 @@ public class MemberReadHistoryController {
@ApiOperation
(
"创建浏览记录"
)
@ApiOperation
(
"创建浏览记录"
)
@RequestMapping
(
value
=
"/create"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/create"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
@ResponseBody
public
Objec
t
create
(
@RequestBody
MemberReadHistory
memberReadHistory
)
{
public
CommonResul
t
create
(
@RequestBody
MemberReadHistory
memberReadHistory
)
{
int
count
=
memberReadHistoryService
.
create
(
memberReadHistory
);
int
count
=
memberReadHistoryService
.
create
(
memberReadHistory
);
if
(
count
>
0
){
if
(
count
>
0
)
{
return
new
CommonResult
()
.
success
(
count
);
return
CommonResult
.
success
(
count
);
}
else
{
}
else
{
return
new
CommonResult
()
.
failed
();
return
CommonResult
.
failed
();
}
}
}
}
@ApiOperation
(
"删除浏览记录"
)
@ApiOperation
(
"删除浏览记录"
)
@RequestMapping
(
value
=
"/delete"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/delete"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
@ResponseBody
public
Objec
t
delete
(
@RequestParam
(
"ids"
)
List
<
String
>
ids
)
{
public
CommonResul
t
delete
(
@RequestParam
(
"ids"
)
List
<
String
>
ids
)
{
int
count
=
memberReadHistoryService
.
delete
(
ids
);
int
count
=
memberReadHistoryService
.
delete
(
ids
);
if
(
count
>
0
){
if
(
count
>
0
)
{
return
new
CommonResult
()
.
success
(
count
);
return
CommonResult
.
success
(
count
);
}
else
{
}
else
{
return
new
CommonResult
()
.
failed
();
return
CommonResult
.
failed
();
}
}
}
}
@ApiOperation
(
"展示浏览记录"
)
@ApiOperation
(
"展示浏览记录"
)
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
@ResponseBody
public
Object
list
(
Long
memberId
)
{
public
CommonResult
<
List
<
MemberReadHistory
>>
list
(
Long
memberId
)
{
List
<
MemberReadHistory
>
memberReadHistoryList
=
memberReadHistoryService
.
list
(
memberId
);
List
<
MemberReadHistory
>
memberReadHistoryList
=
memberReadHistoryService
.
list
(
memberId
);
return
new
CommonResult
()
.
success
(
memberReadHistoryList
);
return
CommonResult
.
success
(
memberReadHistoryList
);
}
}
}
}
mall-portal/src/main/java/com/macro/mall/portal/controller/OmsCartItemController.java
View file @
b5800856
package
com.macro.mall.portal.controller
;
package
com.macro.mall.portal.controller
;
import
com.macro.mall.common.api.CommonResult
;
import
com.macro.mall.model.OmsCartItem
;
import
com.macro.mall.model.OmsCartItem
;
import
com.macro.mall.portal.domain.CartProduct
;
import
com.macro.mall.portal.domain.CartProduct
;
import
com.macro.mall.portal.domain.CartPromotionItem
;
import
com.macro.mall.portal.domain.CartPromotionItem
;
import
com.macro.mall.portal.domain.CommonResult
;
import
com.macro.mall.portal.service.OmsCartItemService
;
import
com.macro.mall.portal.service.OmsCartItemService
;
import
com.macro.mall.portal.service.UmsMemberService
;
import
com.macro.mall.portal.service.UmsMemberService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
@@ -30,80 +30,80 @@ public class OmsCartItemController {
...
@@ -30,80 +30,80 @@ public class OmsCartItemController {
@ApiOperation
(
"添加商品到购物车"
)
@ApiOperation
(
"添加商品到购物车"
)
@RequestMapping
(
value
=
"/add"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/add"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
@ResponseBody
public
Objec
t
add
(
@RequestBody
OmsCartItem
cartItem
)
{
public
CommonResul
t
add
(
@RequestBody
OmsCartItem
cartItem
)
{
int
count
=
cartItemService
.
add
(
cartItem
);
int
count
=
cartItemService
.
add
(
cartItem
);
if
(
count
>
0
)
{
if
(
count
>
0
)
{
return
new
CommonResult
()
.
success
(
count
);
return
CommonResult
.
success
(
count
);
}
}
return
new
CommonResult
()
.
failed
();
return
CommonResult
.
failed
();
}
}
@ApiOperation
(
"获取某个会员的购物车列表"
)
@ApiOperation
(
"获取某个会员的购物车列表"
)
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
@ResponseBody
public
Object
list
()
{
public
CommonResult
<
List
<
OmsCartItem
>>
list
()
{
List
<
OmsCartItem
>
cartItemList
=
cartItemService
.
list
(
memberService
.
getCurrentMember
().
getId
());
List
<
OmsCartItem
>
cartItemList
=
cartItemService
.
list
(
memberService
.
getCurrentMember
().
getId
());
return
new
CommonResult
()
.
success
(
cartItemList
);
return
CommonResult
.
success
(
cartItemList
);
}
}
@ApiOperation
(
"获取某个会员的购物车列表,包括促销信息"
)
@ApiOperation
(
"获取某个会员的购物车列表,包括促销信息"
)
@RequestMapping
(
value
=
"/list/promotion"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/list/promotion"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
@ResponseBody
public
Object
listPromotion
()
{
public
CommonResult
<
List
<
CartPromotionItem
>>
listPromotion
()
{
List
<
CartPromotionItem
>
cartPromotionItemList
=
cartItemService
.
listPromotion
(
memberService
.
getCurrentMember
().
getId
());
List
<
CartPromotionItem
>
cartPromotionItemList
=
cartItemService
.
listPromotion
(
memberService
.
getCurrentMember
().
getId
());
return
new
CommonResult
()
.
success
(
cartPromotionItemList
);
return
CommonResult
.
success
(
cartPromotionItemList
);
}
}
@ApiOperation
(
"修改购物车中某个商品的数量"
)
@ApiOperation
(
"修改购物车中某个商品的数量"
)
@RequestMapping
(
value
=
"/update/quantity"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/update/quantity"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
@ResponseBody
public
Objec
t
updateQuantity
(
@RequestParam
Long
id
,
public
CommonResul
t
updateQuantity
(
@RequestParam
Long
id
,
@RequestParam
Integer
quantity
)
{
@RequestParam
Integer
quantity
)
{
int
count
=
cartItemService
.
updateQuantity
(
id
,
memberService
.
getCurrentMember
().
getId
(),
quantity
);
int
count
=
cartItemService
.
updateQuantity
(
id
,
memberService
.
getCurrentMember
().
getId
(),
quantity
);
if
(
count
>
0
)
{
if
(
count
>
0
)
{
return
new
CommonResult
()
.
success
(
count
);
return
CommonResult
.
success
(
count
);
}
}
return
new
CommonResult
()
.
failed
();
return
CommonResult
.
failed
();
}
}
@ApiOperation
(
"获取购物车中某个商品的规格,用于重选规格"
)
@ApiOperation
(
"获取购物车中某个商品的规格,用于重选规格"
)
@RequestMapping
(
value
=
"/getProduct/{productId}"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/getProduct/{productId}"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
@ResponseBody
public
Obje
ct
getCartProduct
(
@PathVariable
Long
productId
)
{
public
CommonResult
<
CartProdu
ct
>
getCartProduct
(
@PathVariable
Long
productId
)
{
CartProduct
cartProduct
=
cartItemService
.
getCartProduct
(
productId
);
CartProduct
cartProduct
=
cartItemService
.
getCartProduct
(
productId
);
return
new
CommonResult
()
.
success
(
cartProduct
);
return
CommonResult
.
success
(
cartProduct
);
}
}
@ApiOperation
(
"修改购物车中商品的规格"
)
@ApiOperation
(
"修改购物车中商品的规格"
)
@RequestMapping
(
value
=
"/update/attr"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/update/attr"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
@ResponseBody
public
Objec
t
updateAttr
(
@RequestBody
OmsCartItem
cartItem
)
{
public
CommonResul
t
updateAttr
(
@RequestBody
OmsCartItem
cartItem
)
{
int
count
=
cartItemService
.
updateAttr
(
cartItem
);
int
count
=
cartItemService
.
updateAttr
(
cartItem
);
if
(
count
>
0
)
{
if
(
count
>
0
)
{
return
new
CommonResult
()
.
success
(
count
);
return
CommonResult
.
success
(
count
);
}
}
return
new
CommonResult
()
.
failed
();
return
CommonResult
.
failed
();
}
}
@ApiOperation
(
"删除购物车中的某个商品"
)
@ApiOperation
(
"删除购物车中的某个商品"
)
@RequestMapping
(
value
=
"/delete"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/delete"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
@ResponseBody
public
Objec
t
delete
(
@RequestParam
(
"ids"
)
List
<
Long
>
ids
)
{
public
CommonResul
t
delete
(
@RequestParam
(
"ids"
)
List
<
Long
>
ids
)
{
int
count
=
cartItemService
.
delete
(
memberService
.
getCurrentMember
().
getId
(),
ids
);
int
count
=
cartItemService
.
delete
(
memberService
.
getCurrentMember
().
getId
(),
ids
);
if
(
count
>
0
)
{
if
(
count
>
0
)
{
return
new
CommonResult
()
.
success
(
count
);
return
CommonResult
.
success
(
count
);
}
}
return
new
CommonResult
()
.
failed
();
return
CommonResult
.
failed
();
}
}
@ApiOperation
(
"清空购物车"
)
@ApiOperation
(
"清空购物车"
)
@RequestMapping
(
value
=
"/clear"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/clear"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
@ResponseBody
public
Objec
t
clear
()
{
public
CommonResul
t
clear
()
{
int
count
=
cartItemService
.
clear
(
memberService
.
getCurrentMember
().
getId
());
int
count
=
cartItemService
.
clear
(
memberService
.
getCurrentMember
().
getId
());
if
(
count
>
0
)
{
if
(
count
>
0
)
{
return
new
CommonResult
()
.
success
(
count
);
return
CommonResult
.
success
(
count
);
}
}
return
new
CommonResult
()
.
failed
();
return
CommonResult
.
failed
();
}
}
}
}
mall-portal/src/main/java/com/macro/mall/portal/controller/OmsPortalOrderController.java
View file @
b5800856
package
com.macro.mall.portal.controller
;
package
com.macro.mall.portal.controller
;
import
com.macro.mall.
portal.domain
.CommonResult
;
import
com.macro.mall.
common.api
.CommonResult
;
import
com.macro.mall.portal.domain.ConfirmOrderResult
;
import
com.macro.mall.portal.domain.ConfirmOrderResult
;
import
com.macro.mall.portal.domain.OrderParam
;
import
com.macro.mall.portal.domain.OrderParam
;
import
com.macro.mall.portal.service.OmsPortalOrderService
;
import
com.macro.mall.portal.service.OmsPortalOrderService
;
...
@@ -23,9 +23,9 @@ public class OmsPortalOrderController {
...
@@ -23,9 +23,9 @@ public class OmsPortalOrderController {
@ApiOperation
(
"根据购物车信息生成确认单信息"
)
@ApiOperation
(
"根据购物车信息生成确认单信息"
)
@RequestMapping
(
value
=
"/generateConfirmOrder"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/generateConfirmOrder"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
@ResponseBody
public
Object
generateConfirmOrder
(){
public
CommonResult
<
ConfirmOrderResult
>
generateConfirmOrder
(){
ConfirmOrderResult
confirmOrderResult
=
portalOrderService
.
generateConfirmOrder
();
ConfirmOrderResult
confirmOrderResult
=
portalOrderService
.
generateConfirmOrder
();
return
new
CommonResult
()
.
success
(
confirmOrderResult
);
return
CommonResult
.
success
(
confirmOrderResult
);
}
}
@ApiOperation
(
"根据购物车信息生成订单"
)
@ApiOperation
(
"根据购物车信息生成订单"
)
...
@@ -51,8 +51,8 @@ public class OmsPortalOrderController {
...
@@ -51,8 +51,8 @@ public class OmsPortalOrderController {
@ApiOperation
(
"取消单个超时订单"
)
@ApiOperation
(
"取消单个超时订单"
)
@RequestMapping
(
value
=
"/cancelOrder"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/cancelOrder"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
@ResponseBody
public
Objec
t
cancelOrder
(
Long
orderId
){
public
CommonResul
t
cancelOrder
(
Long
orderId
){
portalOrderService
.
sendDelayMessageCancelOrder
(
orderId
);
portalOrderService
.
sendDelayMessageCancelOrder
(
orderId
);
return
new
CommonResult
()
.
success
(
null
);
return
CommonResult
.
success
(
null
);
}
}
}
}
mall-portal/src/main/java/com/macro/mall/portal/controller/OmsPortalOrderReturnApplyController.java
View file @
b5800856
package
com.macro.mall.portal.controller
;
package
com.macro.mall.portal.controller
;
import
com.macro.mall.
portal.domain
.CommonResult
;
import
com.macro.mall.
common.api
.CommonResult
;
import
com.macro.mall.portal.domain.OmsOrderReturnApplyParam
;
import
com.macro.mall.portal.domain.OmsOrderReturnApplyParam
;
import
com.macro.mall.portal.service.OmsPortalOrderReturnApplyService
;
import
com.macro.mall.portal.service.OmsPortalOrderReturnApplyService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
@@ -26,11 +26,11 @@ public class OmsPortalOrderReturnApplyController {
...
@@ -26,11 +26,11 @@ public class OmsPortalOrderReturnApplyController {
@ApiOperation
(
"申请退货"
)
@ApiOperation
(
"申请退货"
)
@RequestMapping
(
value
=
"/create"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/create"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
@ResponseBody
public
Objec
t
create
(
@RequestBody
OmsOrderReturnApplyParam
returnApply
)
{
public
CommonResul
t
create
(
@RequestBody
OmsOrderReturnApplyParam
returnApply
)
{
int
count
=
returnApplyService
.
create
(
returnApply
);
int
count
=
returnApplyService
.
create
(
returnApply
);
if
(
count
>
0
)
{
if
(
count
>
0
)
{
return
new
CommonResult
()
.
success
(
count
);
return
CommonResult
.
success
(
count
);
}
}
return
new
CommonResult
()
.
failed
();
return
CommonResult
.
failed
();
}
}
}
}
mall-portal/src/main/java/com/macro/mall/portal/controller/UmsMemberController.java
View file @
b5800856
package
com.macro.mall.portal.controller
;
package
com.macro.mall.portal.controller
;
import
com.macro.mall.common.api.CommonResult
;
import
com.macro.mall.portal.service.UmsMemberService
;
import
com.macro.mall.portal.service.UmsMemberService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
...
@@ -24,24 +25,24 @@ public class UmsMemberController {
...
@@ -24,24 +25,24 @@ public class UmsMemberController {
@ApiOperation
(
"注册"
)
@ApiOperation
(
"注册"
)
@RequestMapping
(
value
=
"/register"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/register"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
@ResponseBody
public
Objec
t
register
(
@RequestParam
String
username
,
public
CommonResul
t
register
(
@RequestParam
String
username
,
@RequestParam
String
password
,
@RequestParam
String
password
,
@RequestParam
String
telephone
,
@RequestParam
String
telephone
,
@RequestParam
String
authCode
)
{
@RequestParam
String
authCode
)
{
return
memberService
.
register
(
username
,
password
,
telephone
,
authCode
);
return
memberService
.
register
(
username
,
password
,
telephone
,
authCode
);
}
}
@ApiOperation
(
"获取验证码"
)
@ApiOperation
(
"获取验证码"
)
@RequestMapping
(
value
=
"/getAuthCode"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/getAuthCode"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
@ResponseBody
public
Objec
t
getAuthCode
(
@RequestParam
String
telephone
)
{
public
CommonResul
t
getAuthCode
(
@RequestParam
String
telephone
)
{
return
memberService
.
generateAuthCode
(
telephone
);
return
memberService
.
generateAuthCode
(
telephone
);
}
}
@ApiOperation
(
"修改密码"
)
@ApiOperation
(
"修改密码"
)
@RequestMapping
(
value
=
"/updatePassword"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/updatePassword"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
@ResponseBody
public
Objec
t
updatePassword
(
@RequestParam
String
telephone
,
public
CommonResul
t
updatePassword
(
@RequestParam
String
telephone
,
@RequestParam
String
password
,
@RequestParam
String
password
,
@RequestParam
String
authCode
)
{
@RequestParam
String
authCode
)
{
return
memberService
.
updatePassword
(
telephone
,
password
,
authCode
);
return
memberService
.
updatePassword
(
telephone
,
password
,
authCode
);
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment