
package org.nl.acs.udw.rest;


import cn.dev33.satoken.annotation.SaIgnore;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.udw.service.UdwManageService;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequiredArgsConstructor
@Api(tags = "内存点位管理")
@RequestMapping("/api/udw")
@Slf4j
public class UdwManagerController {

    private final UdwManageService udwManageService;

//    @GetMapping
//    @Log("查询内存点位")
//    @ApiOperation("查询内存点位")
//    @SaIgnore
//    public ResponseEntity<Object> query(@RequestParam JSONObject whereJson) {
//        return new ResponseEntity<>(udwManageService.queryByConditions(whereJson), HttpStatus.OK);
//    }

    @GetMapping
    @ApiOperation("查询内存点位")
    @SaIgnore
    //@PreAuthorize("@el.check('device:list')")
    public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page) {
        return new ResponseEntity<>(udwManageService.queryAll(whereJson, page), HttpStatus.OK);
    }
}
