models

package
v0.0.0-...-5cc725f Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2018 License: MIT Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Id           int       `json:"id"`
	Uid          int       `json:"uid"`
	AppId        string    `json:"appId"`
	AppSecret    string    `json:"appSecret"`
	GenerateDate time.Time `json:"generateDate"`
	Status       int       `json:"status"`
}

type Avatar

type Avatar struct {
	Id        int    `json:"id"`
	Uid       int    `json:"uid"`
	AvatarUrl string `json:"avatarUrl"`
	CoverUrl  string `json:"coverUrl"`
}

type Config

type Config struct {
	Id    int    `json:"id"`
	Name  string `json:"name"`
	Value string `json:"value"`
}

type Oauth

type Oauth struct {
	Id       int    `json:"id"`
	Uid      int    `json:"uid"`
	GithubId string `orm:"size(255);null" json:"githubId"`
	Tencent  string `orm:"size(255);null" json:"tencent"`
	Wechat   string `orm:"size(255);null" json:"wechat"`
	Gitee    string `orm:"size(255);null" json:"gitee"`
	Google   string `orm:"size(255);null" json:"google"`
	Facebook string `orm:"size(255);null" json:"facebook"`
	Weibo    string `orm:"size(255);null" json:"weibo"`
	Baidu    string `orm:"size(255);null" json:"baidu"`
}

type Payment

type Payment struct {
	Id           int       `json:"id"`                                /*支付单ID*/
	Pid          string    `json:"pid"`                               /*Pid是唯一的订单支付流水账号,没有使用id存储*/
	Uid          string    `json:"uid"`                               /*创建人的UID*/
	CreateDate   time.Time `json:"createDate"`                        /*创建时间*/
	FinishDate   time.Time `orm:"size(255);null" json:"finishDate"`   /*支付完成时间*/
	Method       string    `json:"method"`                            /*支付渠道 aliapy wexin paypal*/
	Fee          float64   `json:"fee"`                               /*需支付费用*/
	CurrentFee   float64   `orm:"size(255);null" json:"currentfee"`   /*实际支付的费用*/
	TotalFee     float64   `json:"totalFee"`                          /*支付渠道收取的手续费用*/
	Status       string    `json:"status"`                            /*是否已经支付 create finished quit*/
	ContactEmail string    `orm:"size(255);null" json:"ContactEmail"` /*联系邮箱,用户支付后支付渠道回调得来的信息*/
	CallBackData string    `orm:"size(255);null" json:"callBackData"` /*支付渠道回调信息*/
	Action       string    `json:"action"`                            /*increase 充值, custom 消费, other 其他*/
}

func (*Payment) Create

func (m *Payment) Create(uid string, fee float64, totalFee float64, action string, method string) (string, error)

func (*Payment) List

func (m *Payment) List(uid int, pageSize int, pageNumber int) ([]*Payment, int64, error)

func (*Payment) Rand_generator

func (m *Payment) Rand_generator(n int) chan int

func (*Payment) TableName

func (m *Payment) TableName() string

func (*Payment) UpadateToPaid

func (m *Payment) UpadateToPaid(pid string, currentFee float64, contactEmail string) (string, error)

type Posts

type Posts struct {
	Id         int       `json:"id"`
	Uid        int       `json:"uid"`
	CreateDate time.Time `json:"createDate"`
	Title      string    `json:"title"`
	Content    string    `json:"content"`
	Delete     bool      `json:"-"`          /*是否删除*/
	ViewCounts int       `json:"viewCounts"` /*阅读次数*/
	Mention    string    `json:"mention"`    /*提醒谁观看*/
	Group      int       `json:"group"`      /*关联的社群ID,可为空*/
	Public     bool      `json:"public"`     /*是否公开*/
}

type Storage

type Storage struct {
	Id            int       `json:"id"`
	Uid           int       `json:"uid"`
	FileName      string    `json:"fileName"`
	FileType      string    `json:"fileType"`
	FileSize      string    `json:"fileSize"`
	FilePath      string    `json:"filePath"`
	UploadTime    time.Time `json:"registryDate"`
	StorageEngine string    `json:"-"`
}

type Users

type Users struct {
	Id           int       `json:"id"`
	Username     string    `json:"username"`
	Password     string    `json:"-"`
	Salt         string    `json:"-"`
	Truename     string    `json:"truename"`
	Idnumber     string    `json:"-"`
	Verify       int       `json:"verify"`
	Usergroup    int       `json:"userGroup"`
	Registrydate time.Time `json:"registryDate"`
	Phone        string    `json:"phone"`
	Email        string    `json:"email"`
	Credits      int       `json:"credits"`
	Money        float64   `json:"money"`
	Status       int       `json:"status"`
}

func (*Users) CutMoney

func (m *Users) CutMoney(uid int, cutFee float64) error

func (*Users) GetMoney

func (m *Users) GetMoney(uid int) (float64, error)

func (*Users) TableName

func (m *Users) TableName() string

func (*Users) UpdateMoney

func (m *Users) UpdateMoney(uid int, increase float64) error

type Verify

type Verify struct {
	Id         int       `json:"id"`
	Uid        int       `json:"uid"`
	TrueName   string    `json:"trueName"`
	IdNo       string    `json:"idNo"`
	Images     string    `json:"images"`
	CreateTime time.Time `json:"createTime"`
	UpdateTime time.Time `json:"updateTime"`
	Status     string    `json:"status"` /*0审核中,1审核完成,2审核失败*/
}

Jump to

Keyboard shortcuts

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