|
|
|
@ -2,6 +2,7 @@ package com.common.commonlibtest;
|
|
|
|
|
|
|
|
|
|
import android.content.Intent;
|
|
|
|
|
import android.os.Bundle;
|
|
|
|
|
import android.widget.Toast;
|
|
|
|
|
|
|
|
|
|
import androidx.appcompat.app.AppCompatActivity;
|
|
|
|
|
|
|
|
|
@ -15,6 +16,7 @@ import com.common.commonlib.net.interceptor.RequestHeadInterceptor;
|
|
|
|
|
import com.common.commonlib.net.interceptor.ResponseHeadInterceptor;
|
|
|
|
|
import com.common.commonlib.utils.BaseUtils;
|
|
|
|
|
import com.common.commonlib.utils.FTPUtils;
|
|
|
|
|
import com.common.commonlib.utils.MMKVUtils;
|
|
|
|
|
import com.common.commonlibtest.bean.ArticlesResponse;
|
|
|
|
|
import com.common.commonlibtest.bean.CollectionResponse;
|
|
|
|
|
import com.common.commonlibtest.bean.LoginResponse;
|
|
|
|
@ -78,7 +80,8 @@ public class DemoActivity extends AppCompatActivity {
|
|
|
|
|
binding.btn.setOnClickListener(l -> {
|
|
|
|
|
List<RequestHeadInterceptor> interceptors = new ArrayList<>();
|
|
|
|
|
RequestHeadInterceptor.Builder builder = new RequestHeadInterceptor.Builder();
|
|
|
|
|
builder.addHeadParams("Cookie", "loginUserName_wanandroid_com=wang11;token_pass_wanandroid_com=6fbec4fe15d69af8b4531171798f3926;loginUserName=wang11;token_pass=6fbec4fe15d69af8b4531171798f3926");
|
|
|
|
|
builder.addHeadParams("Cookie",
|
|
|
|
|
"loginUserName_wanandroid_com=wang11;token_pass_wanandroid_com=6fbec4fe15d69af8b4531171798f3926;loginUserName=wang11;token_pass=6fbec4fe15d69af8b4531171798f3926");
|
|
|
|
|
interceptors.add(builder.build());
|
|
|
|
|
CollectionLoader loader = new CollectionLoader(interceptors);
|
|
|
|
|
loader.getCollections(0, new RequestNoResultCallBack<CollectionResponse>() {
|
|
|
|
@ -119,11 +122,18 @@ public class DemoActivity extends AppCompatActivity {
|
|
|
|
|
Thread thread = new Thread(new Runnable() {
|
|
|
|
|
@Override
|
|
|
|
|
public void run() {
|
|
|
|
|
FTPUtils.RESULT result = FTPUtils.INSTANCE.ftpUpload("192.168.101.215", "2221", "admin", "123456", filePath, fileName);
|
|
|
|
|
FTPUtils.RESULT result = FTPUtils.INSTANCE.ftpUpload("192.168.101.215", "2221", "admin", "123456",
|
|
|
|
|
filePath, fileName);
|
|
|
|
|
Logger.INSTANCE.d(result.name());
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
thread.start();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
binding.mmkv.setOnClickListener(l -> {
|
|
|
|
|
MMKVUtils.INSTANCE.put("key", 100, "aa");
|
|
|
|
|
int value = MMKVUtils.INSTANCE.getInt("key", "bb");
|
|
|
|
|
Toast.makeText(DemoActivity.this, ""+value, Toast.LENGTH_SHORT).show();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|