FundPerformanceApi.java 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. package com.smppw.analysis.client;
  2. import com.smppw.analysis.application.dto.performance.*;
  3. import com.smppw.analysis.application.service.performance.FundPerformanceService;
  4. import com.smppw.analysis.domain.dto.performance.WinVO;
  5. import com.smppw.common.pojo.ResultVo;
  6. import org.springframework.web.bind.annotation.GetMapping;
  7. import org.springframework.web.bind.annotation.RequestMapping;
  8. import org.springframework.web.bind.annotation.RestController;
  9. import java.util.Map;
  10. /**
  11. * @author wangzaijun
  12. * @date 2023/8/7 15:52
  13. * @description 业绩表现api
  14. */
  15. @RestController
  16. @RequestMapping("/v1/api/performance")
  17. public class FundPerformanceApi {
  18. private final FundPerformanceService service;
  19. public FundPerformanceApi(FundPerformanceService service) {
  20. this.service = service;
  21. }
  22. @GetMapping("indicator")
  23. public Map<String, Object> indicator(IndicatorReq req) {
  24. return this.service.calcIndicator(req);
  25. }
  26. @GetMapping("trend")
  27. public ResultVo<Map<String, Object>> trend(TrendReq req) {
  28. Map<String, Object> data = this.service.trend(req);
  29. return ResultVo.ok(data);
  30. }
  31. @GetMapping("imf-trend")
  32. public ResultVo<Map<String, Object>> imfTrend(ImfTrendReq req) {
  33. Map<String, Object> data = this.service.imfTrend(req);
  34. return ResultVo.ok(data);
  35. }
  36. @GetMapping("dynamic-down")
  37. public ResultVo<Map<String, Object>> dynamicDown(DrawdownTrendReq req) {
  38. Map<String, Object> data = this.service.dynamicDown(req);
  39. return ResultVo.ok(data);
  40. }
  41. @GetMapping("correlation")
  42. public ResultVo<Map<String, Object>> cor(CorrelationReq req) {
  43. Map<String, Object> data = this.service.cor(req);
  44. return ResultVo.ok(data);
  45. }
  46. @GetMapping("win")
  47. public ResultVo<WinVO> win(WinReq req) {
  48. WinVO data = this.service.win(req);
  49. return ResultVo.ok(data);
  50. }
  51. @GetMapping("revenue")
  52. public ResultVo<Map<String, Object>> revenue(RevenueReq req) {
  53. Map<String, Object> data = this.service.revenue(req);
  54. return ResultVo.ok(data);
  55. }
  56. @GetMapping("interval")
  57. public ResultVo<Map<String, Object>> interval(IntervalReq req) {
  58. Map<String, Object> data = this.service.interval(req);
  59. return ResultVo.ok(data);
  60. }
  61. @GetMapping("rolling")
  62. public ResultVo<Map<String, Object>> rolling(RollingReq req) {
  63. Map<String, Object> data = this.service.rolling(req);
  64. return ResultVo.ok(data);
  65. }
  66. @GetMapping("rank")
  67. public ResultVo<Map<String, Object>> rank(RankReq req) {
  68. Map<String, Object> data = this.service.rank(req);
  69. return ResultVo.ok(data);
  70. }
  71. }