Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
shop
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
曲欣亮
shop
Commits
80514e88
Commit
80514e88
authored
Oct 26, 2018
by
zhangyong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
加签名
parent
8cbee67e
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
206 additions
and
86 deletions
+206
-86
pom.xml
pom.xml
+1
-0
WebMvcConfig.java
src/main/java/com/egolm/shop/config/WebMvcConfig.java
+12
-48
OpenInterceptor.java
...va/com/egolm/shop/config/interceptor/OpenInterceptor.java
+77
-0
AddressController.java
...ain/java/com/egolm/shop/controller/AddressController.java
+12
-2
BrandController.java
src/main/java/com/egolm/shop/controller/BrandController.java
+14
-3
CartController.java
src/main/java/com/egolm/shop/controller/CartController.java
+24
-14
CategoryController.java
...in/java/com/egolm/shop/controller/CategoryController.java
+2
-0
CommonController.java
...main/java/com/egolm/shop/controller/CommonController.java
+2
-0
CouponController.java
...main/java/com/egolm/shop/controller/CouponController.java
+6
-0
GoodsController.java
src/main/java/com/egolm/shop/controller/GoodsController.java
+23
-7
PageController.java
src/main/java/com/egolm/shop/controller/PageController.java
+2
-0
SolrGoodsController.java
...n/java/com/egolm/shop/controller/SolrGoodsController.java
+4
-0
SystemCtrlController.java
.../java/com/egolm/shop/controller/SystemCtrlController.java
+2
-0
UserController.java
src/main/java/com/egolm/shop/controller/UserController.java
+10
-0
CartService.java
src/main/java/com/egolm/shop/service/CartService.java
+3
-3
CartServiceImpl.java
...ain/java/com/egolm/shop/service/impl/CartServiceImpl.java
+5
-8
ShopContstrant.java
src/main/java/com/egolm/shop/util/ShopContstrant.java
+2
-0
messages_en.properties
src/main/resources/messages_en.properties
+2
-0
messages_zh_CN.properties
src/main/resources/messages_zh_CN.properties
+3
-1
No files found.
pom.xml
View file @
80514e88
...
...
@@ -26,6 +26,7 @@
<artifactId>
spring-boot-devtools
</artifactId>
<optional>
true
</optional>
</dependency>
<dependency>
<groupId>
org.springframework.security
</groupId>
<artifactId>
spring-security-core
</artifactId>
...
...
src/main/java/com/egolm/shop/config/WebMvcConfig.java
View file @
80514e88
package
com
.
egolm
.
shop
.
config
;
import
java.util.EventListener
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpSession
;
import
org.springframework.boot.web.servlet.ServletListenerRegistrationBean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.RequestContextListener
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
import
org.springframework.web.servlet.config.annotation.PathMatchConfigurer
;
import
org.springframework.web.servlet.config.annotation.InterceptorRegistry
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
;
import
com.egolm.shop.config.interceptor.OpenInterceptor
;
@Configuration
public
class
WebMvcConfig
extends
WebMvcConfigurerAdapter
{
@Override
public
void
configurePathMatch
(
PathMatchConfigurer
configurer
)
{
configurer
.
setUseSuffixPatternMatch
(
false
).
setUseTrailingSlashMatch
(
false
);
@Autowired
private
OpenInterceptor
openInterceptor
;
@Override
public
void
addInterceptors
(
InterceptorRegistry
registry
)
{
//注册自定义拦截器,添加拦截路径和排除拦截路径
System
.
out
.
println
(
"-addInterceptors------"
);
registry
.
addInterceptor
(
openInterceptor
).
excludePathPatterns
(
"api/path/login"
);
super
.
addInterceptors
(
registry
);
}
@Bean
public
ServletListenerRegistrationBean
<
EventListener
>
getDemoListener
(){
ServletListenerRegistrationBean
<
EventListener
>
registrationBean
=
new
ServletListenerRegistrationBean
<>();
registrationBean
.
setListener
(
new
RequestContextListener
());
return
registrationBean
;
}
public
static
HttpServletRequest
getRequest
()
{
ServletRequestAttributes
servletRequestAttributes
=
(
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
();
if
(
servletRequestAttributes
!=
null
)
{
return
servletRequestAttributes
.
getRequest
();
}
return
null
;
}
public
static
HttpServletResponse
getResponse
()
{
ServletRequestAttributes
servletRequestAttributes
=
(
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
();
if
(
servletRequestAttributes
!=
null
)
{
return
servletRequestAttributes
.
getResponse
();
}
return
null
;
}
public
static
HttpSession
getSession
()
{
HttpServletRequest
request
=
WebMvcConfig
.
getRequest
();
if
(
request
!=
null
)
{
return
request
.
getSession
();
}
return
null
;
}
}
src/main/java/com/egolm/shop/config/interceptor/OpenInterceptor.java
0 → 100644
View file @
80514e88
package
com
.
egolm
.
shop
.
config
.
interceptor
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.SortedMap
;
import
java.util.TreeMap
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.servlet.handler.HandlerInterceptorAdapter
;
import
com.egolm.common.GsonUtil
;
import
com.egolm.common.HttpUtil
;
import
com.egolm.common.MD5Util
;
import
com.egolm.common.StringUtil
;
import
com.egolm.shop.config.XException
;
import
com.egolm.shop.util.I18NUtils
;
import
com.egolm.shop.util.ShopContstrant
;
@Component
public
class
OpenInterceptor
extends
HandlerInterceptorAdapter
{
private
static
final
Log
logger
=
LogFactory
.
getLog
(
OpenInterceptor
.
class
);
String
encoding
=
"UTF-8"
;
@Autowired
private
RedisTemplate
redisTemplate
;
/*签名规则:1.按照参数字段名ASCII码排序;2.参数进行url拼接;3.加上签名字符串secret;4.得到字符串后进行SHA1签名;5.将签名得到的字符串加入参数列表中,字段名为sig*/
@Override
public
boolean
preHandle
(
HttpServletRequest
req
,
HttpServletResponse
resp
,
Object
handler
)
throws
Exception
{
String
uri
=
req
.
getRequestURI
();
if
((
uri
.
indexOf
(
"swagger"
)
==
-
1
&&
uri
.
indexOf
(
"/v2/api-docs"
)
==
-
1
)
)
{
Map
<
String
,
String
[]>
paramMap
=
req
.
getParameterMap
();
logger
.
info
(
GsonUtil
.
toJson
(
paramMap
));
String
sign
=
req
.
getParameter
(
"sign"
);
String
timestamp
=
req
.
getParameter
(
"timestamp"
);
String
langID
=
req
.
getParameter
(
"langID"
);
String
terminal
=
req
.
getParameter
(
"terminal"
);
if
(!
StringUtil
.
isNotBlank
(
sign
,
timestamp
,
langID
,
terminal
))
{
throw
new
XException
(
I18NUtils
.
getMessage
(
langID
,
"Msg_Paramter_Empty"
,
"[sign,timestamp,langID,terminal]"
))
;
}
SortedMap
<
Object
,
Object
>
parameters
=
new
TreeMap
<
Object
,
Object
>();
Set
<
String
>
keys
=
paramMap
.
keySet
()
;
for
(
String
key
:
keys
)
{
String
value
=
req
.
getParameter
(
key
);
parameters
.
put
(
key
,
value
);
}
String
md5Key
=
(
String
)
redisTemplate
.
opsForValue
().
get
(
ShopContstrant
.
CLIENT_MD5KEY
);
parameters
.
put
(
"md5Key"
,
md5Key
);
logger
.
info
(
"request sign >>>>>>"
+
sign
);
String
createSign
=
MD5Util
.
createSign
(
encoding
,
parameters
);
logger
.
info
(
"create sign >>>>>>>"
+
createSign
);
if
(
createSign
.
toUpperCase
().
equals
(
sign
.
toUpperCase
()))
{
return
super
.
preHandle
(
req
,
resp
,
handler
);
}
else
{
throw
new
XException
(
I18NUtils
.
getMessage
(
langID
,
"Msg_Sign_failure"
));
}
}
else
{
return
super
.
preHandle
(
req
,
resp
,
handler
);
//swagger-ui.html 界面不进行验证
}
}
public
static
void
main
(
String
[]
args
)
{
String
a
=
"/A0001/20181023/2018_10_23_17_27_00_58303479.png"
;
System
.
out
.
println
(
a
.
length
());
}
}
src/main/java/com/egolm/shop/controller/AddressController.java
View file @
80514e88
...
...
@@ -37,6 +37,8 @@ public class AddressController {
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"langID"
,
dataType
=
"String"
,
required
=
false
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"index"
,
dataType
=
"int"
,
required
=
true
,
value
=
"页码"
,
defaultValue
=
"1"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"limit"
,
dataType
=
"int"
,
required
=
true
,
value
=
"每页显示数"
,
defaultValue
=
"10"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"timestamp"
,
dataType
=
"String"
,
required
=
true
,
value
=
"时间戳"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sign"
,
dataType
=
"String"
,
required
=
true
,
value
=
"签名"
,
defaultValue
=
""
),
})
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
GET
)
public
String
list
(
HttpServletRequest
request
)
{
...
...
@@ -90,6 +92,8 @@ public class AddressController {
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"terminal"
,
dataType
=
"String"
,
required
=
false
,
value
=
"终端标识"
,
defaultValue
=
"wechat"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"langID"
,
dataType
=
"String"
,
required
=
false
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sign"
,
dataType
=
"String"
,
required
=
true
,
value
=
"签名"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"timestamp"
,
dataType
=
"String"
,
required
=
true
,
value
=
"时间戳"
,
defaultValue
=
""
)
})
@RequestMapping
(
value
=
"/saveOrUpdate"
,
method
=
RequestMethod
.
POST
)
...
...
@@ -143,7 +147,9 @@ public class AddressController {
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"userNO"
,
dataType
=
"String"
,
required
=
true
,
value
=
"用户编码"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"addId"
,
dataType
=
"String"
,
required
=
true
,
value
=
"地址ID"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"terminal"
,
dataType
=
"String"
,
required
=
false
,
value
=
"终端标识"
,
defaultValue
=
"wechat"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"langID"
,
dataType
=
"String"
,
required
=
false
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"langID"
,
dataType
=
"String"
,
required
=
false
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sign"
,
dataType
=
"String"
,
required
=
true
,
value
=
"签名"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"timestamp"
,
dataType
=
"String"
,
required
=
true
,
value
=
"时间戳"
,
defaultValue
=
""
)
})
@RequestMapping
(
value
=
"/delete"
,
method
=
RequestMethod
.
GET
)
public
String
delete
(
HttpServletRequest
request
)
{
...
...
@@ -162,7 +168,9 @@ public class AddressController {
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"addId"
,
dataType
=
"String"
,
required
=
true
,
value
=
"地址ID"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"type"
,
dataType
=
"String"
,
required
=
true
,
value
=
"操作类型 0为取消默认 ,2为设置默认"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"terminal"
,
dataType
=
"String"
,
required
=
false
,
value
=
"终端标识"
,
defaultValue
=
"wechat"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"langID"
,
dataType
=
"String"
,
required
=
false
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"langID"
,
dataType
=
"String"
,
required
=
false
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sign"
,
dataType
=
"String"
,
required
=
true
,
value
=
"签名"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"timestamp"
,
dataType
=
"String"
,
required
=
true
,
value
=
"时间戳"
,
defaultValue
=
""
)
})
@RequestMapping
(
value
=
"/defaultAdd"
,
method
=
RequestMethod
.
GET
)
public
String
defaultAdd
(
HttpServletRequest
request
)
{
...
...
@@ -181,6 +189,8 @@ public class AddressController {
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"addId"
,
dataType
=
"String"
,
required
=
true
,
value
=
"地址ID"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"terminal"
,
dataType
=
"String"
,
required
=
false
,
value
=
"终端标识"
,
defaultValue
=
"wechat"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"langID"
,
dataType
=
"String"
,
required
=
false
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sign"
,
dataType
=
"String"
,
required
=
true
,
value
=
"签名"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"timestamp"
,
dataType
=
"String"
,
required
=
true
,
value
=
"时间戳"
,
defaultValue
=
""
)
})
@RequestMapping
(
value
=
"/detail"
,
method
=
RequestMethod
.
GET
)
public
String
detail
(
HttpServletRequest
request
)
{
...
...
src/main/java/com/egolm/shop/controller/BrandController.java
View file @
80514e88
...
...
@@ -40,6 +40,9 @@ public class BrandController {
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"langID"
,
dataType
=
"String"
,
required
=
false
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"index"
,
dataType
=
"int"
,
required
=
true
,
value
=
"页码"
,
defaultValue
=
"1"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"limit"
,
dataType
=
"int"
,
required
=
true
,
value
=
"每页显示数"
,
defaultValue
=
"10"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sign"
,
dataType
=
"String"
,
required
=
true
,
value
=
"签名"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"timestamp"
,
dataType
=
"String"
,
required
=
true
,
value
=
"时间戳"
,
defaultValue
=
""
)
})
@RequestMapping
(
value
=
"/getBanner"
,
method
=
RequestMethod
.
GET
)
public
String
getBanner
(
HttpServletRequest
request
)
{
...
...
@@ -72,8 +75,11 @@ public class BrandController {
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"OrgNO"
,
dataType
=
"String"
,
required
=
true
,
value
=
"区域编号"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"ShopNO"
,
dataType
=
"String"
,
required
=
false
,
value
=
"店铺编号"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"terminal"
,
dataType
=
"String"
,
required
=
false
,
value
=
"终端标识"
,
defaultValue
=
"wechat"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"langID"
,
dataType
=
"String"
,
required
=
false
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"terminal"
,
dataType
=
"String"
,
required
=
true
,
value
=
"终端标识"
,
defaultValue
=
"wechat"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"langID"
,
dataType
=
"String"
,
required
=
true
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sign"
,
dataType
=
"String"
,
required
=
true
,
value
=
"签名"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"timestamp"
,
dataType
=
"String"
,
required
=
true
,
value
=
"时间戳"
,
defaultValue
=
""
)
})
@RequestMapping
(
value
=
"/getBrandList"
,
method
=
RequestMethod
.
GET
)
public
String
getBrandList
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
...
...
@@ -122,7 +128,12 @@ public class BrandController {
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"orgNO"
,
dataType
=
"String"
,
required
=
true
,
value
=
"区域编号"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"compNO"
,
dataType
=
"String"
,
required
=
true
,
value
=
"组件编号"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"index"
,
dataType
=
"String"
,
required
=
false
,
value
=
"第几页"
,
defaultValue
=
"1"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"limit"
,
dataType
=
"String"
,
required
=
false
,
value
=
"每页数量"
,
defaultValue
=
"20"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"limit"
,
dataType
=
"String"
,
required
=
false
,
value
=
"每页数量"
,
defaultValue
=
"20"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"terminal"
,
dataType
=
"String"
,
required
=
true
,
value
=
"终端标识"
,
defaultValue
=
"wechat"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"langID"
,
dataType
=
"String"
,
required
=
true
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sign"
,
dataType
=
"String"
,
required
=
true
,
value
=
"签名"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"timestamp"
,
dataType
=
"String"
,
required
=
true
,
value
=
"时间戳"
,
defaultValue
=
""
)
})
@RequestMapping
(
value
=
"/getHotSaleBrands"
,
method
=
RequestMethod
.
GET
)
public
String
getHotSaleBrands
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
...
...
src/main/java/com/egolm/shop/controller/CartController.java
View file @
80514e88
...
...
@@ -33,7 +33,9 @@ public class CartController {
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"shopNO"
,
dataType
=
"String"
,
required
=
true
,
value
=
"店铺编号"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"terminal"
,
dataType
=
"String"
,
required
=
false
,
value
=
"终端标识"
,
defaultValue
=
"wechat"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"langID"
,
dataType
=
"String"
,
required
=
false
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"langID"
,
dataType
=
"String"
,
required
=
false
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sign"
,
dataType
=
"String"
,
required
=
true
,
value
=
"签名"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"timestamp"
,
dataType
=
"String"
,
required
=
true
,
value
=
"时间戳"
,
defaultValue
=
""
)
})
@RequestMapping
(
value
=
"/cartQuery"
,
method
=
RequestMethod
.
GET
)
...
...
@@ -49,44 +51,52 @@ public class CartController {
@ApiOperation
(
"加入购物车(JSON格式)"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"String"
,
required
=
false
,
value
=
"JSON格式"
,
defaultValue
=
"{\"shopNO\": \"00029975\",\"terminal\": \"wechat\",\"langID\": \"936\",\"cartList\": [{\"goodsID\": \"30771\",\"goodsTypeID\": 0,\"saleQty\": \"24\",\"agentContractNO\": \"600327002\",\"promoGroupNO\":\"\",\"promoPaperNO\":\"00001810100007\" }]}"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"data"
,
dataType
=
"String"
,
required
=
false
,
value
=
"JSON格式"
,
defaultValue
=
"{\"shopNO\": \"00029975\",\"cartList\": [{\"goodsID\": \"30771\",\"goodsTypeID\": 0,\"saleQty\": \"24\",\"agentContractNO\": \"600327002\",\"promoGroupNO\":\"\",\"promoPaperNO\":\"00001810100007\" }]}"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"terminal"
,
dataType
=
"String"
,
required
=
true
,
value
=
"终端标识"
,
defaultValue
=
"wechat"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"langID"
,
dataType
=
"String"
,
required
=
true
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sign"
,
dataType
=
"String"
,
required
=
true
,
value
=
"签名"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"timestamp"
,
dataType
=
"String"
,
required
=
true
,
value
=
"时间戳"
,
defaultValue
=
""
)
})
@RequestMapping
(
value
=
"/appendCart"
,
method
=
RequestMethod
.
POST
,
produces
=
"application/json"
)
public
String
appendCart
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
String
reqJson
=
ServletUtil
.
readReqJson
(
request
);
String
reqJson
=
request
.
getParameter
(
"data"
);
JSONObject
jsonObj
=
JSONObject
.
parseObject
(
reqJson
);
System
.
out
.
println
(
"appendCart-------"
+
reqJson
);
return
cartService
.
append
(
jsonObj
);
System
.
out
.
println
(
"appendCart-------"
+
reqJson
);
String
terminal
=
request
.
getParameter
(
"terminal"
);
return
cartService
.
append
(
jsonObj
,
terminal
);
}
@ApiOperation
(
"删除购物车(JSON格式)"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"String"
,
required
=
false
,
value
=
"JSON格式"
,
defaultValue
=
"{\"shopNO\": \"00029975\",\"terminal\": \"wechat\",\"langID\": \"936\",\"idxs\": [1,2,3]}"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"data"
,
dataType
=
"String"
,
required
=
false
,
value
=
"JSON格式"
,
defaultValue
=
"{\"shopNO\": \"00029975\",\"terminal\": \"wechat\",\"langID\": \"936\",\"idxs\": [1,2,3]}"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sign"
,
dataType
=
"String"
,
required
=
true
,
value
=
"签名"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"timestamp"
,
dataType
=
"String"
,
required
=
true
,
value
=
"时间戳"
,
defaultValue
=
""
)
})
@RequestMapping
(
value
=
"/remove"
,
method
=
RequestMethod
.
POST
)
public
String
remove
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
String
reqJson
=
ServletUtil
.
readReqJson
(
request
);
String
reqJson
=
request
.
getParameter
(
"data"
);
JSONObject
jsonObj
=
JSONObject
.
parseObject
(
reqJson
);
System
.
out
.
println
(
"remove-------"
+
reqJson
);
return
cartService
.
remove
(
jsonObj
);
String
terminal
=
request
.
getParameter
(
"terminal"
);
return
cartService
.
remove
(
jsonObj
,
terminal
);
}
@ApiOperation
(
"修改数量(JSON格式)"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"String"
,
required
=
false
,
value
=
"JSON格式"
,
defaultValue
=
"{\"shopNO\": \"00029975\",\"terminal\": \"wechat\",\"langID\": \"936\", \"idx\": 2,\"saleQty\": \"23\" }"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"data"
,
dataType
=
"String"
,
required
=
false
,
value
=
"JSON格式"
,
defaultValue
=
"{\"shopNO\": \"00029975\", \"idx\": 2,\"saleQty\": \"23\" }"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sign"
,
dataType
=
"String"
,
required
=
true
,
value
=
"签名"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"timestamp"
,
dataType
=
"String"
,
required
=
true
,
value
=
"时间戳"
,
defaultValue
=
""
)
})
@RequestMapping
(
value
=
"/updateQty"
,
method
=
RequestMethod
.
POST
)
public
String
updateQty
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
String
reqJson
=
ServletUtil
.
readReqJson
(
request
);
String
reqJson
=
request
.
getParameter
(
"data"
);
JSONObject
jsonObj
=
JSONObject
.
parseObject
(
reqJson
);
System
.
out
.
println
(
"updateQty-------"
+
reqJson
);
return
cartService
.
updateQty
(
jsonObj
);
String
terminal
=
request
.
getParameter
(
"terminal"
);
return
cartService
.
updateQty
(
jsonObj
,
terminal
);
}
}
src/main/java/com/egolm/shop/controller/CategoryController.java
View file @
80514e88
...
...
@@ -32,6 +32,8 @@ public class CategoryController {
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"scopeTypeID"
,
dataType
=
"String"
,
required
=
true
,
value
=
"店铺类型"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"terminal"
,
dataType
=
"String"
,
required
=
false
,
value
=
"终端标识"
,
defaultValue
=
"wechat"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"langID"
,
dataType
=
"String"
,
required
=
false
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sign"
,
dataType
=
"String"
,
required
=
true
,
value
=
"签名"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"timestamp"
,
dataType
=
"String"
,
required
=
true
,
value
=
"时间戳"
,
defaultValue
=
""
)
})
@RequestMapping
(
value
=
"/queryCategory"
,
method
=
RequestMethod
.
GET
)
...
...
src/main/java/com/egolm/shop/controller/CommonController.java
View file @
80514e88
...
...
@@ -27,6 +27,8 @@ public class CommonController {
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"orgNO"
,
dataType
=
"String"
,
required
=
true
,
value
=
"组织机构"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"terminal"
,
dataType
=
"String"
,
required
=
false
,
value
=
"终端标识"
,
defaultValue
=
"wechat"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"langID"
,
dataType
=
"String"
,
required
=
false
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sign"
,
dataType
=
"String"
,
required
=
true
,
value
=
"签名"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"timestamp"
,
dataType
=
"String"
,
required
=
true
,
value
=
"时间戳"
,
defaultValue
=
""
)
})
@RequestMapping
(
value
=
"/queryDistrictByOrgNO"
,
method
=
RequestMethod
.
GET
)
public
String
detail
(
HttpServletRequest
request
)
{
...
...
src/main/java/com/egolm/shop/controller/CouponController.java
View file @
80514e88
...
...
@@ -35,6 +35,8 @@ public class CouponController {
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"userNO"
,
dataType
=
"String"
,
required
=
true
,
value
=
"用户编码"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"terminal"
,
dataType
=
"String"
,
required
=
true
,
value
=
"终端"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"langID"
,
dataType
=
"String"
,
required
=
true
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sign"
,
dataType
=
"String"
,
required
=
true
,
value
=
"签名"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"timestamp"
,
dataType
=
"String"
,
required
=
true
,
value
=
"时间戳"
,
defaultValue
=
""
)
})
@RequestMapping
(
value
=
"/allCoupon"
,
method
=
RequestMethod
.
GET
)
public
String
allCoupon
(
HttpServletRequest
request
)
{
...
...
@@ -71,6 +73,8 @@ public class CouponController {
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"endDate"
,
dataType
=
"String"
,
required
=
false
,
value
=
"结束日期"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"terminal"
,
dataType
=
"String"
,
required
=
true
,
value
=
"终端"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"langID"
,
dataType
=
"String"
,
required
=
true
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sign"
,
dataType
=
"String"
,
required
=
true
,
value
=
"签名"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"timestamp"
,
dataType
=
"String"
,
required
=
true
,
value
=
"时间戳"
,
defaultValue
=
""
)
})
@RequestMapping
(
value
=
"/myCoupon"
,
method
=
RequestMethod
.
GET
)
public
String
myCoupon
(
HttpServletRequest
request
)
{
...
...
@@ -112,6 +116,8 @@ public class CouponController {
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"point"
,
dataType
=
"int"
,
required
=
false
,
value
=
"抵扣金币"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"terminal"
,
dataType
=
"String"
,
required
=
false
,
value
=
"终端标识"
,
defaultValue
=
"wechat"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"langID"
,
dataType
=
"String"
,
required
=
false
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sign"
,
dataType
=
"String"
,
required
=
true
,
value
=
"签名"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"timestamp"
,
dataType
=
"String"
,
required
=
true
,
value
=
"时间戳"
,
defaultValue
=
""
)
})
@RequestMapping
(
value
=
"/getCoupon"
,
method
=
RequestMethod
.
GET
)
public
String
getCoupon
(
HttpServletRequest
request
)
{
...
...
src/main/java/com/egolm/shop/controller/GoodsController.java
View file @
80514e88
...
...
@@ -41,6 +41,8 @@ public class GoodsController {
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"compNO"
,
dataType
=
"String"
,
required
=
true
,
value
=
"组件编号"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"terminal"
,
dataType
=
"String"
,
required
=
false
,
value
=
"终端标识"
,
defaultValue
=
"wechat"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"langID"
,
dataType
=
"String"
,
required
=
false
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sign"
,
dataType
=
"String"
,
required
=
true
,
value
=
"签名"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"timestamp"
,
dataType
=
"String"
,
required
=
true
,
value
=
"时间戳"
,
defaultValue
=
""
)
})
@RequestMapping
(
value
=
"/thinkLike"
,
method
=
RequestMethod
.
GET
)
public
String
thinkLike
(
HttpServletRequest
request
)
{
...
...
@@ -86,6 +88,8 @@ public class GoodsController {
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"limit"
,
dataType
=
"String"
,
required
=
false
,
value
=
"每页数量"
,
defaultValue
=
"20"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"terminal"
,
dataType
=
"String"
,
required
=
false
,
value
=
"终端标识"
,
defaultValue
=
"wechat"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"langID"
,
dataType
=
"String"
,
required
=
false
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sign"
,
dataType
=
"String"
,
required
=
true
,
value
=
"签名"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"timestamp"
,
dataType
=
"String"
,
required
=
true
,
value
=
"时间戳"
,
defaultValue
=
""
)
})
@RequestMapping
(
value
=
"/getHotSaleGoods"
,
method
=
RequestMethod
.
GET
)
public
String
getHotSaleGoods
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
...
...
@@ -111,6 +115,8 @@ public class GoodsController {
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"limit"
,
dataType
=
"String"
,
required
=
false
,
value
=
"每页数量"
,
defaultValue
=
"20"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"terminal"
,
dataType
=
"String"
,
required
=
false
,
value
=
"终端标识"
,
defaultValue
=
"wechat"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"langID"
,
dataType
=
"String"
,
required
=
false
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sign"
,
dataType
=
"String"
,
required
=
true
,
value
=
"签名"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"timestamp"
,
dataType
=
"String"
,
required
=
true
,
value
=
"时间戳"
,
defaultValue
=
""
)
})
@RequestMapping
(
value
=
"/getCategoryGoods"
,
method
=
RequestMethod
.
GET
)
...
...
@@ -138,6 +144,8 @@ public class GoodsController {
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"limit"
,
dataType
=
"String"
,
required
=
false
,
value
=
"每页数量"
,
defaultValue
=
"20"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"terminal"
,
dataType
=
"String"
,
required
=
false
,
value
=
"终端标识"
,
defaultValue
=
"wechat"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"langID"
,
dataType
=
"String"
,
required
=
false
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sign"
,
dataType
=
"String"
,
required
=
true
,
value
=
"签名"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"timestamp"
,
dataType
=
"String"
,
required
=
true
,
value
=
"时间戳"
,
defaultValue
=
""
)
})
@RequestMapping
(
value
=
"/hotSearchKey"
,
method
=
RequestMethod
.
GET
)
public
String
hotSearchKey
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
...
...
@@ -154,25 +162,29 @@ public class GoodsController {
@ApiOperation
(
"统一搜索(支持品牌,分类,关键字,仓库等)"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"String"
,
required
=
true
,
value
=
"JSON参数"
,
defaultValue
=
"{\"topCategoryNO\":\"01\",\"upCategoryNO\":\"\",\"categoryID\":[\"\"],\"brandID\":[\"\"],\"agentID\":\"\",\"warehouseNO\":\"\",\"scopeTypeID\":\"1\",\"districtID\":\"\",\"keyword\":\"*\",\"index\":1,\"limit\":10,\"userNO\":\"00034\",\"orgNO\":\"XIAN\",\"shopNO\":\"167728271\",\"langID\":\"936\",\"terminal\":\"wechat\"}"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"data"
,
dataType
=
"String"
,
required
=
true
,
value
=
"JSON参数"
,
defaultValue
=
"{\"topCategoryNO\":\"01\",\"upCategoryNO\":\"\",\"categoryID\":[\"\"],\"brandID\":[\"\"],\"agentID\":\"\",\"warehouseNO\":\"\",\"scopeTypeID\":\"1\",\"districtID\":\"\",\"keyword\":\"*\",\"index\":1,\"limit\":10,\"userNO\":\"00034\",\"orgNO\":\"XIAN\",\"shopNO\":\"167728271\"}"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"terminal"
,
dataType
=
"String"
,
required
=
true
,
value
=
"终端标识"
,
defaultValue
=
"wechat"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"langID"
,
dataType
=
"String"
,
required
=
true
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sign"
,
dataType
=
"String"
,
required
=
true
,
value
=
"签名"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"timestamp"
,
dataType
=
"String"
,
required
=
true
,
value
=
"时间戳"
,
defaultValue
=
""
)
})
@RequestMapping
(
value
=
"/searchGoods"
,
method
=
RequestMethod
.
POST
)
public
String
searchGoods
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
String
reqJson
=
ServletUtil
.
readReqJson
(
request
);
String
reqJson
=
request
.
getParameter
(
"data"
);
System
.
out
.
println
(
"searchGoods-------"
+
reqJson
);
Map
<
String
,
Object
>
argsMap
=
new
HashMap
<
String
,
Object
>();
argsMap
=
GsonUtil
.
toMap
(
reqJson
);
String
LangID
=
argsMap
.
get
(
"langID"
)+
""
;
String
langID
=
request
.
getParameter
(
"langID"
);
argsMap
.
put
(
"langID"
,
langID
);
try
{
if
(!
argsMap
.
containsKey
(
"index"
)
||
!
argsMap
.
containsKey
(
"limit"
)
||
!
argsMap
.
containsKey
(
"userNO"
)
||
!
argsMap
.
containsKey
(
"shopNO"
)
||
!
argsMap
.
containsKey
(
"orgNO"
)
||
!
argsMap
.
containsKey
(
"langID"
)
||
!
argsMap
.
containsKey
(
"terminal"
)
)
{
return
Rjx
.
jsonErr
().
setCode
(-
100
).
setMessage
(
I18NUtils
.
getMessage
(
LangID
,
"Msg_Parameter_empty"
)).
set
(
"errorMsg"
,
"index,limit,userNO,shopNO,orgNO,langID,terminal "
+
I18NUtils
.
getMessage
(
LangID
,
"Msg_Must_enter"
)).
toJson
();
if
(!
argsMap
.
containsKey
(
"index"
)
||
!
argsMap
.
containsKey
(
"limit"
)
||
!
argsMap
.
containsKey
(
"userNO"
)
||
!
argsMap
.
containsKey
(
"shopNO"
)
||
!
argsMap
.
containsKey
(
"orgNO"
)
)
{
return
Rjx
.
jsonErr
().
setCode
(-
100
).
setMessage
(
I18NUtils
.
getMessage
(
langID
,
"Msg_Parameter_empty"
)).
set
(
"errorMsg"
,
"index,limit,userNO,shopNO,orgNO "
+
I18NUtils
.
getMessage
(
langID
,
"Msg_Must_enter"
)).
toJson
();
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
Rjx
.
jsonErr
().
setCode
(-
100
).
setMessage
(
I18NUtils
.
getMessage
(
L
angID
,
"Msg_QueryParam_error"
)).
toJson
();
return
Rjx
.
jsonErr
().
setCode
(-
100
).
setMessage
(
I18NUtils
.
getMessage
(
l
angID
,
"Msg_QueryParam_error"
)).
toJson
();
}
return
goodsService
.
searchGoods
(
argsMap
);
}
...
...
@@ -188,6 +200,8 @@ public class GoodsController {
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"terminal"
,
dataType
=
"String"
,
required
=
true
,
value
=
"终端"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"terminal"
,
dataType
=
"String"
,
required
=
false
,
value
=
"终端标识"
,
defaultValue
=
"wechat"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"langID"
,
dataType
=
"String"
,
required
=
false
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sign"
,
dataType
=
"String"
,
required
=
true
,
value
=
"签名"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"timestamp"
,
dataType
=
"String"
,
required
=
true
,
value
=
"时间戳"
,
defaultValue
=
""
)
})
@RequestMapping
(
value
=
"/goodsDetail"
,
method
=
RequestMethod
.
GET
)
...
...
@@ -226,6 +240,8 @@ public class GoodsController {
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"override"
,
dataType
=
"String"
,
required
=
true
,
value
=
"收藏状态(1为收藏,0为取消)"
,
defaultValue
=
"1"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"terminal"
,
dataType
=
"String"
,
required
=
false
,
value
=
"终端标识"
,
defaultValue
=
"wechat"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"langID"
,
dataType
=
"String"
,
required
=
false
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sign"
,
dataType
=
"String"
,
required
=
true
,
value
=
"签名"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"timestamp"
,
dataType
=
"String"
,
required
=
true
,
value
=
"时间戳"
,
defaultValue
=
""
)
})
@RequestMapping
(
value
=
"/myFlavor"
,
method
=
RequestMethod
.
GET
)
...
...
src/main/java/com/egolm/shop/controller/PageController.java
View file @
80514e88
...
...
@@ -32,6 +32,8 @@ public class PageController {
@ApiOperation
(
"查询(只有一条)"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"LangID"
,
dataType
=
"String"
,
required
=
true
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sign"
,
dataType
=
"String"
,
required
=
true
,
value
=
"签名"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"timestamp"
,
dataType
=
"String"
,
required
=
true
,
value
=
"时间戳"
,
defaultValue
=
""
)
})
@RequestMapping
(
value
=
"/query"
,
method
=
RequestMethod
.
GET
)
public
String
query
(
HttpServletRequest
request
)
{
...
...
src/main/java/com/egolm/shop/controller/SolrGoodsController.java
View file @
80514e88
...
...
@@ -47,6 +47,8 @@ public class SolrGoodsController {
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"string"
,
allowMultiple
=
true
,
required
=
true
,
name
=
"keywords"
,
value
=
"精确搜索条件"
),
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"string"
,
allowMultiple
=
true
,
required
=
true
,
name
=
"facetFields"
,
value
=
"单字段分组字段"
),
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"string"
,
allowMultiple
=
true
,
required
=
true
,
name
=
"facetPivotFields"
,
value
=
"多字段分组字段"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sign"
,
dataType
=
"String"
,
required
=
true
,
value
=
"签名"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"timestamp"
,
dataType
=
"String"
,
required
=
true
,
value
=
"时间戳"
,
defaultValue
=
""
)
})
public
Object
query
(
Long
index
,
Long
limit
,
String
queryKey
,
String
[]
orders
,
String
[]
keywords
,
String
[]
facetFields
,
String
[]
facetPivotFields
)
{
Page
page
=
new
Page
(
index
,
limit
,
orders
);
...
...
@@ -58,6 +60,8 @@ public class SolrGoodsController {
@ApiOperation
(
"搜索引擎按区域编号更新商品索引"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"string"
,
allowMultiple
=
false
,
required
=
true
,
name
=
"sDistrictID"
,
value
=
"区域编号"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sign"
,
dataType
=
"String"
,
required
=
true
,
value
=
"签名"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"timestamp"
,
dataType
=
"String"
,
required
=
true
,
value
=
"时间戳"
,
defaultValue
=
""
)
})
public
Object
updateByDistrictID
(
String
sDistrictID
)
{
service
.
update
(
sDistrictID
);
...
...
src/main/java/com/egolm/shop/controller/SystemCtrlController.java
View file @
80514e88
...
...
@@ -32,6 +32,8 @@ public class SystemCtrlController {
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"code"
,
dataType
=
"String"
,
required
=
true
,
value
=
"编号"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"terminal"
,
dataType
=
"String"
,
required
=
false
,
value
=
"终端标识"
,
defaultValue
=
"wechat"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"langID"
,
dataType
=
"String"
,
required
=
false
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sign"
,
dataType
=
"String"
,
required
=
true
,
value
=
"签名"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"timestamp"
,
dataType
=
"String"
,
required
=
true
,
value
=
"时间戳"
,
defaultValue
=
""
)
})
@RequestMapping
(
value
=
"/getSystemCtrlByCode"
,
method
=
RequestMethod
.
GET
)
...
...
src/main/java/com/egolm/shop/controller/UserController.java
View file @
80514e88
...
...
@@ -35,6 +35,8 @@ public class UserController {
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"orgNO"
,
dataType
=
"String"
,
required
=
true
,
value
=
"组织机构"
,
defaultValue
=
"SHBS"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"terminal"
,
dataType
=
"String"
,
required
=
true
,
value
=
"终端标识"
,
defaultValue
=
"wechat"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"langID"
,
dataType
=
"String"
,
required
=
false
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sign"
,
dataType
=
"String"
,
required
=
true
,
value
=
"签名"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"timestamp"
,
dataType
=
"String"
,
required
=
true
,
value
=
"时间戳"
,
defaultValue
=
""
)
})
@RequestMapping
(
value
=
"/createGuest"
,
method
=
RequestMethod
.
GET
)
...
...
@@ -57,6 +59,8 @@ public class UserController {
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"openID"
,
dataType
=
"String"
,
required
=
false
,
value
=
"openID(优先级小于账号)"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"langID"
,
dataType
=
"String"
,
required
=
false
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"terminal"
,
dataType
=
"String"
,
required
=
true
,
value
=
"终端标识"
,
defaultValue
=
"wechat"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sign"
,
dataType
=
"String"
,
required
=
true
,
value
=
"签名"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"timestamp"
,
dataType
=
"String"
,
required
=
true
,
value
=
"时间戳"
,
defaultValue
=
""
)
})
@RequestMapping
(
value
=
"/login"
,
method
=
RequestMethod
.
POST
)
...
...
@@ -81,6 +85,8 @@ public class UserController {
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"shopNO"
,
dataType
=
"String"
,
required
=
false
,
value
=
"店铺编号"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"langID"
,
dataType
=
"String"
,
required
=
true
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"terminal"
,
dataType
=
"String"
,
required
=
true
,
value
=
"终端标识"
,
defaultValue
=
"wechat"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sign"
,
dataType
=
"String"
,
required
=
true
,
value
=
"签名"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"timestamp"
,
dataType
=
"String"
,
required
=
true
,
value
=
"时间戳"
,
defaultValue
=
""
)
})
@RequestMapping
(
value
=
"/userInfo"
,
method
=
RequestMethod
.
GET
)
public
String
userInfo
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
...
...
@@ -116,6 +122,8 @@ public class UserController {
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"smsTmpID"
,
dataType
=
"String"
,
required
=
true
,
value
=
"短信模板ID"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"langID"
,
dataType
=
"String"
,
required
=
true
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"terminal"
,
dataType
=
"String"
,
required
=
true
,
value
=
"终端标识"
,
defaultValue
=
"wechat"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sign"
,
dataType
=
"String"
,
required
=
true
,
value
=
"签名"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"timestamp"
,
dataType
=
"String"
,
required
=
true
,
value
=
"时间戳"
,
defaultValue
=
""
)
})
@RequestMapping
(
value
=
"/modifyPwd"
,
method
=
RequestMethod
.
POST
)
public
String
modifyPwd
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
...
...
@@ -143,6 +151,8 @@ public class UserController {
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"content"
,
dataType
=
"String"
,
required
=
true
,
value
=
"内容,按模板上的参数填值,以,分隔"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"langID"
,
dataType
=
"String"
,
required
=
true
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"terminal"
,
dataType
=
"String"
,
required
=
true
,
value
=
"终端标识"
,
defaultValue
=
"wechat"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sign"
,
dataType
=
"String"
,
required
=
true
,
value
=
"签名"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"timestamp"
,
dataType
=
"String"
,
required
=
true
,
value
=
"时间戳"
,
defaultValue
=
""
)
})
@RequestMapping
(
value
=
"/sendSms"
,
method
=
RequestMethod
.
GET
)
public
String
sendSms
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
...
...
src/main/java/com/egolm/shop/service/CartService.java
View file @
80514e88
...
...
@@ -6,11 +6,11 @@ import com.alibaba.fastjson.JSONObject;
public
interface
CartService
{
public
String
append
(
JSONObject
obj
);
public
String
append
(
JSONObject
obj
,
String
terminal
);
public
String
remove
(
JSONObject
obj
);
public
String
remove
(
JSONObject
obj
,
String
terminal
);
public
String
updateQty
(
JSONObject
obj
);
public
String
updateQty
(
JSONObject
obj
,
String
terminal
);
public
String
query
(
Map
<
String
,
Object
>
params
);
}
src/main/java/com/egolm/shop/service/impl/CartServiceImpl.java
View file @
80514e88
...
...
@@ -49,9 +49,8 @@ public class CartServiceImpl implements CartService {
* @return
* @see com.egolm.shop.service.CartService#append(com.alibaba.fastjson.JSONObject)
*/
public
String
append
(
JSONObject
obj
)
{
public
String
append
(
JSONObject
obj
,
String
terminal
)
{
String
shopNO
=
obj
.
getString
(
"shopNO"
);
String
terminal
=
obj
.
getString
(
"terminal"
);
JSONArray
cartList
=
obj
.
getJSONArray
(
"cartList"
);
Integer
nMaxIdx
=
jdbcTemplate
.
queryForInt
(
"select max(nIdx) from tCart where sShopNO = '"
+
shopNO
+
"'"
);
...
...
@@ -128,10 +127,9 @@ public class CartServiceImpl implements CartService {
* {"shopNO": "00029975","terminal": "wechat","langID": "936","idxs": [1,2,3]}
*/
@Override
public
String
remove
(
JSONObject
obj
)
{
public
String
remove
(
JSONObject
obj
,
String
terminal
)
{
String
shopNO
=
obj
.
getString
(
"shopNO"
);
JSONArray
idxArray
=
obj
.
getJSONArray
(
"idxs"
);
String
terminal
=
obj
.
getString
(
"terminal"
);
System
.
out
.
println
(
"idxArray----"
+
idxArray
);
List
<
String
>
nIdx
=
new
ArrayList
<
String
>();
if
(
idxArray
==
null
)
{
...
...
@@ -161,12 +159,11 @@ public class CartServiceImpl implements CartService {
* @throws
* {"shopNO": "00029975","terminal": "wechat","langID": "936", "idx": 2,"saleQty": "23" }
*/
public
String
updateQty
(
JSONObject
obj
)
{
public
String
updateQty
(
JSONObject
obj
,
String
terminal
)
{
String
shopNO
=
obj
.
getString
(
"shopNO"
);
Integer
idx
=
obj
.
getInteger
(
"idx"
);
Double
saleQty
=
obj
.
getDouble
(
"saleQty"
);
String
terminal
=
obj
.
getString
(
"terminal"
);
String
langID
=
obj
.
getString
(
"langID"
);
String
langID
=
obj
.
getString
(
"langID"
);
System
.
out
.
println
(
saleQty
);
System
.
out
.
println
(
saleQty
==
0
);
if
(
saleQty
==
0
)
{
...
...
@@ -178,7 +175,7 @@ public class CartServiceImpl implements CartService {
removeIdxArray
.
add
(
idx
);
removeObj
.
put
(
"idxs"
,
removeIdxArray
);
System
.
out
.
println
(
removeObj
);
this
.
remove
(
removeObj
);
this
.
remove
(
removeObj
,
terminal
);
}
else
{
jdbcTemplate
.
executeUpdate
(
"update tCart set nSaleQty = "
+
saleQty
+
" where sShopNO = '"
+
shopNO
+
"' and nIdx = "
+
idx
);
}
...
...
src/main/java/com/egolm/shop/util/ShopContstrant.java
View file @
80514e88
...
...
@@ -11,4 +11,6 @@ public class ShopContstrant {
public
static
final
String
SMS_TEMPLATE_CODE
=
"SmsTemplate"
;
//模板字典 code tcommon表
public
static
final
String
CLIENT_MD5KEY
=
"Client_Md5Key"
;
//客户端计算签名的MD5 Key
}
src/main/resources/messages_en.properties
View file @
80514e88
...
...
@@ -48,3 +48,5 @@ Msg_Redemption_failure=The gold coin is insufficient and the redemption failed.
Msg_Coupon_Redemption_success
=
Coupon redemption success
Msg_Coupon_Redemption_failure
=
Coupon redemption failure
Msg_Gold_return_failure
=
Gold coin return failed
Msg_Sign_failure
=
Signature mismatch
Msg_Paramter_Empty
=
Parameter {0} can not be empty.
\ No newline at end of file
src/main/resources/messages_zh_CN.properties
View file @
80514e88
...
...
@@ -47,4 +47,6 @@ Msg_Deduction_failure=\u64CD\u4F5C\u5F02\u5E38\uFF0C\u6263\u79EF\u5206\u5931\u8D
Msg_Redemption_failure
=
\u
91D1
\u
5E01
\u
4E0D
\u
8DB3,
\u5151\u6362\u5931\u
8D25.
Msg_Coupon_Redemption_success
=
\u
4F18
\u
60E0
\u5238\u5151\u6362\u6210\u
529F
Msg_Coupon_Redemption_failure
=
\u
4F18
\u
60E0
\u5238\u5151\u6362\u5931\u
8D25
Msg_Gold_return_failure
=
\u
91D1
\u
5E01
\u
8FD4
\u
8FD8
\u5931\u
8D25
\ No newline at end of file
Msg_Gold_return_failure
=
\u
91D1
\u
5E01
\u
8FD4
\u
8FD8
\u5931\u
8D25
Msg_Sign_failure
=
\u
7B7E
\u
540D
\u
4E0D
\u5339\u
914D
Msg_Paramter_Empty
=
\u
53C2
\u6570
{0}
\u
4E0D
\u
80FD
\u
4E3A
\u
7A7A
\ No newline at end of file
Write
Preview
Markdown
is supported
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