| | |
| | | package com.mes.downstorage.controller; |
| | | |
| | | |
| | | import com.mes.downstorage.entity.DownStorageCageDetails; |
| | | import com.mes.downstorage.service.DownStorageCageDetailsService; |
| | | import com.mes.downstorage.service.DownStorageCageService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | | * @since 2024-03-27 |
| | | */ |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | @RequestMapping("/downStorageCageDetails") |
| | | @RequestMapping("/api/unLoadGlass/downstorage") |
| | | public class DownStorageCageDetailsController { |
| | | |
| | | } |
| | | @Autowired |
| | | private DownStorageCageDetailsService downStorageCageDetailsService; |
| | | @Autowired |
| | | private DownStorageCageService downStorageCageService; |
| | | |
| | | @PostMapping("/add") |
| | | public String addDownStorageCageDetails(@RequestBody DownStorageCageDetails details) { |
| | | downStorageCageDetailsService.addDownStorageCageDetails(details); |
| | | return "Details added successfully"; |
| | | } |
| | | |
| | | @GetMapping("/leisure") |
| | | public List<Map> getLeisureData() { |
| | | return downStorageCageService.getCacheInfo(); |
| | | } |
| | | |
| | | |
| | | private static final int START_VALUE = 0; |
| | | private static final int END_VALUE = 5; |
| | | @GetMapping("/leisure2") |
| | | public List<Map> getLeisureData2() { |
| | | // 调用Service层获取数据 |
| | | return downStorageCageService.getCacheOut(START_VALUE, END_VALUE); |
| | | } |
| | | |
| | | |
| | | |
| | | // Other CRUD operations can be defined here |
| | | } |