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. 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
- Variables
- type Address
- type AddressPure
- type AdminProfile
- type AdminProfilePure
- type AdminProfileWithToken
- type Banner
- type BannerPure
- type Config
- type FileResponse
- type Help
- type HelpPure
- type Invite
- type InvitePure
- type LogLogin
- type LogLoginPure
- type Menu
- type MenuPure
- type MenuTreeItem
- type Message
- type MessageAdmin
- type MessagePure
- type MessagePureAdmin
- type MessageStatus
- type Meta
- type Name
- type News
- type NewsPure
- type Notification
- type NotificationAdmin
- type NotificationPure
- type NotificationPureAdmin
- type Order
- type Profile
- type ProfilePublic
- type ProfilePure
- type ProfileWithToken
- type Query
- type Report
- type ReportPure
- type Response
- type Role
- type RolePure
- type Sort
- type TransferLog
- type TransferLogPure
- type Wallet
- type WalletPure
- type WechatBindingInfo
Constants ¶
const ( StatusSuccess = 1 StatusFail = 0 )
Variables ¶
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"` // 区域代码
StreetCode string `json:"street_code"` // 街道/乡镇代码
Address string `json:"address"` // 详细的地址
IsDefault bool `json:"is_default"` // 是否是默认地址
Note *string `json:"note"` // 备注,例如 `家`/`公司`/`学校`
}
type AdminProfile ¶
type AdminProfile struct {
AdminProfilePure
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
type AdminProfilePure ¶
type AdminProfileWithToken ¶
type AdminProfileWithToken struct {
AdminProfile
Token string `json:"token"`
}
type Banner ¶
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 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 LogLogin ¶
type LogLogin struct {
LogLoginPure
User ProfilePublic `json:"user"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
type LogLoginPure ¶
type MenuTreeItem ¶ added in v0.3.0
type MenuTreeItem struct {
Menu
Children []*MenuTreeItem
}
type Message ¶
type Message struct {
MessagePure
ReadAt *string `json:"read_at"` // 用户读取的时间
CreatedAt string `json:"created_at"` // 创建时间
UpdatedAt string `json:"updated_at"` // 更新时间
}
type MessageAdmin ¶
type MessageAdmin struct {
MessagePureAdmin
ReadAt *string `json:"read_at"` // 用户读取的时间
CreatedAt string `json:"created_at"` // 创建时间
UpdatedAt string `json:"updated_at"` // 更新时间
}
type MessagePure ¶
type MessagePureAdmin ¶
type MessageStatus ¶ added in v0.5.4
type MessageStatus struct {
Unread int64 `json:"unread"` // 未读数量
}
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"` // 是否已设置交易密码
Wechat *WechatBindingInfo `json:"wechat"` // 绑定的微信帐号信息,没有是为 null
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
type ProfilePublic ¶
type ProfilePublic struct {
Id string `json:"id"`
Username string `json:"username"`
Nickname *string `json:"nickname"`
Avatar string `json:"avatar"`
}
公开的用户资料,任何人都可以查阅
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 Query ¶
type Query struct {
Limit int `json:"limit" url:"limit" validate:"omitempty,number,gte=1" comment:"每页数量"`
Page int `json:"page" url:"page" validate:"omitempty,number,gte=0" comment:"页数"`
Sort string `json:"sort" url:"sort" validate:"omitempty,max=255" comment:"排序"`
Platform *string `json:"platform" url:"platform" validate:"omitempty,max=16" comment:"平台"`
Total *int `json:"total" url:"total" validate:"omitempty" comment:"总数"` // 客户端应该不传过来,定义在这里只是允许接收这个参数
Num *int `json:"num" url:"num" validate:"omitempty" comment:"当前页数"` // 客户端应该不传过来,定义在这里只是允许接收这个参数
}
func (*Query) FormatSort ¶
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 TransferLog ¶
type TransferLog struct {
TransferLogPure
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
type TransferLogPure ¶
type Wallet ¶
type Wallet struct {
WalletPure
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
type WalletPure ¶
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"` // 语言
}
绑定的微信帐号信息