model

package
v0.0.0-...-a18df83 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// 上下文变量存储键名,前后端系统共享
	ContextKey = "ContextKey"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Class

type Class struct {
	Id       int       `json:"id" xorm:"pk autoincr"`
	Name     string    `json:"name" xorm:"varchar(10) notnull" `
	Status   int       `json:"status" xorm:"tinyint(1) notnull default 0"`
	CreateAt time.Time `json:"create_at" xorm:"created"`
	UpdateAt time.Time `json:"update_at" xorm:"updated"`
}

定义config结构体

type Config

type Config struct {
	Id        int                    `json:"id" xorm:"pk autoincr"`
	DictType  string                 `json:"dict_type" xorm:"varchar(255) notnull" `
	DictKey   string                 `json:"dict_key" xorm:"varchar(255) notnull"`
	DictValue string                 `json:"dict_value" xorm:"varchar(255)"`
	Tag       map[string]interface{} `json:"tag" xorm:"text dafault ''"`
	Sort      int                    `json:"sort"`
	CreateAt  time.Time              `json:"create_at" xorm:"created"`
	UpdateAt  time.Time              `json:"update_at" xorm:"updated"`
}

定义config结构体

type Context

type Context struct {
	Session *ghttp.Session `json:"session"` // 当前Session管理对象
	User    *ContextUser   `json:"user"`    // 上下文用户信息
	Site    *ContextSite   `json:"site"`    // 上下文站点信息
	Data    g.Map          `json:"data"`    // 自定KV变量,业务模块根据需要设置,不固定
}

请求上下文结构

type ContextSite

type ContextSite struct {
	Title        string `json:"title"`         // 站点标题
	SubTitle     string `json:"sub_title"`     // 副标题
	Description  string `json:"description"`   // 描述
	Keyword      string `json:"keyword"`       // 关键词
	Qq           string `json:"qq"`            // 客服qq
	Email        string `json:"email"`         // 联系邮箱
	HeaderCode   string `json:"header_code"`   // 头部代码
	FooterCode   string `json:"footer_code"`   // 底部代码
	BottomScript string `json:"bottom_script"` // 底部js脚本
}

上下文站点信息

type ContextUser

type ContextUser struct {
	User
}

请求上下文中的用户信息

type Files

type Files struct {
	Id          int       `json:"id" xorm:"pk autoincr"`
	Uuid        string    `json:"uuid" xorm:"varchar(255) notnull default ''"`
	UserId      int       `json:"user_id" xorm:"index"`
	Key         string    `json:"key" xorm:"varchar(255) notnull default ''"`
	Name        string    `json:"name" xorm:"varchar(255) notnull default ''"`
	Type        string    `json:"type" xorm:"varchar(255) notnull default ''"`
	Size        string    `json:"size" xorm:"varchar(255) notnull default ''"`
	Url         string    `json:"url" xorm:"varchar(255) notnull default ''"`
	IsStorage   int       `json:"is_storage"`
	StorageType string    `json:"storage_type" xorm:"varchar(255) notnull default ''"`
	StoragePath string    `json:"storage_path" xorm:"varchar(255) notnull default ''"`
	Status      int       `json:"status" xorm:"tinyint(1) notnull default 0"`
	CreateAt    time.Time `json:"create_at" xorm:"created"`
	UpdateAt    time.Time `json:"update_at" xorm:"updated"`
	DeleteAt    time.Time `json:"delete_at" xorm:"deleted"`
}

type Goods

type Goods struct {
	Id          int       `json:"id" xorm:"pk autoincr"`
	ClassId     int       `json:"class_id" xorm:"index"`
	Title       string    `json:"title" xorm:"varchar(255) notnull default ''"`
	Cover       string    `json:"cover" xorm:"varchar(255) notnull default ''"`
	Desc        string    `json:"desc" xorm:"varchar(255) notnull default ''"`
	Price       int       `json:"price"`
	Details     string    `json:"details" xorm:"mediumtext"`
	Type        int       `json:"type" xorm:"tinyint(1) notnull default 0"`
	Status      int       `json:"status" xorm:"tinyint(1) notnull default 0"`
	IsNum       int       `json:"is_num" xorm:"tinyint(1) notnull default 0"`
	Hot         int       `json:"hot"`
	PayResultId int       `json:"pay_result_id" xorm:"index"`
	CreateAt    time.Time `json:"create_at" xorm:"created"`
	UpdateAt    time.Time `json:"update_at" xorm:"updated"`
	DeleteAt    time.Time `json:"delete_at" xorm:"deleted"`
}

type GoodsFilesFlow

type GoodsFilesFlow struct {
	Id            int `json:"id" xorm:"pk autoincr"`
	GoodsId       int `json:"goods_id" xorm:"index"`
	FilesId       int `json:"files_id" xorm:"index"`
	DownloadLimit int `json:"download_limit"`
}

type GoodsPayResult

type GoodsPayResult struct {
	Id       int       `json:"id" xorm:"pk autoincr"`
	Title    string    `json:"title" xorm:"varchar(255) notnull default ''"`
	Name     string    `json:"name" xorm:"varchar(255) notnull default ''"`
	Details  string    `json:"details" xorm:"mediumtext"`
	CreateAt time.Time `json:"create_at" xorm:"created"`
	UpdateAt time.Time `json:"update_at" xorm:"updated"`
}

type GoodsType

type GoodsType int32
const (
	GoodsTypeAll GoodsType = iota
	GoodsTypeCDK
	GoodsTypeFile
)

func (GoodsType) String

func (p GoodsType) String() string

type Help

type Help struct {
	Id       int       `json:"id" xorm:"pk autoincr"`
	Title    string    `json:"title" xorm:"varchar(255) notnull" `
	Text     string    `json:"text" xorm:"text"`
	Sort     int       `json:"sort" xorm:"int notnull default 0"`
	Status   int       `json:"status" xorm:"tinyint(1) notnull default 0"`
	CreateAt time.Time `json:"create_at" xorm:"created"`
	UpdateAt time.Time `json:"update_at" xorm:"updated"`
}

type Member

type Member struct {
	Id       int       `json:"id" xorm:"pk autoincr"`
	Name     string    `json:"name" xorm:"varchar(255) notnull default ''"`
	Price    int       `json:"price"`
	Rebate   int       `json:"rebate"`
	Day      int       `json:"day"`
	Sort     int       `json:"sort"`
	Status   int       `json:"status" xorm:"tinyint(1) notnull default 0"`
	CreateAt time.Time `json:"create_at" xorm:"created"`
	UpdateAt time.Time `json:"update_at" xorm:"updated"`
}

type MemberAndMemberGoodsPrice

type MemberAndMemberGoodsPrice struct {
	Member `xorm:"extends"`
	Mgp    MemberGoodsPrice `json:"mgp" xorm:"extends"`
}

type MemberGoodsPrice

type MemberGoodsPrice struct {
	Id       int `json:"id" xorm:"pk autoincr"`
	GoodsId  int `json:"goods_id" xorm:"index"`
	MemberId int `json:"member_id" xorm:"index"`
	Price    int `json:"price"`
}

type Order

type Order struct {
	Id            int    `json:"id" xorm:"pk autoincr"`
	TradeNo       string `json:"trade_no" xorm:"varchar(255) notnull default ''"`
	PayTradeNo    string `json:"pay_trade_no" xorm:"varchar(255) notnull default ''"`
	Type          string `json:"type" xorm:"varchar(255) notnull default ''"`
	IsWapPay      int    `json:"is_wap_pay" xorm:"tinyint(1) notnull default 0"`
	Name          string `json:"name" xorm:"varchar(255) notnull default ''"`
	QueryKey      string `json:"query_key" xorm:"varchar(255) notnull default ''"`
	InputDetails  string `json:"input_details" xorm:"varchar(255) notnull default ''"`
	ResultDetails string `json:"result_details" xorm:"varchar(255) notnull default ''"`
	Remarks       string `json:"remarks" xorm:"varchar(255) notnull default ''"`
	Ip            string `json:"ip" xorm:"varchar(255) notnull default ''"`
	Money         int    `json:"money" xorm:"int notnull default 0"`
	Num           int    `json:"num" xorm:"int notnull default 0"`
	/*商品信息*/
	GoodsId   int `json:"goods_id" xorm:"index int notnull default 0"`
	GoodsType int `json:"goods_type" xorm:"tinyint(1) notnull default 0"`
	/*下单用户*/
	UserId int `json:"user_id" xorm:"index int notnull default 0"`
	Status int `json:"status" xorm:"tinyint(1) notnull default 0"`
	/*退款信息*/
	IsRefund            int       `json:"is_refund" xorm:"tinyint(1) notnull default 0"`
	RefundMoney         int       `json:"refund_money" xorm:"tinyint(1) notnull default 0"`
	RefundResultDetails string    `json:"refund_result_details" xorm:"varchar(255) notnull default ''"`
	RefundAt            time.Time `json:"refund_at" xorm:"default null"`
	/*付款时间*/
	PayAt time.Time `json:"pay_at" xorm:"default null"`
	/*创建 更新 删除 at*/
	CreateAt time.Time `json:"create_at" xorm:"created"`
	UpdateAt time.Time `json:"update_at" xorm:"updated"`
	DeleteAt time.Time `json:"delete_at" xorm:"deleted"`
}

type OrderFilesFlow

type OrderFilesFlow struct {
	Uuid          string `xorm:"pk varchar(255)"`
	OrderId       int    `xorm:"index"`
	FilesId       int    `xorm:"index"`
	DownloadLimit int
}

type OrderGoodsFlow

type OrderGoodsFlow struct {
	Id      int `xorm:"pk autoincr"`
	OrderId int `xorm:"index"`
	GoodsId int `xorm:"index"`
}

type OrderStatus

type OrderStatus int
const (
	OrderREFUND  OrderStatus = -1
	OrderWARNING OrderStatus = 0
	OrderSUCCESS OrderStatus = 1
)

func (OrderStatus) String

func (p OrderStatus) String() string

type User

type User struct {
	Id              int       `json:"id" xorm:"pk autoincr"`
	Nickname        string    `json:"nickname" xorm:"varchar(255) notnull default ''"`
	Username        string    `json:"username" xorm:"varchar(255) notnull default ''"`
	Password        string    `json:"password" xorm:"varchar(255) notnull default ''"`
	Money           int       `json:"money" xorm:"int notnull default 0"`
	Status          int       `json:"status" xorm:"tinyint(1) notnull default 0"`
	IsRoot          int       `json:"is_root" xorm:"tinyint(1) notnull default 0"`
	Mobile          string    `json:"mobile" xorm:"varchar(255) notnull default ''"`
	IsMobile        int       `json:"is_mobile" xorm:"tinyint(1) notnull default 0"`
	Email           string    `json:"email" xorm:"varchar(255) notnull default ''"`
	IsEmail         int       `json:"is_email" xorm:"tinyint(1) notnull default 0"`
	MemberId        int       `json:"member_id" xorm:"index int notnull default 0"`
	MemberStartTime time.Time `json:"member_start_time" xorm:"default null"`
	MemberEndTime   time.Time `json:"member_end_time" xorm:"default null"`
	/*创建 更新 删除 at*/
	CreateAt time.Time `json:"create_at" xorm:"created"`
	UpdateAt time.Time `json:"update_at" xorm:"updated"`
	DeleteAt time.Time `json:"delete_at" xorm:"deleted"`
}

type View

type View struct {
	Title       string      // 页面标题
	Description string      // 页面Description
	Error       string      // 错误信息
	MainTpl     string      // 自定义MainTpl展示模板文件
	Data        interface{} // 页面参数
}

视图渲染内容对象

Jump to

Keyboard shortcuts

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