article_security.go
2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package domain
import (
"context"
"github.com/silenceper/wechat/v2/miniprogram/security"
"gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/interanl/pkg/db/transaction"
)
type ArticleSecurity struct {
Id int64 // 唯一标识
ContentKeyWords []string // 内容关键字
ContentType int `json:"contentType,omitempty"` // 内容类型 (1:文章 2:评论)
ContentId int64 `json:"contentId,omitempty"` // 内容ID
AuthorId int64 `json:"authorId,omitempty"` // 发布人
AuthorName string `json:"authorName,omitempty"` // 发布人
Reviewer int64 `json:"reviewer,omitempty"` // 审核人
ReviewStatus int `json:"reviewStatus,omitempty"` // 审核状态 1:待审核 2:通过 3:拒绝
Label string // 标签
Prob int // 分值
Suggest string // 建议 通过、风险、人工审核
Detail MsgCheckDetail `json:"detail,omitempty"`
AutoReviewAt int64 `json:"autoReviewAt,omitempty"` // 自动审核时间
AutoReviewErrorCode string `json:"autoReviewErrorCode,omitempty"` // 自动审核错误码
ReviewAt int64 `json:"reviewAt,omitempty"` // 审核时间(人工处置时间)
CreatedAt int64 `json:"createdAt,omitempty"`
UpdatedAt int64 `json:"updatedAt,omitempty"`
DeletedAt int64 `json:"deletedAt,omitempty"`
Version int `json:"version,omitempty"`
}
const (
ReviewStatusWait = iota + 1
ReviewStatusPass
ReviewStatusFail
)
const (
TypeArticle = 1
TypeComment = 2
)
type MsgCheckDetail security.MsgCheckResponse
type ArticleSecurityRepository interface {
Insert(ctx context.Context, conn transaction.Conn, dm *ArticleSecurity) (*ArticleSecurity, error)
Update(ctx context.Context, conn transaction.Conn, dm *ArticleSecurity) (*ArticleSecurity, error)
UpdateWithVersion(ctx context.Context, conn transaction.Conn, dm *ArticleSecurity) (*ArticleSecurity, error)
Delete(ctx context.Context, conn transaction.Conn, dm *ArticleSecurity) (*ArticleSecurity, error)
FindOne(ctx context.Context, conn transaction.Conn, id int64) (*ArticleSecurity, error)
Find(ctx context.Context, conn transaction.Conn, queryOptions map[string]interface{}) (int64, []*ArticleSecurity, error)
}
func (m *ArticleSecurity) Identify() interface{} {
if m.Id == 0 {
return nil
}
return m.Id
}