init: hgmj server initial commit

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-10-08 16:50:13 +08:00
co-authored by Claude Opus 4.7
commit 625e89c15d
1870 changed files with 254090 additions and 0 deletions
+42
View File
@@ -0,0 +1,42 @@
package contentreviewser
import (
"91jd-server/models/v/contentreviewmod"
"91jd-server/models/v/vidmod"
"go.mongodb.org/mongo-driver/bson/primitive"
)
// videoScanner 视频帖子扫描策略;匹配 title / content / richText(不检测 tag)
type videoScanner struct{}
func (s *videoScanner) CountTotal() (int64, error) {
return vidmod.CountForReview()
}
func (s *videoScanner) ScanBatch(taskID, lastID primitive.ObjectID, terms []string) (*ScanResult, error) {
batch, err := vidmod.FindForReviewBatch(lastID, scanBatchSize)
if err != nil {
return nil, err
}
if len(batch) == 0 {
return &ScanResult{Done: true}, nil
}
issues := make([]*contentreviewmod.ReviewIssue, 0, len(batch))
for _, v := range batch {
b := newIssueBuilder(taskID, contentreviewmod.IssueTargetVideo, v.ID).
MatchTitle("标题", v.Title, terms).
MatchContent("内容", v.Content, terms).
MatchRichText("富文本", v.RichText, terms)
if b.HasHits() {
issues = append(issues, b.Build())
}
}
return &ScanResult{
Issues: issues,
Checked: int64(len(batch)),
NextID: batch[len(batch)-1].ID,
}, nil
}