| | |
| | | import com.xiaopeng.api.model.operation.XpTradingStrategy; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.web.controller.BaseController; |
| | | import com.xiaopeng.common.log.annotation.AdminOperationLog; |
| | | import com.xiaopeng.common.log.enums.AdminBusinessType; |
| | | import com.xiaopeng.common.log.enums.AdminOperationType; |
| | | import com.xiaopeng.operation.dto.XpTradingStrategyEditDTO; |
| | | import com.xiaopeng.operation.service.IXpTradingStrategyService; |
| | | import com.xiaopeng.api.vo.operation.XpTradingStrategyDetailVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @RestController |
| | | @Api(tags = "交易策略管理") |
| | | @RequiredArgsConstructor |
| | | @RequiredArgsConstructor(onConstructor_ = @Lazy) |
| | | public class XpTradingStrategyController extends BaseController { |
| | | |
| | | private final IXpTradingStrategyService tradingStrategyService; |
| | |
| | | @ApiOperation(value = "获取交易策略配置", tags = {"inner-交易策略配置"}) |
| | | @GetMapping("/logan/inner/xpOperationStrategy/getOne") |
| | | public R<XpTradingStrategyDetailVO> getOne() { |
| | | |
| | | // TODO[流量接入] 这里需要判断是哪个三方车队的,获取到对应的交易策略 |
| | | XpTradingStrategyDetailVO detail = tradingStrategyService.queryDetail(); |
| | | return R.ok(detail); |
| | | } |
| | |
| | | */ |
| | | @ApiOperation(value = "修改交易策略", tags = {"管理后台-交易管理-交易策略配置"}) |
| | | @PostMapping("/api/v1/tradingStrategy/edit") |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.TRADING_STRATEGY_MANAGEMENT, |
| | | operationType = AdminOperationType.EDIT, |
| | | content = "修改交易策略", |
| | | appendRequestData = true |
| | | ) |
| | | public R<?> edit(@Validated @RequestBody XpTradingStrategyEditDTO dto) { |
| | | tradingStrategyService.editStrategy(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "三方车队的交易策略", tags = {"流量接入-信息录入-设置交易策略"}) |
| | | @PostMapping("/api/v1/xp-rt/strategy") |
| | | public R<?> add(@Validated @RequestBody XpTradingStrategy dto) {//创建只接收部分可设置的参数的dto |
| | | |
| | | // 通过key认证是哪个三方车队 |
| | | tradingStrategyService.save(dto); |
| | | return R.ok(); |
| | | } |
| | | |