class OperationService {

    @Resource
    private EntityManager entityManager;

    @Resource
    private EruptSecurityProp eruptSecurityProp;

    @Resource
    private HttpServletRequest request;

    @Resource
    private EruptContextService eruptContextService;

    @Transactional
    public void record(Object handler, Exception ex) {<FILL_FUNCTION_BODY>}

    private String findRequestParamVal(HttpServletRequest request) {
        if (request.getParameterMap().size() > 0) {
            StringBuilder sb = new StringBuilder();
            request.getParameterMap().forEach((key, value) -> sb.append(key).append("=").append(Arrays.toString(value)).append("\n"));
            return sb.toString();
        }
        return null;
    }

}

        if (eruptSecurityProp.isRecordOperateLog()) {
            if (handler instanceof HandlerMethod) {
                HandlerMethod handlerMethod = (HandlerMethod) handler;
                Optional.ofNullable(handlerMethod.getMethodAnnotation(EruptRecordOperate.class)).ifPresent(eruptRecordOperate -> {
                    EruptOperateLog operate = new EruptOperateLog();
                    if (eruptRecordOperate.dynamicConfig().isInterface()) {
                        operate.setApiName(eruptRecordOperate.value());
                    } else {
                        String eruptName = request.getHeader(EruptReqHeaderConst.ERUPT_HEADER_KEY);
                        eruptName = Optional.ofNullable(eruptName).orElse(request.getParameter(EruptReqHeaderConst.URL_ERUPT_PARAM_KEY));
                        EruptRecordOperate.DynamicConfig dynamicConfig = EruptSpringUtil.getBean(eruptRecordOperate.dynamicConfig());
                        if (!dynamicConfig.canRecord(eruptName, handlerMethod.getMethod())) return;
                        operate.setApiName(dynamicConfig.naming(eruptRecordOperate.value(),
                                Optional.ofNullable(eruptContextService.getCurrentEruptMenu()).orElse(new EruptMenu()).getName(),
                                eruptName, handlerMethod.getMethod()));
                    }
                    operate.setIp(IpUtil.getIpAddr(request));
                    operate.setRegion(IpUtil.getCityInfo(operate.getIp()));
                    operate.setStatus(true);
                    operate.setReqMethod(request.getMethod());
                    operate.setReqAddr(request.getRequestURL().toString());
                    operate.setOperateUser(MetaContext.getUser().getName());
                    operate.setCreateTime(new Date());
                    operate.setTotalTime(operate.getCreateTime().getTime() - RequestBodyTL.get().getDate());
                    Optional.ofNullable(ex).ifPresent(e -> {
                        String errorInfo = ExceptionUtils.getStackTrace(e);
                        operate.setErrorInfo(errorInfo.length() > 4000 ? errorInfo.substring(0, 4000) : errorInfo);
                        operate.setStatus(false);
                    });
                    Object param = RequestBodyTL.get().getBody();
                    operate.setReqParam(null == param ? findRequestParamVal(request) : param.toString());
                    RequestBodyTL.remove();
                    entityManager.persist(operate);
                });
            }
        }
    
<no_super_class>