trade_analysis.go 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package trade_analysis
  2. import (
  3. "github.com/gin-gonic/gin"
  4. "hongze/hongze_yb/controller/response"
  5. model "hongze/hongze_yb/models/tables/trade_analysis"
  6. "hongze/hongze_yb/services/trade_analysis"
  7. )
  8. // GetClassifyName 获取交易所合约列表
  9. func GetClassifyName(c *gin.Context) {
  10. //userinfo := userService.GetInfoByClaims(c)
  11. list, err, errMsg := trade_analysis.GetClassifyName()
  12. if err !=nil {
  13. response.FailMsg(errMsg, err.Error(), c)
  14. return
  15. }
  16. response.OkData("获取成功", list, c)
  17. }
  18. // GetPositionTop 获取合约榜单详情
  19. func GetPositionTop(c *gin.Context) {
  20. var req model.GetPositionTopReq
  21. if err := c.Bind(&req); err != nil {
  22. response.Fail("参数有误", c)
  23. return
  24. }
  25. if req.ClassifyName == "" {
  26. response.Fail("请输入分类名称", c)
  27. return
  28. }
  29. if req.ClassifyType == "" {
  30. response.Fail("请输入合约名称", c)
  31. return
  32. }
  33. //userinfo := userService.GetInfoByClaims(c)
  34. list, err, errMsg := trade_analysis.GetPositionTopDetail(req)
  35. if err !=nil {
  36. response.FailMsg(errMsg, err.Error(), c)
  37. return
  38. }
  39. response.OkData("获取成功", list, c)
  40. }