You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
2.3 KiB
Java

11 months ago
package com.nmgs.controller;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nmgs.annotation.OperationLogDesc;
import com.nmgs.config.ResultData;
import com.nmgs.entity.WhiteCarnoList;
import com.nmgs.entity.WhiteCarnoLogTable;
import com.nmgs.service.IWhiteCarnoListSerive;
import com.nmgs.service.IWhiteCarnoLogService;
import com.nmgs.util.PubTools;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
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 javax.servlet.http.HttpServletRequest;
import java.sql.SQLException;
import java.text.SimpleDateFormat;
import java.util.Map;
/**
*
*/
@RestController
@RequestMapping("/whiteCarnoLog")
@Api(tags = "白名单日志管理")
public class WhiteCarnoLogController {
@Autowired
public IWhiteCarnoLogService iWhiteCarnoLogSerive;
/* @Autowired
public void setiWhiteCarnoLogSerive(IWhiteCarnoLogService iWhiteCarnoLogSerive) {
this.iWhiteCarnoLogSerive = iWhiteCarnoLogSerive;
}*/
SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd");
@PostMapping(value="/getListByPage")
@ApiOperation(httpMethod="POST",value="查询分页白名单日志数据")
public Object getListByPage(HttpServletRequest request, @RequestBody(required = false) Map<String, Object> req) throws SQLException {
Page<WhiteCarnoLogTable> whiteCarnoListList =null;
try{
whiteCarnoListList=iWhiteCarnoLogSerive.getWhiteCarnoLogByPage(req);
if (PubTools.isEmpty(whiteCarnoListList)) {
return ResultData.fail(-1,"数据查询失败");
}
}catch (Exception e){
String throwableStr=e.toString();
if(throwableStr.contains(":")){
throwableStr = throwableStr.substring(throwableStr.indexOf(":") + 1);
}
return ResultData.fail(-1,"数据查询失败==>"+throwableStr);
}
return whiteCarnoListList;
}
}