//package com.fdage.controller;
//
//import com.fdage.aop.WebControllerLog;
//import com.fdage.enums.ResponEnum;
//import com.fdage.pojo.TbEquipment;
//import com.fdage.pojo.TbUser;
//import com.fdage.request.RequestEquipment;
//import com.fdage.request.RequestUser;
//import com.fdage.respon.ResponEquipment;
//import com.fdage.service.IEquipmentService;
//import com.fdage.util.AjaxJson;
//import com.fdage.util.PasswordUtils;
//import com.github.pagehelper.PageInfo;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiImplicitParam;
//import io.swagger.annotations.ApiImplicitParams;
//import io.swagger.annotations.ApiOperation;
//import lombok.extern.slf4j.Slf4j;
//import org.apache.commons.lang3.StringUtils;
//import org.springframework.beans.BeanUtils;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Controller;
//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.ResponseBody;
//
//import java.util.List;
//
///**
// * Created by Hb_zzZ on 2019/9/11.
// */
//@Controller
//@RequestMapping("/zhoushan/equipment")
//@Slf4j
//@Api(tags = "设备管理模块")
//public class EquipmentController {
//
//    @Autowired
//    private IEquipmentService service;
//
//    @PostMapping("addEquipment")
//    @ResponseBody
//    @WebControllerLog(description = "设备管理-新增设备")
//    @ApiOperation("新增设备")
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "name", value = "设备名称", dataType = "String"),
//            @ApiImplicitParam(name = "uuid", value = "设备id", dataType = "String"),
//            @ApiImplicitParam(name = "positionId", value = "位置id", dataType = "String"),
//            @ApiImplicitParam(name = "state", value = "状态,0：启用，1：禁用", dataType = "String")})
//    public AjaxJson addEquipment(@RequestBody RequestEquipment bo){
//        if(bo == null || StringUtils.isEmpty(bo.getName()) || bo.getPositionId() == null ||
//                StringUtils.isEmpty(bo.getUuid()) || bo.getState() == null){
//            return AjaxJson.failure(ResponEnum.NOT_NULL.getCode(), ResponEnum.NOT_NULL.getMessage());
//        }
//        TbEquipment equipment = new TbEquipment();
//        BeanUtils.copyProperties(bo, equipment);
//        service.insert(equipment);
//        return AjaxJson.success();
//    }
//
//    @PostMapping("updateEquipment")
//    @ResponseBody
//    @WebControllerLog(description = "设备管理-修改设备")
//    @ApiOperation("修改设备")
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "id", value = "文物id", dataType = "String"),
//            @ApiImplicitParam(name = "name", value = "设备名称", dataType = "String"),
//            @ApiImplicitParam(name = "uuid", value = "设备id", dataType = "String"),
//            @ApiImplicitParam(name = "positionId", value = "位置id", dataType = "String"),
//            @ApiImplicitParam(name = "state", value = "状态,0：启用，1：禁用", dataType = "String")})
//    public AjaxJson updateEquipment(@RequestBody RequestEquipment bo){
//        if(bo == null || StringUtils.isEmpty(bo.getName()) || bo.getPositionId() == null ||
//                StringUtils.isEmpty(bo.getUuid()) || bo.getState() == null || bo.getId() == null){
//            return AjaxJson.failure(ResponEnum.NOT_NULL.getCode(), ResponEnum.NOT_NULL.getMessage());
//        }
//        TbEquipment equipment = new TbEquipment();
//        BeanUtils.copyProperties(bo, equipment);
//        service.update(equipment);
//        return AjaxJson.success();
//    }
//
//    @PostMapping("updateState")
//    @ResponseBody
//    @WebControllerLog(description = "设备管理-设备启用/停用")
//    @ApiOperation("设备启用/停用")
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "id", value = "文物id", dataType = "String"),
//            @ApiImplicitParam(name = "state", value = "状态,0：启用，1：禁用", dataType = "String")})
//    public AjaxJson updateState(@RequestBody RequestEquipment bo){
//        if(bo == null || bo.getState() == null || bo.getId() == null){
//            return AjaxJson.failure(ResponEnum.NOT_NULL.getCode(), ResponEnum.NOT_NULL.getMessage());
//        }
//        TbEquipment equipment = new TbEquipment();
//        BeanUtils.copyProperties(bo, equipment);
//        service.update(equipment);
//        return AjaxJson.success();
//    }
//
//    @PostMapping("list")
//    @ResponseBody
//    @WebControllerLog(description = "设备管理-获取设备列表")
//    @ApiOperation("获取设备列表")
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "pageNum", value = "页码", dataType = "String"),
//            @ApiImplicitParam(name = "pageSize", value = "每页数量", dataType = "String")})
//    public AjaxJson list(@RequestBody RequestEquipment bo){
//        List<ResponEquipment> list = service.findList(bo);
//        PageInfo<ResponEquipment> pageInfo = new PageInfo<>(list);
//        return AjaxJson.success(pageInfo);
//    }
//}
