Optimize tools api
This commit is contained in:
@@ -79,7 +79,7 @@ class SecurityConfig(
|
||||
"/forget",
|
||||
"/retrieve"
|
||||
).anonymous()
|
||||
.requestMatchers("/tool/detail/**").permitAll()
|
||||
.requestMatchers("/tool/detail/**", "/tool/store").permitAll()
|
||||
// Authentication required
|
||||
.anyRequest().authenticated()
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user