GoodsRouter.go 418 B

123456789101112131415161718192021222324
  1. package router
  2. import (
  3. domain "demo/data/dao"
  4. "github.com/gin-gonic/gin"
  5. )
  6. func GoodsRouth(engine *gin.RouterGroup) {
  7. user := engine.Group("/goods")
  8. {
  9. user.GET("/all", getAllGoods)
  10. //user.POST("sendSms", SendVerificationCode)
  11. //
  12. //user.GET("/captcha", VerificationCode)
  13. }
  14. }
  15. func getAllGoods(c *gin.Context) {
  16. c.JSON(200, gin.H{
  17. "code": 200,
  18. "msg": "success",
  19. "data": domain.SelectAll(),
  20. })
  21. }