Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
order-group
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
order-group-application
order-group
Commits
132e5643
Commit
132e5643
authored
Jul 23, 2021
by
周晓航
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
日志 fegin 切面注解添加
Signed-off-by: 周晓航 <xiaohang.zhou@freemud.com>
parent
a8577563
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
163 additions
and
2 deletions
+163
-2
order-management/src/main/java/cn/freemud/management/annotations/LogIgnoreFeign.java
+30
-0
order-management/src/main/java/cn/freemud/management/constant/ResponseCodeConstant.java
+36
-0
order-management/src/main/java/cn/freemud/management/constant/ResponseCodeKeyConstant.java
+63
-0
order-management/src/main/java/cn/freemud/management/thirdparty/CouponOfflineMCCafeClient.java
+17
-2
order-management/src/main/java/cn/freemud/management/thirdparty/CustomerMcCafeClient.java
+3
-0
order-management/src/main/java/cn/freemud/management/thirdparty/DeliveryMCCafeClient.java
+5
-0
order-management/src/main/java/cn/freemud/management/thirdparty/MulitiPaymentClient.java
+5
-0
order-management/src/main/java/cn/freemud/management/thirdparty/OMSActivityClient.java
+4
-0
No files found.
order-management/src/main/java/cn/freemud/management/annotations/LogIgnoreFeign.java
0 → 100644
View file @
132e5643
package
cn
.
freemud
.
management
.
annotations
;
import
java.lang.annotation.*
;
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Target
(
value
=
{
ElementType
.
METHOD
})
@Documented
@Inherited
public
@interface
LogIgnoreFeign
{
/**
* 是否打印日志,true打印,false不打印,注意设置成false状态码和状态码信息都不会打印
* @return
*/
boolean
printLog
()
default
true
;
/**
* printLog 设置成true的时候,可以排除哪些状态码的响应不用打印响应报文,只会打印状态码
*
* @return
*/
String
[]
excludeStatusCodes
()
default
"100"
;
String
statusCodeFieldName
()
default
"code"
;
String
messageFieldName
()
default
"message"
;
}
order-management/src/main/java/cn/freemud/management/constant/ResponseCodeConstant.java
0 → 100644
View file @
132e5643
package
cn
.
freemud
.
management
.
constant
;
import
java.util.HashSet
;
import
java.util.Set
;
public
class
ResponseCodeConstant
{
public
final
static
Integer
RESPONSE_SUCCESS
=
100
;
public
final
static
String
RESPONSE_SUCCESS_STR
=
"100"
;
public
final
static
String
RESPONSE_CONFLICTS_STR
=
"105"
;
// coco券校验异常的错误
public
final
static
String
COCO_RESPONSE_COUPON_ERR_STR
=
"700"
;
public
final
static
String
RESPONSE_SUCCESS_OK
=
"ok"
;
public
final
static
Integer
RESPONSE_SUCCESS_1
=
1
;
public
final
static
String
RESPONSE_SUCCESS_0_STR
=
"0"
;
public
final
static
int
RESPONSE_SUCCESS_0
=
0
;
private
final
static
Set
<
Object
>
successResponseCodeSet
=
new
HashSet
<>();
static
{
successResponseCodeSet
.
add
(
RESPONSE_SUCCESS
);
successResponseCodeSet
.
add
(
RESPONSE_SUCCESS_STR
);
successResponseCodeSet
.
add
(
RESPONSE_SUCCESS_OK
);
successResponseCodeSet
.
add
(
RESPONSE_SUCCESS_1
);
successResponseCodeSet
.
add
(
RESPONSE_SUCCESS_0_STR
);
successResponseCodeSet
.
add
(
RESPONSE_CONFLICTS_STR
);
}
public
static
boolean
isSuccessRespinseCode
(
Object
o
)
{
return
successResponseCodeSet
.
contains
(
o
);
}
}
order-management/src/main/java/cn/freemud/management/constant/ResponseCodeKeyConstant.java
0 → 100644
View file @
132e5643
/**
* All rights Reserved, Designed By www.freemud.cn
*
* @Title: ResponseCodeKeyConstant
* @Package cn.freemud.constant
* @Description:
* @author: song.cai
* @date: 2019/1/15 17:20
* @version V1.0
* @Copyright: 2019 www.freemud.cn Inc. All rights reserved.
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
*/
package
cn
.
freemud
.
management
.
constant
;
import
com.alibaba.fastjson.JSONObject
;
import
java.util.HashSet
;
import
java.util.Set
;
public
class
ResponseCodeKeyConstant
{
public
final
static
String
CODE
=
"code"
;
public
final
static
String
MESSAGE
=
"message"
;
public
final
static
String
STATUS_CODE
=
"statusCode"
;
public
static
final
String
MEG
=
"meg"
;
public
static
final
String
MSG
=
"msg"
;
/**
* code名称来源根据 ProductInfosDto
*/
public
final
static
String
ERR_CODE
=
"errcode"
;
/**
* errmsg名称来源根据 ProductInfosDto
*/
public
static
final
String
ERR_MSG
=
"errmsg"
;
private
final
static
Set
<
String
>
responseCodeKeySet
=
new
HashSet
<>();
static
{
responseCodeKeySet
.
add
(
CODE
);
responseCodeKeySet
.
add
(
ERR_CODE
);
responseCodeKeySet
.
add
(
STATUS_CODE
);
}
public
static
Object
getResponseCodeValue
(
JSONObject
jsonObject
)
{
Object
o
=
null
;
for
(
String
key
:
responseCodeKeySet
)
{
if
((
o
=
jsonObject
.
get
(
key
))
!=
null
)
{
break
;
}
}
return
o
;
}
}
order-management/src/main/java/cn/freemud/management/thirdparty/CouponOfflineMCCafeClient.java
View file @
132e5643
package
cn
.
freemud
.
management
.
thirdparty
;
import
cn.freemud.management.annotations.LogIgnoreFeign
;
import
cn.freemud.management.constant.ResponseCodeConstant
;
import
cn.freemud.management.constant.ResponseCodeKeyConstant
;
import
cn.freemud.management.entities.dto.request.order.MCCafeCouponLockRequest
;
import
cn.freemud.management.entities.dto.request.order.MCCafeCouponRequest
;
import
cn.freemud.management.entities.dto.response.coupon.McdNetBatchQueryResponse
;
import
com.freemud.application.sdk.api.couponcenter.offline.response.CouponBaseResponse
;
import
com.freemud.application.sdk.api.couponcenter.offline.response.CouponQueryResponse
;
import
com.freemud.application.sdk.api.couponcenter.offline.response.CouponRedeemResponse
;
import
com.freemud.application.sdk.api.couponcenter.offline.response.CouponBaseResponse
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
@FeignClient
(
name
=
"OPEN-STORE-COUPON-ADAPTER-SERVICE"
,
url
=
"${saas.couponadapterclient.feign.url}"
)
@FeignClient
(
name
=
"OPEN-STORE-COUPON-ADAPTER-SERVICE"
,
url
=
"${saas.couponadapterclient.feign.url}"
)
@RequestMapping
(
produces
=
{
"application/json;charset=UTF-8"
})
public
interface
CouponOfflineMCCafeClient
{
@PostMapping
(
"/mccafe/redeem"
)
@LogIgnoreFeign
(
excludeStatusCodes
=
{
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
},
statusCodeFieldName
=
ResponseCodeKeyConstant
.
STATUS_CODE
)
CouponRedeemResponse
redeem
(
MCCafeCouponRequest
mcCafeCouponRequest
);
@PostMapping
(
"/mccafe/cancelRedeem"
)
@LogIgnoreFeign
(
excludeStatusCodes
=
{
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
},
statusCodeFieldName
=
ResponseCodeKeyConstant
.
STATUS_CODE
)
CouponRedeemResponse
cancelRedeem
(
MCCafeCouponRequest
mcCafeCouponRequest
);
@PostMapping
(
"/mccafe/query"
)
@LogIgnoreFeign
(
excludeStatusCodes
=
{
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
},
statusCodeFieldName
=
ResponseCodeKeyConstant
.
STATUS_CODE
)
CouponQueryResponse
query
(
MCCafeCouponRequest
mcCafeCouponRequest
);
@PostMapping
(
"/mccafe/batchQuery"
)
@LogIgnoreFeign
(
excludeStatusCodes
=
{
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
},
statusCodeFieldName
=
ResponseCodeKeyConstant
.
STATUS_CODE
)
McdNetBatchQueryResponse
batchQuery
(
MCCafeCouponRequest
mcCafeCouponRequest
);
@PostMapping
(
"/mccafe/lock"
)
@LogIgnoreFeign
(
excludeStatusCodes
=
{
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
},
statusCodeFieldName
=
ResponseCodeKeyConstant
.
STATUS_CODE
)
CouponBaseResponse
lock
(
MCCafeCouponLockRequest
MCCafeCouponLockRequest
);
@PostMapping
(
"/mccafe/unlock"
)
@LogIgnoreFeign
(
excludeStatusCodes
=
{
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
},
statusCodeFieldName
=
ResponseCodeKeyConstant
.
STATUS_CODE
)
CouponBaseResponse
unlock
(
MCCafeCouponLockRequest
MCCafeCouponLockRequest
);
}
order-management/src/main/java/cn/freemud/management/thirdparty/CustomerMcCafeClient.java
View file @
132e5643
...
...
@@ -14,6 +14,8 @@
package
cn
.
freemud
.
management
.
thirdparty
;
import
cn.freemud.base.entity.BaseResponse
;
import
cn.freemud.management.annotations.LogIgnoreFeign
;
import
cn.freemud.management.constant.ResponseCodeConstant
;
import
cn.freemud.management.entities.dto.request.customer.ForbiddenCardCodeRequest
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.PostMapping
;
...
...
@@ -25,5 +27,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
public
interface
CustomerMcCafeClient
{
@PostMapping
(
value
=
"/customerextendservice/qujia/forbiddenCardCode"
)
@LogIgnoreFeign
(
excludeStatusCodes
=
{
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
})
BaseResponse
forbiddenCardCodeForQujia
(
@RequestBody
ForbiddenCardCodeRequest
request
);
}
order-management/src/main/java/cn/freemud/management/thirdparty/DeliveryMCCafeClient.java
View file @
132e5643
package
cn
.
freemud
.
management
.
thirdparty
;
import
cn.freemud.management.annotations.LogIgnoreFeign
;
import
cn.freemud.management.constant.ResponseCodeConstant
;
import
cn.freemud.management.constant.ResponseCodeKeyConstant
;
import
cn.freemud.management.entities.dto.request.delivery.DeliveryOrderAssemblyackRequest
;
import
cn.freemud.management.entities.dto.request.delivery.DeliveryOrderHaltedRequest
;
import
com.freemud.application.sdk.api.deliverycenter.response.DeliveryResponseDto
;
...
...
@@ -13,11 +16,13 @@ public interface DeliveryMCCafeClient {
// 配送停单
@PostMapping
(
"/delivery/halted"
)
@LogIgnoreFeign
(
excludeStatusCodes
=
{
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
},
messageFieldName
=
ResponseCodeKeyConstant
.
MSG
)
DeliveryResponseDto
halted
(
DeliveryOrderHaltedRequest
deliveryOrderHaltedRequest
);
/**、
* 入机成功通知配送
*/
@PostMapping
(
"/delivery/assemblyack"
)
@LogIgnoreFeign
(
excludeStatusCodes
=
{
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
},
messageFieldName
=
ResponseCodeKeyConstant
.
MSG
)
DeliveryResponseDto
assemblyAck
(
DeliveryOrderAssemblyackRequest
request
);
}
order-management/src/main/java/cn/freemud/management/thirdparty/MulitiPaymentClient.java
View file @
132e5643
...
...
@@ -13,6 +13,9 @@
package
cn
.
freemud
.
management
.
thirdparty
;
import
cn.freemud.management.annotations.LogIgnoreFeign
;
import
cn.freemud.management.constant.ResponseCodeConstant
;
import
cn.freemud.management.constant.ResponseCodeKeyConstant
;
import
cn.freemud.management.entities.dto.request.BatchOrderRefundV2Request
;
import
cn.freemud.management.entities.dto.response.pay.PayBatchRefundResponse
;
import
com.freemud.sdk.api.assortment.order.request.order.MultiOrderRefundRequest
;
...
...
@@ -30,11 +33,13 @@ public interface MulitiPaymentClient {
* 混合支付退款接口
*/
@PostMapping
(
"/payment/application/refund"
)
@LogIgnoreFeign
(
excludeStatusCodes
=
{
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
},
messageFieldName
=
ResponseCodeKeyConstant
.
MSG
)
MultiOrderRefundResponse
paymentApplicationRefund
(
MultiOrderRefundRequest
multiOrderRefundRequest
,
@RequestHeader
(
"partnerId"
)
String
partnerId
);
/**
* 批量支付退款
*/
@PostMapping
(
"/payment/application/batch/refund"
)
@LogIgnoreFeign
(
excludeStatusCodes
=
{
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
},
messageFieldName
=
ResponseCodeKeyConstant
.
MSG
)
PayBatchRefundResponse
batchRefund
(
BatchOrderRefundV2Request
batchOrderRefundV2Request
);
}
order-management/src/main/java/cn/freemud/management/thirdparty/OMSActivityClient.java
View file @
132e5643
...
...
@@ -13,6 +13,9 @@
package
cn
.
freemud
.
management
.
thirdparty
;
import
cn.freemud.management.annotations.LogIgnoreFeign
;
import
cn.freemud.management.constant.ResponseCodeConstant
;
import
cn.freemud.management.constant.ResponseCodeKeyConstant
;
import
cn.freemud.management.entities.dto.request.activity.GroupWorkRefundRequest
;
import
cn.freemud.management.entities.dto.response.activity.GroupWorkRefundResponse
;
import
org.springframework.cloud.openfeign.FeignClient
;
...
...
@@ -29,6 +32,7 @@ public interface OMSActivityClient {
* @return
*/
@PostMapping
(
"/activity/groupWork/refund"
)
@LogIgnoreFeign
(
excludeStatusCodes
=
{
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
},
statusCodeFieldName
=
ResponseCodeKeyConstant
.
STATUS_CODE
,
messageFieldName
=
ResponseCodeKeyConstant
.
MSG
)
GroupWorkRefundResponse
groupWorkRefund
(
GroupWorkRefundRequest
groupWorkRefundRequest
);
}
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