Commit 6e59e325 by zhouhb

[+商户接口添加

1 parent a3aef103
...@@ -8,6 +8,7 @@ import cn.com.glsx.merchants.response.MerchantRopResponse; ...@@ -8,6 +8,7 @@ import cn.com.glsx.merchants.response.MerchantRopResponse;
import cn.com.glsx.merchants.response.MerchantTreeRopResponse; 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.AbstractRopRequest;
import com.rop.annotation.NeedInSessionType; import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod; import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean; import com.rop.annotation.ServiceMethodBean;
...@@ -29,7 +30,7 @@ import java.util.List; ...@@ -29,7 +30,7 @@ import java.util.List;
*/ */
@Slf4j @Slf4j
@Api("商户接口") @Api("商户接口")
@ServiceMethodBean(version = "1.0.0",needInSession = NeedInSessionType.NO) @ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.NO)
public class MerchantController { public class MerchantController {
@Autowired @Autowired
...@@ -100,7 +101,7 @@ public class MerchantController { ...@@ -100,7 +101,7 @@ public class MerchantController {
@ApiOperation("查询商户详情") @ApiOperation("查询商户详情")
public RopResponse<MerchantRopResponse> findMerchantDetail(MerchantDetailRequest merchantDetailRequest) { public RopResponse<MerchantRopResponse> findMerchantDetail(MerchantDetailRequest merchantDetailRequest) {
try { try {
MerchantRopResponse merchantResponse=merchantService.findMerchantDetail(merchantDetailRequest); MerchantRopResponse merchantResponse = merchantService.findMerchantDetail(merchantDetailRequest);
return RopResponse.success(merchantResponse); return RopResponse.success(merchantResponse);
} catch (RpcServiceException e) { } catch (RpcServiceException e) {
log.info("=======MerchantController__invoke__updatePermissions__exception:{}", e.getMessage()); log.info("=======MerchantController__invoke__updatePermissions__exception:{}", e.getMessage());
...@@ -136,7 +137,7 @@ public class MerchantController { ...@@ -136,7 +137,7 @@ public class MerchantController {
@ApiOperation("查询商户树") @ApiOperation("查询商户树")
public RopResponse<List<MerchantTreeRopResponse>> findMerchantTree(MerchantDetailRequest merchantDetailRequest) { public RopResponse<List<MerchantTreeRopResponse>> findMerchantTree(MerchantDetailRequest merchantDetailRequest) {
try { try {
List<MerchantTreeRopResponse> merchantResponse=merchantService.findMerchantTree(merchantDetailRequest); List<MerchantTreeRopResponse> merchantResponse = merchantService.findMerchantTree(merchantDetailRequest);
return RopResponse.success(merchantResponse); return RopResponse.success(merchantResponse);
} catch (RpcServiceException e) { } catch (RpcServiceException e) {
log.info("=======MerchantController__invoke__findMerchantTree__exception:{}", e.getMessage()); log.info("=======MerchantController__invoke__findMerchantTree__exception:{}", e.getMessage());
...@@ -154,7 +155,7 @@ public class MerchantController { ...@@ -154,7 +155,7 @@ public class MerchantController {
@ApiOperation("查询商户的菜单权限") @ApiOperation("查询商户的菜单权限")
public RopResponse<List<AccountTypeTreeRopResponse>> findPermissionsByMerId(MerchantDetailRequest merchantDetailRequest) { public RopResponse<List<AccountTypeTreeRopResponse>> findPermissionsByMerId(MerchantDetailRequest merchantDetailRequest) {
try { try {
List<AccountTypeTreeRopResponse> merchantResponse=merchantService.findPermissionsByMerId(merchantDetailRequest); List<AccountTypeTreeRopResponse> merchantResponse = merchantService.findPermissionsByMerId(merchantDetailRequest);
return RopResponse.success(merchantResponse); return RopResponse.success(merchantResponse);
} catch (RpcServiceException e) { } catch (RpcServiceException e) {
log.info("=======MerchantController__invoke__findMerchantTree__exception:{}", e.getMessage()); log.info("=======MerchantController__invoke__findMerchantTree__exception:{}", e.getMessage());
...@@ -197,4 +198,21 @@ public class MerchantController { ...@@ -197,4 +198,21 @@ public class MerchantController {
return RopResponse.error(e.getErrId(), e.getMessage()); return RopResponse.error(e.getErrId(), e.getMessage());
} }
} }
/**
* 查询所有商户
*
* @return
*/
@ServiceMethod(method = "cn.com.glsx.merchants.menu.findAllMerchant", needInSession = NeedInSessionType.NO)
@ApiOperation("查询所有商户")
public RopResponse<List<MerchantRopResponse>> findAllMerchant(AbstractRopRequest abstractRopRequest) {
try {
List<MerchantRopResponse> list = merchantService.findAllMerchant();
return RopResponse.success(list);
} catch (RpcServiceException e) {
log.info("=======MerchantMenuController__invoke__findAllMerchant__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
}
}
} }
...@@ -173,4 +173,12 @@ public class MerchantService { ...@@ -173,4 +173,12 @@ public class MerchantService {
} }
throw new RpcServiceException(merProductByPageRemote.getException().getErrId(), merProductByPageRemote.getMessage()); throw new RpcServiceException(merProductByPageRemote.getException().getErrId(), merProductByPageRemote.getMessage());
} }
public List<MerchantRopResponse> findAllMerchant() {
RpcResponse<List<MerchantResponse>> allMerchantRemote = merchantRemote.findAllMerchantRemote();
if (allMerchantRemote.isSuccess()) {
return ConvertResponse.convertList(allMerchantRemote.getResult(), MerchantRopResponse.class);
}
throw new RpcServiceException(allMerchantRemote.getException().getErrId(), allMerchantRemote.getMessage());
}
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!