models

package
v0.0.0-...-24b9871 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ApplicationStatus = map[string]struct{}{
	"PENDING": {},
	"ACCEPT":  {},
	"REJECT":  {},
}
View Source
var ApplicationType = map[string]struct{}{
	"APPLY":  {},
	"REVIEW": {},
}
View Source
var OpenType = map[string]struct{}{
	"PASS_CODE": {},
	"FRIENDS":   {},
}
View Source
var QuotationType = map[string]struct{}{
	"SELL": {},
	"BUY":  {},
}

Functions

This section is empty.

Types

type Application

type Application struct {
	ID               primitive.ObjectID `json:"id" bson:"_id"`
	Applicant        User               `json:"applicant" bson:"applicant"`
	QuotationId      primitive.ObjectID `json:"quotationId" bson:"quotationId"`
	QuotationType    string             `json:"quotationType" bson:"quotationType"`
	Price            int                `json:"price" bson:"price"`
	ReviewerId       primitive.ObjectID `json:"reviewerId" bson:"reviewerId"`
	ReviewerNickname string             `json:"reviewerNickname" bson:"reviewerNickname"`
	PassCode         string             `json:"passCode" bson:"passCode"`
	SwitchFriendCode string             `json:"switchFriendCode" bson:"switchFriendCode"`
	Status           string             `json:"status" bson:"status"`
	LastModified     time.Time          `json:"lastModified" bson:"lastModified"`
}

type ApplicationParam

type ApplicationParam struct {
	Type             string `json:"type" bson:"type"`
	QuotationId      string `json:"quotationId" bson:"quotationId"`
	Status           string `json:"status" bson:"status"`
	PassCode         string `json:"passCode" bson:"passCode"`
	SwitchFriendCode string `json:"switchFriendCode" bson:"switchFriendCode"`
}

type Credentials

type Credentials struct {
	Username string `form:"username" json:"username" binding:"required"`
	Password string `form:"password" json:"password" binding:"required"`
}

type Quotation

type Quotation struct {
	ID           primitive.ObjectID `json:"id" bson:"_id"`
	Type         string             `json:"type" bson:"type"`
	Price        int                `json:"price" bson:"price"`
	Author       User               `json:"author" bson:"author"`
	ValidCount   int                `json:"validCount" bson:"validCount"`
	InvalidCount int                `json:"invalidCount" bson:"invalidCount"`
	OpenType     string             `json:"openType" bson:"openType"`
	PassCode     string             `json:"passCode,omitempty" bson:"passCode"`
	HandlingFee  string             `json:"handlingFee" bson:"handlingFee"`
	LastModified time.Time          `json:"lastModified" bson:"lastModified"`
}

type QuotationParam

type QuotationParam struct {
	ID           string    `json:"id" bson:"_id"`
	Type         string    `json:"type" bson:"type"`
	Price        *int      `json:"price" bson:"price"`
	IsValid      *bool     `json:"isValid" bson:"isValid"`
	OpenType     string    `json:"openType" bson:"openType"`
	PassCode     string    `json:"passCode" bson:"passCode"`
	HandlingFee  string    `json:"handlingFee" bson:"handlingFee"`
	LastModified time.Time `json:"lastModified" bson:"lastModified"`
}

type SimpleUser

type SimpleUser struct {
	ID             primitive.ObjectID `json:"id" bson:"_id"`
	Username       string             `json:"username,omitempty" bson:"username"`
	Nickname       string             `json:"nickname" bson:"nickname"`
	SwitchNickname string             `json:"switchNickname,omitempty" bson:"switchNickname"`
	JikeID         string             `json:"jikeId,omitempty" bson:"jikeId"`
}

type User

type User struct {
	ID               primitive.ObjectID `json:"id" bson:"_id"`
	Username         string             `json:"username,omitempty" bson:"username"`
	Nickname         string             `json:"nickname" bson:"nickname"`
	Password         string             `json:"password,omitempty" bson:"password"`
	SwitchFriendCode string             `json:"switchFriendCode,omitempty" bson:"switchFriendCode"`
	SwitchNickname   string             `json:"switchNickname,omitempty" bson:"switchNickname"`
	JikeID           string             `json:"jikeId,omitempty" bson:"jikeId"`
}

func (User) Simplify

func (u User) Simplify() SimpleUser

Jump to

Keyboard shortcuts

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