mirror of
https://github.com/201206030/novel.git
synced 2025-04-27 07:30:50 +00:00
feat: 增加作家状态查询接口
This commit is contained in:
parent
066dd0f13e
commit
f33c66c5d2
@ -40,6 +40,14 @@ public class AuthorController {
|
||||
return authorService.register(dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询作家状态接口
|
||||
* */
|
||||
@GetMapping("status")
|
||||
public RestResp<Integer> getStatus(){
|
||||
return authorService.getStatus(UserHolder.getUserId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 小说发布接口
|
||||
*/
|
||||
@ -65,7 +73,7 @@ public class AuthorController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 小说发布章节列表查询接口
|
||||
* 小说章节发布列表查询接口
|
||||
*/
|
||||
@GetMapping("book/chapters/{bookId}")
|
||||
public RestResp<PageRespDto<BookChapterRespDto>> listBookChapters(@PathVariable("bookId") Long bookId, PageReqDto dto) {
|
||||
|
@ -32,7 +32,10 @@ public class AuthorAuthStrategy implements AuthStrategy {
|
||||
/**
|
||||
* 不需要进行作家权限认证的 URI
|
||||
* */
|
||||
private static final List<String> EXCLUDE_URI = List.of(ApiRouterConsts.API_AUTHOR_URL_PREFIX + "/register");
|
||||
private static final List<String> EXCLUDE_URI = List.of(
|
||||
ApiRouterConsts.API_AUTHOR_URL_PREFIX + "/register",
|
||||
ApiRouterConsts.API_AUTHOR_URL_PREFIX +"/status"
|
||||
);
|
||||
|
||||
@Override
|
||||
public void auth(String token, String requestUri) throws BusinessException {
|
||||
|
@ -18,4 +18,11 @@ public interface AuthorService {
|
||||
* @return void
|
||||
*/
|
||||
RestResp<Void> register(AuthorRegisterReqDto dto);
|
||||
|
||||
/**
|
||||
* 查询作家状态
|
||||
* @param userId 用户ID
|
||||
* @return 作家状态
|
||||
* */
|
||||
RestResp<Integer> getStatus(Long userId);
|
||||
}
|
||||
|
@ -54,4 +54,10 @@ public class AuthorServiceImpl implements AuthorService {
|
||||
return RestResp.ok();
|
||||
}
|
||||
|
||||
@Override
|
||||
public RestResp<Integer> getStatus(Long userId) {
|
||||
AuthorInfoDto author = authorInfoCacheManager.getAuthor(userId);
|
||||
return Objects.isNull(author) ? RestResp.ok(null) : RestResp.ok(author.getStatus());
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user