models

package
v0.0.0-...-bc307a5 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2013 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Message

model.go

review.go

user

Index

Constants

View Source
const (
	AuthPhone          = AuthType("phone")
	AuthIdCard         = AuthType("id_card")
	AuthDriveLicense   = AuthType("driver_license")
	AuthVehicleLicense = AuthType("vehicle_license")
	AuthOthers         = AuthType("vehicle_license")

	AuthVerified   = AuthStatus("verified")
	AuthVerifying  = AuthStatus("verifying")
	AuthUnverified = AuthStatus("unverified")
	AuthRefused    = AuthStatus("refused")
)

Variables

View Source
var (
	DB       *mgo.Database
	C_User   = "UserInfo"
	C_Review = "Reviews"
)

Functions

This section is empty.

Types

type AuthStatus

type AuthStatus string

type AuthType

type AuthType string

type Message

type Message struct {
	Id           bson.ObjectId `bson:"_id"`
	Receiver     string
	Sender       string
	Message_text string
	Unread       bool
	Post_time    time.Time
}

type Review

type Review struct {
	Id           bson.ObjectId `bson:"_id"`
	Receiver     string
	Sender       string
	Message_text string
	Unread       bool
	Carid        string
	Post_time    time.Time
}

type User

type User struct {
	Id          bson.ObjectId `bson:"_id"`
	Userid      string
	Password    string
	Email       string
	Nickname    string            `json:"nikename"`
	Phone       string            `bson:"phone,omitempty"`
	Profile     string            `bson:",omitempty"`
	Photos      []string          `bson:",omitempty"`
	RegTime     time.Time         `bson:"reg_time"`
	AuthStatus  map[string]string `bson:"auth_status,omitempty"`
	Role        string            `bson:"role,omitempty"`
	Online      bool
	LastAccess  time.Time `bson:"last_access"`
	AccessToken string    `bson:"access_token,omitempty"`
}

func (*User) Exists

func (this *User) Exists() (b bool)

func (*User) Load

func (this *User) Load() (e *errors.Error)

func (*User) LoginCheck

func (this *User) LoginCheck() (e *errors.Error)

func (*User) Save

func (this *User) Save() (e *errors.Error)

func (*User) SetOnline

func (this *User) SetOnline(online bool) (e *errors.Error)

type UserAuth

type UserAuth struct {
	Images []string `bson:"auth_images"`
	Info   string   `bson:"auth_info"`
	Desc   string   `bson:"auth_description"`
	Type   AuthType
	Status AuthStatus
}

Jump to

Keyboard shortcuts

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