| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- /*
- * @Author: deng.yinping deng.yinping@muchinfo.cn
- * @Date: 2024-02-22 11:11:03
- * @LastEditors: deng.yinping deng.yinping@muchinfo.cn
- * @LastEditTime: 2024-05-10 16:41:13
- * @FilePath: \MTP20_IF\controllers\sbyj\goods.go
- * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
- */
- package sbyj
- import (
- "mtp2_if/global/app"
- "mtp2_if/global/e"
- "mtp2_if/logger"
- "mtp2_if/models"
- "net/http"
- "github.com/gin-gonic/gin"
- )
- // GetTouristGoods 获取水贝亿爵游客商品列表
- // @Summary 获取水贝亿爵游客商品列表
- // @Produce json
- // @Success 200 {array} models.TouristGoods
- // @Failure 500 {object} app.Response
- // @Router /sbyj/GetTouristGoods [get]
- // @Tags 水贝亿爵
- func GetTouristGoods(c *gin.Context) {
- appG := app.Gin{C: c}
- // 获取数据
- goodses, err := models.GetTouristGoods([]int{52, 97, 99})
- if err != nil {
- // 查询失败
- logger.GetLogger().Errorf("GetTouristGoods failed: %s", err.Error())
- appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
- return
- }
- // 查询成功返回
- appG.Response(http.StatusOK, e.SUCCESS, goodses)
- }
- type GetMyOrdersReq struct {
- GoodsId int `form:"goodsId"` // 商品ID
- UserId int `form:"userId" binding:"required"` // 用户ID
- }
|