package com.example.springboot.controller; import java.util.HashMap; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import com.example.springboot.mapper.StorageRackMapper; import com.example.springboot.service.StorageRackService; import com.example.springboot.common.Result; import com.example.springboot.entity.StorageRack; import org.springframework.web.bind.annotation.*; @RestController @RequestMapping("/storageRack") public class StorageRackController { @Autowired StorageRackMapper storageRackMapper; @Autowired StorageRackService storageRackService; @GetMapping("/load") public Result selectAll(){ List storageRacklist=storageRackMapper.selectAll(); Map map = new HashMap<>(); map.put("list",storageRacklist); return Result.success(map); } @GetMapping("/loads") public Result selectRack(){ List storageRacklist1=storageRackMapper.selectRack1(); List storageRacklist2=storageRackMapper.selectRack2(); List storageRacklist3=storageRackMapper.selectRack3(); List storageRacklist4=storageRackMapper.selectRack4(); Map map = new HashMap<>(); map.put("list1",storageRacklist1); map.put("list2",storageRacklist2); map.put("list3",storageRacklist3); map.put("list4",storageRacklist4); return Result.success(map); } }