| | |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.fasterxml.jackson.databind.SerializationFeature; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | |
| | | * 文件路径: config/gate-config-{md5(apiKey)}.json |
| | | */ |
| | | @Slf4j |
| | | @ConditionalOnProperty(name = "app.gate.enabled", havingValue = "true", matchIfMissing = true) |
| | | @Service |
| | | public class GateConfigPersistenceService { |
| | | |
| | |
| | | .addPositionQuantity(dto.getAddPositionQuantity() > 0 ? dto.getAddPositionQuantity() : 1) |
| | | .maxPositionPerSide(dto.getMaxPositionPerSide()) |
| | | .addPositionStartThreshold(dto.getAddPositionStartThreshold() >= 0 ? dto.getAddPositionStartThreshold() : 1) |
| | | .placeExcessTakeProfit(dto.isPlaceExcessTakeProfit()) |
| | | .build(); |
| | | } |
| | | |