OperationController.java
5 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
package cn.com.glsx.entmicro.controller;
import cn.com.glsx.entmicro.request.operation.*;
import cn.com.glsx.entmicro.response.operation.OperationCodeRopResponse;
import cn.com.glsx.entmicro.response.operation.OperationDetailRopResponse;
import cn.com.glsx.entmicro.response.operation.OperationPageRopResponse;
import cn.com.glsx.entmicro.service.operation.OperationService;
import cn.com.glsx.entmicro.utils.Pagination;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse;
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;
/**
* @ClassName OperationController
* @Description 运营专家Controller
* @Author lichongyuan
* @Date 2022/5/9
*/
@Slf4j
@Api("运营专家配置接口")
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.NO)
public class OperationController {
@Autowired
private OperationService operationService;
/**
* 运营专家分页接口
*
* @param request 搜索入参
* @return
*/
@ServiceMethod(method = "entmicro.api.operation.page", needInSession = NeedInSessionType.YES)
@ApiOperation("运营专家分页接口")
public RopResponse<Pagination<OperationPageRopResponse>> getPage(OperationSearchRopRequest request) {
try {
return RopResponse.success(operationService.getPage(request));
} catch (RpcServiceException e) {
log.info("=======OperationController_getMassPage_invoke__getPage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 新增运营配置
*
* @param request 搜索入参
* @return
*/
@ServiceMethod(method = "entmicro.api.operation.save", needInSession = NeedInSessionType.YES)
@ApiOperation("新增运营配置")
public RopResponse<Boolean> save(OperationSaveRopRequest request) {
try {
operationService.save(request);
return RopResponse.success(true);
} catch (RpcServiceException e) {
log.info("=======OperationController_invoke__save__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 修改运营配置(禁用)
*
* @param request 搜索入参
* @return
*/
@ServiceMethod(method = "entmicro.api.operation.update", needInSession = NeedInSessionType.YES)
@ApiOperation("修改运营配置(禁用)")
public RopResponse<Boolean> update(OperationSaveRopRequest request) {
try {
operationService.update(request);
return RopResponse.success(true);
} catch (RpcServiceException e) {
log.info("=======OperationController_invoke__update__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 删除运营配置
*
* @param request 搜索入参
* @return
*/
@ServiceMethod(method = "entmicro.api.operation.delete", needInSession = NeedInSessionType.YES)
@ApiOperation("删除运营配置")
public RopResponse<Boolean> delete(OperationDeleteRopRequest request) {
try {
operationService.delete(request);
return RopResponse.success(true);
} catch (RpcServiceException e) {
log.info("=======OperationController_invoke__delete__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 配置详情
*
* @param request 搜索入参
* @return
*/
@ServiceMethod(method = "entmicro.api.operation.detail", needInSession = NeedInSessionType.YES)
@ApiOperation("配置详情")
public RopResponse<OperationDetailRopResponse> getDetail(OperationDetailRopRequest request) {
try {
return RopResponse.success(operationService.getDetail(request));
} catch (RpcServiceException e) {
log.info("=======OperationController_invoke__delete__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 下单获取二维码
*
* @param request 搜索入参
* @return
*/
@ServiceMethod(method = "entmicro.api.operation.code", needInSession = NeedInSessionType.NO)
@ApiOperation("下单获取二维码")
public RopResponse<OperationCodeRopResponse> getQRCode(OperationDetailRopRequest request) {
try {
return RopResponse.success(operationService.getOperationCode(request));
} catch (RpcServiceException e) {
log.info("=======OperationController_invoke__delete__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
}