12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- package index_data
- import (
- "eta/eta_bridge/controller/resp"
- indexDataService "eta/eta_bridge/services/index_data"
- "github.com/gin-gonic/gin"
- )
- // PCSGIndexController 中石油新加坡指标
- type PCSGIndexController struct{}
- // GetBloombergDailyIndex
- // @Description 获取日度指标
- // @Success 200 {string} string "获取成功"
- // @Router /bloomberg/daily_index [post]
- func (this *PCSGIndexController) GetBloombergDailyIndex(c *gin.Context) {
- data, e := indexDataService.GetPCSGBloombergDailyIndex()
- if e != nil {
- resp.FailMsg("获取失败", "获取中石油新加坡日度指标失败, err: "+e.Error(), c)
- return
- }
- resp.OkData("获取成功", data, c)
- }
- // GetBloombergWeeklyIndex
- // @Description 获取周度指标
- // @Success 200 {string} string "获取成功"
- // @Router /bloomberg/weekly_index [post]
- func (this *PCSGIndexController) GetBloombergWeeklyIndex(c *gin.Context) {
- data, e := indexDataService.GetPCSGBloombergWeeklyIndex()
- if e != nil {
- resp.FailMsg("获取失败", "获取中石油新加坡周度指标失败, err: "+e.Error(), c)
- return
- }
- resp.OkData("获取成功", data, c)
- }
- // GetBloombergMonthlyIndex
- // @Description 获取月度指标
- // @Success 200 {string} string "获取成功"
- // @Router /bloomberg/monthly_index [post]
- func (this *PCSGIndexController) GetBloombergMonthlyIndex(c *gin.Context) {
- data, e := indexDataService.GetPCSGBloombergMonthlyIndex()
- if e != nil {
- resp.FailMsg("获取失败", "获取中石油新加坡月度指标失败, err: "+e.Error(), c)
- return
- }
- resp.OkData("获取成功", data, c)
- }
|