schema

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2020 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Copyright 2019-2020 Axetroy. All rights reserved. Apache License 2.0.

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Index

Constants

View Source
const (
	StatusSuccess = 1
	StatusFail    = 0
)

Variables

View Source
var (
	DefaultLimit       = 10            // 默认只获取 10 条数据
	DefaultPage        = 0             // 默认第 0 页
	DefaultSort        = "-created_at" // 默认按照创建时间排序
	MaxLimit           = 100           // 最大的查询数量,100 条 防止查询数据过大拖慢服务端性能
	OrderAsc     Order = "ASC"         // 排序方式,正序
	OrderDesc    Order = "DESC"        // 排序方式,倒序

)

Functions

This section is empty.

Types

type Address

type Address struct {
	AddressPure
	CreatedAt string `json:"created_at"`
	UpdatedAt string `json:"updated_at"`
}

type AddressPure

type AddressPure struct {
	Id           string `json:"id"`            // 地址ID
	Name         string `json:"name"`          // 收货人
	Phone        string `json:"phone"`         // 收货人手机号
	ProvinceCode string `json:"province_code"` // 省份代码
	CityCode     string `json:"city_code"`     // 城市代码
	AreaCode     string `json:"area_code"`     // 区域代码
	Address      string `json:"address"`       // 详细的地址
	IsDefault    bool   `json:"is_default"`    // 是否是默认地址
}

type AdminProfile

type AdminProfile struct {
	AdminProfilePure
	CreatedAt string `json:"created_at"`
	UpdatedAt string `json:"updated_at"`
}

type AdminProfilePure

type AdminProfilePure struct {
	Id        string            `json:"id"`        // 用户ID
	Username  string            `json:"username"`  // 用户名, 用于登陆
	Name      string            `json:"name"`      // 管理员名
	Accession []string          `json:"accession"` // 管理员所拥有的权限
	IsSuper   bool              `json:"is_super"`  // 是否是超级管理员, 超级管理员全站应该只有一个
	Status    model.AdminStatus `json:"status"`    // 状态
}

type AdminProfileWithToken

type AdminProfileWithToken struct {
	AdminProfile
	Token string `json:"token"`
}

type Area

type Area struct {
	Province map[string]string `json:"province"`
	City     map[string]string `json:"city"`
	Area     map[string]string `json:"area"`
}
type Banner struct {
	BannerPure
	CreatedAt string `json:"created_at"`
	UpdatedAt string `json:"updated_at"`
}

type BannerPure

type BannerPure struct {
	Id          string               `json:"id"`           // 地址ID
	Image       string               `json:"image"`        // 图片 URL
	Href        string               `json:"href"`         // 点击图片跳转 URL
	Platform    model.BannerPlatform `json:"platform"`     // 平台
	Description *string              `json:"description"`  // 描述
	Priority    *string              `json:"priority"`     // 优先级,用于排序
	Identifier  *string              `json:"identifier"`   // APP 跳转标识符
	FallbackUrl *string              `json:"fallback_url"` // APP 跳转标识符的备选方案
}

type Config added in v0.4.0

type Config struct {
	Fields    interface{} `json:"fields"`
	CreatedAt string      `json:"created_at"`
	UpdatedAt string      `json:"updated_at"`
}

type FileResponse

type FileResponse struct {
	Hash         string `json:"hash"`          // 文件 hash
	Filename     string `json:"filename"`      // 存储在服务端的文件名
	Origin       string `json:"origin"`        // 上传文件的原始名
	Size         int64  `json:"size"`          // 文件大小
	RawPath      string `json:"raw_path"`      // 纯文本的文件路径, 需要拼接上域名
	DownloadPath string `json:"download_path"` // 下载的文件路径, 需要拼接上域名
}

type Help

type Help struct {
	HelpPure
	CreatedAt string `json:"created_at"`
	UpdatedAt string `json:"updated_at"`
}

type HelpPure

type HelpPure struct {
	Id       string           `json:"id"`        // 帮助文章ID
	Title    string           `json:"title"`     // 帮助文章标题
	Content  string           `json:"content"`   // 帮助文章内容
	Tags     []string         `json:"tags"`      // 帮助文章的标签
	Status   model.HelpStatus `json:"status"`    // 帮助文章状态
	Type     model.HelpType   `json:"type"`      // 帮助文章的类型
	ParentId *string          `json:"parent_id"` // 父级 ID,如果有的话
}

type Invite

type Invite struct {
	InvitePure
	CreatedAt string `json:"created_at"`
	UpdatedAt string `json:"updated_at"`
}

type InvitePure

type InvitePure struct {
	Id            string `json:"id"`
	Inviter       string `json:"inviter"`        // 邀请人
	Invitee       string `json:"invitee"`        // 受邀请人, 只有唯一的一个
	Status        int32  `json:"status"`         // 受邀请人的激活状态
	RewardSettled bool   `json:"reward_settled"` // 是否已发放奖励, 包括邀请人和收邀请人的奖励
}

type LogLogin

type LogLogin struct {
	LogLoginPure
	User      ProfilePublic `json:"user"`
	CreatedAt string        `json:"created_at"`
	UpdatedAt string        `json:"updated_at"`
}

type LogLoginPure

type LogLoginPure struct {
	Id      string `json:"id"`
	Uid     string `json:"uid"`
	Type    int    `json:"type"`
	Command int    `json:"command"`
	LastIp  string `json:"last_ip"`
	Client  string `json:"client"`
}
type Menu struct {
	MenuPure
	Children  []Menu `json:"children"` // 子菜单
	CreatedAt string `json:"created_at"`
	UpdatedAt string `json:"updated_at"`
}
type MenuPure struct {
	Id        string   `json:"id"`
	ParentId  string   `json:"parent_id"` // 该菜单的父级 ID
	Name      string   `json:"name"`      // 菜单名
	Url       string   `json:"url"`       // 菜单链接的 URL 地址
	Icon      string   `json:"icon"`      // 菜单的图标
	Accession []string `json:"accession"` // 该菜单所需要的权限
	Sort      int      `json:"sort"`      // 菜单排序, 越大的越靠前
}
type MenuTreeItem struct {
	Menu
	Children []*MenuTreeItem
}

type Message

type Message struct {
	MessagePure
	ReadAt    *string `json:"read"`       // 用户读取的时间
	CreatedAt string  `json:"created_at"` // 创建时间
	UpdatedAt string  `json:"updated_at"` // 更新时间
}

type MessageAdmin

type MessageAdmin struct {
	MessagePureAdmin
	ReadAt    *string `json:"read"`       // 用户读取的时间
	CreatedAt string  `json:"created_at"` // 创建时间
	UpdatedAt string  `json:"updated_at"` // 更新时间
}

type MessagePure

type MessagePure struct {
	Id      string  `json:"id"`      // 消息ID
	Title   string  `json:"title"`   // 消息标题
	Content string  `json:"content"` // 消息内容
	Read    bool    `json:"read"`    // 用户是否已读
	Note    *string `json:"note"`    // 备注
}

type MessagePureAdmin

type MessagePureAdmin struct {
	Id      string  `json:"id"`      // 消息ID
	Uid     string  `json:"uid"`     // 用户 UID
	Title   string  `json:"title"`   // 消息标题
	Content string  `json:"content"` // 消息内容
	Read    bool    `json:"read"`    // 用户是否已读
	Note    *string `json:"note"`    // 备注
}

type Meta

type Meta struct {
	Limit    int     `json:"limit"`              // 当前请求获取多少条数据, 默认 10
	Page     int     `json:"page"`               // 当前第几页,默认 0 开始
	Total    int64   `json:"total"`              // 数据总量
	Num      int     `json:"num"`                // 当前返回的数据流
	Sort     string  `json:"sort"`               // 排序
	Platform *string `json:"platform,omitempty"` // 平台
}

type Name added in v0.4.0

type Name struct {
	Field       string `json:"field"`       // 字段名称
	Description string `json:"description"` // 配置描述
}

type News

type News struct {
	NewsPure
	CreatedAt string `json:"created_at"`
	UpdatedAt string `json:"updated_at"`
}

type NewsPure

type NewsPure struct {
	Id      string           `json:"id"`
	Author  string           `json:"author"`
	Title   string           `json:"title"`
	Content string           `json:"content"`
	Type    model.NewsType   `json:"type"`
	Tags    []string         `json:"tags"`
	Status  model.NewsStatus `json:"status"`
}

type Notification

type Notification struct {
	NotificationPure
	CreatedAt string `json:"created_at"`
	UpdatedAt string `json:"updated_at"`
}

type NotificationAdmin

type NotificationAdmin struct {
	NotificationPureAdmin
	CreatedAt string `json:"created_at"`
	UpdatedAt string `json:"updated_at"`
}

type NotificationPure

type NotificationPure struct {
	Id      string  `json:"id"`
	Title   string  `json:"title"`
	Content string  `json:"content"`
	Read    bool    `json:"read"`    // 用户是否已读
	ReadAt  string  `json:"read_at"` // 用户读取的时间
	Note    *string `json:"note"`
}

普通会员获取的接口

type NotificationPureAdmin

type NotificationPureAdmin struct {
	Id      string  `json:"id"`
	Author  string  `json:"author"`
	Title   string  `json:"title"`
	Content string  `json:"content"`
	Note    *string `json:"note"`
}

这是管理员获取的接口

type Order

type Order string

type Profile

type Profile struct {
	ProfilePure
	PayPassword bool               `json:"pay_password"` // 是否已设置交易密码
	Wechat      *WechatBindingInfo `json:"wechat"`       // 绑定的微信帐号信息,没有是为 null
	CreatedAt   string             `json:"created_at"`
	UpdatedAt   string             `json:"updated_at"`
}

type ProfilePublic

type ProfilePublic struct {
	Id       string  `json:"id" valid:"required"`
	Username string  `json:"username" valid:"required"`
	Nickname *string `json:"nickname" valid:"required"`
	Avatar   string  `json:"avatar" valid:"required"`
}

公开的用户资料,任何人都可以查阅

type ProfilePure

type ProfilePure struct {
	Id                      string   `json:"id"`
	Username                string   `json:"username"`
	Nickname                *string  `json:"nickname"`
	Email                   *string  `json:"email"`
	Phone                   *string  `json:"phone"`
	Status                  int32    `json:"status"`
	Gender                  int      `json:"gender"`
	Avatar                  string   `json:"avatar"`
	Role                    []string `json:"role"`
	Level                   int32    `json:"level"`
	InviteCode              string   `json:"invite_code"`
	UsernameRenameRemaining int      `json:"username_rename_remaining"`
}

用户自己的资料

type ProfileWithToken

type ProfileWithToken struct {
	Profile
	Token string `json:"token"`
}

type Query

type Query struct {
	Limit    int     `json:"limit" form:"limit"`
	Page     int     `json:"page" form:"page"`
	Sort     string  `json:"sort" form:"sort"`
	Platform *string `json:"platform" form:"platform"`
}

func NewQuery

func NewQuery() *Query

func (*Query) FormatSort

func (q *Query) FormatSort() (fields []Sort)

func (*Query) Normalize

func (q *Query) Normalize() *Query

func (*Query) Order

func (q *Query) Order(db *gorm.DB) *gorm.DB

type Report

type Report struct {
	ReportPure
	CreatedAt string `json:"created_at"`
	UpdatedAt string `json:"updated_at"`
}

type ReportPure

type ReportPure struct {
	Id          string             `json:"id"`
	Uid         string             `json:"uid"`
	Title       string             `json:"title"`
	Content     string             `json:"content"`
	Type        model.ReportType   `json:"type"`
	Status      model.ReportStatus `json:"status"`
	Screenshots []string           `json:"screenshots"`
	Locked      bool               `json:"locked"`
}

type Response

type Response struct {
	Message string      `json:"message"`        // 附带的消息,接口请求错误时,一般都会有错误信息
	Data    interface{} `json:"data"`           // 接口附带的数据
	Status  int         `json:"status"`         // 状态码,非 1 状态码则为错误
	Meta    *Meta       `json:"meta,omitempty"` // 数据列表多了一个 Meta 字段
}

func (Response) Decode added in v0.3.0

func (r Response) Decode(dest interface{}) (err error)

type Role

type Role struct {
	RolePure
	CreatedAt string `json:"created_at"`
	UpdatedAt string `json:"updated_at"`
}

type RolePure

type RolePure struct {
	Name        string   `json:"name"`
	Description string   `json:"description"`
	Accession   []string `json:"accession"`
	BuildIn     bool     `json:"build_in"`
	Note        *string  `json:"note"`
}

type Sort

type Sort struct {
	Field string `json:"field"` // 排序的字段
	Order Order  `json:"order"` // 字段的排序方向
}

type TransferLog

type TransferLog struct {
	TransferLogPure
	CreatedAt string `json:"created_at"`
	UpdatedAt string `json:"updated_at"`
}

type TransferLogPure

type TransferLogPure struct {
	Id       string               `json:"id"`       // 转账ID
	Currency string               `json:"currency"` // 币种
	From     string               `json:"from"`     // 谁转的
	To       string               `json:"to"`       // 转给谁
	Amount   string               `json:"amount"`   // 转账数量
	Status   model.TransferStatus `json:"status"`   // 转账状态
	Note     *string              `json:"string"`   // 转账备注
}

type Wallet

type Wallet struct {
	WalletPure
	CreatedAt string `json:"created_at"`
	UpdatedAt string `json:"updated_at"`
}

type WalletPure

type WalletPure struct {
	Id       string `json:"id"`       // 用户ID
	Currency string `json:"currency"` // 币种
	Balance  string `json:"balance"`  // 可用余额
	Frozen   string `json:"frozen"`   // 冻结余额
}

type WechatBindingInfo

type WechatBindingInfo struct {
	Nickname  string `json:"nickname"`   // 用户昵称
	AvatarUrl string `json:"avatar_url"` // 用户头像
	Gender    int    `json:"gender"`     // 性别
	Country   string `json:"country"`    // 国家
	Province  string `json:"province"`   // 省份
	City      string `json:"city"`       // 城市
	Language  string `json:"language"`   // 语言
}

绑定的微信帐号信息

Jump to

Keyboard shortcuts

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