AiznImageIncantationServiceImpl.java 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //package com.backendsys.service.Ai.Aizn;
  2. //
  3. //import cn.hutool.core.convert.Convert;
  4. //import com.backendsys.entity.Ai.Aizn.AiznImageIncantationDTO;
  5. //import com.backendsys.mapper.Ai.Aizn.AiznImageIncantationMapper;
  6. //import org.springframework.beans.factory.annotation.Autowired;
  7. //import org.springframework.stereotype.Service;
  8. //
  9. //import java.util.*;
  10. //
  11. //@Service
  12. //public class AiznImageIncantationServiceImpl implements AiznImageIncantationService {
  13. //
  14. // @Autowired
  15. // private AiznImageIncantationMapper aiznImageIncantationMapper;
  16. //
  17. // @Override
  18. // public List<Map<String, Object>> getImageIncantationList(AiznImageIncantationDTO aiznImageIncantationDTO) {
  19. //
  20. // List<Map<String, Object>> resp = aiznImageIncantationMapper.queryAiznImageIncantation(aiznImageIncantationDTO);
  21. //
  22. // Map<Integer, Map<String, Object>> groupedData = new LinkedHashMap<>();
  23. //
  24. // for (Map<String, Object> item : resp) {
  25. // int categoryId = Convert.toInt(item.get("category_id"));
  26. // String categoryName = Convert.toStr(item.get("category_name"));
  27. // String name = Convert.toStr(item.get("name"));
  28. //
  29. // if (!groupedData.containsKey(categoryId)) {
  30. // Map<String, Object> categoryData = new LinkedHashMap<>();
  31. // categoryData.put("category_id", categoryId);
  32. // categoryData.put("category_name", categoryName);
  33. // categoryData.put("list", new ArrayList<>());
  34. // groupedData.put(categoryId, categoryData);
  35. // }
  36. //
  37. // List<Map<String, Object>> list = (List<Map<String, Object>>) groupedData.get(categoryId).get("list");
  38. // Map<String, Object> data = new LinkedHashMap<>();
  39. // data.put("name", name);
  40. // list.add(data);
  41. // }
  42. //
  43. // // 打印转换后的数据
  44. // List<Map<String, Object>> result = new ArrayList<>(groupedData.values());
  45. //
  46. // return result;
  47. // }
  48. //
  49. //
  50. // @Override
  51. // public List<Map<String, Object>> getImageIncantationDescriptionList() {
  52. // return aiznImageIncantationMapper.queryAiznImageIncantationDescription();
  53. // }
  54. //
  55. //}