package com.lyms.talkonlineweb.util;
import com.fasterxml.jackson.databind.ObjectMapper;
/**
* Created by Administrator on 2019-09-06.
*/
public class JsonUtil {
/**
* 对象转换为String
* @param cls
* @return
*/
public static String obj2Str(
Object cls) {
try {
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.setDateFormat(DateUtil.getDateFormat(DateUtil.YYYY_MM_DD_HH_MM_SS));
return objectMapper.writeValueAsString(cls);
} catch (Exception e) {
}
return null;
}
}