mirror of
https://github.com/iflytek/skillhub.git
synced 2026-08-28 11:25:00 +00:00
update
This commit is contained in:
parent
175b6c44c9
commit
5254cd155e
2 changed files with 6 additions and 0 deletions
|
|
@ -37,6 +37,9 @@ public class SkillRatingController extends BaseApiController {
|
|||
public ApiResponse<SkillRatingStatusResponse> getUserRating(
|
||||
@PathVariable Long skillId,
|
||||
@AuthenticationPrincipal PlatformPrincipal principal) {
|
||||
if (principal == null) {
|
||||
return ok("response.success.read", new SkillRatingStatusResponse((short) 0, false));
|
||||
}
|
||||
Optional<Short> rating = skillRatingService.getUserRating(skillId, principal.userId());
|
||||
return ok(
|
||||
"response.success.read",
|
||||
|
|
|
|||
|
|
@ -40,6 +40,9 @@ public class SkillStarController extends BaseApiController {
|
|||
public ApiResponse<Boolean> checkStarred(
|
||||
@PathVariable Long skillId,
|
||||
@AuthenticationPrincipal PlatformPrincipal principal) {
|
||||
if (principal == null) {
|
||||
return ok("response.success.read", false);
|
||||
}
|
||||
boolean starred = skillStarService.isStarred(skillId, principal.userId());
|
||||
return ok("response.success.read", starred);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue