package com.alibaba.tboss.util;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.alibaba.fastjson.JSON;
import com.alibaba.tboss.dal.mysql.workOrder.vo.ServerAssetInfo;
public class NotifyUtil {
private static Logger logger = LoggerFactory.getLogger(NotifyUtil.class);
public static String constructMsgInfo(Long orderId, String orderTitle, String rebootType, String emergencyLevel,
String subState, Long effectiveDate,
List serverAssetInfoList, List> bucUser) {
HashMap map = new HashMap();
map.put("orderId", orderId);
map.put("title", orderTitle);
map.put("rebootType", rebootType);
map.put("emergencyLevel", emergencyLevel);
map.put("subState", subState);
map.put("effectiveDate", effectiveDate);
map.put("deviceInfo", serverAssetInfoList);
map.put("operatorList", bucUser);
return JSON.toJSONString(map);
}
}
就是这样用的,自己看。这样就转成了json,可以通过网络传输。