package com.huatek.busi.controller;

import java.util.Map;

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;

import com.alibaba.dubbo.config.annotation.Reference;
import com.github.pagehelper.PageInfo;
import com.huatek.busi.constant.ApiConstant.Tags;
import com.huatek.busi.dto.OpChangeLogEntityDto;
import com.huatek.busi.service.log.OpChangeLogService;
import com.huatek.busi.vo.OpChangeLogEntityVo;
import com.huatek.torch.frame.tools.ConstantUtil;
import com.huatek.torch.frame.tools.ResultUtil;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * 记录变更操作日志控制器
 * 
 * @author anker_cheng
 * @date 2019/07/11
 */
@Api(tags = {Tags.OP_CHANGE_LOG})
@RestController
@RequestMapping("/api/opChangeLog")
public class OpChangeLogController {

    @Reference(check = false)
    private OpChangeLogService opChangeLogService;

    @ApiOperation(value = "避雷器监测装置sersorid表 分页列表", response = OpChangeLogEntityVo.class)
    @PostMapping(value = "/queryList", produces = {"application/json;charset=utf-8"})
    public Map<String, Object> queryList(@RequestBody OpChangeLogEntityDto opChangeLogEntityDto) {
        PageInfo<OpChangeLogEntityVo> pageData = opChangeLogService.findOpChangeLogPage(opChangeLogEntityDto);
        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, pageData.getTotal(), "", pageData.getList());
    }
}
