Prechádzať zdrojové kódy

移动端错误日志记录

zouxuan 1 rok pred
rodič
commit
f459ce7e82

+ 8 - 0
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/ExceptionLogController.java

@@ -1,9 +1,11 @@
 package com.yonge.cooleshow.admin.controller;
 
+import com.dayaedu.cbs.common.enums.EAppKey;
 import com.dayaedu.cbs.openfeign.client.SysExceptionLogFeignClientService;
 import com.dayaedu.cbs.openfeign.wrapper.courseware.SysExceptionLogVo;
 import com.yonge.cooleshow.common.controller.BaseController;
 import com.yonge.cooleshow.common.entity.HttpResponseResult;
+import org.apache.commons.collections.CollectionUtils;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RestController;
@@ -19,6 +21,12 @@ public class ExceptionLogController extends BaseController {
 
 	@PostMapping("sysExceptionLog/save")
 	public HttpResponseResult save(@RequestBody List<SysExceptionLogVo.SysExceptionLog> sysExceptionLogVos) {
+		if(CollectionUtils.isEmpty(sysExceptionLogVos)){
+			return succeed();
+		}
+		sysExceptionLogVos.forEach(sysExceptionLogVo -> {
+			sysExceptionLogVo.setAppKey(EAppKey.KLX);
+		});
 		sysExceptionLogFeignClientService.add(sysExceptionLogVos).feignData();
 		return succeed();
 	}