刘俊驰 1 rok temu
rodzic
commit
8abc75d6d6

+ 1 - 4
mec-mall/mall-admin/src/main/java/com/yonge/cooleshow/admin/controller/open/OpenController.java

@@ -79,11 +79,8 @@ public class OpenController {
 
         List<PmsProductDto> feignProductList = productService.getFeignProductList(productQueryParam);
         CommonPage<PmsProductDto> dtoCommonPage = CommonPage.restPage(feignProductList);
-        PageInfo<PmsProductDto> pageInfo = new PageInfo<>();
+        PageInfo<PmsProductDto> pageInfo = new PageInfo<>(productQueryParam.getPageNum(),productQueryParam.getPageSize());
         pageInfo.setRows(feignProductList);
-        pageInfo.setLimit(productQueryParam.getPageSize());
-        pageInfo.setOffset(productQueryParam.getPageNum());
-        pageInfo.setPageNo(productQueryParam.getPageSize());
         pageInfo.setTotal(dtoCommonPage.getTotal().intValue());
         return pageInfo;
 

+ 25 - 0
mec-mall/mall-common/src/main/java/com/yonge/cooleshow/mall/common/exception/GlobalExceptionHandler.java

@@ -2,12 +2,17 @@ package com.yonge.cooleshow.mall.common.exception;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
+import com.microsvc.toolkit.common.response.enums.ESysMap;
+import com.microsvc.toolkit.common.response.template.R;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.util.http.HttpUtil;
 import com.yonge.cooleshow.mall.common.api.CommonResult;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.codec.binary.Base64;
 import org.apache.commons.lang3.exception.ExceptionUtils;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
 import org.springframework.validation.BindException;
 import org.springframework.validation.BindingResult;
 import org.springframework.validation.FieldError;
@@ -127,6 +132,26 @@ public class GlobalExceptionHandler {
         }
     }
 
+
+    /**
+     * 默认异常信息
+     * @param ex Exception
+     * @return ResponseEntity<JSONObject>
+     */
+    @ResponseBody
+    @ExceptionHandler(Throwable.class)
+    public CommonResult defaultExceptionMapper(Throwable ex) {
+
+        Throwable throwable = getThrowable(ex);
+        log.error("defaultExceptionMapper ", throwable);
+
+        // dingTalk机器人通知
+        sendDingTalkRobotNotify(throwable);
+
+        return  CommonResult.failed("系统异常");
+    }
+
+
     /**
      * 请求日志
      * @param request HttpServletRequest