docs: 添加 Javadoc
This commit is contained in:
@@ -7,12 +7,15 @@ import com.onixbyte.helix.domain.web.request.QueryAuthorityRequest;
|
||||
import com.onixbyte.helix.service.AuthorityService;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* This controller provides entry points for manipulate authorities.
|
||||
*
|
||||
* @author zihluwang
|
||||
* @author siujamo
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/authorities")
|
||||
public class AuthorityController {
|
||||
@@ -23,6 +26,14 @@ public class AuthorityController {
|
||||
this.authorityService = authorityService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get authorities by page.
|
||||
*
|
||||
* @param pageNum current page num
|
||||
* @param pageSize page size
|
||||
* @param request query parameters
|
||||
* @return a page contains authority data of the specified page
|
||||
*/
|
||||
@GetMapping
|
||||
public Page<Authority> getAuthorities(
|
||||
@RequestParam(required = false, defaultValue = "1") Integer pageNum,
|
||||
@@ -33,11 +44,23 @@ public class AuthorityController {
|
||||
return authorityService.getAuthorities(pageRequest, request);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an authority.
|
||||
*
|
||||
* @param request authority specs
|
||||
* @return created authority
|
||||
*/
|
||||
@PostMapping
|
||||
public Authority addAuthority(@Validated @RequestBody AddAuthorityRequest request) {
|
||||
return authorityService.addAuthority(request);
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit an authority.
|
||||
*
|
||||
* @param request authority specs
|
||||
* @return edited authority
|
||||
*/
|
||||
@PutMapping
|
||||
public Authority editAuthority(@Validated @RequestBody EditAuthorityRequest request) {
|
||||
return authorityService.editAuthority(request);
|
||||
|
||||
Reference in New Issue
Block a user