Skip to content

Commit

Permalink
fix: color에 imageUrl entity 생성 #40
Browse files Browse the repository at this point in the history
  • Loading branch information
SubiHwang committed Jan 30, 2024
1 parent bdf59bb commit af238f8
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/main/java/com/endlesshorses/oot/Config/WebConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.endlesshorses.oot.Config;

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 {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOrigins("http://localhost:3000")
.allowedHeaders("*")
.allowCredentials(false)
.allowedMethods("GET", "POST")
.maxAge(3000);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ public class ColorListResponseDto {
private String name;
private String rgb;

private String imageUrl;

@Builder
public ColorListResponseDto(Color color) {
this.id = color.getId();
this.name = color.getName();
this.rgb = color.getRgb();
this.imageUrl = color.getImageUrl();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public class Color {
private String name;
@Column(nullable = false)
private String rgb;
@Column(nullable = false)
private String imageUrl;

@OneToMany(mappedBy = "color") //읽기만 가능
private List<Result> results = new ArrayList<>();
Expand Down

0 comments on commit af238f8

Please sign in to comment.