Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
A
Afrishop refactored project
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Whispa
Afrishop refactored project
Commits
eebe2bb6
提交
eebe2bb6
authored
11月 23, 2020
作者:
Whispa
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/master'
上级
d4c2a5a0
31ea6bb9
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
122 行增加
和
41 行删除
+122
-41
AddressController.java
...om/example/afrishop_v3/controllers/AddressController.java
+6
-0
AdvertisementController.java
...mple/afrishop_v3/controllers/AdvertisementController.java
+9
-6
DpoPayController.java
...com/example/afrishop_v3/controllers/DpoPayController.java
+5
-34
TbCfAddress.java
...main/java/com/example/afrishop_v3/models/TbCfAddress.java
+2
-0
TbCfStationItemRepository.java
...ple/afrishop_v3/repository/TbCfStationItemRepository.java
+3
-0
WebSecurityConfig.java
...a/com/example/afrishop_v3/security/WebSecurityConfig.java
+1
-1
Category.java
src/main/java/com/example/afrishop_v3/vo/Category.java
+19
-0
ColumnController.java
...mple/afrishop_v3/website/controller/ColumnController.java
+72
-0
application-test.yml
src/main/resources/application-test.yml
+5
-0
没有找到文件。
src/main/java/com/example/afrishop_v3/controllers/AddressController.java
浏览文件 @
eebe2bb6
...
@@ -62,6 +62,12 @@ public class AddressController extends Controller{
...
@@ -62,6 +62,12 @@ public class AddressController extends Controller{
return
new
Result
<>(
save
);
return
new
Result
<>(
save
);
}
}
@GetMapping
(
"/findAddressById/{id}"
)
public
Result
findAddressById
(
@PathVariable
(
"id"
)
String
id
){
return
new
Result
(
repository
.
findById
(
id
));
}
@PutMapping
(
"/{addressId}"
)
@PutMapping
(
"/{addressId}"
)
public
Result
editAddressInfo
(
@PathVariable
(
"addressId"
)
String
addressId
,
@RequestBody
TbCfAddress
address
)
{
public
Result
editAddressInfo
(
@PathVariable
(
"addressId"
)
String
addressId
,
@RequestBody
TbCfAddress
address
)
{
...
...
src/main/java/com/example/afrishop_v3/controllers/AdvertisementController.java
浏览文件 @
eebe2bb6
...
@@ -14,10 +14,7 @@ import org.springframework.data.domain.Sort;
...
@@ -14,10 +14,7 @@ import org.springframework.data.domain.Sort;
import
static
org
.
springframework
.
data
.
domain
.
Sort
.
Order
.
asc
;
import
static
org
.
springframework
.
data
.
domain
.
Sort
.
Order
.
asc
;
import
static
org
.
springframework
.
data
.
domain
.
Sort
.
Order
.
desc
;
import
static
org
.
springframework
.
data
.
domain
.
Sort
.
Order
.
desc
;
import
java.util.Date
;
import
java.util.*
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Optional
;
/**
/**
* @Auther: wudepeng
* @Auther: wudepeng
...
@@ -46,7 +43,7 @@ public class AdvertisementController {
...
@@ -46,7 +43,7 @@ public class AdvertisementController {
*/
*/
@GetMapping
(
"/info/{link}"
)
@GetMapping
(
"/info/{link}"
)
public
Result
getAdvertisementById
(
@PathVariable
(
"link"
)
String
link
,
public
Result
getAdvertisementById
(
@PathVariable
(
"link"
)
String
link
,
@RequestParam
(
value
=
"pageNum"
,
defaultValue
=
"
1
"
)
Integer
pageNum
,
@RequestParam
(
value
=
"pageNum"
,
defaultValue
=
"
0
"
)
Integer
pageNum
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"12"
)
Integer
pageSize
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"12"
)
Integer
pageSize
,
@RequestParam
(
value
=
"order"
,
required
=
false
)
String
order
)
{
@RequestParam
(
value
=
"order"
,
required
=
false
)
String
order
)
{
LinkedHashMap
advertisementMap
=
new
LinkedHashMap
();
LinkedHashMap
advertisementMap
=
new
LinkedHashMap
();
...
@@ -61,8 +58,14 @@ public class AdvertisementController {
...
@@ -61,8 +58,14 @@ public class AdvertisementController {
if
(
now
>
endTime
.
getTime
())
{
if
(
now
>
endTime
.
getTime
())
{
advertisement
.
setStatus
(
3
);
advertisement
.
setStatus
(
3
);
}
}
List
<
TbCfStationItem
>
itemList
=
new
ArrayList
<>();
if
(
StringUtils
.
isBlank
(
order
))
{
List
<
TbCfStationItem
>
itemList
=
itemRepository
.
getAdvertisementItem
(
advertisement
.
getId
(),
PageRequest
.
of
(
pageNum
-
1
,
pageSize
)).
toList
();
itemList
=
itemRepository
.
getAdvertisementItem
(
advertisement
.
getId
(),
PageRequest
.
of
(
pageNum
,
pageSize
)).
toList
();
}
else
{
itemList
=
itemRepository
.
getAdvertisementItem2
(
advertisement
.
getId
(),
PageRequest
.
of
(
pageNum
,
pageSize
,
sort
(
order
))).
toList
();
}
advertisementMap
.
put
(
"advertisement"
,
advertisement
);
advertisementMap
.
put
(
"advertisement"
,
advertisement
);
advertisementMap
.
put
(
"itemList"
,
itemList
);
advertisementMap
.
put
(
"itemList"
,
itemList
);
}
}
...
...
src/main/java/com/example/afrishop_v3/controllers/DpoPayController.java
浏览文件 @
eebe2bb6
...
@@ -49,38 +49,6 @@ public class DpoPayController extends Controller {
...
@@ -49,38 +49,6 @@ public class DpoPayController extends Controller {
}
}
@GetMapping
(
"/notify"
)
@GetMapping
(
"/notify"
)
public
Result
payNotify
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
Result
result
=
new
Result
();
try
{
System
.
out
.
println
(
"DPO支付回调"
);
//订单号
String
orderId
=
request
.
getParameter
(
"CompanyRef"
);
//交易ID
String
transId
=
request
.
getParameter
(
"TransID"
);
//交易令牌
String
transToken
=
request
.
getParameter
(
"TransactionToken"
);
System
.
err
.
println
(
"transID:"
+
transId
);
System
.
err
.
println
(
"transToken:"
+
transToken
);
//logger.info("DPO支付:" + "开始支付校验");
if
(!
StringUtils
.
isBlank
(
orderId
)
&&
!
StringUtils
.
isBlank
(
transToken
))
{
boolean
verifyPay
=
verifyPay
(
transToken
,
orderId
);
if
(
verifyPay
)
{
//logger.info("DPO支付:" + "支付校验成功");
result
.
setMessage
(
"Pay for success"
);
result
.
setCode
(
ResultCodeEnum
.
SUCCESS
.
getCode
());
return
result
;
}
}
return
new
Result
<>(
result
,
ResultCodeEnum
.
SERVICE_ERROR
.
getCode
(),
"Pay for failure"
);
}
catch
(
Exception
e
)
{
return
new
Result
<>(
result
,
ResultCodeEnum
.
SERVICE_ERROR
.
getCode
(),
"Pay for failure"
);
//logger.error("DPO支付回调发生异常--->>>" + e.toString());
}
}
@GetMapping
(
"/notifyWeb"
)
public
void
payNotifyWeb
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
IOException
{
public
void
payNotifyWeb
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
IOException
{
// Result result = new Result();
// Result result = new Result();
// try {
// try {
...
@@ -94,8 +62,11 @@ public class DpoPayController extends Controller {
...
@@ -94,8 +62,11 @@ public class DpoPayController extends Controller {
System
.
err
.
println
(
"transID:"
+
transId
);
System
.
err
.
println
(
"transID:"
+
transId
);
System
.
err
.
println
(
"transToken:"
+
transToken
);
System
.
err
.
println
(
"transToken:"
+
transToken
);
//logger.info("DPO支付:" + "开始支付校验");
//logger.info("DPO支付:" + "开始支付校验");
Optional
<
TbCfOrder
>
byId
=
repository
.
findById
(
orderId
);
// Optional<TbCfOrder> byId = repository.findById(orderId);
// String orderSource = null;
// if (byId.isPresent()) {
// orderSource = byId.get().getOrderSource().toString();
// }
if
(!
StringUtils
.
isBlank
(
orderId
)
&&
!
StringUtils
.
isBlank
(
transToken
))
{
if
(!
StringUtils
.
isBlank
(
orderId
)
&&
!
StringUtils
.
isBlank
(
transToken
))
{
boolean
verifyPay
=
verifyPay
(
transToken
,
orderId
);
boolean
verifyPay
=
verifyPay
(
transToken
,
orderId
);
if
(
verifyPay
)
{
if
(
verifyPay
)
{
...
...
src/main/java/com/example/afrishop_v3/models/TbCfAddress.java
浏览文件 @
eebe2bb6
...
@@ -2,6 +2,7 @@ package com.example.afrishop_v3.models;
...
@@ -2,6 +2,7 @@ package com.example.afrishop_v3.models;
import
lombok.Getter
;
import
lombok.Getter
;
import
lombok.Setter
;
import
lombok.Setter
;
import
org.hibernate.annotations.DynamicUpdate
;
import
javax.persistence.Entity
;
import
javax.persistence.Entity
;
import
javax.persistence.Id
;
import
javax.persistence.Id
;
...
@@ -18,6 +19,7 @@ import java.util.Date;
...
@@ -18,6 +19,7 @@ import java.util.Date;
@Entity
@Entity
@Setter
@Setter
@Getter
@Getter
@DynamicUpdate
public
class
TbCfAddress
{
public
class
TbCfAddress
{
/**
/**
...
...
src/main/java/com/example/afrishop_v3/repository/TbCfStationItemRepository.java
浏览文件 @
eebe2bb6
...
@@ -39,4 +39,7 @@ public interface TbCfStationItemRepository extends PagingAndSortingRepository<Tb
...
@@ -39,4 +39,7 @@ public interface TbCfStationItemRepository extends PagingAndSortingRepository<Tb
@Query
(
value
=
"select i from #{#entityName} i inner join AdvertisementItem a on i.itemId=a.itemId where a.adId=?1 order by a.sort"
)
@Query
(
value
=
"select i from #{#entityName} i inner join AdvertisementItem a on i.itemId=a.itemId where a.adId=?1 order by a.sort"
)
Page
<
TbCfStationItem
>
getAdvertisementItem
(
String
adId
,
Pageable
pageable
);
Page
<
TbCfStationItem
>
getAdvertisementItem
(
String
adId
,
Pageable
pageable
);
@Query
(
value
=
"select i from #{#entityName} i inner join AdvertisementItem a on i.itemId=a.itemId where a.adId=?1"
)
Page
<
TbCfStationItem
>
getAdvertisementItem2
(
String
adId
,
Pageable
pageable
);
}
}
src/main/java/com/example/afrishop_v3/security/WebSecurityConfig.java
浏览文件 @
eebe2bb6
...
@@ -65,7 +65,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
...
@@ -65,7 +65,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
http
.
cors
().
and
().
csrf
().
disable
()
http
.
cors
().
and
().
csrf
().
disable
()
.
exceptionHandling
().
authenticationEntryPoint
(
unauthorizedHandler
).
and
()
.
exceptionHandling
().
authenticationEntryPoint
(
unauthorizedHandler
).
and
()
.
sessionManagement
().
sessionCreationPolicy
(
SessionCreationPolicy
.
STATELESS
).
and
()
.
sessionManagement
().
sessionCreationPolicy
(
SessionCreationPolicy
.
STATELESS
).
and
()
.
authorizeRequests
().
antMatchers
(
"/api/auth/**"
,
"/search/image/**"
,
"/itemStation/**"
,
"/startPage/**"
,
"/goodsType/**"
,
"/home/**"
,
"/spider/**"
,
"/store/**"
,
"/shopify/**"
,
"/community/**"
,
"/version/**"
,
"/flutterwave/notify/**"
,
"/dpo/notify/**"
).
permitAll
()
.
authorizeRequests
().
antMatchers
(
"/api/auth/**"
,
"/search/image/**"
,
"/itemStation/**"
,
"/startPage/**"
,
"/goodsType/**"
,
"/home/**"
,
"/spider/**"
,
"/store/**"
,
"/shopify/**"
,
"/community/**"
,
"/version/**"
,
"/flutterwave/notify/**"
,
"/dpo/notify/**"
,
"/advertisement/**"
).
permitAll
()
.
antMatchers
(
"/api/test/**"
).
permitAll
()
.
antMatchers
(
"/api/test/**"
).
permitAll
()
.
anyRequest
().
authenticated
();
.
anyRequest
().
authenticated
();
...
...
src/main/java/com/example/afrishop_v3/vo/Category.java
0 → 100644
浏览文件 @
eebe2bb6
package
com
.
example
.
afrishop_v3
.
vo
;
import
com.example.afrishop_v3.models.TbCfDescripiton
;
import
lombok.Data
;
import
java.util.List
;
/**
* @Auther: wudepeng
* @Date: 2020/11/23
* @Description:商品分类
*/
@Data
public
class
Category
{
private
String
id
;
private
String
category
;
private
List
<
TbCfDescripiton
>
categoryList
;
}
src/main/java/com/example/afrishop_v3/website/controller/ColumnController.java
0 → 100644
浏览文件 @
eebe2bb6
package
com
.
example
.
afrishop_v3
.
website
.
controller
;
import
com.example.afrishop_v3.base.Result
;
import
com.example.afrishop_v3.models.TbCfDescripiton
;
import
com.example.afrishop_v3.models.TbCfGoodstwotype
;
import
com.example.afrishop_v3.repository.TbCfDescripitonRepository
;
import
com.example.afrishop_v3.repository.TbCfGoodstwotypeRepository
;
import
com.example.afrishop_v3.repository.TbCfGoodstypeRepository
;
import
com.example.afrishop_v3.vo.Category
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.*
;
/**
* @Auther: wudepeng
* @Date: 2020/11/23
* @Description:PC官网首页商品分类管理
*/
@RestController
@RequestMapping
(
value
=
"/website/column"
)
public
class
ColumnController
{
private
final
TbCfGoodstypeRepository
repository
;
private
final
TbCfGoodstwotypeRepository
secondaryRepository
;
private
final
TbCfDescripitonRepository
tertiaryRepository
;
public
ColumnController
(
TbCfGoodstypeRepository
repository
,
TbCfGoodstwotypeRepository
secondaryRepository
,
TbCfDescripitonRepository
tertiaryRepository
)
{
this
.
repository
=
repository
;
this
.
secondaryRepository
=
secondaryRepository
;
this
.
tertiaryRepository
=
tertiaryRepository
;
}
/**
* 查询所有一级分类
*/
@GetMapping
public
Result
findTopCategory
()
{
return
new
Result
(
repository
.
findAll
());
}
/**
* 查询一级分类的子分类
*/
@GetMapping
(
"/{id}"
)
public
Result
findCategoryChildrens
(
@PathVariable
(
"id"
)
String
id
)
{
LinkedList
<
Category
>
categoryList
=
new
LinkedList
();
//二级分类
List
<
TbCfGoodstwotype
>
secondaryCategory
=
secondaryRepository
.
findAllByGoodstypeId
(
id
);
secondaryCategory
.
forEach
(
category
->
{
//三级分类
List
<
TbCfDescripiton
>
tertiaryCategory
=
tertiaryRepository
.
findAllByGoodstwotypeId
(
category
.
getGoodstwotypeId
());
Category
c
=
new
Category
();
c
.
setId
(
category
.
getGoodstwotypeId
());
c
.
setCategory
(
category
.
getGoodstwotypeTitle
());
c
.
setCategoryList
(
tertiaryCategory
);
categoryList
.
add
(
c
);
});
return
new
Result
(
categoryList
);
}
}
src/main/resources/application-test.yml
浏览文件 @
eebe2bb6
server
:
servlet
:
context-path
:
/afrishop
port
:
8099
spring
:
spring
:
datasource
:
datasource
:
url
:
jdbc:mysql://159.138.48.71:3306/chinafrica_ref?useUnicode=true&connectionCollation=utf8mb4_general_ci&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
url
:
jdbc:mysql://159.138.48.71:3306/chinafrica_ref?useUnicode=true&connectionCollation=utf8mb4_general_ci&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
...
@@ -71,3 +75,4 @@ flutter:
...
@@ -71,3 +75,4 @@ flutter:
redirect_url
:
https://www.afrieshop.com/afrishop/flutterwave/notify
redirect_url
:
https://www.afrieshop.com/afrishop/flutterwave/notify
public_key
:
FLWPUBK_TEST-e3cc948e7cb24b2128fca3b781f6fce0-X
public_key
:
FLWPUBK_TEST-e3cc948e7cb24b2128fca3b781f6fce0-X
secret_key
:
FLWSECK_TEST-f88371ca63a989a4af95625475a0d22d-X
secret_key
:
FLWSECK_TEST-f88371ca63a989a4af95625475a0d22d-X
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论