Documentation
¶
Index ¶
- Constants
- Variables
- func ClearTable(tbname string) error
- func FieldAddPrev(prev, fieldStr string) string
- func Init()
- func InputDatabase() (oldDb, newDb *sql.DB, err error)
- func Ip2long(ipstr string) uint32
- func Long2ip(ipLong uint32) string
- func ToForum() (bool, string)
- func ToPost() (bool, string)
- func ToThread() (bool, string)
- func ToUser() (bool, string)
- type DForum
- type DPost
- type DThread
- type DUser
- type Forum
- type Hostinfo
- type NewUsers
- type Post
- type Thread
- type User
- type UserInfo
Constants ¶
View Source
const ( PreInsertErr = "预插入 %s 失败: %s" InsertErr = "插入 %s 失败: %s" SelectErr = "查询 %s 失败: %s" InsertSuccess = "插入 %s, 成功 %d 条" ClearErrMsg = "清理 %s 失败: %s" UpdateSuccess = "更新 %s 成功, uid为 %s" )
View Source
const ( DxForum = "pre_forum_forum" XnForum = "bbs_forum" )
View Source
const ( DxPost = "pre_forum_post" XnPost = "bbs_post" Sid = "56912b6948e57" )
View Source
const ( DxThread = "pre_forum_thread" XnThread = "bbs_thread" XnMyThread = "bbs_mythread" )
View Source
const ( DxUser = "pre_common_member" DxUcUser = "pre_ucenter_members" DxUserStatus = "pre_common_member_status" XnUser = "bbs_user" )
Variables ¶
View Source
var ( OldDB, NewDB *sql.DB ClearTB = true //是否先清理表 MergeUser = true //是否合并用户 ResetPost = false //AdminUid = 1 //管理员 uid AdminUid string )
数据库初始化
Functions ¶
func InputDatabase ¶
Types ¶
type DPost ¶
type DPost struct {
Tid int //主题 id
Pid int //帖子 id
AuthorId int //用户 id
First int //主帖
Dateline int //发帖时间戳
UseIp string //用户 ip
Message string //内容
Fid int //版块 id
Subject string //标题
}
*
dx 帖子表
type DThread ¶
type DThread struct {
Tid int //主题 id
Fid int //版块 id
AuthorId int //发帖者id
Subject string //标题
Dateline int //发帖时间
Lastpost int //最后回复时间
Views int //浏览数
Replies int //回复数
}
*
dx 主题表
type DUser ¶
type DUser struct {
Uid,
GroupId,
RegDate int //注册时间
Email,
UserName,
Password,
Salt,
UcPassword,
Regip,
Lastip string //最后登陆 ip
Lastvisit int //最后登陆时间
}
*
pre_common_member dx 用户表
type Forum ¶
type Forum struct {
Fid int //版块 id
Name string //版块名
Threads int //主题数
Brief string //介绍
CreateDate int //创建时间
}
*
xn 版块表
type Post ¶
type Post struct {
Tid int //主题 id
Pid int //帖子 id
Uid int //用户 id
IsFirst int //主帖,与 thread.firstpid 呼应
CreateDate int //发帖时间戳
UserIp int //用户 ip ip2long()
Sid string //标识串
Message string //内容
}
*
xn 帖子表
type Thread ¶
type Thread struct {
Fid int //版块 id
Tid int //主题 id
Uid int //发帖者id
UserIp int //发帖者 ip
Subject string //标题
CreateDate int //发帖时间
LastDate int //最后回复时间
Views int //浏览数
Posts int //回复数
FirstPId int //主题帖 id
LastUid int //最后回复人
LastPid int //最后回复 id
}
*
xn 主题表
Click to show internal directories.
Click to hide internal directories.