Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

黄成意 / go_sku_server

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Settings
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Find file
BlameHistoryPermalink
Switch branch/tag
  • go_sku_server
  • pkg
  • common
  • request.go
  • huangchengyi's avatar
    1.0 · 59acfdf8
    huangchengyi committed 4 years ago
    59acfdf8
request.go 666 Bytes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
package common

import (
	"github.com/gin-gonic/gin"
	"strings"
)

type RecommendRequest struct {
	GoodsName    string `form:"goods_name"`
	Attrs        string `form:"attrs"`
	Encap        string `form:"encap"`
	Num          int    `form:"num"`
	DeliveryType int    `form:"delivery_type"`
	Flag         int    `form:"flag"`
	BrandName    string `form:"brand_name"`
}

//获取所有请求参数放到字典里面
func GetAllRequestParams(c *gin.Context) (request map[string]string){
	request = make(map[string]string)
	c.MultipartForm()
	for name, value := range c.Request.Form {
		if value[0] != "" {
			request[name] = strings.TrimSpace(value[0])
		}
	}
	return
}