yooputer's devlog

고정 헤더 영역

글 제목

메뉴 레이어

yooputer's devlog

메뉴 리스트

  • 홈
  • 분류 전체보기 (165)
    • Computer Science (10)
      • 알고리즘 (2)
      • 데이터베이스 (8)
    • Programming Language (3)
      • Java (1)
      • Python (1)
      • JavaScript (1)
    • Framework (9)
      • Spring | SpringBoot (6)
      • SwiftUI (0)
      • DBMS (2)
    • Project (36)
      • WithParents (18)
      • Meta ESG (7)
      • MugLog (1)
      • 영풍문고 리뉴얼 (3)
      • 정산타임 (1)
      • 포트폴리오(NextJS + Notion API) (5)
      • etc. (1)
    • Coding Test (43)
      • 개념 (0)
      • 문제풀이 (43)
    • 컴공 수업 (0)
      • 오픈소스 소프트웨어 (0)
      • 정보검색 (0)
      • 컴파일러 (0)
    • Development Study (57)
      • 개발 관련 도서 (7)
      • 이펙티브 자바 (15)
      • SQLP (2)
      • 잡기술 (14)
      • 도커 (4)
      • 대용량 트래픽 처리 (6)
      • AI 개발 활용기 (4)
      • HTML&CSS (2)
      • 프론트엔드 (2)
    • 취업준비 (1)
      • 면접후기 (0)
      • 면접준비 (0)
    • 주절주절 (3)

검색 레이어

yooputer's devlog

검색 영역

컨텐츠 검색

분류 전체보기

  • [WithParents] testLogin api 구현

    2023.01.16 by yooputer

  • [WithParents] User 엔티티 구현 | JwtAuthorizationFilter 구현

    2023.01.16 by yooputer

  • [WithParents] SpringSecurityConfig 작성 | JWT Token 생성 메서드 작성

    2023.01.16 by yooputer

  • [WithParents] SpringSecurity 적용하기

    2023.01.13 by yooputer

  • [WithParents] RDS 생성 후 스프링부트에 연동 | ec2 인스턴스 생성

    2023.01.13 by yooputer

  • [WithParents] 오늘의 약알림 조회 기능 구현 | getTodayMedicationList api 구현

    2022.12.02 by yooputer

  • [WithParents] 약알림 조회 기능 구현, getMedicationList api 구현

    2022.12.02 by yooputer

  • [WithParents] 약알림 삭제 기능 구현, deleteMedication api 구현

    2022.12.02 by yooputer

[WithParents] testLogin api 구현

이번 포스팅에서는 testuser를 생성하고 testLogin api를 구현해 jwt토큰 생성 및 인증이 잘 작동하는지 확인해보겠다 테스트 유저 생성 users 테이블에 다음과 같이 testuser를 insert한다 insert into users(email, nickname, password, authority) values('test@test.com', 'testuser', 'password', 'ROLE_USER'); AuthController, AuthService 생성 controller 패키지 아래에 AuthController 클래스를 생성한다 service패키지 아래에 AuthService클래스를 생성한다 findByEmail 메서드 구현 다음과같이 UserRepository에서 Email을..

Project/WithParents 2023. 1. 16. 17:10

[WithParents] User 엔티티 구현 | JwtAuthorizationFilter 구현

이번 포스팅에서는 UserDetails를 구현한 User 엔티티를 구현하고 헤더에 들은 jwt token을 분석해 사용자를 인증하는 필터를 구현해보도록 하겠다 User 엔티티 생성 entity 패키지 아래에 User 클래스를 생성한다 다음과 같이 User 클래스를 구현한다 MySQL에서 테이블명이 user이면 오류가 나서 테이블명은 users로 바꿔주었다 family 정보를 저장하는 코드는 아직 demo에서 코드를 옮기지 않아서 코드를 모두 옮긴 후 주석을 해제할 예정이다 @Entity @Getter @NoArgsConstructor @AllArgsConstructor @Table(name = "users") public class User implements UserDetails { @Id @Colum..

Project/WithParents 2023. 1. 16. 15:47

[WithParents] SpringSecurityConfig 작성 | JWT Token 생성 메서드 작성

SpringSecurity를 사용하면 기본적으로 모든 페이지에서 로그인을 해야한다 페이지마다 접근권한을 다르게 하기 위해 SpringSecurityConfig를 작성한다 SpringSecurityConfig 작성 config라는 패키지를 새로 생성하고 config패키지 아래에 SpringSecurityConfig라는 클래스를 생성한다 WebSecurityConfigurerAdapter을 상속하고 http관련 설정과 web 관련 설정을 해준다 (참고로 WebSecurityConfigurerAdapter는 스프링부트 3.0.1버전에서 사용할 수 없어서 버전을 2.7.5로 내렸다....) 다음과 같이 설정하면 "/" 경로와 "/api/auth/testLogin" 경로는 로그인이 없어도 접근할 수 있다 @Ena..

Project/WithParents 2023. 1. 16. 14:52

[WithParents] SpringSecurity 적용하기

이번 포스팅에서는 SpringSecurity를 적용해보도록 하겠다. 기존 데모에 SpringSecurity 의존성을 추가하는 것이 아닌 새로운 프로젝트를 팔 것이다. 프로젝트 생성 인텔리제이의 Spring Initializr 기능을 이용해 스프링부트 프로젝트를 생성할 것이다 빌드툴은 gradle, 자바는 17, 패키징방식은 Jar을 사용한다 디펜던시는 다음과 같이 선택하고 프로젝트를 생성한다 빌드가 완료된 후 프로젝트를 실행해보면 오류가 뜬다 데이터베이스가 연동되지 않았기 때문이다 application.properties에 다음과 같이 작성한다. 데이터베이스를 연동한 후 실행해보면 아래와 같이 로그인화면이 뜨는 것을 확인할 수 있다 username은 user, password는 아래와 같이 빌드될 때 나..

Project/WithParents 2023. 1. 13. 16:12

[WithParents] RDS 생성 후 스프링부트에 연동 | ec2 인스턴스 생성

이번 포스팅에서는 rds 인스턴스를 생성하고 프로젝트에 연동해보고 ec2 인스턴스를 생성해보도록 하겠다 RDS 생성 AWS Console 접속 https://ap-northeast-2.console.aws.amazon.com/console/home?region=ap-northeast-2 https://ap-northeast-2.console.aws.amazon.com/console/home?region=ap-northeast-2 ap-northeast-2.console.aws.amazon.com 데이터베이스 생성 RDS 서비스로 이동 후 데이터베이스를 생성한다 dbms는 MySQL을 사용한다 프리티어 템플릿을 선택했다 DB 인스턴스 이름과 관리자 이름, 암호를 입력한다 퍼블릭 액세스를 허용한다 생성이 완..

Project/WithParents 2023. 1. 13. 15:46

[WithParents] 오늘의 약알림 조회 기능 구현 | getTodayMedicationList api 구현

이번 포스팅에서는 오늘의 약 알림을 조회하는 api를 구현해보도록 하겠다 MedicationService에서 getTodayMedicationList 메서드 구현하기 MedicationService에 다음과 같이 메서드를 작성한다 public List getTodayMedicationList( Long memberId ) { Member member = memberRepo.findById(memberId) .orElseThrow(() -> new InvalidIdException(memberId, "member")); // TODO: 현재 로그인한 유저와 memberId에 해당하는 유저가 같은 family_id를 가지고 있는지 확인 String dayOfTheWeek = String.valueOf(Loc..

Project/WithParents 2022. 12. 2. 16:42

[WithParents] 약알림 조회 기능 구현, getMedicationList api 구현

이번 포스팅에서는 Medication을 조회하는 api를 구현해보도록 하겠다 MedicationRepository에서 findAllByMemberId 메서드 명시 MedicationRepository에 다음과 같이 메서드를 명시한다 MedicationService에서 getMedicationList 메서드 구현 MedicationService에서 다음과 같이 메서드를 작성한다 public List getMedicationList(Long memberId) { Member member = memberRepo.findById(memberId) .orElseThrow(() -> new InvalidIdException(memberId, "member")); // TODO: 현재 로그인한 유저와 memberId..

Project/WithParents 2022. 12. 2. 16:28

[WithParents] 약알림 삭제 기능 구현, deleteMedication api 구현

이번포스팅에서는 medication을 삭제하는 api를 구현해보도록 하겠다. MedicationService에서 deleteMedication 메서드 구현 MedicationService에서 다음과 같이 메서드를 작성한다 @Transactional public void deleteMedication( Long medicationId ) { Medication medication = medicationRepo.findById(medicationId) .orElseThrow(() -> new InvalidIdException(medicationId, "medication")); medicationRepo.delete(medication); } MediationController에서 deleteMedicati..

Project/WithParents 2022. 12. 2. 16:03

추가 정보

인기글

최신글

페이징

이전
1 ··· 16 17 18 19 20 21
다음
TISTORY
yooputer's devlog © Magazine Lab
페이스북 트위터 인스타그램 유투브 메일

티스토리툴바