package com.cpp.web.utils;

import java.math.BigDecimal;

/**
 * 信息拼装工具类
 *
 * @Author: tl
 * @Date: 2023/8/1 15:30
 */
public class MessageUtils {


  public static String normal(String methodName) {
    return methodName + "【结果正常】";

  }

  public static String abnormal(String methodName) {
    return methodName + "×结果异常×";
  }

  public static String insufficient(String methodName) {
    return methodName + "【所需数据不足，暂不进行此项校验】";
  }

  public static String success(String methodName, BigDecimal value) {
    return methodName + "【尝试修复成功，结果为: {" + value + "}】";
  }

  public static String fail(String methodName) {
    return methodName + "×尝试修复失败×";
  }





  public static String format(String message, Object... args) {
    for (Object arg : args) {
      message = message.replaceFirst("\\{\\}", arg.toString());
    }
    return message;
  }

}
