代码拉取完成,页面将自动刷新
// Copyright 2016 The StudyGolang Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// http://studygolang.com
// Author: polaris polaris@studygolang.com
package model
// 不要修改常量的顺序
const (
TypeTopic = iota // 主题
TypeArticle // 博文
TypeResource // 资源
TypeWiki // WIKI
TypeProject // 开源项目
TypeBook // 图书
)
const (
TopicURI = "topics"
ArticleURI = "articles"
ResourceURI = "resources"
WikiURI = "wiki"
ProjectURI = "p"
BookURI = "book"
)
var PathUrlMap = map[int]string{
TypeTopic: "/topics/",
TypeArticle: "/articles/",
TypeResource: "/resources/",
TypeWiki: "/wiki/",
TypeProject: "/p/",
TypeBook: "/book/",
}
var TypeNameMap = map[int]string{
TypeTopic: "主题",
TypeArticle: "博文",
TypeResource: "资源",
TypeWiki: "Wiki",
TypeProject: "项目",
TypeBook: "图书",
}
// 评论信息(通用)
type Comment struct {
Cid int `json:"cid" xorm:"pk autoincr"`
Objid int `json:"objid"`
Objtype int `json:"objtype"`
Content string `json:"content"`
Uid int `json:"uid"`
Floor int `json:"floor"`
Flag int `json:"flag"`
Ctime OftenTime `json:"ctime" xorm:"created"`
Objinfo map[string]interface{} `json:"objinfo" xorm:"-"`
ReplyFloor int `json:"reply_floor" xorm:"-"` // 回复某一楼层
}
func (*Comment) TableName() string {
return "comments"
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。