正在查看: 新暖心缘 v8.1.1 应用的 TemplateManager.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: 新暖心缘 v8.1.1 应用的 TemplateManager.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.qiniu.qvs;
import com.qiniu.common.QiniuException;
import com.qiniu.http.Client;
import com.qiniu.http.Response;
import com.qiniu.qvs.model.PatchOperation;
import com.qiniu.qvs.model.Template;
import com.qiniu.util.Auth;
import com.qiniu.util.StringMap;
import com.qiniu.util.UrlUtils;
import com.tencent.open.SocialConstants;
public class TemplateManager {
private final String apiServer;
private final Auth auth;
private final Client client;
public TemplateManager(Auth auth) {
this(auth, "http://qvs.qiniuapi.com");
}
public Response createTemplate(Template template) throws QiniuException {
StringMap stringMap = new StringMap();
stringMap.putNotNull("name", template.getName());
stringMap.putNotNull(SocialConstants.PARAM_APP_DESC, template.getDesc());
stringMap.putNotNull("bucket", template.getBucket());
stringMap.putNotNull("deleteAfterDays", Integer.valueOf(template.getDeleteAfterDays()));
stringMap.putNotNull("fileType", Integer.valueOf(template.getFileType()));
stringMap.putNotNull("recordFileFormat", Integer.valueOf(template.getRecordFileFormat()));
stringMap.putNotNull("templateType", Integer.valueOf(template.getTemplateType()));
stringMap.putNotNull("recordInterval", Integer.valueOf(template.getRecordInterval()));
stringMap.putNotNull("snapInterval", Integer.valueOf(template.getSnapInterval()));
stringMap.putNotNull("recordType", Integer.valueOf(template.getRecordType()));
stringMap.putNotNull("jpgOverwriteStatus", Boolean.valueOf(template.isJpgOverwriteStatus()));
stringMap.putNotNull("jpgSequenceStatus", Boolean.valueOf(template.isJpgSequenceStatus()));
stringMap.putNotNull("jpgOnDemandStatus", Boolean.valueOf(template.isJpgOnDemandStatus()));
return QvsResponse.post(String.format("%s/v1/templates", this.apiServer), stringMap, this.client, this.auth);
}
public Response deleteTemplate(String str) throws QiniuException {
return QvsResponse.delete(String.format("%s/v1/templates/%s", this.apiServer, str), this.client, this.auth);
}
public Response listTemplate(int i8, int i9, int i10, String str) throws QiniuException {
return QvsResponse.get(UrlUtils.composeUrlWithQueries(String.format("%s/v1/templates", this.apiServer), new StringMap().put("offset", Integer.valueOf(i8)).put("line", Integer.valueOf(i9)).put("templateType", Integer.valueOf(i10)).putNotEmpty("match", str)), this.client, this.auth);
}
public Response queryTemplate(String str) throws QiniuException {
return QvsResponse.get(String.format("%s/v1/templates/%s", this.apiServer, str), this.client, this.auth);
}
public Response updateTemplate(String str, PatchOperation[] patchOperationArr) throws QiniuException {
return QvsResponse.patch(String.format("%s/v1/templates/%s", this.apiServer, str), new StringMap().put("operations", patchOperationArr), this.client, this.auth);
}
public TemplateManager(Auth auth, String str) {
this(auth, str, new Client());
}
public TemplateManager(Auth auth, String str, Client client) {
this.auth = auth;
this.apiServer = str;
this.client = client;
}
}