business

package module
v0.0.0-...-7db1362 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2016 License: MIT Imports: 20 Imported by: 0

README

business

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPayUrl

func GetPayUrl(id, name string, price float64, notify string) (string, error)

func NewDecoder

func NewDecoder() *schema.Decoder

func VerifyPaySign

func VerifyPaySign(query url.Values) bool

Types

type NotifyQuery

type NotifyQuery struct {
	Out_trade_no bson.ObjectId `schema:"out_trade_no"`
	Trade_status string        `schema:"trade_status"`
}

type Order

type Order struct {
	Id      bson.ObjectId `json:"id" bson:"_id,omitempty" schema:"-"`
	Buyer   bson.ObjectId `json:"buyer" bson:",omitempty" schema:"-"`
	State   string        `json:"state" bson:",omitempty" schema:"-"`
	Date    time.Time     `json:"date" schema:"-"`
	Price   float64       `json:"price" schema:"-"`
	Shop    bson.ObjectId `json:"shop" bson:",omitempty"`
	Contact struct {
		Name  string `json:"name"`
		Phone string `json:"phone"`
		Addr  string `json:"addr"`
	} `json:"contact"`
	Express struct {
		Code string `json:"code"`
		Id   string `json:"id"`
	} `json:"express"`
	Items []struct {
		Id       bson.ObjectId `json:"id"`
		Spec     string        `json:"spec"`
		Quantity int           `json:"quantity"`
		Name     string        `json:"name"`
		Price    float64       `json:"price"`
	} `json:"items"`
}

type OrderHandler

type OrderHandler struct {
	Sess *mgo.Session
	Db   string
}

func (*OrderHandler) CancleById

func (this *OrderHandler) CancleById(w http.ResponseWriter, r *http.Request)

func (*OrderHandler) ConfirmById

func (this *OrderHandler) ConfirmById(w http.ResponseWriter, r *http.Request)

func (*OrderHandler) DeliverById

func (this *OrderHandler) DeliverById(w http.ResponseWriter, r *http.Request)

func (*OrderHandler) Get

func (this *OrderHandler) Get(w http.ResponseWriter, r *http.Request)

func (*OrderHandler) GetById

func (this *OrderHandler) GetById(w http.ResponseWriter, r *http.Request)

func (*OrderHandler) Post

func (this *OrderHandler) Post(w http.ResponseWriter, r *http.Request)

type OrderQuery

type OrderQuery struct {
	Skip   int
	Limit  int
	Sort   string
	Target string
}

type Orders

type Orders struct {
	Total int     `json:"total"`
	Data  []Order `json:"data"`
}

type PayHandler

type PayHandler struct {
	Sess *mgo.Session
	Db   string
}

func (*PayHandler) Notify

func (this *PayHandler) Notify(w http.ResponseWriter, r *http.Request)

func (*PayHandler) RedirectById

func (this *PayHandler) RedirectById(w http.ResponseWriter, r *http.Request)

type Product

type Product struct {
	Id        bson.ObjectId `json:"id" bson:"_id,omitempty" schema:"-"`
	Shop      bson.ObjectId `json:"shop" bson:",omitempty" schema:"-"`
	Date      time.Time     `json:"date" bson:",omitempty" schema:"-"`
	Name      string        `json:"name" validate:"min=1,max=40"`
	Images    []string      `json:"images"`
	Price     float64       `json:"price"`
	Inventory int           `json:"inventory"`
	Active    bool          `json:"active"`
	Info      string        `json:"info,omitempty"`
	Props     []struct {
		Name  string `json:"name"`
		Value string `json:"value"`
	} `json:"props,omitempty"`
	Spec []struct {
		Name  string   `json:"name"`
		Value []string `json:"value"`
	} `json:"spec,omitempty"`
}

type ProductHandler

type ProductHandler struct {
	Sess *mgo.Session
	Db   string
}

func (*ProductHandler) DelById

func (this *ProductHandler) DelById(w http.ResponseWriter, r *http.Request)

func (*ProductHandler) Get

func (this *ProductHandler) Get(w http.ResponseWriter, r *http.Request)

func (*ProductHandler) GetById

func (this *ProductHandler) GetById(w http.ResponseWriter, r *http.Request)

func (*ProductHandler) Post

func (this *ProductHandler) Post(w http.ResponseWriter, r *http.Request)

func (*ProductHandler) PutById

func (this *ProductHandler) PutById(w http.ResponseWriter, r *http.Request)

type ProductQuery

type ProductQuery struct {
	Skip   int               `bson:"-"`
	Limit  int               `bson:"-"`
	Sort   string            `bson:"-"`
	Word   string            `bson:"-"`
	Shop   string            `bson:"-"`
	Active bool              `bson:",omitempty"`
	ShopId bson.ObjectId     `bson:"shop,omitempty" schema:"-"`
	Name   map[string]string `bson:",omitempty" schema:"-"`
}

type Products

type Products struct {
	Total int       `json:"total"`
	Data  []Product `json:"data"`
}

type Shop

type Shop struct {
	Id     bson.ObjectId `json:"id" bson:"_id,omitempty" schema:"-"`
	Owner  bson.ObjectId `json:"owner" bson:",omitempty" schema:"-"`
	Date   time.Time     `json:"date" bson:",omitempty" schema:"-"`
	Name   string        `json:"name" validate:"min=3,max=40"`
	Active bool          `json:"active"`
	Info   string        `json:"info,omitempty"`
}

type ShopHandler

type ShopHandler struct {
	Sess *mgo.Session
	Db   string
}

func (*ShopHandler) Get

func (this *ShopHandler) Get(w http.ResponseWriter, r *http.Request)

func (*ShopHandler) GetById

func (this *ShopHandler) GetById(w http.ResponseWriter, r *http.Request)

func (*ShopHandler) GetMyShop

func (this *ShopHandler) GetMyShop(w http.ResponseWriter, r *http.Request)

func (*ShopHandler) Post

func (this *ShopHandler) Post(w http.ResponseWriter, r *http.Request)

func (*ShopHandler) PutMyShop

func (this *ShopHandler) PutMyShop(w http.ResponseWriter, r *http.Request)

type ShopQuery

type ShopQuery struct {
	Skip   int    `bson:"-"`
	Limit  int    `bson:"-"`
	Sort   string `bson:"-"`
	Active bool   `bson:",omitempty"`
}

type Shops

type Shops struct {
	Total int    `json:"total"`
	Data  []Shop `json:"data"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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