You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.7 KiB
46 lines
1.7 KiB
4 years ago
|
package com.epmet.controller;
|
||
|
|
||
|
import com.epmet.commons.tools.security.user.LoginUserUtil;
|
||
|
import com.epmet.commons.tools.utils.Result;
|
||
|
import com.epmet.commons.tools.validator.ValidatorUtils;
|
||
|
import com.epmet.dto.form.LogOperationListFormDTO;
|
||
|
import com.epmet.dto.region.LogOperationResultDTO;
|
||
|
import com.epmet.service.LogOperationService;
|
||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||
|
import org.springframework.util.CollectionUtils;
|
||
|
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 java.util.ArrayList;
|
||
|
import java.util.List;
|
||
|
|
||
|
@RequestMapping("log/operation")
|
||
|
@RestController
|
||
|
public class LogOperationController {
|
||
|
|
||
|
@Autowired
|
||
|
private LogOperationService logOperationService;
|
||
|
|
||
|
@Autowired
|
||
|
private LoginUserUtil loginUserUtil;
|
||
|
|
||
|
@PostMapping("/list")
|
||
|
public Result<List<LogOperationResultDTO>> listLogOperations(@RequestBody LogOperationListFormDTO input) {
|
||
|
ValidatorUtils.validateEntity(input);
|
||
|
String operatorMobile = input.getOperatorMobile();
|
||
|
String operatorName = input.getOperatorName();
|
||
|
Integer pageNo = input.getPageNo();
|
||
|
Integer pageSize = input.getPageSize();
|
||
|
|
||
|
String customerId = loginUserUtil.getLoginUserCustomerId();
|
||
|
List<LogOperationResultDTO> resultList = logOperationService.listOperationLogs(operatorName, operatorMobile, customerId, pageNo, pageSize);
|
||
|
if (CollectionUtils.isEmpty(resultList)) {
|
||
|
resultList = new ArrayList<>();
|
||
|
}
|
||
|
return new Result<List<LogOperationResultDTO>>().ok(resultList);
|
||
|
}
|
||
|
|
||
|
}
|