Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
Z
zion
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
1
合并请求
1
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
zhengfg
zion
Commits
ee54e456
提交
ee54e456
authored
11月 22, 2019
作者:
zgy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改订单查询的bug
上级
8a1faa3c
全部展开
显示空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
149 行增加
和
93 行删除
+149
-93
TokenVerification.java
...com/diaoyun/zion/chinafrica/client/TokenVerification.java
+0
-1
ShopifyController.java
...diaoyun/zion/chinafrica/controller/ShopifyController.java
+12
-0
TbCfOrderController.java
...aoyun/zion/chinafrica/controller/TbCfOrderController.java
+1
-1
TbCfUserInfoDao.java
...java/com/diaoyun/zion/chinafrica/dao/TbCfUserInfoDao.java
+8
-0
ShopifyService.java
...a/com/diaoyun/zion/chinafrica/service/ShopifyService.java
+9
-4
TbCfOrderService.java
...com/diaoyun/zion/chinafrica/service/TbCfOrderService.java
+1
-1
TbCfUserInfoService.java
.../diaoyun/zion/chinafrica/service/TbCfUserInfoService.java
+1
-1
ShopifyServiceImpl.java
...oyun/zion/chinafrica/service/impl/ShopifyServiceImpl.java
+28
-5
TbCfOrderServiceImpl.java
...un/zion/chinafrica/service/impl/TbCfOrderServiceImpl.java
+60
-58
TbCfUserInfoServiceImpl.java
...zion/chinafrica/service/impl/TbCfUserInfoServiceImpl.java
+4
-0
MyUserDetails.java
.../java/com/diaoyun/zion/master/security/MyUserDetails.java
+17
-18
TbCfUserInfoDao.xml
src/main/resources/mapper/TbCfUserInfoDao.xml
+8
-4
没有找到文件。
src/main/java/com/diaoyun/zion/chinafrica/client/TokenVerification.java
浏览文件 @
ee54e456
...
...
@@ -47,7 +47,6 @@ public class TokenVerification {
"&&!execution(* com.diaoyun.zion.chinafrica.controller.GoodsTypeController.*(..))"
+
"&&!execution(* com.diaoyun.zion.chinafrica.controller.VersionController.*(..))"
+
"&&!execution(* com.diaoyun.zion.chinafrica.controller.TbCfFeeController.*(..))"
+
"&&!execution(* com.diaoyun.zion.chinafrica.controller.TbCfOrderController.*(..))"
+
"&&!execution(* com.diaoyun.zion.chinafrica.controller.PayPalController.*(..))"
+
"&&!execution(* com.diaoyun.zion.chinafrica.controller.ShopifyController.*(..))"
)
...
...
src/main/java/com/diaoyun/zion/chinafrica/controller/ShopifyController.java
浏览文件 @
ee54e456
...
...
@@ -175,4 +175,16 @@ public class ShopifyController {
public
Result
delReply
(
@ApiParam
(
"回复ID"
)
@RequestParam
(
"replyId"
)
String
replyId
)
{
return
tbCfReplyService
.
delReply
(
replyId
);
}
/**
* 通过商品标题搜索
*
* @param title
* @return
*/
@ApiOperation
(
"搜索商品"
)
@GetMapping
(
"/search"
)
public
Result
searchProducts
(
@ApiParam
(
"商品标题"
)
@RequestParam
(
"title"
)
String
title
)
{
return
shopifyService
.
searchProductByTitle
(
title
);
}
}
src/main/java/com/diaoyun/zion/chinafrica/controller/TbCfOrderController.java
浏览文件 @
ee54e456
...
...
@@ -52,7 +52,7 @@ public class TbCfOrderController {
public
Result
<
PageInfo
>
getUserOrderList
(
@ApiParam
(
value
=
"页数"
)
@RequestParam
(
value
=
"pageNum"
,
defaultValue
=
"1"
)
Integer
pageNum
,
@ApiParam
(
value
=
"每页大小"
)
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"10"
)
Integer
pageSize
,
@ApiParam
(
value
=
"订单状态"
)
@RequestParam
(
value
=
"orderStatus"
,
required
=
false
)
Integer
orderStatus
)
{
)
throws
InterruptedException
{
return
tbCfOrderService
.
getUserOrderList
(
pageNum
,
pageSize
,
orderStatus
);
}
...
...
src/main/java/com/diaoyun/zion/chinafrica/dao/TbCfUserInfoDao.java
浏览文件 @
ee54e456
...
...
@@ -18,6 +18,7 @@ public interface TbCfUserInfoDao extends BaseDao<TbCfUserInfoEntity> {
/**
* 根据nickname获取用户信息
*
* @param nickname
* @return
*/
...
...
@@ -25,19 +26,25 @@ public interface TbCfUserInfoDao extends BaseDao<TbCfUserInfoEntity> {
/**
* 根据用户名、昵称查找
*
* @param account
* @return
*/
TbCfUserInfoEntity
findByAccount
(
String
account
);
TbCfUserInfoEntity
findAccount
(
String
account
);
/**
* 根据手机号查找
*
* @param phone
* @return
*/
TbCfUserInfoEntity
checkUserByPhone
(
String
phone
);
/**
* 更改用户密码
*
* @param userId
* @param newPassword
* @return
...
...
@@ -46,6 +53,7 @@ public interface TbCfUserInfoDao extends BaseDao<TbCfUserInfoEntity> {
/**
* 根据邮箱查询用户信息
*
* @return
*/
TbCfUserInfoEntity
findByEmail
(
String
email
);
...
...
src/main/java/com/diaoyun/zion/chinafrica/service/ShopifyService.java
浏览文件 @
ee54e456
...
...
@@ -11,8 +11,13 @@ import org.springframework.web.bind.annotation.RequestParam;
* @Description:
*/
public
interface
ShopifyService
{
public
Result
queryShopifyProducts
();
public
Result
queryProductsByType
(
String
product_type
,
String
product_id
);
public
Result
queryProductsDetails
(
String
product_id
);
public
Result
queryAllProducts
(
String
product_id
);
Result
queryShopifyProducts
();
Result
queryProductsByType
(
String
product_type
,
String
product_id
);
Result
queryProductsDetails
(
String
product_id
);
Result
queryAllProducts
(
String
product_id
);
Result
searchProductByTitle
(
String
title
);
}
src/main/java/com/diaoyun/zion/chinafrica/service/TbCfOrderService.java
浏览文件 @
ee54e456
...
...
@@ -95,7 +95,7 @@ public interface TbCfOrderService {
* @param orderStatus 订单状态 OrderStatusEnum
* @return
*/
Result
getUserOrderList
(
Integer
pageNum
,
Integer
pageSize
,
Integer
orderStatus
);
Result
getUserOrderList
(
Integer
pageNum
,
Integer
pageSize
,
Integer
orderStatus
)
throws
InterruptedException
;
/**
* 取消订单
...
...
src/main/java/com/diaoyun/zion/chinafrica/service/TbCfUserInfoService.java
浏览文件 @
ee54e456
...
...
@@ -121,7 +121,7 @@ public interface TbCfUserInfoService {
* @return
*/
TbCfUserInfoEntity
findByAccount
(
String
account
);
TbCfUserInfoEntity
findAccount
(
String
account
);
/**
* 更改用户密码
* @param newPassword
...
...
src/main/java/com/diaoyun/zion/chinafrica/service/impl/ShopifyServiceImpl.java
浏览文件 @
ee54e456
...
...
@@ -7,6 +7,7 @@ import com.diaoyun.zion.master.base.Result;
import
com.diaoyun.zion.master.common.RedisCache
;
import
com.diaoyun.zion.master.enums.ResultCodeEnum
;
import
com.diaoyun.zion.master.util.HttpClientUtil
;
import
net.sf.json.JSON
;
import
net.sf.json.JSONArray
;
import
net.sf.json.JSONObject
;
import
org.slf4j.Logger
;
...
...
@@ -58,7 +59,7 @@ public class ShopifyServiceImpl implements ShopifyService {
params
.
put
(
"limit"
,
ShopifyConstant
.
SHOPIFY_LIMIT
);
String
data
=
HttpClientUtil
.
createConnection
(
ShopifyConstant
.
productTypeUrl
(),
params
,
"UTF-8"
);
list
.
add
(
data
);
redisCache
.
set
(
KeyConstant
.
SHOPIFY_ITEMS
,
list
,
864
00
);
redisCache
.
set
(
KeyConstant
.
SHOPIFY_ITEMS
,
list
,
36
00
);
}
System
.
out
.
println
(
list
);
JSONArray
jsonArr
=
JSONArray
.
fromObject
(
list
);
...
...
@@ -88,13 +89,13 @@ public class ShopifyServiceImpl implements ShopifyService {
}
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"product_type"
,
product_type
);
params
.
put
(
"limit"
,
/*ShopifyConstant.SHOPIFY_PAGE_SIZE*/
"250"
);
//params.put("limit", ShopifyConstant.SHOPIFY_PAGE_SIZE
);
params
.
put
(
"since_id"
,
product_id
);
try
{
String
data
=
HttpClientUtil
.
createConnection
(
ShopifyConstant
.
productTypeUrl
(),
params
,
"UTF-8"
);
JSONObject
jsonObject
=
JSONObject
.
fromObject
(
data
);
result
.
setData
(
jsonObject
);
//redisCache.set(KeyConstant.SHOPIFY_TYPE_ITEMS + product_type + product_id, data, 864
00);
redisCache
.
set
(
KeyConstant
.
SHOPIFY_TYPE_ITEMS
+
product_type
+
product_id
,
data
,
36
00
);
}
catch
(
IOException
e
)
{
result
.
setCode
(
ResultCodeEnum
.
QUERY_ERROR
.
getCode
()).
setMessage
(
e
.
getMessage
());
logger
.
error
(
e
.
getMessage
(),
e
);
...
...
@@ -122,7 +123,7 @@ public class ShopifyServiceImpl implements ShopifyService {
params
.
put
(
"ids"
,
product_id
);
String
data
=
HttpClientUtil
.
createConnection
(
ShopifyConstant
.
productTypeUrl
(),
params
,
"UTF-8"
);
jsonProduct
=
JSONObject
.
fromObject
(
data
);
redisCache
.
set
(
KeyConstant
.
SHOPIFY_ITEM
+
product_id
,
data
,
864
00
);
redisCache
.
set
(
KeyConstant
.
SHOPIFY_ITEM
+
product_id
,
data
,
36
00
);
}
result
.
setData
(
jsonProduct
);
}
catch
(
IOException
e
)
{
...
...
@@ -150,7 +151,7 @@ public class ShopifyServiceImpl implements ShopifyService {
return
result
;
}
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"limit"
,
ShopifyConstant
.
SHOPIFY_PAGE_SIZE
);
//
params.put("limit", ShopifyConstant.SHOPIFY_PAGE_SIZE);
params
.
put
(
"since_id"
,
product_id
);
String
data
=
HttpClientUtil
.
createConnection
(
ShopifyConstant
.
productTypeUrl
(),
params
,
"UTF-8"
);
redisCache
.
set
(
KeyConstant
.
SHOPIFY_ITEMS_ALL
+
product_id
,
data
);
...
...
@@ -188,5 +189,27 @@ public class ShopifyServiceImpl implements ShopifyService {
return
list
;
}
/**
* 根据商品标题搜索
*
* @param title
* @return
*/
public
Result
searchProductByTitle
(
String
title
)
{
Result
result
=
new
Result
();
try
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"title"
,
title
);
String
data
=
HttpClientUtil
.
createConnection
(
ShopifyConstant
.
productTypeUrl
(),
params
,
"UTF-8"
);
JSONObject
jsonObject
=
JSONObject
.
fromObject
(
data
);
result
.
setData
(
jsonObject
);
}
catch
(
Exception
e
)
{
result
.
setCode
(
ResultCodeEnum
.
QUERY_ERROR
.
getCode
()).
setMessage
(
e
.
getMessage
());
logger
.
error
(
e
.
getMessage
(),
e
);
return
result
;
}
return
result
;
}
}
src/main/java/com/diaoyun/zion/chinafrica/service/impl/TbCfOrderServiceImpl.java
浏览文件 @
ee54e456
差异被折叠。
点击展开。
src/main/java/com/diaoyun/zion/chinafrica/service/impl/TbCfUserInfoServiceImpl.java
浏览文件 @
ee54e456
...
...
@@ -386,6 +386,10 @@ public class TbCfUserInfoServiceImpl implements TbCfUserInfoService {
return
tbCfUserInfoEntity
;
}
public
TbCfUserInfoEntity
findAccount
(
String
account
)
{
TbCfUserInfoEntity
tbCfUserInfoEntity
=
tbCfUserInfoDao
.
findAccount
(
account
);
return
tbCfUserInfoEntity
;
}
@Override
public
Result
updatePassWord
(
String
newPassword
,
String
oldPassword
)
{
Result
result
=
new
Result
();
...
...
src/main/java/com/diaoyun/zion/master/security/MyUserDetails.java
浏览文件 @
ee54e456
...
...
@@ -16,8 +16,7 @@ public class MyUserDetails implements UserDetailsService {
@Override
public
UserDetails
loadUserByUsername
(
String
username
)
throws
UsernameNotFoundException
{
final
TbCfUserInfoEntity
user
=
tbCfUserInfoService
.
findByAccount
(
username
);
final
TbCfUserInfoEntity
user
=
tbCfUserInfoService
.
findAccount
(
username
);
if
(
user
==
null
)
{
throw
new
UsernameNotFoundException
(
"User '"
+
username
+
"' not found or disable"
);
}
...
...
src/main/resources/mapper/TbCfUserInfoDao.xml
浏览文件 @
ee54e456
...
...
@@ -115,7 +115,7 @@
AND name LIKE concat('%',#{name},'%')
</if>
</select>
<select
id=
"checkUserByPhone"
resultType=
"com.diaoyun.zion.chinafrica.entity.TbCfUserInfoEntity"
>
<select
id=
"checkUserByPhone"
resultType=
"com.diaoyun.zion.chinafrica.entity.TbCfUserInfoEntity"
>
select * from tb_cf_user_info
WHERE phone=#{phone}
</select>
...
...
@@ -210,15 +210,19 @@
<!--根据userId 账号 email nick 查找用户-->
<select
id=
"findByAccount"
resultType=
"com.diaoyun.zion.chinafrica.entity.TbCfUserInfoEntity"
>
select * from tb_cf_user_info where enable_flag=1 and (user_id=#{userId} or account=#{account}
or email =#{account} or nick =#{account})
;
or email =#{account} or nick =#{account})
</select>
<!--根据userId 账号 email nick 查找用户-->
<select
id=
"findAccount"
resultType=
"com.diaoyun.zion.chinafrica.entity.TbCfUserInfoEntity"
>
select * from tb_cf_user_info where enable_flag=1 and account=#{account}
</select>
<!--根据userId 账号 email 查找用户-->
<select
id=
"findByEmail"
resultType=
"com.diaoyun.zion.chinafrica.entity.TbCfUserInfoEntity"
>
select * from tb_cf_user_info where enable_flag=1 and account=#{email} or email =#{email}
;
select * from tb_cf_user_info where enable_flag=1 and account=#{email} or email =#{email}
</select>
<!--修改密码-->
<update
id=
"updatePassWord"
>
<update
id=
"updatePassWord"
>
update tb_cf_user_info set password=#{newPassword} where user_id=#{userId}
</update>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论