
com.fastchar.extjs.appshare.web.AppShareAction Maven / Gradle / Ivy
The newest version!
package com.fastchar.extjs.appshare.web;
import com.fastchar.extjs.appshare.entity.FinalAppEntity;
import com.fastchar.core.FastAction;
import com.fastchar.core.FastFile;
import com.fastchar.core.FastHandler;
import com.fastchar.extjs.annotation.AFastSession;
/**
* @author 沈建(Janesen)
* @date 2020/5/19 14:55
*/
@AFastSession
public class AppShareAction extends FastAction {
@Override
protected String getRoute() {
return "/appshare";
}
public void upload() throws Exception {
doResolve();
responseJson(-1, "上传失败!请稍后重试!");
}
private void doResolve() throws Exception {
FastFile> paramFile = getParamFile();
if (paramFile.getUploadFileName().toLowerCase().endsWith(".apk")) {
FastHandler fastHandler = FinalAppEntity.dao().addAndroidApp("auto", paramFile.getFile());
responseJson(fastHandler.getCode(), fastHandler.getError());
} else if (paramFile.getUploadFileName().toLowerCase().endsWith(".ipa")) {
FastHandler fastHandler = FinalAppEntity.dao().addIOSApp("auto", paramFile.getFile());
responseJson(fastHandler.getCode(), fastHandler.getError());
} else {
responseJson(-1, "上传失败!暂不支持解析此文件!");
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy