whycrzh
2021-01-28 c8332186836b3dfe1fbd32d7bec7cd29a57e1888
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
package com.fgkj.controller.Ld9;
 
import com.fgkj.dto.LD9_state;
import com.fgkj.dto.ServiceModel;
import com.fgkj.dto.User_inf;
import com.fgkj.services.Ld9.LD9_stateService;
import com.fgkj.util.ActionUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
 
import javax.annotation.Resource;
 
@RequestMapping("ld9State")
@RestController
@Api(tags = "ld9State接口")
public class LD9_stateController{
 
    @Resource
    private LD9_stateService service;
 
    //查询ld9实时数据
    @GetMapping("all")
    @ApiOperation(notes = "",value="查询ld9实时数据")
    public ServiceModel searchAll() {
        ServiceModel model=service.searchAll();
        return model;
    }
    
    //11.1LD9设备通信状态查询
    @PostMapping("byCondition")
    @ApiOperation(notes = "",value="设备通信状态查询")
    public ServiceModel serchByCondition(@RequestBody LD9_state ld9){
        // LD9_state ld9= getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, LD9_state.class);
        User_inf uinf=(User_inf) ActionUtil.getUser();
        ld9.setNum(uinf.getuId());//将用户id存放在LD9_state的num中用于处理用户管理的机房问题
        ServiceModel model = service.serchByCondition(ld9);
        return model;
    }
 
}