|
|
@@ -11,15 +11,15 @@ import (
|
|
|
"github.com/gin-gonic/gin"
|
|
|
)
|
|
|
|
|
|
-// QueryTopGoodsesReq 查询热门商品列表请求参数
|
|
|
-type QueryTopGoodsesReq struct {
|
|
|
+// QueryHsbyTopGoodsesReq 查询热门商品列表请求参数
|
|
|
+type QueryHsbyTopGoodsesReq struct {
|
|
|
app.PageInfo
|
|
|
MarketIDs string `form:"marketIDs" binding:"required"`
|
|
|
DescProvinceID int `form:"descProvinceID"`
|
|
|
DescCityID int `form:"descCityID"`
|
|
|
}
|
|
|
|
|
|
-// QueryTopGoods 查询热卖商品列表(二级市场挂牌点选)
|
|
|
+// QueryHsbyTopGoodses 查询热卖商品列表(二级市场挂牌点选)
|
|
|
// @Summary 查询热卖商品列表(二级市场挂牌点选)
|
|
|
// @Description 说明:查询结果已按Hotindex(景点热度)从大到小排序
|
|
|
// @Produce json
|
|
|
@@ -31,15 +31,15 @@ type QueryTopGoodsesReq struct {
|
|
|
// @Param DescCityID query int false "目的地(市)ID"
|
|
|
// @Success 200 {object} models.HsbyTopGoods
|
|
|
// @Failure 500 {object} app.Response
|
|
|
-// @Router /HSBY/QueryTopGoods [get]
|
|
|
+// @Router /HSBY/QueryHsbyTopGoodses [get]
|
|
|
// @Tags 定制【海商报业】
|
|
|
-func QueryTopGoods(c *gin.Context) {
|
|
|
+func QueryHsbyTopGoodses(c *gin.Context) {
|
|
|
appG := app.Gin{C: c}
|
|
|
|
|
|
// 获取请求参数
|
|
|
- var req QueryTopGoodsesReq
|
|
|
+ var req QueryHsbyTopGoodsesReq
|
|
|
if err := appG.C.ShouldBindQuery(&req); err != nil {
|
|
|
- logger.GetLogger().Errorf("QueryTopGoods failed: %s", err.Error())
|
|
|
+ logger.GetLogger().Errorf("QueryHsbyTopGoodses failed: %s", err.Error())
|
|
|
appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
|
|
|
return
|
|
|
}
|
|
|
@@ -48,7 +48,7 @@ func QueryTopGoods(c *gin.Context) {
|
|
|
topGoodses, err := models.GetHsbyTopGoodses(req.MarketIDs, req.DescProvinceID, req.DescCityID)
|
|
|
if err != nil {
|
|
|
// 查询失败
|
|
|
- logger.GetLogger().Errorf("QueryTopGoods failed: %s", err.Error())
|
|
|
+ logger.GetLogger().Errorf("QueryHsbyTopGoodses failed: %s", err.Error())
|
|
|
appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
|
|
|
return
|
|
|
}
|
|
|
@@ -82,10 +82,10 @@ func QueryTopGoods(c *gin.Context) {
|
|
|
|
|
|
// 查询成功返回
|
|
|
if req.PageSize > 0 {
|
|
|
- logger.GetLogger().Debugln("QueryTopGoods successed: %v", topGoodses)
|
|
|
+ logger.GetLogger().Debugln("QueryHsbyTopGoodses successed: %v", topGoodses)
|
|
|
appG.ResponseByPage(http.StatusOK, e.SUCCESS, topGoodses, app.PageInfo{Page: req.Page, PageSize: req.PageSize, Total: total})
|
|
|
} else {
|
|
|
- logger.GetLogger().Debugln("QueryTopGoods successed: %v", topGoodses)
|
|
|
+ logger.GetLogger().Debugln("QueryHsbyTopGoodses successed: %v", topGoodses)
|
|
|
appG.Response(http.StatusOK, e.SUCCESS, topGoodses)
|
|
|
}
|
|
|
}
|