MerchantCommonController.java
1.86 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
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.DefaultRequest;
import cn.com.glsx.merchants.request.accounttype.AccountTypeSearchRequest;
import cn.com.glsx.merchants.response.AccountTypeResponse;
import cn.com.glsx.merchants.response.CarbrandResponse;
import cn.com.glsx.merchants.service.MerchantCommonService;
import com.rop.AbstractRopRequest;
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 zhouhaibao
* @version 1.0
* @description: 商户公共服务
* @date 2021/8/1 10:16
*/
@Slf4j
@Api("商户公共服务")
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.NO)
public class MerchantCommonController {
@Autowired
private MerchantCommonService merchantCommonService;
/**
* 获取车辆品牌树
*
* @param defaultRequest
* @return
*/
@ServiceMethod(method = "cn.com.glsx.merchants.merchantCommon.getCarbrandTree", needInSession = NeedInSessionType.NO)
@ApiOperation("获取车辆品牌树")
public RopResponse<List<CarbrandResponse>> getCarbrandTree(DefaultRequest defaultRequest) {
try {
return RopResponse.success(merchantCommonService.getCarbrandTree());
} catch (RpcServiceException e) {
log.info("=======MerchantCommonController__invoke__getCarbrandTree__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(),e.getMessage());
}
}
}