From e00590336e46e416e4e2094e1192dc649d703156 Mon Sep 17 00:00:00 2001 From: shikong <919411476@qq.com> Date: Tue, 30 Apr 2024 15:56:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=20=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=20&&=20demo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/.gitignore | 10 ++ .idea/compiler.xml | 30 ++++ .idea/encodings.xml | 8 + .idea/inspectionProfiles/Project_Default.xml | 6 + .idea/jarRepositories.xml | 20 +++ .idea/misc.xml | 143 ++++++++++++++++++ pom.xml | 122 +++++++++++++++ starter/pom.xml | 73 +++++++++ .../study/rxjava/RxJavaStudyStarter.java | 11 ++ .../study/rxjava/RxJavaStudyStarterTest.java | 30 ++++ 10 files changed, 453 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/compiler.xml create mode 100644 .idea/encodings.xml create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/jarRepositories.xml create mode 100644 .idea/misc.xml create mode 100644 pom.xml create mode 100644 starter/pom.xml create mode 100644 starter/src/main/java/cn/skcks/study/rxjava/RxJavaStudyStarter.java create mode 100644 starter/src/test/java/cn/skcks/study/rxjava/RxJavaStudyStarterTest.java diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..afa4cd3 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,10 @@ +# 默认忽略的文件 +/shelf/ +/workspace.xml +# 基于编辑器的 HTTP 客户端请求 +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml +# Zeppelin 忽略的文件 +/ZeppelinRemoteNotebooks/ diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..51d4a87 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..570fd95 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..7c04147 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 0000000..5a2f139 --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..26901cf --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + + + + Android + + + Angular + + + CoffeeScript + + + ECMAScript 6 迁移辅助JavaScript and TypeScript + + + Java + + + Java 15Java 语言级别迁移帮助Java + + + Java 5Java 语言级别迁移帮助Java + + + Java 7Java 语言级别迁移帮助Java + + + Java 8Java 语言级别迁移帮助Java + + + Java 9Java 语言级别迁移帮助Java + + + Java EE + + + Java interop issuesKotlin + + + Java 语言级别迁移帮助Java + + + Java 语言级问题Java + + + JavaScript and TypeScript + + + JavadocJava + + + Kotlin + + + Maven + + + Node.jsJavaScript and TypeScript + + + Style issuesKotlin + + + TypeScriptJavaScript and TypeScript + + + 代码样式问题Java + + + 反射访问Java + + + 可能的错误CoffeeScript + + + 可见性Java + + + 命名惯例Java + + + 声明冗余Java + + + 导入和依赖关系JavaScript and TypeScript + + + 序列化问题Java + + + 打包问题Java + + + 数值问题Java + + + 模块化问题Java + + + 类结构Java + + + 继承问题Java + + + 详细或冗余的代码结构Java + + + 选项JavaScript and TypeScript + + + + + Android + + + + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..0dc71af --- /dev/null +++ b/pom.xml @@ -0,0 +1,122 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 3.2.5 + + + cn.skcks.study + rxjava-study + 0.0.1-SNAPSHOT + rxjava-study + RxJava Study + + starter + + pom + + 17 + 17 + 17 + UTF-8 + + 3.2.5 + 3.1.8 + 2.5.0 + + + + + + io.reactivex.rxjava3 + rxjava + ${rxjava.version} + + + + org.springdoc + springdoc-openapi-starter-webmvc-api + ${springdoc.version} + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + + + org.projectlombok + lombok + ${lombok.version} + + + + org.projectlombok + lombok-mapstruct-binding + 0.2.0 + + + + org.springframework.boot + spring-boot-configuration-processor + + ${springboot.version} + + + + + + + + org.apache.maven.plugins + maven-resources-plugin + ${maven-resources-plugin.version} + + + @ + + false + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${maven-surefire-plugin.version} + + true + + + + + + + src/main/resources + + **/** + + true + + + + + + src/test/resources + + **/** + + true + + + + + diff --git a/starter/pom.xml b/starter/pom.xml new file mode 100644 index 0000000..f5c34ef --- /dev/null +++ b/starter/pom.xml @@ -0,0 +1,73 @@ + + + 4.0.0 + + cn.skcks.study + rxjava-study + 0.0.1-SNAPSHOT + + + cn.skcks.study.rxjava + rxjava-study-starter + + + 17 + 17 + UTF-8 + + + + + org.springdoc + springdoc-openapi-starter-webmvc-api + + + + io.reactivex.rxjava3 + rxjava + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-devtools + runtime + true + + + org.projectlombok + lombok + true + + + org.springframework.boot + spring-boot-starter-test + test + + + + + ${project.artifactId} + + + + org.springframework.boot + spring-boot-maven-plugin + + + + org.projectlombok + lombok + + + + + + + \ No newline at end of file diff --git a/starter/src/main/java/cn/skcks/study/rxjava/RxJavaStudyStarter.java b/starter/src/main/java/cn/skcks/study/rxjava/RxJavaStudyStarter.java new file mode 100644 index 0000000..ad58577 --- /dev/null +++ b/starter/src/main/java/cn/skcks/study/rxjava/RxJavaStudyStarter.java @@ -0,0 +1,11 @@ +package cn.skcks.study.rxjava; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class RxJavaStudyStarter { + public static void main(String[] args) { + SpringApplication.run(RxJavaStudyStarter.class, args); + } +} diff --git a/starter/src/test/java/cn/skcks/study/rxjava/RxJavaStudyStarterTest.java b/starter/src/test/java/cn/skcks/study/rxjava/RxJavaStudyStarterTest.java new file mode 100644 index 0000000..13b69bf --- /dev/null +++ b/starter/src/test/java/cn/skcks/study/rxjava/RxJavaStudyStarterTest.java @@ -0,0 +1,30 @@ +package cn.skcks.study.rxjava; + +import io.reactivex.rxjava3.core.Flowable; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.core.ObservableOnSubscribe; +import io.reactivex.rxjava3.disposables.Disposable; +import lombok.extern.slf4j.Slf4j; +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@Slf4j +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE) +public class RxJavaStudyStarterTest { + @Test + void contextLoads() { + log.info("Hello, RxJava!"); + Disposable disposable = Flowable.just("Hello world").subscribe(System.out::println); + disposable.dispose(); + + Observable.create((ObservableOnSubscribe) emitter -> { + for (int i = 1; i <= 5; i++) { + emitter.onNext(i); + } + emitter.onComplete(); + }).subscribe(item -> System.out.println("Next: " + item)); + + Observable take = Observable.fromArray(1, 2, 3, 4, 5).skip(2).take(1); + take.subscribe(System.out::println); + } +}