Skip to content

Commit

Permalink
[Chore] 배포 코드 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
jiyunio committed Nov 25, 2024
1 parent 79bad3d commit 3d41849
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4

- name: Set Java
uses: actions/setup-java@v3
Expand Down Expand Up @@ -50,5 +50,5 @@ jobs:
password: ${{ secrets.PASSWORD }}
port: ${{ secrets.SSH_PORT }}
script_stop: true
script: |
script: |
sh deploy/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

@SpringBootApplication
public class TodolistApplication {

public static void main(String[] args) {
SpringApplication.run(TodolistApplication.class, args);
}
Expand Down
20 changes: 20 additions & 0 deletions src/main/java/com/jiyunio/todolist/config/WebConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.jiyunio.todolist.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebConfig implements WebMvcConfigurer {
@Value("${web.port}")
private String port;

@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/api/**")
.allowedOrigins("http://localhost:" + port)
.allowedMethods("GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS")
.allowedHeaders("*");
}
}
1 change: 1 addition & 0 deletions src/main/java/com/jiyunio/todolist/jwt/JwtProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public JwtDTO createToken(Authentication authentication) {
return new JwtDTO(accessToken);
}

//SecurityContext에 인증된 클라이언트의 Authentication를 저장하기 위해 사용됨
public Authentication getAuthentication(String accessToken) {
//인증 객체 반환 (로그인 이외의 토큰 인증할 때 "Jwt 필터" 에서 이용)
Claims claims = parseClaims(accessToken);
Expand Down
11 changes: 5 additions & 6 deletions src/main/java/com/jiyunio/todolist/member/Member.java
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
package com.jiyunio.todolist.member;

import jakarta.persistence.*;
import lombok.AccessLevel;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.*;

@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor
@Entity
public class Member {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "memberId")
@Column(name = "member_id")
private Long id;

@Column(columnDefinition = "text")
private String userId;

private String userPw;

private String role;

@Builder
protected Member(String userId, String userPw) {
private Member(String userId, String userPw) {
this.userId = userId;
this.userPw = userPw;
this.role = "ROLE_USER";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
import java.util.Optional;

public interface MemberRepository extends JpaRepository<Member, Long> {
Optional<Member> findById(Long id);

Optional<Member> findByUserId(String userId);

boolean existsByUserId(String userId);
Expand Down
7 changes: 3 additions & 4 deletions src/main/java/com/jiyunio/todolist/todo/Todo.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.jiyunio.todolist.todo;

import com.jiyunio.todolist.category.CategoryDTO;
import com.jiyunio.todolist.responseDTO.ResponseCategoryDTO;
import com.jiyunio.todolist.todo.dto.UpdateTodoDTO;
import jakarta.persistence.*;
Expand All @@ -17,7 +16,7 @@
public class Todo {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "todoId")
@Column(name = "todo_id")
private Long id;

private String userId;
Expand All @@ -37,7 +36,7 @@ public class Todo {


@Builder
protected Todo(String userId, String content, Boolean checked, LocalDate setDate,
private Todo(String userId, String content, Boolean checked, LocalDate setDate,
Long categoryId, String categoryContent, String categoryColor) {
this.userId = userId;
this.content = content;
Expand All @@ -56,7 +55,7 @@ protected void updateTodo(UpdateTodoDTO updateTodoDto) {

protected void updateCategory(ResponseCategoryDTO categoryDTO) {
this.categoryId = categoryDTO.getCategoryId();
; this.categoryContent = categoryDTO.getContent();
this.categoryContent = categoryDTO.getContent();
this.categoryColor = categoryDTO.getColor();
}
}

0 comments on commit 3d41849

Please sign in to comment.