LogController.java
2.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package cn.com.glsx.merchants.controller;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse;
import cn.com.glsx.merchants.request.log.LogSearchRequest;
import cn.com.glsx.merchants.request.log.MerchantAndStaffLogRopRequest;
import cn.com.glsx.merchants.response.LogResponse;
import cn.com.glsx.merchants.service.MerchantLogService;
import cn.com.glsx.merchants.util.Pagination;
import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
/**
* @author zhouhaibao
* @version 1.0
* @description: 日志服务
* @date 2021/7/16 10:49
*/
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.NO)
@Api("日志服务")
@Slf4j
public class LogController {
@Autowired
private MerchantLogService merchantLogService;
/**
* 查询日志列表
*
* @param logSearchRequest 入参
* @return
*/
@ServiceMethod(method = "merchants.api.menu.findLog", needInSession = NeedInSessionType.NO)
@ApiOperation("查询字典类型")
public RopResponse<Pagination<LogResponse>> findLog(LogSearchRequest logSearchRequest) {
try {
Pagination<LogResponse> list = merchantLogService.findLog(logSearchRequest);
return RopResponse.success(list);
} catch (RpcServiceException e) {
log.info("=======LogController__invoke_findLog__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 查询商户、员工操作日志列表
*
* @param ropRequest 入参
* @return
*/
@ServiceMethod(method = "merchants.api.menu.findMerchantAndStaffLog", needInSession = NeedInSessionType.NO)
@ApiOperation("查询商户、员工操作日志列表")
public RopResponse<Pagination<LogResponse>> findMerchantAndStaffLog(MerchantAndStaffLogRopRequest ropRequest) {
try {
Pagination<LogResponse> list = merchantLogService.findMerchantAndStaffLog(ropRequest);
return RopResponse.success(list);
} catch (RpcServiceException e) {
log.info("=======LogController__invoke_findMerchantAndStaffLog__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
}