Optimize role

This commit is contained in:
2023-11-14 18:08:51 +08:00
parent a1844973fa
commit f86028a449
20 changed files with 115 additions and 16 deletions

View File

@@ -6,10 +6,7 @@ import jakarta.validation.Valid
import org.springframework.web.bind.annotation.*
import top.fatweb.api.entity.common.ResponseCode
import top.fatweb.api.entity.common.ResponseResult
import top.fatweb.api.param.authentication.RoleAddParam
import top.fatweb.api.param.authentication.RoleChangeStatusParam
import top.fatweb.api.param.authentication.RoleGetParam
import top.fatweb.api.param.authentication.RoleUpdateParam
import top.fatweb.api.param.authentication.*
import top.fatweb.api.service.permission.IRoleService
import top.fatweb.api.vo.PageVo
import top.fatweb.api.vo.permission.RoleVo
@@ -72,4 +69,18 @@ class RoleController(
ResponseResult.databaseFail(ResponseCode.DATABASE_UPDATE_FILED)
}
}
@Operation(summary = "删除角色")
@DeleteMapping("/{id}")
fun delete(@PathVariable id: Long): ResponseResult<Nothing> {
roleService.deleteOne(id)
return ResponseResult.databaseSuccess(ResponseCode.DATABASE_DELETE_SUCCESS)
}
@Operation(summary = "批量删除角色")
@DeleteMapping
fun deleteList(@Valid @RequestBody roleDeleteParam: RoleDeleteParam): ResponseResult<Nothing> {
roleService.delete(roleDeleteParam)
return ResponseResult.databaseSuccess(ResponseCode.DATABASE_DELETE_SUCCESS)
}
}