Add tool submit and cancel api

This commit is contained in:
2024-02-01 19:07:12 +08:00
parent 04587fbb7a
commit 13d8ba8e78
6 changed files with 87 additions and 2 deletions

View File

@@ -128,6 +128,30 @@ class EditController(
fun update(@RequestBody @Valid toolUpdateParam: ToolUpdateParam) =
ResponseResult.databaseSuccess(ResponseCode.DATABASE_UPDATE_SUCCESS, data = editService.update(toolUpdateParam))
/**
* Submit tool review
*
* @author FatttSnake, fatttsnake@gmail.com
* @since 1.0.0
*/
@Operation(summary = "提交工具审核")
@PostMapping("/{id}")
fun submit(@PathVariable id: Long): ResponseResult<Nothing> =
if (editService.submit(id)) ResponseResult.success(ResponseCode.TOOL_SUBMIT_SUCCESS)
else ResponseResult.fail(ResponseCode.TOOL_SUBMIT_ERROR)
/**
* Cancel tool review
*
* @author FatttSnake, fatttsnake@gmail.com
* @since 1.0.0
*/
@Operation(summary = "取消工具审核")
@PutMapping("/{id}")
fun cancel(@PathVariable id: Long): ResponseResult<Nothing> =
if (editService.cancel(id)) ResponseResult.success(ResponseCode.TOOL_CANCEL_SUCCESS)
else ResponseResult.fail(ResponseCode.TOOL_CANCEL_ERROR)
/**
* Delete tool
*