取名小程序

This commit is contained in:
cjd
2025-11-06 19:23:42 +08:00
parent 68ae25fac2
commit 823dc8d37b
8 changed files with 490 additions and 17 deletions

View File

@@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
namespace DouyinApi.Model.Security
{
public class ContentSecurityResult
{
public bool IsSafe { get; init; }
public string RiskCode { get; init; } = string.Empty;
public string Message { get; init; } = string.Empty;
public IReadOnlyList<string> HitKeywords { get; init; } = Array.Empty<string>();
public static ContentSecurityResult Safe() => new ContentSecurityResult { IsSafe = true };
public static ContentSecurityResult Unsafe(string riskCode, string message) => Unsafe(riskCode, message, Array.Empty<string>());
public static ContentSecurityResult Unsafe(string riskCode, string message, IReadOnlyList<string> keywords)
=> new ContentSecurityResult
{
IsSafe = false,
RiskCode = riskCode,
Message = message,
HitKeywords = keywords ?? Array.Empty<string>()
};
public static ContentSecurityResult Failure(string message)
=> new ContentSecurityResult
{
IsSafe = true,
Message = message
};
}
}