Blame view

Lib/LeYouTu/tools.go 534 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/aarongao/tools"
	"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")
	}

a4680f1e   aarongao   .
18
	if ScenicId == "" || ScenicId == "undefined" {
56a66138   aarongao   ..
19
20
21
22
		c.JSON(200, tools.ResponseError{
			1,
			"缺少ScenicId(景区id)",
		})