SystemSubscribeController.java
10.9 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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
package cn.com.glsx.entmicro.controller;
import cn.com.glsx.entmicro.model.request.subscription.MerchantIdRpcRequest;
import cn.com.glsx.entmicro.model.request.subscription.SubscribeServiceRpcRequest;
import cn.com.glsx.entmicro.model.response.subscribe.MerchantSubScribeRpcResponse;
import cn.com.glsx.entmicro.model.response.subscribe.SubscribeMerchantResponse;
import cn.com.glsx.entmicro.model.response.subscribe.SubscribeServiceRpcResponse;
import cn.com.glsx.entmicro.request.subscription.*;
import cn.com.glsx.entmicro.response.subscribe.*;
import cn.com.glsx.entmicro.service.subscribe.SystemSubscribeService;
import cn.com.glsx.entmicro.utils.Pagination;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
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 javax.annotation.Resource;
import java.util.List;
/**
* @author chizw
* @version ver.1.0.0
* @Description
* @create 2022/9/19 15:06
*/
@Slf4j
@Api("系统订阅")
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES)
public class SystemSubscribeController {
@Resource
private SystemSubscribeService systemSubscribeService;
@ServiceMethod(method = "entmicro.api.system.subscribe.open")
@ApiOperation("开通订阅")
public RopResponse<Boolean> openSubscribe(OpenSubscribeCreateRopRequest request) {
try {
return RopResponse.success(systemSubscribeService.openSubscribe(request));
} catch (RpcServiceException e) {
log.info("=======SystemSubscribeController_openSubscribe_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.system.subscribe.view")
@ApiOperation("服务订阅分页列表")
public RopResponse<Pagination<SubscriptionViewRopResponse>> subscribeListView(SubscriptionQueryRopRequest request) {
try {
return RopResponse.success(systemSubscribeService.subscribeListView(request));
} catch (RpcServiceException e) {
log.info("=======SystemSubscribeController_subscribeListView_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.system.subscribe.code.generate")
@ApiOperation("生成挪车贴")
public RopResponse<Boolean> generateMoveCode(OpenSubscribeRopRequest request) {
try {
return RopResponse.success(systemSubscribeService.generateMoveCode(request));
} catch (RpcServiceException e) {
log.info("=======SystemSubscribeController_generateMoveCode_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.system.subscribe.activity.correlate")
@ApiOperation("关联活动")
public RopResponse<Boolean> correlateActivity(CorrelateActivityRopRequest request) {
try {
return RopResponse.success(systemSubscribeService.correlateActivity(request));
} catch (RpcServiceException e) {
log.info("=======SystemSubscribeController_correlateActivity_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.system.subscribe.state.update")
@ApiOperation("更改商户开通状态")
public RopResponse<Boolean> updateSubscribeState(CorrelateActivityRopRequest request) {
try {
return RopResponse.success(systemSubscribeService.updateSubscribeState(request));
} catch (RpcServiceException e) {
log.info("=======SystemSubscribeController_updateSubscribeState_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.system.accident.open.verify")
@ApiOperation("验证开通事故车救援")
public RopResponse<Boolean> verifyOpenAccident(OpenSubscribeRopRequest request) {
try {
return RopResponse.success(systemSubscribeService.verifyOpenAccident(request));
} catch (RpcServiceException e) {
log.info("=======SystemSubscribeController_verifyOpenAccident_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.system.subscribe.merchant.page")
@ApiOperation("订阅开通商户分页查询")
public RopResponse<Pagination<SubscribeMerchantResponse>> findSubscribeMerchantList(SubscribeMerchantRopRequest request) {
try {
return RopResponse.success(systemSubscribeService.findSubscribeMerchantList(request));
} catch (RpcServiceException e) {
log.info("=======SystemSubscribeController_findSubscribeMerchantList_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.system.withdrawal.of.points.merchant.page")
@ApiOperation("积分提现白名单开通商户分页查询")
public RopResponse<Pagination<SubscribeMerchantResponse>> withdrawalOfPointsMerchantList(SubscribeMerchantRopRequest request) {
try {
return RopResponse.success(systemSubscribeService.withdrawalOfPointsMerchantList(request));
} catch (RpcServiceException e) {
log.info("=======SystemSubscribeController_withdrawalOfPointsMerchantList_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.system.subscribe.code.view")
@ApiOperation("挪车贴分页查询")
public RopResponse<Pagination<MoveCarCodeViewRopResponse>> moveCarCodeView(MoveCarCodeQueryRopRequest request) {
try {
return RopResponse.success(systemSubscribeService.moveCarCodeView(request));
} catch (RpcServiceException e) {
log.info("=======SystemSubscribeController_moveCarCodeView_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.system.subscribe.rescue.generate")
@ApiOperation("生成救援贴")
public RopResponse<String> generateRescueSticker(MoveCarCodeQueryRopRequest request) {
try {
return RopResponse.success(systemSubscribeService.generateRescueSticker(request));
} catch (RpcServiceException e) {
log.info("=======SystemSubscribeController_generateRescueSticker_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.system.subscribe.findActivityIdList", needInSession = NeedInSessionType.NO)
@ApiOperation("查询已订阅的活动id")
public RopResponse<List<SubscribeActRopResponse>> findActivityIdList(FindActivityIdRopRequest request) {
try {
return RopResponse.success(systemSubscribeService.findActivityIdList(request));
} catch (RpcServiceException e) {
log.info("=======SystemSubscribeController_findActivityIdList_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 根据商户号集合查询福利官详情
*
* @param request
* @return
*/
@ServiceMethod(method = "entmicro.api.system.subscribe.findMerchantWelfareInfo", needInSession = NeedInSessionType.NO)
@ApiOperation("根据商户号集合查询福利官详情")
public RopResponse<List<MerchantWelfareRopResponse>> findMerchantWelfareInfo(FindWelfareRopRequest request) {
try {
return RopResponse.success(systemSubscribeService.findMerchantWelfareInfo(request));
} catch (RpcServiceException e) {
log.info("=======SystemSubscribeController_findMerchantWelfareInfo_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.system.subscribe.getOpenedMerchant", needInSession = NeedInSessionType.NO)
@ApiOperation("查询商户订阅的服务")
public RopResponse<List<MerchantSubServeRopResponse>> getOpenedMerchant(OpenedMerchantRopRequest request) {
try {
return RopResponse.success(systemSubscribeService.getOpenedMerchant(request));
} catch (RpcServiceException e) {
log.info("=======SystemSubscribeController_getOpenedMerchant_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.system.subscribe.updateSubscribe", needInSession = NeedInSessionType.YES)
@ApiOperation("更新商户订阅")
public RopResponse<Boolean> updateSubscribe(UpdateSubScribeRopRequest request) {
try {
return RopResponse.success(systemSubscribeService.updateSubscribe(request));
} catch (RpcServiceException e) {
log.info("=======SystemSubscribeController_updateSubscribe_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.system.subscribe.getMerchantSubscribeDetail", needInSession = NeedInSessionType.NO)
@ApiOperation("查询订阅客户代运营状态")
public RopResponse<MerchantSubScribeRopResponse> getMerchantSubscribeDetail(MerchantIdRopRequest request){
try {
return RopResponse.success(systemSubscribeService.getMerchantSubscribeDetail(request));
} catch (RpcServiceException e) {
log.info("=======SystemSubscribeController_getMerchantSubscribeDetail_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.system.subscribe.openedMerchantPageByType", needInSession = NeedInSessionType.NO)
@ApiOperation("分页查询已开通的商户")
public RopResponse<Pagination<SubscribeServiceRopResponse>> openedMerchantPageByType(SubscribeServiceRopRequest request){
try {
return RopResponse.success(systemSubscribeService.openedMerchantPageByType(request));
} catch (RpcServiceException e) {
log.info("=======SystemSubscribeController_openedMerchantPageByType_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
}