mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-20 00:06:53 +08:00
szx-1194 获取用户信息用http添加日志
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package com.xboe.module.course.api;
|
package com.xboe.module.course.api;
|
||||||
|
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@@ -8,6 +9,9 @@ import javax.annotation.Resource;
|
|||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.xboe.module.course.dao.ThreadLogDao;
|
||||||
|
|
||||||
import com.boe.feign.api.infrastructure.entity.CommonSearchVo;
|
import com.boe.feign.api.infrastructure.entity.CommonSearchVo;
|
||||||
import com.boe.feign.api.infrastructure.entity.Dict;
|
import com.boe.feign.api.infrastructure.entity.Dict;
|
||||||
import com.xboe.api.ThirdApi;
|
import com.xboe.api.ThirdApi;
|
||||||
@@ -95,6 +99,9 @@ public class CourseManageApi extends ApiBaseController{
|
|||||||
@Resource
|
@Resource
|
||||||
private ThirdApi thirdApi;
|
private ThirdApi thirdApi;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ThreadLogDao threadLogDao;
|
||||||
|
|
||||||
// @PostMapping("/test")
|
// @PostMapping("/test")
|
||||||
// public JsonResponse<PageList<Course>> findTest(Pagination pager,CourseQueryDto dto){
|
// public JsonResponse<PageList<Course>> findTest(Pagination pager,CourseQueryDto dto){
|
||||||
// //dto.setOrgAid("7003708665807110150");
|
// //dto.setOrgAid("7003708665807110150");
|
||||||
@@ -630,8 +637,13 @@ public class CourseManageApi extends ApiBaseController{
|
|||||||
if (CollectionUtils.isEmpty(userBasicInfoVoList)) {
|
if (CollectionUtils.isEmpty(userBasicInfoVoList)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
log.info("审批获取邮箱 userBasicInfoVoList.get(0).getEmail():{}", userBasicInfoVoList.get(0).getEmail());
|
String email = userBasicInfoVoList.get(0).getEmail();
|
||||||
return userBasicInfoVoList.get(0).getEmail();
|
log.info("审批获取邮箱 userBasicInfoVoList.get(0).getEmail():{}", email);
|
||||||
|
|
||||||
|
// 记录日志到boe_thread_log表
|
||||||
|
saveEmailLog(email);
|
||||||
|
|
||||||
|
return email;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("获取用户邮箱错误",e);
|
log.error("获取用户邮箱错误",e);
|
||||||
}
|
}
|
||||||
@@ -1264,4 +1276,40 @@ public class CourseManageApi extends ApiBaseController{
|
|||||||
courseService.saveTip(aid);
|
courseService.saveTip(aid);
|
||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存邮箱日志到boe_thread_log表
|
||||||
|
* @param email 获取到的邮箱地址
|
||||||
|
*/
|
||||||
|
private void saveEmailLog(String email) {
|
||||||
|
try {
|
||||||
|
JSONObject extraData = new JSONObject();
|
||||||
|
extraData.put("email", email);
|
||||||
|
|
||||||
|
LocalDateTime now = LocalDateTime.now();
|
||||||
|
String threadName = "email";
|
||||||
|
|
||||||
|
String sql = "INSERT INTO boe_thread_log (system_name,module_name,action_name,level,content,thread_name,extra_data,remark,create_time,create_id,create_name,update_time,update_id,update_name) "
|
||||||
|
+ "VALUES (?1,?2,?3,?4,?5,?6,?7,?8,?9,?10,?11,?12,?13,?14)";
|
||||||
|
|
||||||
|
threadLogDao.sqlUpdate(sql,
|
||||||
|
"课程审批",
|
||||||
|
"课程审批邮箱",
|
||||||
|
"记录获取的邮箱",
|
||||||
|
"info",
|
||||||
|
null,
|
||||||
|
threadName,
|
||||||
|
extraData.toJSONString(),
|
||||||
|
null,
|
||||||
|
now,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
now,
|
||||||
|
null,
|
||||||
|
null);
|
||||||
|
log.info("课程审批邮箱日志插入成功, email={}", email);
|
||||||
|
} catch (Exception ex) {
|
||||||
|
log.error("保存课程审批邮箱日志失败 email={}", email, ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user