|
|
|
@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.math.RoundingMode;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Random;
|
|
|
|
|
|
|
|
|
@ -54,12 +55,14 @@ public class ProfitManagementController {
|
|
|
|
|
@ApiOperation("退出时机弹窗/随机获取股票价格")
|
|
|
|
|
@AnonymousAccess
|
|
|
|
|
@GetMapping("/getRandomPrice")
|
|
|
|
|
public ResultEntity getRandomPrice(@ApiParam("getLineChart返回的Id") @RequestParam String id) {
|
|
|
|
|
public ResultEntity<BigDecimal> getRandomPrice(@ApiParam("getLineChart返回的Id") @RequestParam String id) {
|
|
|
|
|
Random random = new Random();
|
|
|
|
|
double randomValue = 0.01 + random.nextDouble() * 19.99; // 生成0到20之间的随机数(不包括0)
|
|
|
|
|
return new ResultEntity<>(randomValue);
|
|
|
|
|
BigDecimal bigDecimal = BigDecimal.valueOf(randomValue).setScale(2, RoundingMode.HALF_UP);
|
|
|
|
|
return new ResultEntity<>(bigDecimal);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("退出时机弹窗/判断市值和基金收益对错,计算错误则返回正确答案")
|
|
|
|
|
@AnonymousAccess
|
|
|
|
|
@GetMapping("/getExitTimeRightMarketValueAndFundEarnings")
|
|
|
|
|