gomeican

package module
v0.0.0-...-47a72c3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 22, 2021 License: MIT Imports: 9 Imported by: 1

README

gomeican

meican sdk by Go.

使用说明

    // token 获取的方式参见下面
    meian := NewMeican(token)

    // 获取今天可以预定的餐
    orders, err := meican.GetTodayOrderList(context.Background())

    // 或者
    // 获取指定日期的可预定的餐
    d := time.Date(2021, time.Month(5), 25, 0, 0, 0, 0, time.Local)
    orders, err := meican.GetOrderList(context.Background(), d)

token的获取方式

  1. 使用Chrome浏览器打开meican.com,登录。

  2. 右键 - 检查 dev-tool

  3. 点击任意一个,获取请求头部的Cookie信息。 cookie 只需要其中remember对应的值。

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DinnerOrder

type DinnerOrder struct {
	TimeInfo            *calendarItem
	RestaurantFoodInfos []RestaurantFood
}

DinnerOrder 餐的订单信息,包含时间点和多家可选餐厅信息

type FoodInfo

type FoodInfo struct {
	Name string
}

type Meican

type Meican struct {
	// contains filtered or unexported fields
}

func NewMeican

func NewMeican(token string) *Meican

func (*Meican) GetOrderList

func (meican *Meican) GetOrderList(ctx context.Context, d time.Time) ([]DinnerOrder, error)

GetOrderList 获取指定日期的可预定列表。

func (*Meican) GetTodayOrderList

func (meican *Meican) GetTodayOrderList(ctx context.Context) ([]DinnerOrder, error)

GetTodayList 获取今天的可预定列表。 返回值列表表示:午餐、晚餐

type Restaurant

type Restaurant struct {
	Name string `json:"name"`
	ID   string `json:"uniqueId"`
	Tel  string `json:"tel"`

	DishLimit          int `json:"dishLimit"`
	AvailableDishCount int `json:"availableDishCount"`
}

type RestaurantFood

type RestaurantFood struct {
	RestaurantInfo *Restaurant
	FoodList       []FoodInfo
}

RestaurantFood 一家餐厅的餐的信息

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL