From 9362a97be623d5fe155a63f6b85d248ec1b95a5c Mon Sep 17 00:00:00 2001 From: JellyBrick Date: Fri, 18 Jun 2021 14:50:17 +0900 Subject: [PATCH] release 1.9.2: convert from java to kotlin (some source code) - apply ktlint --- .editorconfig | 2 + .idea/KotlinInside.iml | 2 - .idea/compiler.xml | 2 +- .idea/misc.xml | 2 +- README.md | 4 +- build.gradle | 15 +++- .../be/zvz/kotlininside/value/ApiUrl.java | 78 ------------------- .../java/be/zvz/kotlininside/value/Const.java | 17 ---- .../be/zvz/kotlininside/KotlinInside.kt | 24 +++--- .../kotlininside/api/article/ArticleList.kt | 34 ++++---- .../kotlininside/api/article/ArticleModify.kt | 3 +- .../kotlininside/api/article/ArticleRead.kt | 12 +-- .../kotlininside/api/article/ArticleWrite.kt | 1 - .../api/async/article/AsyncArticleDelete.kt | 2 +- .../async/article/AsyncArticleHitUpvote.kt | 2 +- .../api/async/article/AsyncArticleList.kt | 2 +- .../api/async/article/AsyncArticleModify.kt | 2 +- .../api/async/article/AsyncArticleRead.kt | 2 +- .../api/async/article/AsyncArticleReport.kt | 2 +- .../api/async/article/AsyncArticleVote.kt | 2 +- .../api/async/article/AsyncArticleWrite.kt | 2 +- .../api/async/comment/AsyncCommentDelete.kt | 2 +- .../api/async/comment/AsyncCommentRead.kt | 2 +- .../api/async/comment/AsyncCommentWrite.kt | 2 +- .../api/async/dccon/AsyncDCConBuy.kt | 2 +- .../api/async/dccon/AsyncDCConDetail.kt | 2 +- .../api/async/dccon/AsyncDCConList.kt | 2 +- .../api/async/generic/AsyncGalleryRanking.kt | 2 +- .../api/async/generic/AsyncGallerySearch.kt | 2 +- .../api/async/generic/AsyncMainPage.kt | 2 +- .../async/generic/AsyncMinorGalleryInfo.kt | 2 +- .../async/generic/AsyncMinorGalleryRanking.kt | 2 +- .../api/async/generic/AsyncTotalSearch.kt | 2 +- .../minigallery/AsyncJoinMiniGallery.kt | 2 +- .../minigallery/AsyncQuitMiniGallery.kt | 2 +- .../userinfo/AsyncCheckJoinedMiniGallery.kt | 2 +- .../userinfo/AsyncCheckManagedGallery.kt | 2 +- .../generic/userinfo/AsyncModifyMyGall.kt | 2 +- .../api/async/generic/userinfo/AsyncMyGall.kt | 2 +- .../async/management/AsyncChangeHeadText.kt | 2 +- .../async/management/AsyncGallerySetting.kt | 2 +- .../api/async/management/AsyncNotice.kt | 2 +- .../api/async/management/AsyncRecommend.kt | 2 +- .../api/async/management/AsyncUserBlock.kt | 2 +- .../kotlininside/api/comment/CommentRead.kt | 1 - .../kotlininside/api/comment/CommentWrite.kt | 1 - .../be/zvz/kotlininside/api/dccon/DCConBuy.kt | 2 +- .../zvz/kotlininside/api/dccon/DCConDetail.kt | 3 +- .../zvz/kotlininside/api/dccon/DCConList.kt | 2 +- .../api/generic/GalleryRanking.kt | 2 +- .../kotlininside/api/generic/GallerySearch.kt | 2 +- .../api/generic/MinorGalleryInfo.kt | 2 +- .../api/generic/MinorGalleryRanking.kt | 2 +- .../kotlininside/api/generic/TotalSearch.kt | 2 +- .../generic/minigallery/JoinMiniGallery.kt | 2 +- .../generic/minigallery/QuitMiniGallery.kt | 2 +- .../userinfo/CheckJoinedMiniGallery.kt | 2 +- .../generic/userinfo/CheckManagedGallery.kt | 2 +- .../api/generic/userinfo/ModifyMyGall.kt | 2 +- .../api/generic/userinfo/MyGall.kt | 2 +- .../api/management/ChangeHeadText.kt | 2 +- .../zvz/kotlininside/api/management/Notice.kt | 4 +- .../kotlininside/api/management/Recommend.kt | 4 +- .../be/zvz/kotlininside/api/type/Article.kt | 2 +- .../be/zvz/kotlininside/api/type/DCCon.kt | 2 +- .../be/zvz/kotlininside/api/type/Gallery.kt | 2 +- .../be/zvz/kotlininside/api/type/HeadText.kt | 2 +- .../kotlininside/api/type/comment/Comment.kt | 2 +- .../api/type/comment/DCConComment.kt | 2 +- .../api/type/comment/StringComment.kt | 2 +- .../kotlininside/api/type/content/Content.kt | 2 +- .../api/type/content/ImageContent.kt | 2 +- .../api/type/content/StringContent.kt | 2 +- .../be/zvz/kotlininside/http/Request.kt | 2 +- .../be/zvz/kotlininside/security/App.kt | 2 +- .../be/zvz/kotlininside/security/Auth.kt | 12 +-- .../be/zvz/kotlininside/session/Session.kt | 2 +- .../zvz/kotlininside/session/SessionDetail.kt | 24 +++--- .../kotlininside/session/user/Anonymous.kt | 2 +- .../kotlininside/session/user/LoginUser.kt | 2 +- .../be/zvz/kotlininside/session/user/User.kt | 2 +- .../zvz/kotlininside/session/user/UserType.kt | 2 +- .../session/user/named/DuplicateNamed.kt | 2 +- .../kotlininside/session/user/named/Named.kt | 2 +- .../be/zvz/kotlininside/utils/StringUtil.kt | 3 +- .../be/zvz/kotlininside/value/ApiUrl.kt | 75 ++++++++++++++++++ .../kotlin/be/zvz/kotlininside/value/Const.kt | 15 ++++ 87 files changed, 234 insertions(+), 232 deletions(-) create mode 100644 .editorconfig delete mode 100644 .idea/KotlinInside.iml delete mode 100644 src/main/java/be/zvz/kotlininside/value/ApiUrl.java delete mode 100644 src/main/java/be/zvz/kotlininside/value/Const.java create mode 100644 src/main/kotlin/be/zvz/kotlininside/value/ApiUrl.kt create mode 100644 src/main/kotlin/be/zvz/kotlininside/value/Const.kt diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..2e2ba828 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,2 @@ +[*.{kt, kts}] +disabled_rules = no-wildcard-imports diff --git a/.idea/KotlinInside.iml b/.idea/KotlinInside.iml deleted file mode 100644 index f7509839..00000000 --- a/.idea/KotlinInside.iml +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 659bf431..fb7f4a8a 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index a292c19c..aec92563 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -7,5 +7,5 @@ - + \ No newline at end of file diff --git a/README.md b/README.md index 2ac00b92..769996a2 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ ### Gradle ```gradle -compile 'be.zvz:KotlinInside:1.9.1' +compile 'be.zvz:KotlinInside:1.9.2' ``` ### Maven @@ -17,7 +17,7 @@ compile 'be.zvz:KotlinInside:1.9.1' be.zvz KotlinInside - 1.9.1 + 1.9.2 ``` diff --git a/build.gradle b/build.gradle index 84f68ad9..6c73c02e 100644 --- a/build.gradle +++ b/build.gradle @@ -1,3 +1,5 @@ +import org.jmailen.gradle.kotlinter.tasks.* + plugins { id 'java' id 'org.jetbrains.kotlin.jvm' version '1.5.10' @@ -5,11 +7,12 @@ plugins { id 'maven-publish' id 'io.github.gradle-nexus.publish-plugin' version '1.1.0' id 'signing' + id 'org.jmailen.kotlinter' version '3.4.5' } def libName = 'KotlinInside' def libDevVersion = '' -def libVersion = "1.9.1$libDevVersion" +def libVersion = "1.9.2$libDevVersion" def libDesc = 'Unofficial DCInside API written in Kotlin' group = 'be.zvz' @@ -88,6 +91,16 @@ task sourcesJar(type: Jar, dependsOn: classes) { from sourceSets.main.allSource } +task ktLint(type: LintTask, group: 'verification') { + source files('src') +} + +task ktFormat(type: FormatTask, group: 'formatting') { + source files('src') + report = file('build/format-report.txt') + disabledRules = ["import-ordering"] +} + signing { useGpgCmd() sign publishing.publications diff --git a/src/main/java/be/zvz/kotlininside/value/ApiUrl.java b/src/main/java/be/zvz/kotlininside/value/ApiUrl.java deleted file mode 100644 index 30823718..00000000 --- a/src/main/java/be/zvz/kotlininside/value/ApiUrl.java +++ /dev/null @@ -1,78 +0,0 @@ -package be.zvz.kotlininside.value; - -public final class ApiUrl { - public static final String PC_WEB = Protocol.HTTPS + "gall.dcinside.com/"; - public static final String MOBILE_WEB = Protocol.HTTP + "m.dcinside.com/"; - public static final String APP_API = Protocol.HTTPS + "app.dcinside.com/api/"; - public static final String AUTH_API = Protocol.HTTPS + "dcid.dcinside.com/join/"; - public static final String MAIN_API = Protocol.HTTP + "json2.dcinside.com/"; - public static final String UPLOAD = Protocol.HTTPS + "upload.dcinside.com/"; - public static final String REDIRECT = APP_API + "redirect.php"; - - private static final class Protocol { - private static final String HTTP = "http://"; - private static final String HTTPS = "https://"; - } - - public static final class Article { - public static final String LIST = APP_API + "gall_list_new.php"; - public static final String READ = APP_API + "gall_view_new.php"; - public static final String WRITE = UPLOAD + "_app_write_api.php"; - public static final String DELETE = APP_API + "gall_del.php"; - public static final String MODIFY = APP_API + "gall_modify.php"; - - public static final String UPVOTE = APP_API + "_recommend_up.php"; - public static final String DOWNVOTE = APP_API + "_recommend_down.php"; - - public static final String REPORT = MOBILE_WEB + "api/report.php"; - - public static final String HIT_UPVOTE = APP_API + "hit_recommend"; - } - - public static final class Comment { - public static final String OK = APP_API + "comment_ok.php"; - public static final String DELETE = APP_API + "comment_del.php"; - public static final String READ = APP_API + "comment_new.php"; - } - - public static final class DCCon { - public static final String DCCON = APP_API + "dccon.php"; - } - - public static final class Gallery { - public static final String MINOR_INFO = APP_API + "minor_info"; - public static final String MINOR_MANAGEMENT = PC_WEB + "mgallery/management/mobile"; - public static final String MINOR_MANAGER_REQUEST = APP_API + "_manager_request.php"; - public static final String MINOR_BLOCK_WEB = APP_API + "minor_avoid"; - public static final String MINOR_BLOCK_ADD = APP_API + "minor_avoidadd"; - } - - public static final class Search { - public static final String SEARCH = APP_API + "_total_search.php"; - } - - public static final class Auth { - public static final String LOGIN = AUTH_API + "mobile_app_login.php"; - public static final String APP_ID = AUTH_API + "mobile_app_key_verification_3rd.php"; - public static final String APP_CHECK = MAIN_API + "json0/app_check_A_rina_beta.php"; - } - - public static final class User { - public static final String MY_GALL = APP_API + "mygall.php"; - public static final String MY_GALL_MODIFY = APP_API + "mygall_modify.php"; - public static final String MY_MANAGE_GALL_CHECK = APP_API + "mymanageGallChk"; - public static final String MY_MINI_JOIN_CHECK = APP_API + "myminijoinGallChk"; - } - - public static final class MiniGallery { - public static final String JOIN = APP_API + "memberjoin"; - public static final String JOIN_OK = APP_API + "memberjoin_ok"; - public static final String QUIT = APP_API + "memberout_ok"; - } - - public static final class MainInfo { - public static final String APP_MAIN = MAIN_API + "json3/main_content.php"; - public static final String GALLERY_RANKING = MAIN_API + "json3/ranking_gallery.php"; - public static final String MINOR_GALLERY_RANKING = MAIN_API + "json1/mgallmain/mgallery_ranking.php"; - } -} diff --git a/src/main/java/be/zvz/kotlininside/value/Const.java b/src/main/java/be/zvz/kotlininside/value/Const.java deleted file mode 100644 index a785b89a..00000000 --- a/src/main/java/be/zvz/kotlininside/value/Const.java +++ /dev/null @@ -1,17 +0,0 @@ -package be.zvz.kotlininside.value; - -import org.apache.commons.lang3.RandomStringUtils; - -public final class Const { - public static final String DC_APP_SIGNATURE = "ReOo4u96nnv8Njd7707KpYiIVYQ3FlcKHDJE046Pg6s="; - public static final String DC_APP_PACKAGE = "com.dcinside.app"; - public static final String DC_APP_VERSION_CODE = "30503"; - public static final String DC_APP_VERSION_NAME = "4.0.7"; - - public static final String DEFAULT_FCM_TOKEN; - public static final String USER_AGENT = "dcinside.app"; - - static { - DEFAULT_FCM_TOKEN = RandomStringUtils.randomAlphanumeric(11) + ":APA91bFMI-0d1b0wJmlIWoDPVa_V5Nv0OWnAefN7fGLegy6D76TN_CRo5RSUO-6V7Wnq44t7Rzx0A4kICVZ7wX-hJd3mrczE5NnLud722k5c-XRjIxYGVM9yZBScqE3oh4xbJOe2AvDe"; - } -} diff --git a/src/main/kotlin/be/zvz/kotlininside/KotlinInside.kt b/src/main/kotlin/be/zvz/kotlininside/KotlinInside.kt index 81dff251..49e18e08 100644 --- a/src/main/kotlin/be/zvz/kotlininside/KotlinInside.kt +++ b/src/main/kotlin/be/zvz/kotlininside/KotlinInside.kt @@ -26,18 +26,21 @@ class KotlinInside private constructor( if (sessionAutoRefresh) { val timer = Timer() - timer.schedule(object : TimerTask() { - override fun run() { - if (user is LoginUser) { - synchronized(instance) { - instance.hashedAppKey = instance.auth.generateHashedAppKey() - instance.app = - App(instance.hashedAppKey, instance.auth.fetchAppId(getInstance().hashedAppKey)) - instance.session = instance.auth.login(user) + timer.schedule( + object : TimerTask() { + override fun run() { + if (user is LoginUser) { + synchronized(instance) { + instance.hashedAppKey = instance.auth.generateHashedAppKey() + instance.app = + App(instance.hashedAppKey, instance.auth.fetchAppId(getInstance().hashedAppKey)) + instance.session = instance.auth.login(user) + } } } - } - }, 43200 * 1000, 43200 * 1000) + }, + 43200 * 1000, 43200 * 1000 + ) } } @@ -69,5 +72,4 @@ class KotlinInside private constructor( return instance } } - } diff --git a/src/main/kotlin/be/zvz/kotlininside/api/article/ArticleList.kt b/src/main/kotlin/be/zvz/kotlininside/api/article/ArticleList.kt index 4f856197..1e8d2852 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/article/ArticleList.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/article/ArticleList.kt @@ -120,24 +120,24 @@ class ArticleList @JvmOverloads constructor( @Throws(HttpException::class) fun request() { val url = "${ApiUrl.Article.LIST}?id=$gallId&page=$page&app_id=${KotlinInside.getInstance().auth.getAppId()}" + - StringBuilder().apply { - if (searchKeyword.isNotEmpty()) { - append("&s_type=") - append(searchType.type) - append("&serVal=").append(URLEncoder.encode(searchKeyword, "UTF-8").replace("+", "%20")) - } - if (recommend) - append("&recommend=1") - if (notice) - append("¬ice=1") - if (headId > 0) - append("&headid=").append(headId) - session?.let { - if (it.user !is Anonymous) { - append("&confirm_id=").append(it.detail!!.userId) - } + StringBuilder().apply { + if (searchKeyword.isNotEmpty()) { + append("&s_type=") + append(searchType.type) + append("&serVal=").append(URLEncoder.encode(searchKeyword, "UTF-8").replace("+", "%20")) + } + if (recommend) + append("&recommend=1") + if (notice) + append("¬ice=1") + if (headId > 0) + append("&headid=").append(headId) + session?.let { + if (it.user !is Anonymous) { + append("&confirm_id=").append(it.detail!!.userId) } - }.toString() + } + }.toString() json = KotlinInside.getInstance().httpInterface.get(Request.redirectUrl(url), Request.getDefaultOption())!! } diff --git a/src/main/kotlin/be/zvz/kotlininside/api/article/ArticleModify.kt b/src/main/kotlin/be/zvz/kotlininside/api/article/ArticleModify.kt index 47ffc66d..dea9cdd6 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/article/ArticleModify.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/article/ArticleModify.kt @@ -14,7 +14,6 @@ import org.apache.commons.text.StringEscapeUtils import java.io.BufferedInputStream import java.net.URL - class ArticleModify( private val gallId: String, private val articleId: Int, @@ -154,4 +153,4 @@ class ArticleModify( return articleWrite.write() } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/article/ArticleRead.kt b/src/main/kotlin/be/zvz/kotlininside/api/article/ArticleRead.kt index aa50d498..49977623 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/article/ArticleRead.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/article/ArticleRead.kt @@ -69,13 +69,13 @@ class ArticleRead @JvmOverloads constructor( fun request() { val url = "${ApiUrl.Article.READ}?id=$gallId&no=$articleId&app_id=${KotlinInside.getInstance().auth.getAppId()}" + - StringBuilder().apply { - session?.let { - if (it.user !is Anonymous) { - append("&confirm_id=").append(it.detail!!.userId) - } + StringBuilder().apply { + session?.let { + if (it.user !is Anonymous) { + append("&confirm_id=").append(it.detail!!.userId) } - }.toString() + } + }.toString() json = KotlinInside.getInstance().httpInterface.get(Request.redirectUrl(url), Request.getDefaultOption())!! } diff --git a/src/main/kotlin/be/zvz/kotlininside/api/article/ArticleWrite.kt b/src/main/kotlin/be/zvz/kotlininside/api/article/ArticleWrite.kt index 8d470677..801eb648 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/article/ArticleWrite.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/article/ArticleWrite.kt @@ -99,7 +99,6 @@ class ArticleWrite internal constructor( option )!!.index(0) - return WriteResult( result = json.get("result").asBoolean(), articleId = json.get("cause").asNullableInteger(), diff --git a/src/main/kotlin/be/zvz/kotlininside/api/async/article/AsyncArticleDelete.kt b/src/main/kotlin/be/zvz/kotlininside/api/async/article/AsyncArticleDelete.kt index d32513b8..4fb454f8 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/async/article/AsyncArticleDelete.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/async/article/AsyncArticleDelete.kt @@ -20,4 +20,4 @@ class AsyncArticleDelete @JvmOverloads constructor( articleDelete.delete() } } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/async/article/AsyncArticleHitUpvote.kt b/src/main/kotlin/be/zvz/kotlininside/api/async/article/AsyncArticleHitUpvote.kt index 3e1fea0f..9f2f8295 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/async/article/AsyncArticleHitUpvote.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/async/article/AsyncArticleHitUpvote.kt @@ -18,4 +18,4 @@ class AsyncArticleHitUpvote( articleHitUpvote.upvote() } } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/async/article/AsyncArticleList.kt b/src/main/kotlin/be/zvz/kotlininside/api/async/article/AsyncArticleList.kt index f6395c6c..271ecf01 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/async/article/AsyncArticleList.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/async/article/AsyncArticleList.kt @@ -82,4 +82,4 @@ class AsyncArticleList @JvmOverloads constructor( articleList.getGallList() } } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/async/article/AsyncArticleModify.kt b/src/main/kotlin/be/zvz/kotlininside/api/async/article/AsyncArticleModify.kt index 4d343aef..3c4038a5 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/async/article/AsyncArticleModify.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/async/article/AsyncArticleModify.kt @@ -25,4 +25,4 @@ class AsyncArticleModify( articleModify.modify(article, fcmToken) } } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/async/article/AsyncArticleRead.kt b/src/main/kotlin/be/zvz/kotlininside/api/async/article/AsyncArticleRead.kt index bfb0d146..2ff37da6 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/async/article/AsyncArticleRead.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/async/article/AsyncArticleRead.kt @@ -30,4 +30,4 @@ class AsyncArticleRead @JvmOverloads constructor( articleRead.getViewMain() } } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/async/article/AsyncArticleReport.kt b/src/main/kotlin/be/zvz/kotlininside/api/async/article/AsyncArticleReport.kt index 6a0c20bc..c540ffef 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/async/article/AsyncArticleReport.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/async/article/AsyncArticleReport.kt @@ -18,4 +18,4 @@ class AsyncArticleReport( articleReport.getLink() } } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/async/article/AsyncArticleVote.kt b/src/main/kotlin/be/zvz/kotlininside/api/async/article/AsyncArticleVote.kt index 94f289ce..dc515980 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/async/article/AsyncArticleVote.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/async/article/AsyncArticleVote.kt @@ -24,4 +24,4 @@ class AsyncArticleVote( articleVote.downvote() } } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/async/article/AsyncArticleWrite.kt b/src/main/kotlin/be/zvz/kotlininside/api/async/article/AsyncArticleWrite.kt index 601d984a..fd03418a 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/async/article/AsyncArticleWrite.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/async/article/AsyncArticleWrite.kt @@ -21,4 +21,4 @@ class AsyncArticleWrite @JvmOverloads constructor( articleWrite.write() } } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/async/comment/AsyncCommentDelete.kt b/src/main/kotlin/be/zvz/kotlininside/api/async/comment/AsyncCommentDelete.kt index ba5b6900..d86b0796 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/async/comment/AsyncCommentDelete.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/async/comment/AsyncCommentDelete.kt @@ -21,4 +21,4 @@ class AsyncCommentDelete @JvmOverloads constructor( commentDelete.delete() } } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/async/comment/AsyncCommentRead.kt b/src/main/kotlin/be/zvz/kotlininside/api/async/comment/AsyncCommentRead.kt index b99b1dc9..9494561c 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/async/comment/AsyncCommentRead.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/async/comment/AsyncCommentRead.kt @@ -17,4 +17,4 @@ class AsyncCommentRead( commentRead.request() } } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/async/comment/AsyncCommentWrite.kt b/src/main/kotlin/be/zvz/kotlininside/api/async/comment/AsyncCommentWrite.kt index 6b1ecbf7..a5f15d86 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/async/comment/AsyncCommentWrite.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/async/comment/AsyncCommentWrite.kt @@ -28,4 +28,4 @@ class AsyncCommentWrite @JvmOverloads constructor( commentWrite.reply(commentId) } } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/async/dccon/AsyncDCConBuy.kt b/src/main/kotlin/be/zvz/kotlininside/api/async/dccon/AsyncDCConBuy.kt index 3ad9ec0c..9001ae34 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/async/dccon/AsyncDCConBuy.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/async/dccon/AsyncDCConBuy.kt @@ -18,4 +18,4 @@ class AsyncDCConBuy( dcConBuy.buy() } } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/async/dccon/AsyncDCConDetail.kt b/src/main/kotlin/be/zvz/kotlininside/api/async/dccon/AsyncDCConDetail.kt index 4f8f3086..e3e3fa62 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/async/dccon/AsyncDCConDetail.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/async/dccon/AsyncDCConDetail.kt @@ -16,4 +16,4 @@ class AsyncDCConDetail( dcConDetail.request() } } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/async/dccon/AsyncDCConList.kt b/src/main/kotlin/be/zvz/kotlininside/api/async/dccon/AsyncDCConList.kt index 52acaeca..57ed7ee6 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/async/dccon/AsyncDCConList.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/async/dccon/AsyncDCConList.kt @@ -16,4 +16,4 @@ class AsyncDCConList( dcConList.request() } } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/async/generic/AsyncGalleryRanking.kt b/src/main/kotlin/be/zvz/kotlininside/api/async/generic/AsyncGalleryRanking.kt index b3577cce..7149ce48 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/async/generic/AsyncGalleryRanking.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/async/generic/AsyncGalleryRanking.kt @@ -13,4 +13,4 @@ class AsyncGalleryRanking { galleryRanking.request() } } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/async/generic/AsyncGallerySearch.kt b/src/main/kotlin/be/zvz/kotlininside/api/async/generic/AsyncGallerySearch.kt index 2c1158be..7c901be3 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/async/generic/AsyncGallerySearch.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/async/generic/AsyncGallerySearch.kt @@ -15,4 +15,4 @@ class AsyncGallerySearch( gallerySearch.search() } } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/async/generic/AsyncMainPage.kt b/src/main/kotlin/be/zvz/kotlininside/api/async/generic/AsyncMainPage.kt index 13db160c..9dca2299 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/async/generic/AsyncMainPage.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/async/generic/AsyncMainPage.kt @@ -37,4 +37,4 @@ class AsyncMainPage { mainPage.getNewGallery() } } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/async/generic/AsyncMinorGalleryInfo.kt b/src/main/kotlin/be/zvz/kotlininside/api/async/generic/AsyncMinorGalleryInfo.kt index 3d66447c..f9fa7297 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/async/generic/AsyncMinorGalleryInfo.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/async/generic/AsyncMinorGalleryInfo.kt @@ -15,4 +15,4 @@ class AsyncMinorGalleryInfo( minorGalleryInfo.request() } } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/async/generic/AsyncMinorGalleryRanking.kt b/src/main/kotlin/be/zvz/kotlininside/api/async/generic/AsyncMinorGalleryRanking.kt index ca5a5d9b..23570865 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/async/generic/AsyncMinorGalleryRanking.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/async/generic/AsyncMinorGalleryRanking.kt @@ -13,4 +13,4 @@ class AsyncMinorGalleryRanking { minorGalleryRanking.request() } } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/async/generic/AsyncTotalSearch.kt b/src/main/kotlin/be/zvz/kotlininside/api/async/generic/AsyncTotalSearch.kt index 10a2ca19..3fa6ef02 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/async/generic/AsyncTotalSearch.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/async/generic/AsyncTotalSearch.kt @@ -15,4 +15,4 @@ class AsyncTotalSearch( totalSearch.search() } } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/async/generic/minigallery/AsyncJoinMiniGallery.kt b/src/main/kotlin/be/zvz/kotlininside/api/async/generic/minigallery/AsyncJoinMiniGallery.kt index 7f512e02..7559bd2c 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/async/generic/minigallery/AsyncJoinMiniGallery.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/async/generic/minigallery/AsyncJoinMiniGallery.kt @@ -29,4 +29,4 @@ class AsyncJoinMiniGallery( joinMiniGallery.requestMemberJoinOk() } } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/async/generic/minigallery/AsyncQuitMiniGallery.kt b/src/main/kotlin/be/zvz/kotlininside/api/async/generic/minigallery/AsyncQuitMiniGallery.kt index 9dd53ba0..32820b89 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/async/generic/minigallery/AsyncQuitMiniGallery.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/async/generic/minigallery/AsyncQuitMiniGallery.kt @@ -17,4 +17,4 @@ class AsyncQuitMiniGallery( quitMiniGallery.quit() } } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/async/generic/userinfo/AsyncCheckJoinedMiniGallery.kt b/src/main/kotlin/be/zvz/kotlininside/api/async/generic/userinfo/AsyncCheckJoinedMiniGallery.kt index b48bded6..1a68bbc2 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/async/generic/userinfo/AsyncCheckJoinedMiniGallery.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/async/generic/userinfo/AsyncCheckJoinedMiniGallery.kt @@ -16,4 +16,4 @@ class AsyncCheckJoinedMiniGallery( checkJoinMiniGallery.request() } } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/async/generic/userinfo/AsyncCheckManagedGallery.kt b/src/main/kotlin/be/zvz/kotlininside/api/async/generic/userinfo/AsyncCheckManagedGallery.kt index b50b6c2e..beba34cc 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/async/generic/userinfo/AsyncCheckManagedGallery.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/async/generic/userinfo/AsyncCheckManagedGallery.kt @@ -16,4 +16,4 @@ class AsyncCheckManagedGallery( checkManagedGallery.request() } } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/async/generic/userinfo/AsyncModifyMyGall.kt b/src/main/kotlin/be/zvz/kotlininside/api/async/generic/userinfo/AsyncModifyMyGall.kt index faafd581..16a66395 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/async/generic/userinfo/AsyncModifyMyGall.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/async/generic/userinfo/AsyncModifyMyGall.kt @@ -18,4 +18,4 @@ class AsyncModifyMyGall( modifyMyGall.request() } } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/async/generic/userinfo/AsyncMyGall.kt b/src/main/kotlin/be/zvz/kotlininside/api/async/generic/userinfo/AsyncMyGall.kt index 3457b3d4..df04b9a7 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/async/generic/userinfo/AsyncMyGall.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/async/generic/userinfo/AsyncMyGall.kt @@ -16,4 +16,4 @@ class AsyncMyGall( myGall.request() } } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/async/management/AsyncChangeHeadText.kt b/src/main/kotlin/be/zvz/kotlininside/api/async/management/AsyncChangeHeadText.kt index ad5b7f73..5ec4ec7d 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/async/management/AsyncChangeHeadText.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/async/management/AsyncChangeHeadText.kt @@ -19,4 +19,4 @@ class AsyncChangeHeadText( changeHeadText.request() } } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/async/management/AsyncGallerySetting.kt b/src/main/kotlin/be/zvz/kotlininside/api/async/management/AsyncGallerySetting.kt index d0093247..807edefd 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/async/management/AsyncGallerySetting.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/async/management/AsyncGallerySetting.kt @@ -17,4 +17,4 @@ class AsyncGallerySetting( gallerySetting.getLink() } } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/async/management/AsyncNotice.kt b/src/main/kotlin/be/zvz/kotlininside/api/async/management/AsyncNotice.kt index 7216e37b..92e80783 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/async/management/AsyncNotice.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/async/management/AsyncNotice.kt @@ -18,4 +18,4 @@ class AsyncNotice( notice.request() } } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/async/management/AsyncRecommend.kt b/src/main/kotlin/be/zvz/kotlininside/api/async/management/AsyncRecommend.kt index 6e4fe74f..98a4a3e3 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/async/management/AsyncRecommend.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/async/management/AsyncRecommend.kt @@ -18,4 +18,4 @@ class AsyncRecommend( recommend.request() } } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/async/management/AsyncUserBlock.kt b/src/main/kotlin/be/zvz/kotlininside/api/async/management/AsyncUserBlock.kt index c449e590..c282dd9c 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/async/management/AsyncUserBlock.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/async/management/AsyncUserBlock.kt @@ -25,4 +25,4 @@ class AsyncUserBlock @JvmOverloads constructor( userBlock.getLink() } } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/comment/CommentRead.kt b/src/main/kotlin/be/zvz/kotlininside/api/comment/CommentRead.kt index e4dda780..50957b52 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/comment/CommentRead.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/comment/CommentRead.kt @@ -86,6 +86,5 @@ class CommentRead( } } ) - } } diff --git a/src/main/kotlin/be/zvz/kotlininside/api/comment/CommentWrite.kt b/src/main/kotlin/be/zvz/kotlininside/api/comment/CommentWrite.kt index 9d8396c6..244732e9 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/comment/CommentWrite.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/comment/CommentWrite.kt @@ -53,7 +53,6 @@ class CommentWrite @JvmOverloads constructor( val json = KotlinInside.getInstance().httpInterface.upload(ApiUrl.Comment.OK, option)!!.index(0) - return WriteResult( result = json.get("result").asBoolean(), data = json.get("data").asNullableInteger(), diff --git a/src/main/kotlin/be/zvz/kotlininside/api/dccon/DCConBuy.kt b/src/main/kotlin/be/zvz/kotlininside/api/dccon/DCConBuy.kt index 27c47304..3a8f2b10 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/dccon/DCConBuy.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/dccon/DCConBuy.kt @@ -44,4 +44,4 @@ class DCConBuy( msg = json.get("msg").safeText() ) } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/dccon/DCConDetail.kt b/src/main/kotlin/be/zvz/kotlininside/api/dccon/DCConDetail.kt index 3445448a..45199ee9 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/dccon/DCConDetail.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/dccon/DCConDetail.kt @@ -68,6 +68,5 @@ class DCConDetail( } ) } - } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/dccon/DCConList.kt b/src/main/kotlin/be/zvz/kotlininside/api/dccon/DCConList.kt index ead919b9..247a3ef5 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/dccon/DCConList.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/dccon/DCConList.kt @@ -59,4 +59,4 @@ class DCConList( } ) } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/generic/GalleryRanking.kt b/src/main/kotlin/be/zvz/kotlininside/api/generic/GalleryRanking.kt index 594574e8..7d4964ed 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/generic/GalleryRanking.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/generic/GalleryRanking.kt @@ -55,4 +55,4 @@ class GalleryRanking { } } } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/generic/GallerySearch.kt b/src/main/kotlin/be/zvz/kotlininside/api/generic/GallerySearch.kt index daa100fd..f2eadd05 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/generic/GallerySearch.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/generic/GallerySearch.kt @@ -73,4 +73,4 @@ class GallerySearch( } ) } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/generic/MinorGalleryInfo.kt b/src/main/kotlin/be/zvz/kotlininside/api/generic/MinorGalleryInfo.kt index f9e45ab4..d79e1e3f 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/generic/MinorGalleryInfo.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/generic/MinorGalleryInfo.kt @@ -89,4 +89,4 @@ class MinorGalleryInfo( } ) } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/generic/MinorGalleryRanking.kt b/src/main/kotlin/be/zvz/kotlininside/api/generic/MinorGalleryRanking.kt index 28d92fae..1d3cd5aa 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/generic/MinorGalleryRanking.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/generic/MinorGalleryRanking.kt @@ -55,4 +55,4 @@ class MinorGalleryRanking { } } } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/generic/TotalSearch.kt b/src/main/kotlin/be/zvz/kotlininside/api/generic/TotalSearch.kt index c3148d7a..4476131b 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/generic/TotalSearch.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/generic/TotalSearch.kt @@ -127,4 +127,4 @@ class TotalSearch( } ) } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/generic/minigallery/JoinMiniGallery.kt b/src/main/kotlin/be/zvz/kotlininside/api/generic/minigallery/JoinMiniGallery.kt index c1aff172..402df0fe 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/generic/minigallery/JoinMiniGallery.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/generic/minigallery/JoinMiniGallery.kt @@ -70,4 +70,4 @@ class JoinMiniGallery( status = json.get("status").safeText() ) } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/generic/minigallery/QuitMiniGallery.kt b/src/main/kotlin/be/zvz/kotlininside/api/generic/minigallery/QuitMiniGallery.kt index a5181002..459d4924 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/generic/minigallery/QuitMiniGallery.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/generic/minigallery/QuitMiniGallery.kt @@ -33,4 +33,4 @@ class QuitMiniGallery( result = json.get("result").asBoolean() ) } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/generic/userinfo/CheckJoinedMiniGallery.kt b/src/main/kotlin/be/zvz/kotlininside/api/generic/userinfo/CheckJoinedMiniGallery.kt index d1ec2fab..a2b29795 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/generic/userinfo/CheckJoinedMiniGallery.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/generic/userinfo/CheckJoinedMiniGallery.kt @@ -76,4 +76,4 @@ class CheckJoinedMiniGallery( }, ) } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/generic/userinfo/CheckManagedGallery.kt b/src/main/kotlin/be/zvz/kotlininside/api/generic/userinfo/CheckManagedGallery.kt index 404dad6e..d8ff9293 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/generic/userinfo/CheckManagedGallery.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/generic/userinfo/CheckManagedGallery.kt @@ -56,4 +56,4 @@ class CheckManagedGallery( }, ) } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/generic/userinfo/ModifyMyGall.kt b/src/main/kotlin/be/zvz/kotlininside/api/generic/userinfo/ModifyMyGall.kt index 33f050ee..6a7717e3 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/generic/userinfo/ModifyMyGall.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/generic/userinfo/ModifyMyGall.kt @@ -38,4 +38,4 @@ class ModifyMyGall( cause = json.get("cause").safeText() ) } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/generic/userinfo/MyGall.kt b/src/main/kotlin/be/zvz/kotlininside/api/generic/userinfo/MyGall.kt index bfec625d..ba1cff47 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/generic/userinfo/MyGall.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/generic/userinfo/MyGall.kt @@ -57,4 +57,4 @@ class MyGall( }, ) } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/management/ChangeHeadText.kt b/src/main/kotlin/be/zvz/kotlininside/api/management/ChangeHeadText.kt index 92a13acc..413a2417 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/management/ChangeHeadText.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/management/ChangeHeadText.kt @@ -61,4 +61,4 @@ class ChangeHeadText( state = json.get("state").safeText() ) } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/management/Notice.kt b/src/main/kotlin/be/zvz/kotlininside/api/management/Notice.kt index a24e3221..26cdaedc 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/management/Notice.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/management/Notice.kt @@ -59,6 +59,4 @@ class Notice( state = json.get("state").safeText() ) } - - -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/management/Recommend.kt b/src/main/kotlin/be/zvz/kotlininside/api/management/Recommend.kt index 3cab74ec..e28e502e 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/management/Recommend.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/management/Recommend.kt @@ -58,6 +58,4 @@ class Recommend( state = json.get("state").text() ) } - - -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/type/Article.kt b/src/main/kotlin/be/zvz/kotlininside/api/type/Article.kt index a6ebfd3c..af640600 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/type/Article.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/type/Article.kt @@ -6,4 +6,4 @@ data class Article @JvmOverloads constructor( val subject: String, val content: List, val headText: HeadText? = null -) \ No newline at end of file +) diff --git a/src/main/kotlin/be/zvz/kotlininside/api/type/DCCon.kt b/src/main/kotlin/be/zvz/kotlininside/api/type/DCCon.kt index 1ee06ea5..68f8d73f 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/type/DCCon.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/type/DCCon.kt @@ -6,4 +6,4 @@ data class DCCon @JvmOverloads constructor( val imgLink: String = "", val memo: String = "", val title: String = "" -) \ No newline at end of file +) diff --git a/src/main/kotlin/be/zvz/kotlininside/api/type/Gallery.kt b/src/main/kotlin/be/zvz/kotlininside/api/type/Gallery.kt index ddc85388..60b7f7bb 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/type/Gallery.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/type/Gallery.kt @@ -3,4 +3,4 @@ package be.zvz.kotlininside.api.type data class Gallery( val title: String, val id: String -) \ No newline at end of file +) diff --git a/src/main/kotlin/be/zvz/kotlininside/api/type/HeadText.kt b/src/main/kotlin/be/zvz/kotlininside/api/type/HeadText.kt index 27745871..5af37549 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/type/HeadText.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/type/HeadText.kt @@ -5,4 +5,4 @@ data class HeadText @JvmOverloads constructor( val name: String, val level: Int = 0, val selected: Boolean = false -) \ No newline at end of file +) diff --git a/src/main/kotlin/be/zvz/kotlininside/api/type/comment/Comment.kt b/src/main/kotlin/be/zvz/kotlininside/api/type/comment/Comment.kt index 77f30147..11f240dd 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/type/comment/Comment.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/type/comment/Comment.kt @@ -1,3 +1,3 @@ package be.zvz.kotlininside.api.type.comment -interface Comment \ No newline at end of file +interface Comment diff --git a/src/main/kotlin/be/zvz/kotlininside/api/type/comment/DCConComment.kt b/src/main/kotlin/be/zvz/kotlininside/api/type/comment/DCConComment.kt index 7bd6cb79..0b9ef01b 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/type/comment/DCConComment.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/type/comment/DCConComment.kt @@ -4,4 +4,4 @@ import be.zvz.kotlininside.api.type.DCCon data class DCConComment( val dcCon: DCCon -) : Comment \ No newline at end of file +) : Comment diff --git a/src/main/kotlin/be/zvz/kotlininside/api/type/comment/StringComment.kt b/src/main/kotlin/be/zvz/kotlininside/api/type/comment/StringComment.kt index 8b96871d..570661aa 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/type/comment/StringComment.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/type/comment/StringComment.kt @@ -2,4 +2,4 @@ package be.zvz.kotlininside.api.type.comment data class StringComment( val memo: String -) : Comment \ No newline at end of file +) : Comment diff --git a/src/main/kotlin/be/zvz/kotlininside/api/type/content/Content.kt b/src/main/kotlin/be/zvz/kotlininside/api/type/content/Content.kt index 2092c21f..a390b5f9 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/type/content/Content.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/type/content/Content.kt @@ -1,3 +1,3 @@ package be.zvz.kotlininside.api.type.content -interface Content \ No newline at end of file +interface Content diff --git a/src/main/kotlin/be/zvz/kotlininside/api/type/content/ImageContent.kt b/src/main/kotlin/be/zvz/kotlininside/api/type/content/ImageContent.kt index f4629673..022c615e 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/type/content/ImageContent.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/type/content/ImageContent.kt @@ -15,4 +15,4 @@ data class ImageContent( FileInputStream(file) ) ) -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/api/type/content/StringContent.kt b/src/main/kotlin/be/zvz/kotlininside/api/type/content/StringContent.kt index 745fd1f0..2f77d21f 100644 --- a/src/main/kotlin/be/zvz/kotlininside/api/type/content/StringContent.kt +++ b/src/main/kotlin/be/zvz/kotlininside/api/type/content/StringContent.kt @@ -2,4 +2,4 @@ package be.zvz.kotlininside.api.type.content data class StringContent( val string: String -) : Content \ No newline at end of file +) : Content diff --git a/src/main/kotlin/be/zvz/kotlininside/http/Request.kt b/src/main/kotlin/be/zvz/kotlininside/http/Request.kt index a836b2ba..5cc08671 100644 --- a/src/main/kotlin/be/zvz/kotlininside/http/Request.kt +++ b/src/main/kotlin/be/zvz/kotlininside/http/Request.kt @@ -18,4 +18,4 @@ class Request { .addHeader("Referer", "http://www.dcinside.com") } } -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/security/App.kt b/src/main/kotlin/be/zvz/kotlininside/security/App.kt index 035a38a9..596d83f0 100644 --- a/src/main/kotlin/be/zvz/kotlininside/security/App.kt +++ b/src/main/kotlin/be/zvz/kotlininside/security/App.kt @@ -1,3 +1,3 @@ package be.zvz.kotlininside.security -data class App(val token: String, val id: String) \ No newline at end of file +data class App(val token: String, val id: String) diff --git a/src/main/kotlin/be/zvz/kotlininside/security/Auth.kt b/src/main/kotlin/be/zvz/kotlininside/security/Auth.kt index e81edc8c..91baa603 100644 --- a/src/main/kotlin/be/zvz/kotlininside/security/Auth.kt +++ b/src/main/kotlin/be/zvz/kotlininside/security/Auth.kt @@ -18,7 +18,6 @@ import org.apache.commons.codec.digest.DigestUtils import org.apache.commons.lang3.time.FastDateFormat import java.util.* - class Auth { private val seoulTimeZone = TimeZone.getTimeZone("Asia/Seoul") private val refreshDateFormat = FastDateFormat.getInstance("yyyyMMddHH", seoulTimeZone) @@ -94,11 +93,12 @@ class Auth { return FastDateFormat.getInstance( "E${dayOfYear - 1}d${getDayOfWeekMonday(dayOfWeek)}${dayOfWeek - 1}${ - String.format( - "%02d", - weekOfYear - ) - }MddMM", seoulTimeZone, Locale.US + String.format( + "%02d", + weekOfYear + ) + }MddMM", + seoulTimeZone, Locale.US ).format(date) } diff --git a/src/main/kotlin/be/zvz/kotlininside/session/Session.kt b/src/main/kotlin/be/zvz/kotlininside/session/Session.kt index 9577d4b4..07b7beed 100644 --- a/src/main/kotlin/be/zvz/kotlininside/session/Session.kt +++ b/src/main/kotlin/be/zvz/kotlininside/session/Session.kt @@ -5,4 +5,4 @@ import be.zvz.kotlininside.session.user.User data class Session( val user: User, val detail: SessionDetail? -) \ No newline at end of file +) diff --git a/src/main/kotlin/be/zvz/kotlininside/session/SessionDetail.kt b/src/main/kotlin/be/zvz/kotlininside/session/SessionDetail.kt index c2147f55..16275302 100644 --- a/src/main/kotlin/be/zvz/kotlininside/session/SessionDetail.kt +++ b/src/main/kotlin/be/zvz/kotlininside/session/SessionDetail.kt @@ -1,15 +1,15 @@ package be.zvz.kotlininside.session data class SessionDetail( - val result: Boolean, - val userId: String, - val userNo: String, - val name: String, - val stype: String, - val isAdult: Int, - val isDormancy: Int, - val isOtp: Int, - val pwCampaign: Int, - val mailSend: String, - val cause: String? -) \ No newline at end of file + val result: Boolean, + val userId: String, + val userNo: String, + val name: String, + val stype: String, + val isAdult: Int, + val isDormancy: Int, + val isOtp: Int, + val pwCampaign: Int, + val mailSend: String, + val cause: String? +) diff --git a/src/main/kotlin/be/zvz/kotlininside/session/user/Anonymous.kt b/src/main/kotlin/be/zvz/kotlininside/session/user/Anonymous.kt index 47602447..0942cd7b 100644 --- a/src/main/kotlin/be/zvz/kotlininside/session/user/Anonymous.kt +++ b/src/main/kotlin/be/zvz/kotlininside/session/user/Anonymous.kt @@ -3,4 +3,4 @@ package be.zvz.kotlininside.session.user data class Anonymous( override val id: String, override val password: String -) : User \ No newline at end of file +) : User diff --git a/src/main/kotlin/be/zvz/kotlininside/session/user/LoginUser.kt b/src/main/kotlin/be/zvz/kotlininside/session/user/LoginUser.kt index f6b1a0e9..79bd2d8d 100644 --- a/src/main/kotlin/be/zvz/kotlininside/session/user/LoginUser.kt +++ b/src/main/kotlin/be/zvz/kotlininside/session/user/LoginUser.kt @@ -3,4 +3,4 @@ package be.zvz.kotlininside.session.user open class LoginUser( override val id: String, override val password: String -) : User \ No newline at end of file +) : User diff --git a/src/main/kotlin/be/zvz/kotlininside/session/user/User.kt b/src/main/kotlin/be/zvz/kotlininside/session/user/User.kt index f245401a..49457c88 100644 --- a/src/main/kotlin/be/zvz/kotlininside/session/user/User.kt +++ b/src/main/kotlin/be/zvz/kotlininside/session/user/User.kt @@ -3,4 +3,4 @@ package be.zvz.kotlininside.session.user interface User { val id: String val password: String -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/session/user/UserType.kt b/src/main/kotlin/be/zvz/kotlininside/session/user/UserType.kt index 34171f59..659f1ed8 100644 --- a/src/main/kotlin/be/zvz/kotlininside/session/user/UserType.kt +++ b/src/main/kotlin/be/zvz/kotlininside/session/user/UserType.kt @@ -4,4 +4,4 @@ enum class UserType(val stype: String) { ANONYMOUS("C"), NAMED("A"), DUPLICATE_NAMED("B") -} \ No newline at end of file +} diff --git a/src/main/kotlin/be/zvz/kotlininside/session/user/named/DuplicateNamed.kt b/src/main/kotlin/be/zvz/kotlininside/session/user/named/DuplicateNamed.kt index 7aeca362..e57a79ff 100644 --- a/src/main/kotlin/be/zvz/kotlininside/session/user/named/DuplicateNamed.kt +++ b/src/main/kotlin/be/zvz/kotlininside/session/user/named/DuplicateNamed.kt @@ -5,4 +5,4 @@ import be.zvz.kotlininside.session.user.LoginUser data class DuplicateNamed( override val id: String, override val password: String -) : LoginUser(id, password) \ No newline at end of file +) : LoginUser(id, password) diff --git a/src/main/kotlin/be/zvz/kotlininside/session/user/named/Named.kt b/src/main/kotlin/be/zvz/kotlininside/session/user/named/Named.kt index 8b42e168..be5f4ee6 100644 --- a/src/main/kotlin/be/zvz/kotlininside/session/user/named/Named.kt +++ b/src/main/kotlin/be/zvz/kotlininside/session/user/named/Named.kt @@ -5,4 +5,4 @@ import be.zvz.kotlininside.session.user.LoginUser data class Named( override val id: String, override val password: String -) : LoginUser(id, password) \ No newline at end of file +) : LoginUser(id, password) diff --git a/src/main/kotlin/be/zvz/kotlininside/utils/StringUtil.kt b/src/main/kotlin/be/zvz/kotlininside/utils/StringUtil.kt index 6edc0a41..4af4ca77 100644 --- a/src/main/kotlin/be/zvz/kotlininside/utils/StringUtil.kt +++ b/src/main/kotlin/be/zvz/kotlininside/utils/StringUtil.kt @@ -11,7 +11,8 @@ class StringUtil { companion object { private val OPTIONS = MutableDataSet() .set( - Parser.EXTENSIONS, listOf( + Parser.EXTENSIONS, + listOf( TablesExtension.create(), StrikethroughExtension.create(), TaskListExtension.create() diff --git a/src/main/kotlin/be/zvz/kotlininside/value/ApiUrl.kt b/src/main/kotlin/be/zvz/kotlininside/value/ApiUrl.kt new file mode 100644 index 00000000..bdd9f776 --- /dev/null +++ b/src/main/kotlin/be/zvz/kotlininside/value/ApiUrl.kt @@ -0,0 +1,75 @@ +package be.zvz.kotlininside.value + +object ApiUrl { + const val PC_WEB = Protocol.HTTPS + "gall.dcinside.com/" + const val MOBILE_WEB = Protocol.HTTP + "m.dcinside.com/" + const val APP_API = Protocol.HTTPS + "app.dcinside.com/api/" + const val AUTH_API = Protocol.HTTPS + "dcid.dcinside.com/join/" + const val MAIN_API = Protocol.HTTP + "json2.dcinside.com/" + const val UPLOAD = Protocol.HTTPS + "upload.dcinside.com/" + const val REDIRECT = APP_API + "redirect.php" + + private object Protocol { + const val HTTP = "http://" + const val HTTPS = "https://" + } + + object Article { + const val LIST = APP_API + "gall_list_new.php" + const val READ = APP_API + "gall_view_new.php" + const val WRITE = UPLOAD + "_app_write_api.php" + const val DELETE = APP_API + "gall_del.php" + const val MODIFY = APP_API + "gall_modify.php" + const val UPVOTE = APP_API + "_recommend_up.php" + const val DOWNVOTE = APP_API + "_recommend_down.php" + const val REPORT = MOBILE_WEB + "api/report.php" + const val HIT_UPVOTE = APP_API + "hit_recommend" + } + + object Comment { + const val OK = APP_API + "comment_ok.php" + const val DELETE = APP_API + "comment_del.php" + const val READ = APP_API + "comment_new.php" + } + + object DCCon { + const val DCCON = APP_API + "dccon.php" + } + + object Gallery { + const val MINOR_INFO = APP_API + "minor_info" + const val MINOR_MANAGEMENT = PC_WEB + "mgallery/management/mobile" + const val MINOR_MANAGER_REQUEST = APP_API + "_manager_request.php" + const val MINOR_BLOCK_WEB = APP_API + "minor_avoid" + const val MINOR_BLOCK_ADD = APP_API + "minor_avoidadd" + } + + object Search { + const val SEARCH = APP_API + "_total_search.php" + } + + object Auth { + const val LOGIN = AUTH_API + "mobile_app_login.php" + const val APP_ID = AUTH_API + "mobile_app_key_verification_3rd.php" + const val APP_CHECK = MAIN_API + "json0/app_check_A_rina_beta.php" + } + + object User { + const val MY_GALL = APP_API + "mygall.php" + const val MY_GALL_MODIFY = APP_API + "mygall_modify.php" + const val MY_MANAGE_GALL_CHECK = APP_API + "mymanageGallChk" + const val MY_MINI_JOIN_CHECK = APP_API + "myminijoinGallChk" + } + + object MiniGallery { + const val JOIN = APP_API + "memberjoin" + const val JOIN_OK = APP_API + "memberjoin_ok" + const val QUIT = APP_API + "memberout_ok" + } + + object MainInfo { + const val APP_MAIN = MAIN_API + "json3/main_content.php" + const val GALLERY_RANKING = MAIN_API + "json3/ranking_gallery.php" + const val MINOR_GALLERY_RANKING = MAIN_API + "json1/mgallmain/mgallery_ranking.php" + } +} diff --git a/src/main/kotlin/be/zvz/kotlininside/value/Const.kt b/src/main/kotlin/be/zvz/kotlininside/value/Const.kt new file mode 100644 index 00000000..149e7e37 --- /dev/null +++ b/src/main/kotlin/be/zvz/kotlininside/value/Const.kt @@ -0,0 +1,15 @@ +package be.zvz.kotlininside.value + +import org.apache.commons.lang3.RandomStringUtils + +object Const { + const val DC_APP_SIGNATURE = "ReOo4u96nnv8Njd7707KpYiIVYQ3FlcKHDJE046Pg6s=" + const val DC_APP_PACKAGE = "com.dcinside.app" + const val DC_APP_VERSION_CODE = "30516" + const val DC_APP_VERSION_NAME = "4.2.13" + const val USER_AGENT = "dcinside.app" + + @JvmStatic + val DEFAULT_FCM_TOKEN = + RandomStringUtils.randomAlphanumeric(11) + ":APA91bFMI-0d1b0wJmlIWoDPVa_V5Nv0OWnAefN7fGLegy6D76TN_CRo5RSUO-6V7Wnq44t7Rzx0A4kICVZ7wX-hJd3mrczE5NnLud722k5c-XRjIxYGVM9yZBScqE3oh4xbJOe2AvDe" +}