Blame view

Lib/LeYouTu/tools.go 428 Bytes
56a66138   aarongao   ..
1
2
3
package LeYouTu

import (
56a66138   aarongao   ..
4
5
6
7
8
9
10
11
12
13
14
15
16
17
	"github.com/gin-gonic/gin"
	"github.com/pkg/errors"
)

func GetScenicId(c *gin.Context) (ScenicId string, error error) {

	if c.Request.Method == "POST" {
		ScenicId = c.PostForm("ScenicId")
	}
	if c.Request.Method == "GET" {
		ScenicId = c.Query("ScenicId")
	}

	if ScenicId == "" || ScenicId == "undefined" {
a4680f1e   aarongao   .
18
		return "", errors.New("缺少ScenicId(景区id)")
56a66138   aarongao   ..
19
20
21
22
	} else {
		return ScenicId, nil
	}
}