whyclxw
2025-04-21 3a6d4de77253bb86aed3383f9b9c54be5c25752c
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
package com.whyc.controller;
 
import com.whyc.dto.LockHisDto;
import com.whyc.dto.Response;
import com.whyc.pojo.plus_user.UserInf;
import com.whyc.service.LockHisService;
import com.whyc.util.ActionUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.text.ParseException;
 
@RestController
@Api(tags = "锁的历史状态")
@RequestMapping("lockHis")
public class LockHisController {
    @Autowired
    private LockHisService service;
    @ApiOperation("查询锁的历史状态")
    @PostMapping("getLockHis")
    public Response getLockHis(@RequestBody LockHisDto dto) throws ParseException, InterruptedException {
        UserInf uinf= ActionUtil.getUser();
        dto.setUid(uinf.getUid());
        Response res=service.getLockHis(dto);
        return res;
    }
 
 
    @ApiOperation("实时界面点击查看历史信息")
    @GetMapping("getLockHisWithReal")
    public Response getLockHisWithReal(@RequestParam int lockId, @RequestParam String startTime, @RequestParam String endTime) throws ParseException, InterruptedException {
        Response res=service.getLockHisWithReal(lockId,startTime,endTime);
        return res;
    }
}