fastjson把map转成json字符串按字母大小排序

86403969 2019-10-23

public static void main(String[] args) {
        HashMap<String, Object> map=new HashMap<String, Object>();
        map.put("sign_status", "UNBIND");
        map.put("sign_type", "RSB");
        map.put("user_id", "2088622919786204");
        map.put("gmt_time", "20191023142225");
        System.out.println(JSON.toJSONString(map,SerializerFeature.MapSortField));
    }

相关推荐