Documentation
¶
Index ¶
- type ArgsCreate
- type ArgsDeleteByBind
- type ArgsDeleteByID
- type ArgsDeleteByOrg
- type ArgsDeleteByUser
- type ArgsGetAnalysisAvg
- type ArgsGetAnalysisAvgOne
- type ArgsGetList
- type ArgsUpdate
- type Comment
- func (t *Comment) Create(args *ArgsCreate) (data FieldsComment, err error)
- func (t *Comment) DeleteByBind(args *ArgsDeleteByBind) (err error)
- func (t *Comment) DeleteByID(args *ArgsDeleteByID) (err error)
- func (t *Comment) DeleteByOrg(args *ArgsDeleteByOrg) (err error)
- func (t *Comment) DeleteByUser(args *ArgsDeleteByUser) (err error)
- func (t *Comment) GetAnalysisAvg(args *ArgsGetAnalysisAvg) (dataList []DataGetAnalysisAvg, err error)
- func (t *Comment) GetAnalysisAvgOne(args *ArgsGetAnalysisAvgOne) (resultData int, err error)
- func (t *Comment) GetByID(id int64) (data FieldsComment)
- func (t *Comment) GetCountByFrom(bindID int64) (count int64)
- func (t *Comment) GetList(args *ArgsGetList) (dataList []FieldsComment, dataCount int64, err error)
- func (t *Comment) Update(args *ArgsUpdate) (err error)
- type DataGetAnalysisAvg
- type DataGetAnalysisAvgOne
- type FieldsComment
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArgsCreate ¶
type ArgsCreate struct {
//上级ID
// 评论的上下级关系,一旦建立无法修改
ParentID int64 `db:"parent_id" json:"parentID" check:"id" empty:"true"`
//绑定组织
// 该组织根据资源来源设定
// 如果是平台资源,则为0
OrgID int64 `db:"org_id" json:"orgID" check:"id" empty:"true"`
//所属用户
UserID int64 `db:"user_id" json:"userID" check:"id"`
//绑定内容
BindID int64 `db:"bind_id" json:"bindID" check:"id"`
//评价类型
// 0 好评 1 中立 2 差评
LevelType int `db:"level_type" json:"levelType"`
//分数
Level int `db:"level" json:"level"`
//标题
Title string `db:"title" json:"title" check:"title" min:"1" max:"100"`
//内容
Des string `db:"des" json:"des" check:"des" min:"1" max:"600" empty:"true"`
//介绍图文
DesFiles pq.Int64Array `db:"des_files" json:"desFiles" check:"ids" empty:"true"`
//扩展参数
Params CoreSQLConfig.FieldsConfigsType `db:"params" json:"params"`
}
ArgsCreate 创建新的评论参数
type ArgsDeleteByBind ¶
type ArgsDeleteByBind struct {
//绑定内容
BindID int64 `db:"bind_id" json:"bindID" check:"id"`
//绑定组织
// 用于验证
OrgID int64 `db:"org_id" json:"orgID" check:"id" empty:"true"`
}
ArgsDeleteByBind 删除来源所有评论参数
type ArgsDeleteByID ¶
type ArgsDeleteByID struct {
//ID
ID int64 `db:"id" json:"id" check:"id"`
//绑定组织
// 用于验证
OrgID int64 `db:"org_id" json:"orgID" check:"id" empty:"true"`
//所属用户
// 用于验证
UserID int64 `db:"user_id" json:"userID" check:"id" empty:"true"`
}
ArgsDeleteByID 删除评论ID参数
type ArgsDeleteByOrg ¶
type ArgsDeleteByOrg struct {
//组织ID
OrgID int64 `db:"org_id" json:"orgID" check:"id"`
}
ArgsDeleteByOrg 删除组织所有数据参数
type ArgsDeleteByUser ¶
type ArgsDeleteByUser struct {
//所属用户
UserID int64 `db:"user_id" json:"userID" check:"id"`
//绑定组织
// 用于验证
OrgID int64 `db:"org_id" json:"orgID" check:"id" empty:"true"`
}
ArgsDeleteByUser 删除用户所有评论参数
type ArgsGetAnalysisAvg ¶
type ArgsGetAnalysisAvg struct {
//组织ID
// 留空则表明为平台的用户留下的内容
OrgID int64 `db:"org_id" json:"orgID" check:"id"`
//绑定ID
BindID int64 `db:"bind_id" json:"bindID" check:"id" empty:"true"`
//购买人
UserID int64 `db:"user_id" json:"userID" check:"id" empty:"true"`
//结构方式
// year / month / day / hour
TimeType string `json:"timeType" check:"mark"`
}
ArgsGetAnalysisAvg 统计指定范围的评价平均值参数
type ArgsGetAnalysisAvgOne ¶
type ArgsGetList ¶
type ArgsGetList struct {
//分页
Pages CoreSQLPages.ArgsDataList `json:"pages"`
//评论ID
// 评论被删除后出现,指向新的评论
// 下级评论的上级江全部改为该新的ID
CommentID int64 `db:"comment_id" json:"commentID" check:"id" empty:"true"`
//上级ID
ParentID int64 `json:"parentID" check:"id" empty:"true"`
//绑定组织
// 该组织根据资源来源设定
// 如果是平台资源,则为0
OrgID int64 `db:"org_id" json:"orgID" check:"id" empty:"true"`
//所属用户
UserID int64 `db:"user_id" json:"userID" check:"id" empty:"true"`
//绑定ID
BindID int64 `json:"bindID" check:"id" empty:"true"`
//评价类型
// 0 好评 1 中立 2 差评
LevelType int `db:"level_type" json:"levelType"`
//分数范围
LevelMin int `db:"level_min" json:"levelMin"`
LevelMax int `db:"level_max" json:"levelMax"`
//是否删除
IsRemove bool `db:"is_remove" json:"isRemove" check:"bool"`
//搜索
Search string `json:"search" check:"search" empty:"true"`
}
ArgsGetList 获取列表参数
type ArgsUpdate ¶
type ArgsUpdate struct {
//ID
ID int64 `db:"id" json:"id" check:"id"`
//绑定组织
// 用于验证
OrgID int64 `db:"org_id" json:"orgID" check:"id" empty:"true"`
//所属用户
// 用于验证
UserID int64 `db:"user_id" json:"userID" check:"id" empty:"true"`
//评价类型
// 0 好评 1 中立 2 差评
LevelType int `db:"level_type" json:"levelType"`
//分数
Level int `db:"level" json:"level"`
//标题
Title string `db:"title" json:"title" check:"name" empty:"true"`
//内容
Des string `db:"des" json:"des" check:"des" min:"1" max:"600" empty:"true"`
//介绍图文
DesFiles pq.Int64Array `db:"des_files" json:"desFiles" check:"ids" empty:"true"`
//扩展参数
Params CoreSQLConfig.FieldsConfigsType `db:"params" json:"params"`
}
ArgsUpdate 修改评论参数
type Comment ¶
type Comment struct {
//主表
TableName string
//用户是否可以为某个绑定关系创建多个评论
UserMoreComment bool
//用户是否可以编辑评论
UserEditComment bool
//用户是否可以删除评论
UserDeleteComment bool
//组织是否可以删除评论
OrgDeleteComment bool
//系统来源
// 用于推送nats等操作
System string
}
Comment 通用评论模块 * 可以模块引用到
func (*Comment) Create ¶
func (t *Comment) Create(args *ArgsCreate) (data FieldsComment, err error)
Create 创建新的评论
func (*Comment) DeleteByBind ¶
func (t *Comment) DeleteByBind(args *ArgsDeleteByBind) (err error)
DeleteByBind 删除来源所有评论
func (*Comment) DeleteByID ¶
func (t *Comment) DeleteByID(args *ArgsDeleteByID) (err error)
DeleteByID 删除评论ID
func (*Comment) DeleteByOrg ¶
func (t *Comment) DeleteByOrg(args *ArgsDeleteByOrg) (err error)
DeleteByOrg 删除组织所有数据
func (*Comment) DeleteByUser ¶
func (t *Comment) DeleteByUser(args *ArgsDeleteByUser) (err error)
DeleteByUser 删除用户所有评论
func (*Comment) GetAnalysisAvg ¶
func (t *Comment) GetAnalysisAvg(args *ArgsGetAnalysisAvg) (dataList []DataGetAnalysisAvg, err error)
GetAnalysisAvg 统计指定范围的评价平均值
func (*Comment) GetAnalysisAvgOne ¶
func (t *Comment) GetAnalysisAvgOne(args *ArgsGetAnalysisAvgOne) (resultData int, err error)
GetAnalysisAvgOne 统计指定绑定的评价平均值
func (*Comment) GetCountByFrom ¶
GetCountByFrom 获取评论人数
func (*Comment) GetList ¶
func (t *Comment) GetList(args *ArgsGetList) (dataList []FieldsComment, dataCount int64, err error)
GetList 获取列表
type DataGetAnalysisAvg ¶
type DataGetAnalysisAvg struct {
//时间
DayTime string `db:"d" json:"dayTime"`
//数据
Count int `db:"count" json:"count"`
}
DataGetAnalysisAvg 统计指定范围的评价平均值数据
type DataGetAnalysisAvgOne ¶
type DataGetAnalysisAvgOne struct {
//数据
Count int `db:"count" json:"count"`
}
type FieldsComment ¶
type FieldsComment struct {
//ID
ID int64 `db:"id" json:"id"`
//创建时间
CreateAt time.Time `db:"create_at" json:"createAt"`
//删除时间
DeleteAt time.Time `db:"delete_at" json:"deleteAt"`
//评论ID
// 评论被删除后出现,指向新的评论
// 下级评论的上级江全部改为该新的ID
CommentID int64 `db:"comment_id" json:"commentID"`
//上级ID
// 评论的上下级关系,一旦建立无法修改
ParentID int64 `db:"parent_id" json:"parentID"`
//绑定组织
// 该组织根据资源来源设定
// 如果是平台资源,则为0
OrgID int64 `db:"org_id" json:"orgID"`
//所属用户
UserID int64 `db:"user_id" json:"userID"`
//绑定内容
BindID int64 `db:"bind_id" json:"bindID"`
//评价类型
// 0 好评 1 中立 2 差评
LevelType int `db:"level_type" json:"levelType"`
//分数
Level int `db:"level" json:"level"`
//标题
Title string `db:"title" json:"title"`
//内容
Des string `db:"des" json:"des"`
//介绍图文
DesFiles pq.Int64Array `db:"des_files" json:"desFiles"`
//扩展参数
Params CoreSQLConfig.FieldsConfigsType `db:"params" json:"params"`
}
Click to show internal directories.
Click to hide internal directories.