goods.go 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. package guangzuan
  2. import (
  3. "mtp2_if/global/app"
  4. "mtp2_if/global/e"
  5. "mtp2_if/logger"
  6. "mtp2_if/models"
  7. "net/http"
  8. "github.com/gin-gonic/gin"
  9. )
  10. // GetGoods
  11. // @Summary 获取钻石详情
  12. // @Produce json
  13. // @Security ApiKeyAuth
  14. // @Security LoginID
  15. // @Security Group
  16. // @Param goodsno query string true "商品编号"
  17. // @Success 200 {object} models.GZGoods
  18. // @Failure 500 {object} app.Response
  19. // @Router /Guangzuan/GetGoods [get]
  20. // @Tags 广钻
  21. func GetGoods(c *gin.Context) {
  22. a := app.GinUtils{Gin: app.Gin{C: c}}
  23. m := models.GZGoods{}
  24. a.DoBindReq(&m)
  25. a.DoGetDataEx(&m)
  26. }
  27. // GetGZBSCGoods
  28. // @Summary 获取保税商品表
  29. // @Produce json
  30. // @Security ApiKeyAuth
  31. // @Security LoginID
  32. // @Security Group
  33. // @Success 200 {array} models.Gzbscgoods
  34. // @Failure 500 {object} app.Response
  35. // @Router /Guangzuan/GetGZBSCGoods [get]
  36. // @Tags 广钻
  37. func GetGZBSCGoods(c *gin.Context) {
  38. a := app.GinUtils{Gin: app.Gin{C: c}}
  39. m := models.Gzbscgoods{}
  40. if rsp, err := m.GetAll(); err == nil {
  41. a.Gin.Response(http.StatusOK, e.SUCCESS, rsp)
  42. } else {
  43. logger.GetLogger().Errorf("query fail, %v", err)
  44. a.Gin.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
  45. }
  46. }
  47. // GetGZMemberInfo
  48. // @Summary 获取会员风采表
  49. // @Produce json
  50. // @Security ApiKeyAuth
  51. // @Security LoginID
  52. // @Security Group
  53. // @Success 200 {array} models.Gzmemberinfo
  54. // @Failure 500 {object} app.Response
  55. // @Router /Guangzuan/GetGZMemberInfo [get]
  56. // @Tags 广钻
  57. func GetGZMemberInfo(c *gin.Context) {
  58. a := app.GinUtils{Gin: app.Gin{C: c}}
  59. m := models.Gzmemberinfo{}
  60. if rsp, err := m.GetAll(); err == nil {
  61. a.Gin.Response(http.StatusOK, e.SUCCESS, rsp)
  62. } else {
  63. logger.GetLogger().Errorf("query fail, %v", err)
  64. a.Gin.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
  65. }
  66. }