diff --git a/src/main/java/com/example/lcf/LcfMappingRules.java b/src/main/java/com/example/lcf/LcfMappingRules.java new file mode 100644 index 0000000..fca8f56 --- /dev/null +++ b/src/main/java/com/example/lcf/LcfMappingRules.java @@ -0,0 +1,40 @@ +package com.example.lcf; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.transaction.annotation.Transactional; + +public class LcfMappingRules { + private static final Logger logger = LoggerFactory.getLogger(LcfMappingRules.class); + + public void lcfTry(Runnable action) { + try { + action.run(); + } catch (Exception e) { + lcfSetErr(e); + } + } + + public void lcfSetErr(Exception e) { + logger.error("Error occurred: ", e); + // 추가적인 에러 처리 로직 + } + + public void lcfLog(String message) { + logger.info(message); + } + + @Transactional + public void batchCommit(Runnable batchAction) { + try { + batchAction.run(); + } catch (Exception e) { + // 롤백 처리 + throw e; + } + } + + public double performDecimalOperation(double a, double b) { + return a + b; // 예시로 덧셈을 수행 + } +}