Ai
1 Star 0 Fork 0

鹏程/studygolang

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
comment.go 1.54 KB
一键复制 编辑 原始数据 按行查看 历史
polarisxu 提交于 2018-02-18 18:23 +08:00 . 突出显示某个评论,即评论详情
// 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"
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/barry_zpc/studygolang.git
git@gitee.com:barry_zpc/studygolang.git
barry_zpc
studygolang
studygolang
master

搜索帮助