Commit 6ba55926 by zhouhb

[+]代码提交

1 parent d5496023
...@@ -5,10 +5,7 @@ import cn.com.glsx.framework.rop.response.RopResponse; ...@@ -5,10 +5,7 @@ import cn.com.glsx.framework.rop.response.RopResponse;
import cn.com.glsx.merchants.request.accounttype.AccountTypeSearchRequest; import cn.com.glsx.merchants.request.accounttype.AccountTypeSearchRequest;
import cn.com.glsx.merchants.request.merchant.*; import cn.com.glsx.merchants.request.merchant.*;
import cn.com.glsx.merchants.request.role.RoleSearchRequest; import cn.com.glsx.merchants.request.role.RoleSearchRequest;
import cn.com.glsx.merchants.response.AccountTypeTreeRopResponse; import cn.com.glsx.merchants.response.*;
import cn.com.glsx.merchants.response.MerchantBaseInfoRopResponse;
import cn.com.glsx.merchants.response.MerchantRopResponse;
import cn.com.glsx.merchants.response.MerchantTreeRopResponse;
import cn.com.glsx.merchants.service.MerchantService; import cn.com.glsx.merchants.service.MerchantService;
import cn.com.glsx.merchants.util.Pagination; import cn.com.glsx.merchants.util.Pagination;
import com.rop.annotation.NeedInSessionType; import com.rop.annotation.NeedInSessionType;
...@@ -261,9 +258,9 @@ public class MerchantController { ...@@ -261,9 +258,9 @@ public class MerchantController {
*/ */
@ServiceMethod(method = "cn.com.glsx.merchants.menu.findAllMerchant", needInSession = NeedInSessionType.NO) @ServiceMethod(method = "cn.com.glsx.merchants.menu.findAllMerchant", needInSession = NeedInSessionType.NO)
@ApiOperation("查询所有商户") @ApiOperation("查询所有商户")
public RopResponse<List<MerchantRopResponse>> findAllMerchant(MerchantFindRequest merchantFindRequest) { public RopResponse<List<MerchantRopListRes>> findAllMerchant(MerchantFindRequest merchantFindRequest) {
try { try {
List<MerchantRopResponse> list = merchantService.findAllMerchant(merchantFindRequest); List<MerchantRopListRes> list = merchantService.findAllMerchant(merchantFindRequest);
return RopResponse.success(list); return RopResponse.success(list);
} catch (RpcServiceException e) { } catch (RpcServiceException e) {
log.info("=======MerchantMenuController__invoke__findAllMerchant__exception:{}", e.getMessage()); log.info("=======MerchantMenuController__invoke__findAllMerchant__exception:{}", e.getMessage());
......
package cn.com.glsx.merchants.response;
import io.swagger.annotations.ApiModelProperty;
/**
* @author zhouhaibao
* @version 1.0
* @description: TODO
* @date 2021/10/12 11:41
*/
public class MerchantRopListRes {
@ApiModelProperty(name = "id", notes = "商户id", dataType = "Integer", required = true, example = "1", value = "商户id")
private Integer id;
/**
* 商户名称
*/
@ApiModelProperty(name = "id", notes = "商户名称", dataType = "String", required = true, example = "1", value = "商户id")
private String merchantName;
}
...@@ -207,10 +207,10 @@ public class MerchantService { ...@@ -207,10 +207,10 @@ public class MerchantService {
* *
* @return * @return
*/ */
public List<MerchantRopResponse> findAllMerchant(MerchantFindRequest merchantFindRequest) { public List<MerchantRopListRes> findAllMerchant(MerchantFindRequest merchantFindRequest) {
RpcResponse<List<MerchantResponse>> allMerchantRemote = merchantRemote.findAllMerchantRemote(ConvertRequest.convertRequest(merchantFindRequest, new MerchantRequest())); RpcResponse<List<MerchantResponse>> allMerchantRemote = merchantRemote.findAllMerchantRemote(ConvertRequest.convertRequest(merchantFindRequest, new MerchantRequest()));
if (allMerchantRemote.isSuccess()) { if (allMerchantRemote.isSuccess()) {
return ConvertResponse.convertList(allMerchantRemote.getResult(), MerchantRopResponse.class); return ConvertResponse.convertList(allMerchantRemote.getResult(), MerchantRopListRes.class);
} }
throw new RpcServiceException(allMerchantRemote.getException().getErrId(), allMerchantRemote.getMessage()); throw new RpcServiceException(allMerchantRemote.getException().getErrId(), allMerchantRemote.getMessage());
} }
......
...@@ -2,7 +2,10 @@ package cn.com.glsx.merchants.controller; ...@@ -2,7 +2,10 @@ package cn.com.glsx.merchants.controller;
import java.util.Base64; import java.util.Base64;
import cn.com.glsx.merchants.model.request.MerchantRequest;
import cn.com.glsx.merchants.remote.MerchantRemote;
import org.junit.Test; import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.ClassPathResource;
import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap; import org.springframework.util.MultiValueMap;
...@@ -19,6 +22,8 @@ import com.rop.request.UploadFile; ...@@ -19,6 +22,8 @@ import com.rop.request.UploadFile;
* @Copyright Copyright (c) 2018 * @Copyright Copyright (c) 2018
*/ */
public class ExampleControllerTest extends BaseControllerTest { public class ExampleControllerTest extends BaseControllerTest {
@Autowired
private MerchantRemote merchantRemote;
@Test @Test
public void testGetExample() throws Exception{ public void testGetExample() throws Exception{
...@@ -72,4 +77,12 @@ public class ExampleControllerTest extends BaseControllerTest { ...@@ -72,4 +77,12 @@ public class ExampleControllerTest extends BaseControllerTest {
fileParams.add("file", "png@" + Base64.getEncoder().encodeToString(uploadFile.getContent())); fileParams.add("file", "png@" + Base64.getEncoder().encodeToString(uploadFile.getContent()));
System.out.println(upload(params, fileParams)); System.out.println(upload(params, fileParams));
} }
@Test
public void test() throws Exception{
MerchantRequest merchantRequest=new MerchantRequest();
merchantRequest.setSource("OP");
System.out.println(merchantRemote.findAllMerchantRemote(merchantRequest));
}
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!