ChannelCodeBillController.java
5.95 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
package cn.com.glsx.entmicro.controller;
import cn.com.glsx.entmicro.request.code.*;
import cn.com.glsx.entmicro.response.code.DetailChannelCodeBillResponse;
import cn.com.glsx.entmicro.response.code.GetSubCodeChannelCodeBillResponse;
import cn.com.glsx.entmicro.response.code.ListChannelCodeBillListResponse;
import cn.com.glsx.entmicro.service.ChannelCodeBillService;
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:28
*/
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES)
@Api("海报活码服务")
@Slf4j
public class ChannelCodeBillController {
@Autowired
private ChannelCodeBillService channelCodeBillService;
/**
* 保存海报活码
*
* @param saveChannelCodeBillRequest
* @return
*/
@ServiceMethod(method = "entmicro.api.code.saveChannelCodeBill", needInSession = NeedInSessionType.YES)
@ApiOperation("保存海报活码")
public RopResponse<Boolean> saveChannelCodeBill(SaveChannelCodeBillRequest saveChannelCodeBillRequest) {
try {
channelCodeBillService.saveChannelCodeBill(saveChannelCodeBillRequest);
return RopResponse.success(true);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__saveChannelCodeBill__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 删除海报活码
*
* @param deleteChannelCodeBillRequest
* @return
*/
@ServiceMethod(method = "entmicro.api.code.deleteChannelCodeBill", needInSession = NeedInSessionType.YES)
@ApiOperation("删除海报活码")
public RopResponse<Boolean> deleteChannelCodeBill(DeleteChannelCodeBillRequest deleteChannelCodeBillRequest) {
try {
channelCodeBillService.deleteChannelCodeBill(deleteChannelCodeBillRequest);
return RopResponse.success(true);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__deleteChannelCodeBill__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 当前活码的海报活码列表
*
* @param listChannelCodeBillRequest
* @return
*/
@ServiceMethod(method = "entmicro.api.code.getSubCodeChannelCodeBill", needInSession = NeedInSessionType.YES)
@ApiOperation("当前活码的海报活码列表")
public RopResponse<GetSubCodeChannelCodeBillResponse> getSubCodeChannelCodeBill(ListChannelCodeBillRequest listChannelCodeBillRequest) {
try {
GetSubCodeChannelCodeBillResponse subCodeChannelCodeBill = channelCodeBillService.getSubCodeChannelCodeBill(listChannelCodeBillRequest);
return RopResponse.success(subCodeChannelCodeBill);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__getSubCodeChannelCodeBill__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 编辑海报活码
* @param updateChannelCodeBillRequest
* @return
*/
@ServiceMethod(method = "entmicro.api.code.updateChannelCodeBill", needInSession = NeedInSessionType.YES)
@ApiOperation("编辑海报活码")
public RopResponse<Boolean> updateChannelCodeBill(UpdateChannelCodeBillRequest updateChannelCodeBillRequest) {
try {
channelCodeBillService.updateChannelCodeBill(updateChannelCodeBillRequest);
return RopResponse.success(true);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__updateChannelCodeBill__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* id获取海报活码详情
*
* @param detailChannelCodeBillRequest
* @return
*/
@ServiceMethod(method = "entmicro.api.code.getChannelCodeBill", needInSession = NeedInSessionType.YES)
@ApiOperation("id获取海报活码详情")
public RopResponse<DetailChannelCodeBillResponse> getChannelCodeBill(DetailChannelCodeBillRequest detailChannelCodeBillRequest) {
try {
DetailChannelCodeBillResponse responses = channelCodeBillService.getChannelCodeBill(detailChannelCodeBillRequest);
return RopResponse.success(responses);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__getChannelCodeBill__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
/**
* 获取所有海报列表
*
* @param listChannelCodeBillRequest
* @return
*/
@ServiceMethod(method = "entmicro.api.code.listChannelCodeBill", needInSession = NeedInSessionType.YES)
@ApiOperation("获取所有海报列表")
public RopResponse<Pagination<ListChannelCodeBillListResponse>> listChannelCodeBill(ListChannelCodeBillByPageRequest listChannelCodeBillRequest) {
try {
Pagination<ListChannelCodeBillListResponse> listChannelCodeBillListResponses = channelCodeBillService.listChannelCodeBill(listChannelCodeBillRequest);
return RopResponse.success(listChannelCodeBillListResponses);
} catch (RpcServiceException e) {
log.info("=======ChannelCodeController__invoke__listChannelCodeBill__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
}