schema

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Copyright 2019 Axetroy. All rights reserved. MIT license.

Copyright 2019 Axetroy. All rights reserved. MIT license.

Copyright 2019 Axetroy. All rights reserved. MIT license.

Copyright 2019 Axetroy. All rights reserved. MIT license.

Copyright 2019 Axetroy. All rights reserved. MIT license.

Copyright 2019 Axetroy. All rights reserved. MIT license.

Copyright 2019 Axetroy. All rights reserved. MIT license.

Copyright 2019 Axetroy. All rights reserved. MIT license.

Copyright 2019 Axetroy. All rights reserved. MIT license.

Copyright 2019 Axetroy. All rights reserved. MIT license.

Copyright 2019 Axetroy. All rights reserved. MIT license.

Copyright 2019 Axetroy. All rights reserved. MIT license.

Copyright 2019 Axetroy. All rights reserved. MIT license.

Copyright 2019 Axetroy. All rights reserved. MIT license.

Copyright 2019 Axetroy. All rights reserved. MIT license.

Copyright 2019 Axetroy. All rights reserved. MIT license.

Copyright 2019 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 DESC" // 默认按照创建时间排序, 只允许
	MaxLimit     = 100
)

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 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 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 added in v0.1.1

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

type HelpPure added in v0.1.1

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 List

type List struct {
	Response       // 常规的接口返回结构
	Meta     *Meta `json:"meta"` // 数据列表多了一个 Meta 字段
}

type LogLogin

type LogLogin struct {
	LogLoginPure
	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 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"` // 平台
}

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 Profile

type Profile struct {
	ProfilePure
	PayPassword bool   `json:"pay_password"` // 是否已设置交易密码
	CreatedAt   string `json:"created_at"`
	UpdatedAt   string `json:"updated_at"`
}

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"`
}

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 (*Query) Normalize

func (q *Query) Normalize() *Query

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 状态码则为错误
}

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 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"`   // 冻结余额
}

Jump to

Keyboard shortcuts

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