6 changed files with 250 additions and 17 deletions
@ -0,0 +1,50 @@ |
|||||
|
package com.epmet.commons.tools.scan.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* 检测成功(检测成功+检测失败的)的任务详情 |
||||
|
* 处理中的该接口不返回,继续轮询即可 |
||||
|
* @author yinzuomei@elink-cn.com |
||||
|
* @date 2020/12/18 13:10 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class VoiceResultDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 8006827312407034344L; |
||||
|
/** |
||||
|
* 检测对象对应的数据ID。 |
||||
|
*/ |
||||
|
private String dataId; |
||||
|
|
||||
|
/** |
||||
|
* 检测任务的ID |
||||
|
*/ |
||||
|
private String taskId; |
||||
|
|
||||
|
/** |
||||
|
* 建议您执行的后续操作。取值: |
||||
|
* pass:结果正常,无需进行其余操作。 |
||||
|
* review:结果不确定,需要进行人工审核。 |
||||
|
* block:结果违规,建议直接删除或者限制公开。 |
||||
|
*/ |
||||
|
private String suggestion; |
||||
|
|
||||
|
/** |
||||
|
* 检测结果的分类。取值: |
||||
|
* normal:正常文本 |
||||
|
* spam:含垃圾信息 |
||||
|
* ad:广告 |
||||
|
* politics:涉政 |
||||
|
* terrorism:暴恐 |
||||
|
* abuse:辱骂 |
||||
|
* porn:色情 |
||||
|
* flood:灌水 |
||||
|
* contraband:违禁 |
||||
|
* meaningless:无意义 |
||||
|
* customized:自定义(例如命中自定义关键词) |
||||
|
*/ |
||||
|
private String label; |
||||
|
private String labelDesc; |
||||
|
} |
@ -0,0 +1,66 @@ |
|||||
|
package com.epmet.openapi.scan.common.enu; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 阿里检测结果的分类字典 |
||||
|
* |
||||
|
* @author yinzuomei@elink-cn.com |
||||
|
* @date 2020/12/18 14:04 |
||||
|
*/ |
||||
|
public enum LabelEnum { |
||||
|
NORMAL("normal", "正常文本"), |
||||
|
SPAM("spam", "含垃圾信息"), |
||||
|
AD("ad", "广告"), |
||||
|
POLITICS("politics","涉政"), |
||||
|
TERRORISM("terrorism","暴恐"), |
||||
|
ABUSE("abuse","辱骂"), |
||||
|
PORN("porn","色情"), |
||||
|
FLOOD("flood","灌水"), |
||||
|
CONTRABAND("contraband","违禁"), |
||||
|
MEANINGLESS("meaningless","无意义"), |
||||
|
CUSTOMIZED("customized","自定义"); |
||||
|
|
||||
|
private String code; |
||||
|
private String desc; |
||||
|
|
||||
|
LabelEnum(String code, String desc) { |
||||
|
this.code = code; |
||||
|
this.desc = desc; |
||||
|
} |
||||
|
|
||||
|
public static List<String> getLabelEnumList() { |
||||
|
List<String> result = new ArrayList<>(); |
||||
|
LabelEnum[] values = LabelEnum.values(); |
||||
|
for (LabelEnum v : values) { |
||||
|
result.add(v.getCode()); |
||||
|
} |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
public static String getDesc(String code) { |
||||
|
LabelEnum[] businessModeEnums = values(); |
||||
|
for (LabelEnum labelEnum : businessModeEnums) { |
||||
|
if (labelEnum.getCode().equals(code)) { |
||||
|
return labelEnum.getDesc(); |
||||
|
} |
||||
|
} |
||||
|
return ""; |
||||
|
} |
||||
|
public String getCode() { |
||||
|
return code; |
||||
|
} |
||||
|
|
||||
|
public void setCode(String code) { |
||||
|
this.code = code; |
||||
|
} |
||||
|
|
||||
|
public String getDesc() { |
||||
|
return desc; |
||||
|
} |
||||
|
|
||||
|
public void setDesc(String desc) { |
||||
|
this.desc = desc; |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue