sba应用管理
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
717 B

  1. package com.bfd.qanda.utils;
  2. import com.alibaba.fastjson.JSONObject;
  3. import com.bfd.qanda.entity.Constants;
  4. /**
  5. * json工具
  6. * @author jian.mao
  7. * @date 2023年7月10日
  8. * @description
  9. */
  10. public class JsonUtil {
  11. /**
  12. * 校验字符串是list/map/str
  13. * @param jsonString
  14. * @return
  15. */
  16. public static String checkJsonType(String jsonString) {
  17. try {
  18. JSONObject.parseObject(jsonString);
  19. return Constants.MAP_TYPE;
  20. } catch (Exception e) {
  21. try {
  22. JSONObject.parseArray(jsonString);
  23. return Constants.LIST_TYPE;
  24. } catch (Exception ex) {
  25. return Constants.STRING_TYPE;
  26. }
  27. }
  28. }
  29. }