All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.yeecode.objectlogger.server.util.RespUtil Maven / Gradle / Ivy

The newest version!
package com.github.yeecode.objectlogger.server.util;

import com.github.yeecode.objectlogger.server.constant.RespConstant;

import java.util.HashMap;
import java.util.Map;

public class RespUtil {

    private RespUtil() {
    }

    public static Map getSuccessMap() {
        Map returnMap = new HashMap<>();
        returnMap.put(RespConstant.RESP_CODE_KEY, RespConstant.SUCCESS);
        returnMap.put(RespConstant.RESP_MSG_KEY, "SUCCESS");
        return returnMap;
    }

    public static Map getSuccessMap(Object respData) {
        Map returnMap = new HashMap<>();
        returnMap.put(RespConstant.RESP_CODE_KEY, RespConstant.SUCCESS);
        returnMap.put(RespConstant.RESP_MSG_KEY, "SUCCESS");
        returnMap.put(RespConstant.RESP_MSG_DATA, respData);
        return returnMap;
    }

    public static Map getCommonErrorMap(String respMsg) {
        Map returnMap = new HashMap<>();
        returnMap.put(RespConstant.RESP_CODE_KEY, RespConstant.COMMON_ERROR);
        returnMap.put(RespConstant.RESP_MSG_KEY, respMsg);
        return returnMap;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy