Skip to content

Commit

Permalink
backpack
Browse files Browse the repository at this point in the history
  • Loading branch information
devzwy committed Sep 5, 2023
1 parent 5c1d839 commit 5bb08b2
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 8 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# 初始化函数不要加入异步的check
# 单独增加一个函数做check
# 响应参数只打印一份






# mdhelper
明道云Api封装,kotlin环境测试。
部分Api在Java环境可能不被支持,例如:__getData____getRow__,可能需要使用GPT自己处理一下。
Expand All @@ -12,13 +21,13 @@
<dependency>
<groupId>io.github.devzwy</groupId>
<artifactId>mdhelper</artifactId>
<version>2.1.8</version>
<version>2.1.9</version>
</dependency>
```

- Gradle
```
implementation("io.github.devzwy:mdhelper:2.1.7")
implementation("io.github.devzwy:mdhelper:2.1.9")
```

## 开始使用
Expand Down
3 changes: 2 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
}

group = "io.github.devzwy"
version = "2.1.8"
version = "2.1.9"

val sourceJar by tasks.registering(Jar::class) {
from(sourceSets["main"].allSource)
Expand Down Expand Up @@ -105,6 +105,7 @@ dependencies {
// implementation("com.alibaba:fastjson:2.0.32")
implementation("com.google.code.gson:gson:2.10.1")
implementation("com.squareup.okhttp3:okhttp:4.11.0")
// implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2")
}

tasks.test {
Expand Down
8 changes: 4 additions & 4 deletions src/main/kotlin/io/github/devzwy/mdhelper/MDHelper.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
import io.github.devzwy.mdhelper.data.*
import io.github.devzwy.mdhelper.util.toRowDataList
import java.util.*

class MDHelper private constructor(private val baseUrl: String, private val configList: ArrayList<MDConfig>, val loggerFactory: ILoggerFactory? = null) {

Expand Down Expand Up @@ -81,7 +82,6 @@ class MDHelper private constructor(private val baseUrl: String, private val conf

}


/**
* 查询同名称的应用是否已配置
* [appName] 应用名称
Expand Down Expand Up @@ -187,7 +187,7 @@ class MDHelper private constructor(private val baseUrl: String, private val conf
hashMapOf<String, Any?>(
"worksheetId" to worksheetId,
"appKey" to appKey,
"sign" to sign,
"sign" to sign
)
)
).parseResp<MDTableInfo>()
Expand Down Expand Up @@ -251,7 +251,7 @@ class MDHelper private constructor(private val baseUrl: String, private val conf
return HttpUtil.sendPost(
"/api/v2/open/worksheet/getRowByIdPost".getRequestUrl(), hashMapOf<String, Any?>(
"worksheetId" to worksheetId,
"rowId" to rowId,
"rowId" to rowId
).buildRequestJsonParams(appName)
).parseResp<R>()
}
Expand Down Expand Up @@ -293,7 +293,7 @@ class MDHelper private constructor(private val baseUrl: String, private val conf
"/api/v2/open/worksheet/deleteRow".getRequestUrl(), hashMapOf<String, Any?>(
"worksheetId" to worksheetId,
"triggerWorkflow" to triggerWorkflow,
"rowId" to rowId,
"rowId" to rowId
).buildRequestJsonParams(appName)
).parseResp<Boolean>()
}
Expand Down
11 changes: 10 additions & 1 deletion src/main/kotlin/io/github/devzwy/mdhelper/data/data.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ data class MDTableControl(
val options: List<MDOption>? = null,
val required: Boolean? = null,
val type: Int,
val unique: Boolean,
val unique: Boolean
)

data class MDView(
Expand Down Expand Up @@ -95,10 +95,19 @@ class FilterBean private constructor(val controlId: String, val value: Any?, v
*/
fun typeOf(dateType: Int) = apply { this.dataType = dateType }

/**
* 字段的类型 使用[io.github.devzwy.FilterType]构造
*/
fun filterOf(filterType: Int) = apply { this.filterType = filterType }

/**
* 与下一组条件的关系为AND拼接
*/
fun buildAnd() = FilterBean(controlId, value, dataType, 1, filterType)

/**
* 与下一组条件的关系为OR拼接
*/
fun buildOr() = FilterBean(controlId, value, dataType, 2, filterType)
}
}
Expand Down

0 comments on commit 5bb08b2

Please sign in to comment.