Documentation
¶
Index ¶
- Constants
- type Class
- type Config
- type Context
- type ContextSite
- type ContextUser
- type Files
- type Goods
- type GoodsFilesFlow
- type GoodsPayResult
- type GoodsType
- type Help
- type Member
- type MemberAndMemberGoodsPrice
- type MemberGoodsPrice
- type Order
- type OrderFilesFlow
- type OrderGoodsFlow
- type OrderStatus
- type User
- type View
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"` // 关键词
Logo string `json:"logo"` // 站点logo
Qq string `json:"qq"` // 客服qq
Email string `json:"email"` // 联系邮箱
HeaderCode string `json:"header_code"` // 头部代码
BottomScript string `json:"bottom_script"` // 底部js脚本
}
上下文站点信息
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 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 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 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 OrderGoodsFlow ¶
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"`
}
Click to show internal directories.
Click to hide internal directories.