json 解析异常捕获
This commit is contained in:
@@ -162,8 +162,13 @@ public class ShopActivateServiceImpl extends ServiceImpl<ShopActivateMapper, Sho
|
|||||||
* 获取优惠券详细信息 目前仅返回 id 名称 剩余数量 赠送数量
|
* 获取优惠券详细信息 目前仅返回 id 名称 剩余数量 赠送数量
|
||||||
*/
|
*/
|
||||||
private List<ShopCoupon> getCoupons(String couponJson) {
|
private List<ShopCoupon> getCoupons(String couponJson) {
|
||||||
Map<String, Integer> couponMap = JSONObject.parseObject(couponJson, new TypeReference<>() {
|
Map<String, Integer> couponMap;
|
||||||
});
|
try {
|
||||||
|
couponMap = JSONObject.parseObject(couponJson, new TypeReference<>() {});
|
||||||
|
} catch (Exception e) {
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
if (couponMap.isEmpty()) {
|
if (couponMap.isEmpty()) {
|
||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user