Commit b7c6e199 by 春觉晓

添加示例

1 parent 919ec091
package cn.com.glsx.dj.strategy.controller;
import cn.com.glsx.dj.strategy.model.StrategyInfo;
import cn.com.glsx.dj.strategy.remote.StrategyInfoRemote;
import cn.com.glsx.dj.strategy.uitl.CommonUtil;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse;
import com.rop.AbstractRopRequest;
......@@ -13,6 +15,8 @@ import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
@Slf4j
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES)
@Api("策略中心-策略信息")
......@@ -22,11 +26,16 @@ public class StrategyInfoController {
private StrategyInfoRemote strategyInfoRemote;
@ApiOperation("创建策略")
@ServiceMethod(method = "dj.api.strategy.info.create")
public RopResponse<Boolean> create(AbstractRopRequest request) {
public RopResponse<List<StrategyInfo>> create(AbstractRopRequest request) {
String accountName = CommonUtil.getAccountName();
try {
log.info("=====创建策略 accountName:{}", accountName);
return RopResponse.success(true);
RpcResponse<List<StrategyInfo>> response = strategyInfoRemote.getStrategyInfoById(1);
if (response.hasError()) {
log.error("=====查询策略失败 error:{}", response.getError());
return RopResponse.error(response.getError(), response.getMessage());
}
return RopResponse.success(response.getResult());
} catch (RpcServiceException e) {
log.error("=====AI助理-账号管理-新建账号 rpcServiceException:{}", e.getMessage());
return RopResponse.error(e);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!