[Core] [File] Add none file convert

This commit is contained in:
qianmoQ 2024-06-10 08:38:11 +08:00
parent 4dfbbd9c3c
commit f6db223090
7 changed files with 120 additions and 0 deletions

View File

@ -80,6 +80,11 @@
<artifactId>datacap-file-json</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.edurt.datacap</groupId>
<artifactId>datacap-file-none</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<build>

View File

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>io.edurt.datacap</groupId>
<artifactId>datacap</artifactId>
<version>2024.03.6-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>datacap-file-none</artifactId>
<description>DataCap - File for Multidimensional Arrays</description>
<dependencies>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-reflect</artifactId>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>
<dependency>
<groupId>io.edurt.datacap</groupId>
<artifactId>datacap-file-spi</artifactId>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.jetbrains.dokka</groupId>
<artifactId>dokka-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,23 @@
package io.edurt.datacap.file.none
import io.edurt.datacap.file.File
import io.edurt.datacap.file.model.FileRequest
import io.edurt.datacap.file.model.FileResponse
class NoneFile : File
{
override fun format(request: FileRequest): FileResponse
{
TODO("Not yet implemented")
}
override fun writer(request: FileRequest): FileResponse
{
TODO("Not yet implemented")
}
override fun reader(request: FileRequest): FileResponse
{
TODO("Not yet implemented")
}
}

View File

@ -0,0 +1,15 @@
package io.edurt.datacap.file.none
import com.google.inject.multibindings.Multibinder
import io.edurt.datacap.file.File
import io.edurt.datacap.file.FileModule
class NoneModule : FileModule()
{
override fun configure()
{
Multibinder.newSetBinder(this.binder(), File::class.java)
.addBinding()
.to(NoneFile::class.java)
}
}

View File

@ -0,0 +1 @@
io.edurt.datacap.file.none.NoneModule

View File

@ -0,0 +1,27 @@
package io.edurt.datacap.file.none
import com.google.inject.Guice.createInjector
import com.google.inject.Injector
import com.google.inject.Key
import com.google.inject.TypeLiteral
import io.edurt.datacap.file.File
import io.edurt.datacap.file.FileManager
import org.junit.Assert.assertEquals
import org.junit.Test
class NoneModuleTest
{
private val injector: Injector = createInjector(FileManager())
@Test
fun test()
{
injector.getInstance(Key.get(object : TypeLiteral<Set<File>>()
{}))
.stream()
.findFirst()
.ifPresent {
assertEquals("None", it.name())
}
}
}

View File

@ -92,6 +92,7 @@
<module>file/datacap-file-spi</module>
<module>file/datacap-file-txt</module>
<module>file/datacap-file-json</module>
<module>file/datacap-file-none</module>
</modules>
<name>datacap</name>