-
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add batch content moderation api
添加主动批量审核 api
- Loading branch information
Showing
8 changed files
with
467 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
111 changes: 111 additions & 0 deletions
111
src/main/java/io/github/doocs/im/model/request/AuditContentItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
package io.github.doocs.im.model.request; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
import java.io.Serializable; | ||
|
||
/** | ||
* 云端审核主动批量审核内容项 | ||
* | ||
* @author bingo | ||
* @since 2023/10/31 10:25 | ||
*/ | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public class AuditContentItem implements Serializable { | ||
private static final long serialVersionUID = -4862840041361119218L; | ||
|
||
/** | ||
* 必填 | ||
* 内容 ID,数组里各个成员,不能重复的 ContentId。 | ||
*/ | ||
@JsonProperty("ContentId") | ||
private Integer contentId; | ||
|
||
/** | ||
* 必填 | ||
* 送审类型,批量审核接口里,限制取值:Text/Image,音视频送审请参见 主动审核接口 | ||
* {@link io.github.doocs.im.constant.AuditContentType} | ||
*/ | ||
@JsonProperty("ContentType") | ||
private String contentType; | ||
|
||
/** | ||
* 必填 | ||
* 送审内容,最大限制8KB,当审核文件时,填对应 URL。其中图片审核最大不超过5MB。 | ||
*/ | ||
@JsonProperty("Content") | ||
private String content; | ||
|
||
public AuditContentItem() { | ||
} | ||
|
||
public AuditContentItem(Integer contentId, String contentType, String content) { | ||
this.contentId = contentId; | ||
this.contentType = contentType; | ||
this.content = content; | ||
} | ||
|
||
private AuditContentItem(Builder builder) { | ||
this.contentId = builder.contentId; | ||
this.contentType = builder.contentType; | ||
this.content = builder.content; | ||
} | ||
|
||
public static Builder builder() { | ||
return new Builder(); | ||
} | ||
|
||
public Integer getContentId() { | ||
return contentId; | ||
} | ||
|
||
public void setContentId(Integer contentId) { | ||
this.contentId = contentId; | ||
} | ||
|
||
public String getContentType() { | ||
return contentType; | ||
} | ||
|
||
public void setContentType(String contentType) { | ||
this.contentType = contentType; | ||
} | ||
|
||
public String getContent() { | ||
return content; | ||
} | ||
|
||
public void setContent(String content) { | ||
this.content = content; | ||
} | ||
|
||
|
||
public static final class Builder { | ||
private Integer contentId; | ||
private String contentType; | ||
private String content; | ||
|
||
private Builder() { | ||
} | ||
|
||
public AuditContentItem build() { | ||
return new AuditContentItem(this); | ||
} | ||
|
||
public Builder contentId(Integer contentId) { | ||
this.contentId = contentId; | ||
return this; | ||
} | ||
|
||
public Builder contentType(String contentType) { | ||
this.contentType = contentType; | ||
return this; | ||
} | ||
|
||
public Builder content(String content) { | ||
this.content = content; | ||
return this; | ||
} | ||
} | ||
} |
87 changes: 87 additions & 0 deletions
87
src/main/java/io/github/doocs/im/model/request/BatchContentModerationRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
package io.github.doocs.im.model.request; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
import java.io.Serializable; | ||
import java.util.List; | ||
|
||
/** | ||
* 云端审核主动批量审核-请求参数 | ||
* | ||
* @author bingo | ||
* @since 2023/10/31 10:25 | ||
*/ | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public class BatchContentModerationRequest extends GenericRequest implements Serializable { | ||
private static final long serialVersionUID = 1971966887350107478L; | ||
|
||
/** | ||
* 表明送审策略,取值:C2C/Group/UserInfo/GroupInfo/GroupMemberInfo/RelationChain | ||
* {@link io.github.doocs.im.constant.AuditNameType} | ||
*/ | ||
@JsonProperty("AuditName") | ||
private String auditName; | ||
|
||
/** | ||
* 批量送审数组,最多支持10个内容批量送审。 | ||
*/ | ||
@JsonProperty("Contents") | ||
private List<AuditContentItem> contents; | ||
|
||
public BatchContentModerationRequest() { | ||
} | ||
|
||
public BatchContentModerationRequest(String auditName, List<AuditContentItem> contents) { | ||
this.auditName = auditName; | ||
this.contents = contents; | ||
} | ||
|
||
private BatchContentModerationRequest(Builder builder) { | ||
this.auditName = builder.auditName; | ||
this.contents = builder.contents; | ||
} | ||
|
||
public static Builder builder() { | ||
return new Builder(); | ||
} | ||
|
||
public String getAuditName() { | ||
return auditName; | ||
} | ||
|
||
public void setAuditName(String auditName) { | ||
this.auditName = auditName; | ||
} | ||
|
||
public List<AuditContentItem> getContents() { | ||
return contents; | ||
} | ||
|
||
public void setContents(List<AuditContentItem> contents) { | ||
this.contents = contents; | ||
} | ||
|
||
|
||
public static final class Builder { | ||
private String auditName; | ||
private List<AuditContentItem> contents; | ||
|
||
private Builder() { | ||
} | ||
|
||
public BatchContentModerationRequest build() { | ||
return new BatchContentModerationRequest(this); | ||
} | ||
|
||
public Builder auditName(String auditName) { | ||
this.auditName = auditName; | ||
return this; | ||
} | ||
|
||
public Builder contents(List<AuditContentItem> contents) { | ||
this.contents = contents; | ||
return this; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/main/java/io/github/doocs/im/model/response/BatchContentModerationResult.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package io.github.doocs.im.model.response; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
import java.io.Serializable; | ||
import java.util.List; | ||
|
||
/** | ||
* 云端审核主动批量审核结果 | ||
* | ||
* @author bingo | ||
* @since 2023/10/31 10:25 | ||
*/ | ||
public class BatchContentModerationResult extends GenericResult implements Serializable { | ||
private static final long serialVersionUID = 2158637502606683308L; | ||
|
||
@JsonProperty("AuditResults") | ||
private List<BatchContentModerationResultItem> auditResults; | ||
|
||
public List<BatchContentModerationResultItem> getAuditResults() { | ||
return auditResults; | ||
} | ||
|
||
public void setAuditResults(List<BatchContentModerationResultItem> auditResults) { | ||
this.auditResults = auditResults; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "BatchContentModerationResult{" + | ||
"auditResults=" + auditResults + | ||
", actionStatus='" + actionStatus + '\'' + | ||
", errorInfo='" + errorInfo + '\'' + | ||
", errorCode=" + errorCode + | ||
'}'; | ||
} | ||
} |
Oops, something went wrong.