Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/najasin/na-jasin-be into…
Browse files Browse the repository at this point in the history
… feature/#21

# Conflicts:
#	src/main/java/com/najasin/domain/user/controller/UserController.java
  • Loading branch information
adoo24 committed Aug 20, 2023
2 parents 0d31a20 + 6e4a674 commit 87dca07
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.najasin.domain.comment.service.CommentService;
import com.najasin.domain.keyword.repository.KeywordRepository;
import com.najasin.domain.keyword.service.KeywordService;
import com.najasin.domain.keyword.service.KeywordService;
import com.najasin.domain.question.entity.QuestionType;
import com.najasin.domain.question.service.QuestionService;
import com.najasin.domain.user.dto.*;
Expand Down Expand Up @@ -117,7 +118,6 @@ public ResponseEntity<ApiResponse<?>> postMyManual(
) {

String userId = user.getId();
System.out.println(userId);
userService.updateNickname(userId, dto.getNickname());
userUserTypeService.updateCharacter(userId, userTypeName, dto.getCharacterItems());
answerService.deleteAnswers(userId, userTypeName);
Expand Down Expand Up @@ -153,6 +153,7 @@ public ResponseEntity<ApiResponse<?>> getMyManual(
@AuthorizeUser User user
) {
Manual manual = new Manual();

String userId = user.getId();
if(!isNull(user)) {
manual.setNickname(user.getId());
Expand Down Expand Up @@ -193,7 +194,6 @@ public ResponseEntity<ApiResponse<?>> getMyPage(
@PathVariable String userTypeName,
@AuthorizeUser User user
) {
// User user = userService.findById(userId);
String userId = user.getId();
Page page = new Page();

Expand Down
6 changes: 4 additions & 2 deletions src/main/java/com/najasin/global/aspect/LoggingAspect.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ public void beforeParameterLog(JoinPoint joinPoint) {
Object[] args = joinPoint.getArgs();
if (!isNull(args)) {
for (Object arg : args) {
log.info("parameter type = {}", arg.getClass().getSimpleName());
log.info("parameter value = {}", arg);
if(!isNull(arg)) {
log.info("parameter type = {}", arg.getClass().getSimpleName());
log.info("parameter value = {}", arg);
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,11 @@ public boolean supportsParameter(MethodParameter parameter) {
@Override
public User resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer,
NativeWebRequest webRequest, WebDataBinderFactory binderFactory) {
SecurityContext securityContext = SecurityContextHolder.getContext();
if(isNull(securityContext)) {
String userId = SecurityContextHolder.getContext().getAuthentication().getName();

if(userId.equals("anonymousUser")) {
return null;
}
String authentication = securityContext.getAuthentication().getName();

return userService.findById(authentication);
return userService.findById(userId);
}
}
2 changes: 1 addition & 1 deletion src/main/resources/application-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spring:
jpa:
open-in-view: false
hibernate:
ddl-auto: create-drop
ddl-auto: update
show-sql: true
generate-ddl: true

Expand Down

0 comments on commit 87dca07

Please sign in to comment.