StrategyInfoController.java
1.58 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
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.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse;
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;
@Slf4j
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES)
@Api("策略中心-策略信息")
public class StrategyInfoController {
@Autowired
private StrategyInfoRemote strategyInfoRemote;
@ApiOperation("创建策略")
@ServiceMethod(method = "dj.api.strategy.info.create")
public RopResponse<Boolean> create(AbstractRopRequest request) {
String accountName = CommonUtil.getAccountName();
try {
log.info("=====创建策略 accountName:{}", accountName);
return RopResponse.success(true);
} catch (RpcServiceException e) {
log.error("=====AI助理-账号管理-新建账号 rpcServiceException:{}", e.getMessage());
return RopResponse.error(e);
} catch (Exception e) {
log.error("=====AI助理-账号管理-新建账号 exception:{}", e.getMessage(), e);
return RopResponse.error("查询AI助理-账号管理-新建账号 失败");
}
}
}