| | |
| | | package com.zy.common.config; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | |
| | | |
| | | public void beforeBodyWriteCallApiLogSave(String name, String url, String appkey, String ip, String request, String response, boolean success) { |
| | | ApiLogService apiLogService = SpringUtils.getBean(ApiLogService.class); |
| | | String memo = response; |
| | | try{ |
| | | JSONObject reqJson = JSONObject.parseObject(request); |
| | | memo = reqJson.getString("staNo"); // 提取 staNo |
| | | } catch (Exception e){ |
| | | |
| | | } |
| | | ApiLog apiLog = apiLogService.selectOne(new EntityWrapper<ApiLog>() |
| | | .eq("namespace", name) |
| | | .eq("response", response) |
| | | .eq("memo", memo) |
| | | .eq("result", success? 1:0) |
| | | .orderBy("create_time", false) |
| | | ); |
| | |
| | | ip, |
| | | request, |
| | | response, |
| | | success |
| | | success, |
| | | memo |
| | | ); |
| | | } |
| | | |