ChannelCodeController.java
9.06 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
package cn.com.glsx.entmicro.controller;
import cn.com.glsx.entmicro.request.code.*;
import cn.com.glsx.entmicro.response.code.*;
import cn.com.glsx.entmicro.service.ChannelCodeService;
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;
import java.util.List;
/**
* @author Lichongyuan
* @Description: 渠道活码
* @date 2021/11/14 10:27
*/
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES)
@Api("渠道活码服务")
@Slf4j
public class ChannelCodeController {
@Autowired
private ChannelCodeService channelCodeService;
/**
* 新增渠道活码
*
* @param saveChannelCodeRequest
* @return
*/
@ServiceMethod(method = "entmicro.api.code.saveChannelCode", needInSession = NeedInSessionType.YES)
@ApiOperation("新增渠道活码")
public RopResponse<Boolean> saveChannelCode(SaveChannelCodeRequest saveChannelCodeRequest) {
try {
channelCodeService.saveChannelCode(saveChannelCodeRequest);
return RopResponse.success(true);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__saveChannelCode__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 编辑渠道活码
*
* @param updateChannelCodeRequest
* @return
*/
@ServiceMethod(method = "entmicro.api.code.updateChannelCode", needInSession = NeedInSessionType.YES)
@ApiOperation("编辑渠道活码")
public RopResponse<Boolean> updateChannelCode(UpdateChannelCodeRequest updateChannelCodeRequest) {
try {
channelCodeService.updateChannelCode(updateChannelCodeRequest);
return RopResponse.success(true);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__updateChannelCode__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 删除渠道活码
*
* @param deleteChannelCodeRequest
* @return
*/
@ServiceMethod(method = "entmicro.api.code.deleteChannelCode", needInSession = NeedInSessionType.YES)
@ApiOperation("删除渠道活码")
public RopResponse<Boolean> deleteChannelCode(DeleteChannelCodeRequest deleteChannelCodeRequest) {
try {
channelCodeService.deleteChannelCode(deleteChannelCodeRequest);
return RopResponse.success(true);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__deleteChannelCode__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 渠道活码分页列表
*
* @param searchChannelCodeRequest
* @return
*/
@ServiceMethod(method = "entmicro.api.code.listChannelCodeByPage", needInSession = NeedInSessionType.YES)
@ApiOperation("渠道活码分页列表")
public RopResponse<Pagination<ListChannelCodeByPageResponse>> listChannelCodeByPage(SearchChannelCodeRequest searchChannelCodeRequest) {
try {
Pagination<ListChannelCodeByPageResponse> codeByPage = channelCodeService.listChannelCodeByPage(searchChannelCodeRequest);
return RopResponse.success(codeByPage);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__listChannelCodeByPage__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 获取活码详情
*
* @param detailChanelCodeRequest
* @return
*/
@ServiceMethod(method = "entmicro.api.code.detailChannelCode", needInSession = NeedInSessionType.YES)
@ApiOperation("获取活码详情")
public RopResponse<DetailChannelCodeResponse> detailChannelCode(DetailChanelCodeRequest detailChanelCodeRequest) {
try {
DetailChannelCodeResponse detailChannelCodeResponse = channelCodeService.detailChannelCode(detailChanelCodeRequest);
return RopResponse.success(detailChannelCodeResponse);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__detailChannelCode__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 当前活码员工列表
*
* @param getChannelCodeStaffListRequest
* @return
*/
@ServiceMethod(method = "entmicro.api.code.getChannelCodeStaffList", needInSession = NeedInSessionType.YES)
@ApiOperation("当前活码员工列表")
public RopResponse<Pagination<GetChannelCodeStaffListResponse>> getChannelCodeStaffList(GetChannelCodeStaffListRequest getChannelCodeStaffListRequest) {
try {
Pagination<GetChannelCodeStaffListResponse> channelStaffList = channelCodeService.getChannelStaffList(getChannelCodeStaffListRequest);
return RopResponse.success(channelStaffList);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__getChannelCodeStaffList__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 渠道活码列表 企微端
*
* @param searchEntmicroChannelCodeRequest
* @return
*/
@ServiceMethod(method = "entmicro.api.code.listEntmicroChannelCodeList", needInSession = NeedInSessionType.YES)
@ApiOperation("渠道活码列表 企微端")
public RopResponse<List<ListEntmicroChannelCodeRopResponse>> listEntmicroChannelCodeList(SearchEntmicroChannelCodeRequest searchEntmicroChannelCodeRequest) {
try {
List<ListEntmicroChannelCodeRopResponse> responses = channelCodeService.listEntmicroChannelCodeList(searchEntmicroChannelCodeRequest);
return RopResponse.success(responses);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__listEntmicroChannelCodeList__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 无忧服务渠道活码分页列表
*
* @param searchChannelCodeRequest
* @return
*/
@ServiceMethod(method = "entmicro.api.code.getFreeChannelCode", needInSession = NeedInSessionType.YES)
@ApiOperation("无忧服务渠道活码分页列表")
public RopResponse<Pagination<ListChannelCodeByPageResponse>> getFreeChannelCode(SearchChannelCodeRequest searchChannelCodeRequest) {
try {
Pagination<ListChannelCodeByPageResponse> codeByPage = channelCodeService.getFreeChannelCode(searchChannelCodeRequest);
return RopResponse.success(codeByPage);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__getFreeChannelCode__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 渠道我的活码列表 企微端
*
* @param searchEntmicroChannelCodeRequest
* @return
*/
@ServiceMethod(method = "entmicro.api.code.listStaffEntmicroChannelCodeList", needInSession = NeedInSessionType.YES)
@ApiOperation("渠道我的活码列表 企微端")
public RopResponse<List<ListEntmicroChannelCodeRopResponse>> listStaffEntmicroChannelCodeList(SearchEntmicroChannelCodeRequest searchEntmicroChannelCodeRequest) {
try {
List<ListEntmicroChannelCodeRopResponse> responses = channelCodeService.listStaffEntmicroChannelCodeList(searchEntmicroChannelCodeRequest);
return RopResponse.success(responses);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__listStaffEntmicroChannelCodeList__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 获取当前门店已配置了活码的员工(仅服务商账号)
* @param request
* @return
*/
@ServiceMethod(method = "entmicro.api.code.getCodeStaffList", needInSession = NeedInSessionType.YES)
@ApiOperation("获取当前门店已配置了活码的员工(仅服务商账号)")
public RopResponse<List<DracChannelCodeStaffRopResponse>> getCodeStaffList(DracChannelCodeStaffRopRequest request) {
try {
List<DracChannelCodeStaffRopResponse> codeStaffList = channelCodeService.getCodeStaffList(request);
return RopResponse.success(codeStaffList);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__getCodeStaffList__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
}