wuyouming666
2024-04-19 4a489b6d2a512169c7422d282ec73b0b01329c44
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package com.mes.downstorage.controller;
 
import com.mes.downstorage.entity.DownStorageCageDetails;
import com.mes.downstorage.service.DownStorageCageDetailsService;
import com.mes.downstorage.service.DownStorageCageService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
import java.util.Map;
@Api(tags = "缓存")
@RestController
@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
}