12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- //package com.backendsys.service.Ai.Aizn;
- //
- //import cn.hutool.core.convert.Convert;
- //import com.backendsys.entity.Ai.Aizn.AiznImageIncantationDTO;
- //import com.backendsys.mapper.Ai.Aizn.AiznImageIncantationMapper;
- //import org.springframework.beans.factory.annotation.Autowired;
- //import org.springframework.stereotype.Service;
- //
- //import java.util.*;
- //
- //@Service
- //public class AiznImageIncantationServiceImpl implements AiznImageIncantationService {
- //
- // @Autowired
- // private AiznImageIncantationMapper aiznImageIncantationMapper;
- //
- // @Override
- // public List<Map<String, Object>> getImageIncantationList(AiznImageIncantationDTO aiznImageIncantationDTO) {
- //
- // List<Map<String, Object>> resp = aiznImageIncantationMapper.queryAiznImageIncantation(aiznImageIncantationDTO);
- //
- // Map<Integer, Map<String, Object>> groupedData = new LinkedHashMap<>();
- //
- // for (Map<String, Object> item : resp) {
- // int categoryId = Convert.toInt(item.get("category_id"));
- // String categoryName = Convert.toStr(item.get("category_name"));
- // String name = Convert.toStr(item.get("name"));
- //
- // if (!groupedData.containsKey(categoryId)) {
- // Map<String, Object> categoryData = new LinkedHashMap<>();
- // categoryData.put("category_id", categoryId);
- // categoryData.put("category_name", categoryName);
- // categoryData.put("list", new ArrayList<>());
- // groupedData.put(categoryId, categoryData);
- // }
- //
- // List<Map<String, Object>> list = (List<Map<String, Object>>) groupedData.get(categoryId).get("list");
- // Map<String, Object> data = new LinkedHashMap<>();
- // data.put("name", name);
- // list.add(data);
- // }
- //
- // // 打印转换后的数据
- // List<Map<String, Object>> result = new ArrayList<>(groupedData.values());
- //
- // return result;
- // }
- //
- //
- // @Override
- // public List<Map<String, Object>> getImageIncantationDescriptionList() {
- // return aiznImageIncantationMapper.queryAiznImageIncantationDescription();
- // }
- //
- //}
|