diff --git a/README.md b/README.md index fe5d01aadc1e323f18a097dc0a1a694ffb4e1998..ac896a5abd8196fcce1c14c718bf7e46c820c3c7 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,8 @@ - 功能:web端与app端文件传输 - 项目移植状态:完成 - 调用差异:因网络库限制 暂不支持断点续传功能以及文件传输速度无法控制。 - +#### 效果演示 +![效果演示](img/demo.gif "效果演示.gif") #### 使用说明: ```java @@ -34,8 +35,8 @@ public class UserController { @PostMapping(path = "/upload", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) String upload(@RequestParam(name = "avatar") MultipartFile file) throws IOException { - File localFile = ...FileUtils.createRandomFile(file); - + File localFile = FileUtils.createRandomFile(file); + ... return localFile.getAbsolutePath(); } diff --git a/build.gradle b/build.gradle index fa0982e0b0e3e4b27a986a728df526d1b262c1c3..c7b70cc862a9adb389fbda507b558ff7cda7cfe7 100755 --- a/build.gradle +++ b/build.gradle @@ -22,7 +22,7 @@ buildscript { dependencies { classpath 'com.huawei.ohos:hap:2.4.2.7' classpath "com.yanzhenjie.andserver:plugin:2.1.7" - classpath 'com.huawei.ohos:decctest:1.0.0.6' + classpath 'com.huawei.ohos:decctest:1.0.0.7' } } diff --git a/entry/build.gradle b/entry/build.gradle index 3a58d12e67a66d463894ca422e7ee0aa8740f316..1d442aec75f0417a7de04016fbbcfd939f629ce0 100644 --- a/entry/build.gradle +++ b/entry/build.gradle @@ -1,6 +1,12 @@ apply plugin: 'com.huawei.ohos.hap' apply plugin: 'com.yanzhenjie.andserver' +apply plugin: 'com.huawei.ohos.decctest' + ohos { + + signingConfigs { + + } compileSdkVersion 5 defaultConfig { compatibleSdkVersion 5 @@ -13,8 +19,8 @@ ohos { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) testCompile 'junit:junit:4.12' - api project(':api') - api project(':annotation') + api project(':api') + api project(':annotation') annotationProcessor project(':processor') api 'org.apache.commons:commons-lang3:3.9' api 'com.alibaba:fastjson:1.1.71.android' @@ -23,4 +29,6 @@ dependencies { implementation 'io.openharmony.tpc.thirdlib:EventBus:1.0.2' implementation 'io.openharmony.tpc.thirdlib:BGARefreshLayout-ohos:1.0.0' implementation 'io.openharmony.tpc.thirdlib:XPopup:1.0.3' + ohosTestImplementation 'com.huawei.ohos.testkit:runner:1.0.0.100' + } diff --git a/entry/src/main/config.json b/entry/src/main/config.json index 3ad619c202f37310b311c25c3467fdd7ba49b382..cf2e12db081a2623f34c0dba1b8a57e4051e556d 100644 --- a/entry/src/main/config.json +++ b/entry/src/main/config.json @@ -3,11 +3,11 @@ "bundleName": "com.yanzhenjie.hos", "vendor": "yanzhenjie", "version": { - "code": 1, + "code": 1000000, "name": "1.0.0" }, "apiVersion": { - "compatible": 5, + "compatible": 4, "target": 5, "releaseType": "Release" } diff --git a/entry/src/main/java/com/yanzhenjie/andserver/slice/MainAbilitySlice.java b/entry/src/main/java/com/yanzhenjie/andserver/slice/MainAbilitySlice.java index 43a2c2000a4dbdefc1fdb01b924374bf89e83598..afcfce640a6e2c04dc08b974c5388bf653fd02e1 100644 --- a/entry/src/main/java/com/yanzhenjie/andserver/slice/MainAbilitySlice.java +++ b/entry/src/main/java/com/yanzhenjie/andserver/slice/MainAbilitySlice.java @@ -6,9 +6,9 @@ import cn.bingoogolapple.refreshlayout.BgarefreshLayout; import com.github.clans.fab.FloatingActionButton; import com.lxj.xpopup.XPopup; -import com.lxj.xpopup.interfaces.OnConfirmListener; + import com.yanzhenjie.andserver.MyCommonEventSubscriber; -import com.yanzhenjie.andserver.dialog.BottomDialog; + import com.yanzhenjie.andserver.dialog.CustomAttachPopup2; import com.yanzhenjie.andserver.dialog.ZhihuCommentPopup; @@ -224,26 +224,26 @@ public class MainAbilitySlice extends AbilitySlice implements Component.ClickedL if (null != resultData.getParams()) { IntentParams parms = resultData.getParams(); - ArrayList pathlist=new ArrayList<>(); + ArrayList pathlist = new ArrayList<>(); String uri1 = null; - ArrayList urilist=new ArrayList<>(); - ArrayList filelist=new ArrayList<>(); + ArrayList urilist = new ArrayList<>(); + ArrayList filelist = new ArrayList<>(); for (String key : parms.keySet()) { - pathlist= (ArrayList) parms.getParam(key); + pathlist = (ArrayList) parms.getParam(key); } - for(int i=0; i