diff --git a/README.md b/README.md index feb7f71..d485f44 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,12 @@ +# 初始化函数不要加入异步的check +# 单独增加一个函数做check +# 响应参数只打印一份 + + + + + + # mdhelper 明道云Api封装,kotlin环境测试。 部分Api在Java环境可能不被支持,例如:__getData__、__getRow__,可能需要使用GPT自己处理一下。 @@ -12,13 +21,13 @@ io.github.devzwy mdhelper - 2.1.8 + 2.1.9 ``` - Gradle ``` -implementation("io.github.devzwy:mdhelper:2.1.7") +implementation("io.github.devzwy:mdhelper:2.1.9") ``` ## 开始使用 diff --git a/build.gradle.kts b/build.gradle.kts index 4c022bc..fa7b046 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -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) @@ -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 { diff --git a/src/main/kotlin/io/github/devzwy/mdhelper/MDHelper.kt b/src/main/kotlin/io/github/devzwy/mdhelper/MDHelper.kt index d52d821..deace7c 100644 --- a/src/main/kotlin/io/github/devzwy/mdhelper/MDHelper.kt +++ b/src/main/kotlin/io/github/devzwy/mdhelper/MDHelper.kt @@ -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, val loggerFactory: ILoggerFactory? = null) { @@ -81,7 +82,6 @@ class MDHelper private constructor(private val baseUrl: String, private val conf } - /** * 查询同名称的应用是否已配置 * [appName] 应用名称 @@ -187,7 +187,7 @@ class MDHelper private constructor(private val baseUrl: String, private val conf hashMapOf( "worksheetId" to worksheetId, "appKey" to appKey, - "sign" to sign, + "sign" to sign ) ) ).parseResp() @@ -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( "worksheetId" to worksheetId, - "rowId" to rowId, + "rowId" to rowId ).buildRequestJsonParams(appName) ).parseResp() } @@ -293,7 +293,7 @@ class MDHelper private constructor(private val baseUrl: String, private val conf "/api/v2/open/worksheet/deleteRow".getRequestUrl(), hashMapOf( "worksheetId" to worksheetId, "triggerWorkflow" to triggerWorkflow, - "rowId" to rowId, + "rowId" to rowId ).buildRequestJsonParams(appName) ).parseResp() } diff --git a/src/main/kotlin/io/github/devzwy/mdhelper/data/data.kt b/src/main/kotlin/io/github/devzwy/mdhelper/data/data.kt index 86bbb54..0e27389 100644 --- a/src/main/kotlin/io/github/devzwy/mdhelper/data/data.kt +++ b/src/main/kotlin/io/github/devzwy/mdhelper/data/data.kt @@ -51,7 +51,7 @@ data class MDTableControl( val options: List? = null, val required: Boolean? = null, val type: Int, - val unique: Boolean, + val unique: Boolean ) data class MDView( @@ -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) } }