diff --git a/src/main/kotlin/top/fatweb/oxygen/api/config/SecurityConfig.kt b/src/main/kotlin/top/fatweb/oxygen/api/config/SecurityConfig.kt index 3c0059b..c4b8679 100644 --- a/src/main/kotlin/top/fatweb/oxygen/api/config/SecurityConfig.kt +++ b/src/main/kotlin/top/fatweb/oxygen/api/config/SecurityConfig.kt @@ -79,7 +79,7 @@ class SecurityConfig( "/forget", "/retrieve" ).anonymous() - .requestMatchers("/tool/detail/**").permitAll() + .requestMatchers("/tool/detail/**", "/tool/store").permitAll() // Authentication required .anyRequest().authenticated() } diff --git a/src/main/kotlin/top/fatweb/oxygen/api/service/tool/impl/EditServiceImpl.kt b/src/main/kotlin/top/fatweb/oxygen/api/service/tool/impl/EditServiceImpl.kt index 7b2eecd..ab8268c 100644 --- a/src/main/kotlin/top/fatweb/oxygen/api/service/tool/impl/EditServiceImpl.kt +++ b/src/main/kotlin/top/fatweb/oxygen/api/service/tool/impl/EditServiceImpl.kt @@ -223,7 +223,7 @@ class EditServiceImpl( if (tool.review == Tool.ReviewType.PROCESSING) { throw ToolUnderReviewException() } - if (tool.review == Tool.ReviewType.PASS || tool.publish != 0L) { + if (tool.review == Tool.ReviewType.PASS && tool.publish != 0L) { throw ToolHasBeenPublishedException() } @@ -232,7 +232,7 @@ class EditServiceImpl( override fun cancel(id: Long): Boolean { val tool = getById(id) - if (tool.review == Tool.ReviewType.PASS || tool.publish != 0L) { + if (tool.review == Tool.ReviewType.PASS && tool.publish != 0L) { throw ToolHasBeenPublishedException() } if (tool.review != Tool.ReviewType.PROCESSING) { diff --git a/src/main/kotlin/top/fatweb/oxygen/api/service/tool/impl/ManagementServiceImpl.kt b/src/main/kotlin/top/fatweb/oxygen/api/service/tool/impl/ManagementServiceImpl.kt index 9e6ed3e..e5180b1 100644 --- a/src/main/kotlin/top/fatweb/oxygen/api/service/tool/impl/ManagementServiceImpl.kt +++ b/src/main/kotlin/top/fatweb/oxygen/api/service/tool/impl/ManagementServiceImpl.kt @@ -111,7 +111,6 @@ class ManagementServiceImpl( KtUpdateWrapper(Tool()) .eq(Tool::id, id) .set(Tool::review, Tool.ReviewType.REJECT) - .set(Tool::publish, 0) ) return this.getOne(id) diff --git a/src/main/resources/mapper/tool/StoreMapper.xml b/src/main/resources/mapper/tool/StoreMapper.xml index 6f5f2c9..93192fa 100644 --- a/src/main/resources/mapper/tool/StoreMapper.xml +++ b/src/main/resources/mapper/tool/StoreMapper.xml @@ -2,31 +2,40 @@