mirror of
https://gitee.com/devlive-community/datacap.git
synced 2024-11-30 02:57:37 +08:00
[Core] [File] Add csv file convert
This commit is contained in:
parent
0a29a7ef0e
commit
836490cd40
48
file/datacap-file-csv/pom.xml
Normal file
48
file/datacap-file-csv/pom.xml
Normal 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-csv</artifactId>
|
||||
<description>DataCap - File for csv</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>
|
@ -0,0 +1,28 @@
|
||||
package io.edurt.datacap.file.csv
|
||||
|
||||
import io.edurt.datacap.file.File
|
||||
import io.edurt.datacap.file.model.FileRequest
|
||||
import io.edurt.datacap.file.model.FileResponse
|
||||
|
||||
class CsvFile : File
|
||||
{
|
||||
override fun format(request: FileRequest): FileResponse
|
||||
{
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
override fun formatStream(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")
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package io.edurt.datacap.file.csv
|
||||
|
||||
import com.google.inject.multibindings.Multibinder
|
||||
import io.edurt.datacap.file.File
|
||||
import io.edurt.datacap.file.FileModule
|
||||
|
||||
class CsvModule : FileModule()
|
||||
{
|
||||
override fun configure()
|
||||
{
|
||||
Multibinder.newSetBinder(this.binder(), File::class.java)
|
||||
.addBinding()
|
||||
.to(CsvFile::class.java)
|
||||
}
|
||||
}
|
@ -0,0 +1 @@
|
||||
io.edurt.datacap.file.csv.CsvModule
|
@ -0,0 +1,27 @@
|
||||
package io.edurt.datacap.file.csv
|
||||
|
||||
import com.google.inject.Guice
|
||||
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 CsvModuleTest
|
||||
{
|
||||
private val injector: Injector = Guice.createInjector(FileManager())
|
||||
|
||||
@Test
|
||||
fun test()
|
||||
{
|
||||
injector.getInstance(Key.get(object : TypeLiteral<Set<File>>()
|
||||
{}))
|
||||
.stream()
|
||||
.findFirst()
|
||||
.ifPresent {
|
||||
assertEquals("Csv", it.name())
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user