Documentation
¶
Index ¶
- Constants
- Variables
- type AccountBookInvitations
- type AccountBookInvitationsModel
- type AccountBookMembers
- type AccountBookMembersModel
- type AccountBooks
- type AccountBooksModel
- type Festivals
- type FestivalsModel
- type RecurringTransactions
- type RecurringTransactionsModel
- type Tags
- type TagsModel
- type Transactions
- type TransactionsModel
- type UploadFiles
- type UploadFilesModel
- type UserSettings
- type UserSettingsModel
- type Users
- type UsersModel
Constants ¶
const ( UserIsDisableYes = 1 // 启用 UserIsDisableNo = 2 // 禁用 )
users 表相关
const ( TagsIsSystemYes = 1 // 系统标签 TagsIsSystemNo = 2 // 用户自定义标签 // type TagsTypeExpense = "expense" // 支出 TagsTypeIncome = "income" // 收入 )
tags 表相关
const ( // is_show_home 是否显示在首页 FestivalIsShowHomeYes = 1 // 显示 FestivalIsShowHomeNo = 2 // 不显示 )
festivals 表相关
const ( // is_creator 是否创建者 AccountBookMemberIsCreatorYes = 1 // 是 AccountBookMemberIsCreatorNo = 2 // 否 // is_default 是否为默认账本 AccountBookMemberIsDefaultYes = 1 // 是 AccountBookMemberIsDefaultNo = 2 // 否 // status 成员状态 AccountBookMemberStatusJoined = "joined" // 已加入 AccountBookMemberStatusWaiting = "waiting" // 待加入 AccountBookMemberStatusRejected = "rejected" // 已拒绝 )
account_book_members 表相关
const ( // status 邀请状态 AccountBookInvitationStatusPending = "pending" // 待处理 AccountBookInvitationStatusAccepted = "accepted" // 已接受 AccountBookInvitationStatusRejected = "rejected" // 已拒绝 )
account_book_invitations 表相关
const ( // type 交易类型 TransactionTypeExpense = "expense" // 支出 TransactionTypeIncome = "income" // 收入 // is_auto_generated 是否自动生成 TransactionIsAutoGeneratedYes = 1 // 是 TransactionIsAutoGeneratedNo = 2 // 否 )
transactions 表相关
const ( // type 交易类型 RecurringTransactionTypeExpense = "expense" // 支出 RecurringTransactionTypeIncome = "income" // 收入 // recurring_type 周期类型 RecurringTransactionTypeDaily = "daily" // 每日 RecurringTransactionTypeWeekly = "weekly" // 每周 RecurringTransactionTypeMonthly = "monthly" // 每月 RecurringTransactionTypeQuarterly = "quarterly" // 每季度 RecurringTransactionTypeYearly = "yearly" // 每年 // is_recurring_enabled 是否启用 RecurringTransactionIsEnabledYes = 1 // 是 RecurringTransactionIsEnabledNo = 2 // 否 )
recurring_transactions 表相关
Variables ¶
var ErrNotFound = sqlx.ErrNotFound
Functions ¶
This section is empty.
Types ¶
type AccountBookInvitations ¶
type AccountBookInvitations struct {
InvitationId uint64 `db:"invitation_id"` // 邀请ID
BookId uint64 `db:"book_id"` // 账本ID
InviterUid uint64 `db:"inviter_uid"` // 邀请人UID
TargetUid uint64 `db:"target_uid"` // 被邀请人UID
Status string `db:"status"` // 邀请状态
CreatedAt uint64 `db:"created_at"` // 创建时间(秒级时间戳)
UpdatedAt uint64 `db:"updated_at"` // 更新时间(秒级时间戳)
}
type AccountBookInvitationsModel ¶
type AccountBookInvitationsModel interface {
// contains filtered or unexported methods
}
AccountBookInvitationsModel is an interface to be customized, add more methods here, and implement the added methods in customAccountBookInvitationsModel.
func NewAccountBookInvitationsModel ¶
func NewAccountBookInvitationsModel(conn sqlx.SqlConn) AccountBookInvitationsModel
NewAccountBookInvitationsModel returns a model for the database table.
type AccountBookMembers ¶
type AccountBookMembers struct {
BookMemberId uint64 `db:"book_member_id"` // 账本成员ID
BookId uint64 `db:"book_id"` // 账本ID
UserId uint64 `db:"user_id"` // 用户ID
IsCreator int64 `db:"is_creator"` // 是否为创建者 1-是 2-否
IsDefault int64 `db:"is_default"` // 是否为默认账本 1-是 2-否
Status string `db:"status"` // 成员状态
JoinedAt uint64 `db:"joined_at"` // 加入时间(秒级时间戳)
CreatedAt uint64 `db:"created_at"` // 创建时间(秒级时间戳)
UpdatedAt uint64 `db:"updated_at"` // 更新时间(秒级时间戳)
}
type AccountBookMembersModel ¶
type AccountBookMembersModel interface {
// contains filtered or unexported methods
}
AccountBookMembersModel is an interface to be customized, add more methods here, and implement the added methods in customAccountBookMembersModel.
func NewAccountBookMembersModel ¶
func NewAccountBookMembersModel(conn sqlx.SqlConn) AccountBookMembersModel
NewAccountBookMembersModel returns a model for the database table.
type AccountBooks ¶
type AccountBooksModel ¶
type AccountBooksModel interface {
// contains filtered or unexported methods
}
AccountBooksModel is an interface to be customized, add more methods here, and implement the added methods in customAccountBooksModel.
func NewAccountBooksModel ¶
func NewAccountBooksModel(conn sqlx.SqlConn) AccountBooksModel
NewAccountBooksModel returns a model for the database table.
type Festivals ¶
type Festivals struct {
FestivalId uint64 `db:"festival_id"` // 节日ID
UserId uint64 `db:"user_id"` // 用户ID
FestivalName string `db:"festival_name"` // 节日名称
FestivalDate uint64 `db:"festival_date"` // 节日日期(YYYYMMDD格式)
IsShowHome int64 `db:"is_show_home"` // 是否在首页显示 1-是 2-否
CreatedAt uint64 `db:"created_at"` // 创建时间(秒级时间戳)
UpdatedAt uint64 `db:"updated_at"` // 更新时间(秒级时间戳)
}
type FestivalsModel ¶
type FestivalsModel interface {
// contains filtered or unexported methods
}
FestivalsModel is an interface to be customized, add more methods here, and implement the added methods in customFestivalsModel.
func NewFestivalsModel ¶
func NewFestivalsModel(conn sqlx.SqlConn) FestivalsModel
NewFestivalsModel returns a model for the database table.
type RecurringTransactions ¶
type RecurringTransactions struct {
RecurringId uint64 `db:"recurring_id"` // 周期性记账ID
BookId uint64 `db:"book_id"` // 账本ID
UserId uint64 `db:"user_id"` // 用户ID
Name string `db:"name"` // 记账名称
Type string `db:"type"` // 交易类型
Amount float64 `db:"amount"` // 金额
TagId uint64 `db:"tag_id"` // 标签ID
Remark string `db:"remark"` // 备注
RecurringType string `db:"recurring_type"` // 周期类型
RecurringHour uint64 `db:"recurring_hour"` // 执行小时(0-23)
RecurringMinute uint64 `db:"recurring_minute"` // 执行分钟(0-59)
RecurringWeekday uint64 `db:"recurring_weekday"` // 星期几(0-6,0为周日)
RecurringMonth uint64 `db:"recurring_month"` // 月份(1-12)
RecurringDay uint64 `db:"recurring_day"` // 日期(1-31)
IsRecurringEnabled int64 `db:"is_recurring_enabled"` // 是否启用 1-是 2-否
LastExecutedAt uint64 `db:"last_executed_at"` // 最后执行时间(秒级时间戳)
NextExecutionTime uint64 `db:"next_execution_time"` // 下一次执行时间(秒级时间戳)
CreatedAt uint64 `db:"created_at"` // 创建时间(秒级时间戳)
UpdatedAt uint64 `db:"updated_at"` // 更新时间(秒级时间戳)
}
type RecurringTransactionsModel ¶
type RecurringTransactionsModel interface {
// contains filtered or unexported methods
}
RecurringTransactionsModel is an interface to be customized, add more methods here, and implement the added methods in customRecurringTransactionsModel.
func NewRecurringTransactionsModel ¶
func NewRecurringTransactionsModel(conn sqlx.SqlConn) RecurringTransactionsModel
NewRecurringTransactionsModel returns a model for the database table.
type Tags ¶
type Tags struct {
TagId uint64 `db:"tag_id"` // 标签ID
UserId uint64 `db:"user_id"` // 用户ID(系统标签为空)
Name string `db:"name"` // 标签名称
Color string `db:"color"` // 标签颜色
Icon string `db:"icon"` // 标签图标
IsSystem int64 `db:"is_system"` // 是否为系统标签 1-是 2-否
Type string `db:"type"` // 标签类型
SortNum uint64 `db:"sort_num"` // 排序
CreatedAt uint64 `db:"created_at"` // 创建时间(秒级时间戳)
UpdatedAt uint64 `db:"updated_at"` // 更新时间(秒级时间戳)
}
type TagsModel ¶
type TagsModel interface {
// contains filtered or unexported methods
}
TagsModel is an interface to be customized, add more methods here, and implement the added methods in customTagsModel.
func NewTagsModel ¶
NewTagsModel returns a model for the database table.
type Transactions ¶
type Transactions struct {
TransactionId uint64 `db:"transaction_id"` // 交易记录ID
BookId uint64 `db:"book_id"` // 账本ID
UserId uint64 `db:"user_id"` // 用户ID
Type string `db:"type"` // 交易类型
Amount float64 `db:"amount"` // 金额
TagId uint64 `db:"tag_id"` // 标签ID
Remark string `db:"remark"` // 备注
TransactionTime uint64 `db:"transaction_time"` // 交易时间(秒级时间戳)
IsAutoGenerated int64 `db:"is_auto_generated"` // 是否自动生成 1-是 2-否
CreatedAt uint64 `db:"created_at"` // 创建时间(秒级时间戳)
UpdatedAt uint64 `db:"updated_at"` // 更新时间(秒级时间戳)
}
type TransactionsModel ¶
type TransactionsModel interface {
// contains filtered or unexported methods
}
TransactionsModel is an interface to be customized, add more methods here, and implement the added methods in customTransactionsModel.
func NewTransactionsModel ¶
func NewTransactionsModel(conn sqlx.SqlConn) TransactionsModel
NewTransactionsModel returns a model for the database table.
type UploadFiles ¶
type UploadFiles struct {
FileId uint64 `db:"file_id"` // 文件ID
UserId uint64 `db:"user_id"` // 用户ID
RelativePath string `db:"relative_path"` // 文件相对路径
AbsoluteUrl string `db:"absolute_url"` // 文件绝对URL
FileSize uint64 `db:"file_size"` // 文件大小(字节)
FileType string `db:"file_type"` // 文件类型
BusinessType string `db:"business_type"` // 业务类型
UploadTime uint64 `db:"upload_time"` // 上传时间(秒级时间戳)
CreatedAt uint64 `db:"created_at"` // 创建时间(秒级时间戳)
}
type UploadFilesModel ¶
type UploadFilesModel interface {
// contains filtered or unexported methods
}
UploadFilesModel is an interface to be customized, add more methods here, and implement the added methods in customUploadFilesModel.
func NewUploadFilesModel ¶
func NewUploadFilesModel(conn sqlx.SqlConn) UploadFilesModel
NewUploadFilesModel returns a model for the database table.
type UserSettings ¶
type UserSettings struct {
UserSettingId uint64 `db:"user_setting_id"` // 主键ID
UserId uint64 `db:"user_id"` // 用户ID
BackgroundUrl string `db:"background_url"` // 首页背景图片URL
Budget float64 `db:"budget"` // 月度预算
CreatedAt uint64 `db:"created_at"` // 创建时间(秒级时间戳)
UpdatedAt uint64 `db:"updated_at"` // 更新时间(秒级时间戳)
}
type UserSettingsModel ¶
type UserSettingsModel interface {
// contains filtered or unexported methods
}
UserSettingsModel is an interface to be customized, add more methods here, and implement the added methods in customUserSettingsModel.
func NewUserSettingsModel ¶
func NewUserSettingsModel(conn sqlx.SqlConn) UserSettingsModel
NewUserSettingsModel returns a model for the database table.
type Users ¶
type Users struct {
UserId uint64 `db:"user_id"` // 用户唯一ID(雪花算法)
Openid string `db:"openid"` // 微信openid
Unionid string `db:"unionid"` // 微信unionid
Nickname string `db:"nickname"` // 用户昵称
Avatar string `db:"avatar"` // 用户头像URL
Phone string `db:"phone"` // 手机号
IsDisable int64 `db:"is_disable"` // 是否禁用 1-启用 2-禁用
RegisterIp string `db:"register_ip"` // 注册时的ip
LoginIp string `db:"login_ip"` // 登录时的ip
LastLoginTime uint64 `db:"last_login_time"` // 最近登录的时间(秒级时间戳)
CreatedAt uint64 `db:"created_at"` // 创建时间(秒级时间戳)
UpdatedAt uint64 `db:"updated_at"` // 更新时间(秒级时间戳)
}
type UsersModel ¶
type UsersModel interface {
// contains filtered or unexported methods
}
UsersModel is an interface to be customized, add more methods here, and implement the added methods in customUsersModel.
func NewUsersModel ¶
func NewUsersModel(conn sqlx.SqlConn) UsersModel
NewUsersModel returns a model for the database table.
Source Files
¶
- accountBookInvitationsModel.go
- accountBookInvitationsModel_gen.go
- accountBookMembersModel.go
- accountBookMembersModel_gen.go
- accountBooksModel.go
- accountBooksModel_gen.go
- festivalsModel.go
- festivalsModel_gen.go
- recurringTransactionsModel.go
- recurringTransactionsModel_gen.go
- tagsModel.go
- tagsModel_gen.go
- transactionsModel.go
- transactionsModel_gen.go
- uploadFilesModel.go
- uploadFilesModel_gen.go
- userSettingsModel.go
- userSettingsModel_gen.go
- usersModel.go
- usersModel_gen.go
- vars.go