Files
backend/internal/pkg/tencent/config.go
lan 9a1851f023
Some checks failed
Build Backend / build (push) Successful in 1m56s
Build Backend / build-docker (push) Has been cancelled
refactor: cleanup unused code and simplify internal packages
This commit performs a significant cleanup of the codebase by removing unused functions, methods, and entire files across various internal modules. This reduces technical debt and simplifies the project structure.

Key changes include:
- **cache**: Removed unused cache key generators and metrics snapshots.
- **dto**: Removed redundant converter functions and segment creation helpers.
- **middleware**: Deleted the unused `logger.go` middleware and simplified `ratelimit.go` and `casbin.go`.
- **model**: Removed unused ID helpers, database closing functions, and batch decryption logic.
- **pkg**: Cleaned up unused utility functions in `circuitbreaker`, `crypto`, `cursor`, `hook`, and `utils`.
- **service**: Deleted `account_cleanup_service.go` and removed unused helper functions in `log_cleanup_service.go` and `sensitive_service.go`.
- **repository**: Removed unused private loading methods in `comment_repo.go`.
2026-05-14 02:24:30 +08:00

49 lines
1.0 KiB
Go

package tencent
type Config struct {
Enabled bool
SecretID string
SecretKey string
Region string
BizType string
Timeout int
}
type ModerationSuggestion string
const (
SuggestionPass ModerationSuggestion = "Pass"
SuggestionReview ModerationSuggestion = "Review"
SuggestionBlock ModerationSuggestion = "Block"
)
type ModerationResponse struct {
Suggestion ModerationSuggestion
Label string
RiskLevel string
Keywords []string
RequestID string
}
type textModerationRequest struct {
Content string `json:"Content"`
BizType string `json:"BizType,omitempty"`
}
type tencentAPIResponse struct {
Response struct {
Suggestion string `json:"Suggestion"`
Label string `json:"Label"`
RiskLevel string `json:"RiskLevel"`
Keywords []struct {
Word string `json:"Word"`
} `json:"Keywords,omitempty"`
RequestID string `json:"RequestId"`
Error *struct {
Code string `json:"Code"`
Message string `json:"Message"`
} `json:"Error,omitempty"`
} `json:"Response"`
}