All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.netease.yidun.sdk.irisk.v1.IRiskMediaCheckDemo Maven / Gradle / Ivy

The newest version!
package com.netease.yidun.sdk.irisk.v1;

import com.netease.yidun.sdk.AbstractDemo;
import com.netease.yidun.sdk.irisk.v1.mediacheck.IRiskMediaCheckRequest;
import com.netease.yidun.sdk.irisk.v1.mediacheck.IRiskMediaCheckResponse;
import com.netease.yidun.sdk.irisk.v1.mediacheck.IRiskMediaCheckResult;

/**
 * 【智能风控】图片外挂识别接口demo
 */
public class IRiskMediaCheckDemo extends AbstractDemo {

    public static void main(String[] args) {

        // 实例化发起请求的client对象
        IRiskClient iRiskClient = IRiskClient.getInstance("SecretId", "SecretKey");
        // 如需自定义请求器参数,可使用参考如下方式创建ClientProfile,然后创建client
//        ClientProfile profile = createProfile("secretId", "secretKey");
//        IRiskClient client = new IRiskClient(profile);
        // 填充请求参数
        IRiskMediaCheckRequest request = new IRiskMediaCheckRequest("businessId");
        // 用户/玩家的角色 ID
        request.setRoleId("xxxx");
        // 用户/玩家的角色名称
        request.setNickname("yyyyy");
        // 图片的文件名,(需要包含文件的后缀)。
        request.setMediaName("xxx.jpg");
        // 请求ip
        request.setIp("192.168.0.1");
        // 图片数据,图片支持类型为BASE64的数据,无需包含base64协议请求头部分
        request.setMediaData("/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBwgHBgkIBwgKCgkLDRYPDQwMDRsUFRAWIB0iIiAdHx8kKDQsJCYxJx8fLT0tMTU3Ojo6Iys/RD84QzQ5OjcBCgoKDQwNGg8PGjclHyU3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3N//AABEIAFwAXAMBIgACEQEDEQH/xAAbAAACAwEBAQAAAAAAAAAAAAAEBQIDBgEHAP/EADMQAAIBAwIEBAUCBgMAAAAAAAECAwAEERIhBRMxQSJRcZEGFDJhgSNSB5KhsdHhQmJ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d8ChExxgehon4aJlgVx+m65GpO+PMdKPnwz5caiR1Nc3dTkKdTSXFlYLjc//Z");
        // 玩家的服务器名称
        request.setServer("比尔吉沃特");
        IRiskMediaCheckResponse mediaCheckResponse = null;
        try {
            mediaCheckResponse = iRiskClient.mediaCheck(request);
        } catch (Exception e) {
            e.printStackTrace();
        }
        if (mediaCheckResponse != null && mediaCheckResponse.getCode() == 200) {
            IRiskMediaCheckResult data = mediaCheckResponse.getData();
            // 得到检测任务 ID,可自行决定是否存储。若存储可用于记录该次数据请求以及数据核查追踪。
            String taskId = data.getTaskId();
        }

    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy