Commit 919ec091 by 春觉晓

添加示例

1 parent 7f895f3a
package cn.com.glsx.dj.strategy.config.dubbo;
import cn.com.glsx.dj.strategy.remote.StrategyInfoRemote;
import cn.com.glsx.scrm.proxy.remote.CommonProxyRemote;
import org.oreframework.boot.autoconfigure.dubbo.reference.ReferenceBuilderFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* @Title: DubboConfig.java
* @Description: Dubbo服务注册配置
* @author zengqi
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2018
*/
@Configuration
public class DubboConfig {
@Autowired
protected ReferenceBuilderFactory factory;
protected final boolean check = false;
protected final int timeout = 30000;
@Bean
public StrategyInfoRemote strategyInfoRemote() {
return factory.builder(StrategyInfoRemote.class).check(check).timeout(timeout).version("1.0.0").build();
}
}
package cn.com.glsx.dj.strategy.controller; package cn.com.glsx.dj.strategy.controller;
import cn.com.glsx.dj.strategy.remote.StrategyInfoRemote;
import cn.com.glsx.dj.strategy.uitl.CommonUtil; import cn.com.glsx.dj.strategy.uitl.CommonUtil;
import cn.com.glsx.framework.core.exception.RpcServiceException; import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse; import cn.com.glsx.framework.rop.response.RopResponse;
...@@ -10,12 +11,15 @@ import com.rop.annotation.ServiceMethodBean; ...@@ -10,12 +11,15 @@ import com.rop.annotation.ServiceMethodBean;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@Slf4j @Slf4j
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES) @ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES)
@Api("策略中心-策略信息") @Api("策略中心-策略信息")
public class StrategyInfoController { public class StrategyInfoController {
@Autowired
private StrategyInfoRemote strategyInfoRemote;
@ApiOperation("创建策略") @ApiOperation("创建策略")
@ServiceMethod(method = "dj.api.strategy.info.create") @ServiceMethod(method = "dj.api.strategy.info.create")
public RopResponse<Boolean> create(AbstractRopRequest request) { public RopResponse<Boolean> create(AbstractRopRequest request) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!