StrategyInfoController.java 1.58 KB
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助理-账号管理-新建账号 失败");
        }
    }

}