Skip to content

Commit 99b7b15

Browse files
Merge branch 'main' of https://github.com/prgrms-web-devcourse-final-project/WEB5_6_NeogulCoder_BE into feature/EA3-134-study-optimal-time-vote
2 parents e4dd29d + 32dcd63 commit 99b7b15

File tree

5 files changed

+61
-18
lines changed

5 files changed

+61
-18
lines changed

src/main/java/grep/neogulcoder/domain/prtemplate/entity/PrTemplate.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,11 @@ public class PrTemplate extends BaseEntity {
2323
private String location;
2424

2525
@Builder
26-
private PrTemplate(Long templateId, Long userId, String introduction, String location, Boolean activated) {
26+
private PrTemplate(Long templateId, Long userId, String introduction, String location) {
2727
this.id = templateId;
2828
this.userId = userId;
2929
this.introduction = introduction;
3030
this.location = location;
31-
this.activated = activated;
3231
}
3332

3433
public static PrTemplate PrTemplateInit(Long userId, String introduction, String location) {

src/main/java/grep/neogulcoder/domain/study/controller/dto/request/StudyCreateRequest.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,15 @@ private StudyCreateRequest(String name, Category category, int capacity, StudyTy
6666

6767
public Study toEntity(String imageUrl) {
6868
return Study.builder()
69-
.name(this.name)
70-
.category(this.category)
71-
.capacity(this.capacity)
72-
.studyType(this.studyType)
73-
.location(this.location)
74-
.startDate(this.startDate)
75-
.endDate(this.endDate)
76-
.introduction(this.introduction)
77-
.imageUrl(imageUrl)
78-
.build();
69+
.name(this.name)
70+
.category(this.category)
71+
.capacity(this.capacity)
72+
.studyType(this.studyType)
73+
.location(this.location)
74+
.startDate(this.startDate)
75+
.endDate(this.endDate)
76+
.introduction(this.introduction)
77+
.imageUrl(imageUrl)
78+
.build();
7979
}
8080
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package grep.neogulcoder.global.config;
2+
3+
import com.fasterxml.jackson.databind.ObjectMapper;
4+
import org.springframework.http.MediaType;
5+
import org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter;
6+
import org.springframework.stereotype.Component;
7+
8+
import java.lang.reflect.Type;
9+
10+
@Component
11+
public class OctetStreamReadMsgConverter extends AbstractJackson2HttpMessageConverter {
12+
13+
public OctetStreamReadMsgConverter(ObjectMapper objectMapper) {
14+
super(objectMapper, MediaType.APPLICATION_OCTET_STREAM);
15+
}
16+
17+
@Override
18+
public boolean canWrite(Class<?> clazz, MediaType mediaType) {
19+
return false;
20+
}
21+
22+
@Override
23+
public boolean canWrite(Type type, Class<?> clazz, MediaType mediaType) {
24+
return false;
25+
}
26+
27+
@Override
28+
protected boolean canWrite(MediaType mediaType) {
29+
return false;
30+
}
31+
}

src/main/java/grep/neogulcoder/global/config/WebConfig.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,22 @@
22

33
import org.springframework.beans.factory.annotation.Value;
44
import org.springframework.context.annotation.Configuration;
5+
import org.springframework.http.converter.HttpMessageConverter;
56
import org.springframework.web.servlet.config.annotation.CorsRegistry;
67
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
78
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
89

10+
import java.util.List;
11+
912
@Configuration
1013
public class WebConfig implements WebMvcConfigurer {
1114

15+
private OctetStreamReadMsgConverter octetStreamReadMsgConverter;
16+
17+
public WebConfig(OctetStreamReadMsgConverter octetStreamReadMsgConverter) {
18+
this.octetStreamReadMsgConverter = octetStreamReadMsgConverter;
19+
}
20+
1221
@Value("${upload.path}")
1322
private String uploadPath;
1423

@@ -21,7 +30,6 @@ public void addResourceHandlers(ResourceHandlerRegistry registry) {
2130
.addResourceLocations("file:" + uploadPath);
2231
}
2332

24-
2533
@Override
2634
public void addCorsMappings(CorsRegistry registry) {
2735
registry.addMapping("/**")
@@ -31,4 +39,9 @@ public void addCorsMappings(CorsRegistry registry) {
3139
.allowCredentials(true)
3240
.maxAge(3600);
3341
}
42+
43+
@Override
44+
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
45+
converters.add(octetStreamReadMsgConverter);
46+
}
3447
}

src/main/resources/data.sql

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
INSERT INTO member (activated, email, password, nickname, profile_image_url, role, oauth_id, oauth_provider) VALUES (true, '[email protected]', '$2a$10$WZzvlwlN6FVtQvGUXw2CIeNQvT5fPfA4qN99NisD2GOyCeuC4W0t2','&QT5Jklx#t', 'https://www.lorempixel.com/227/245', 'ROLE_ADMIN', NULL, NULL);
2-
INSERT INTO member (activated, email, password, nickname, profile_image_url, role, oauth_id, oauth_provider) VALUES (true, '[email protected]', '$2a$10$WZzvlwlN6FVtQvGUXw2CIeNQvT5fPfA4qN99NisD2GOyCeuC4W0t2', '!h1nRU1oKH','https://placeimg.com/350/227/any', 'ROLE_USER', 2139, 'google');
3-
INSERT INTO member (activated, email, password, nickname, profile_image_url, role, oauth_id, oauth_provider) VALUES (true, '[email protected]', '$2a$10$WZzvlwlN6FVtQvGUXw2CIeNQvT5fPfA4qN99NisD2GOyCeuC4W0t2', 'm#T99Yfl@*','https://placekitten.com/101/440', 'ROLE_USER', 5741, 'google');
4-
INSERT INTO member (activated, email, password, nickname, profile_image_url, role, oauth_id, oauth_provider) VALUES (true, '[email protected]', '$2a$10$WZzvlwlN6FVtQvGUXw2CIeNQvT5fPfA4qN99NisD2GOyCeuC4W0t2','NPy2EpXd$6', 'https://placekitten.com/842/456', 'ROLE_USER', NULL, NULL);
5-
INSERT INTO member (activated, email, password, nickname, profile_image_url, role, oauth_id, oauth_provider) VALUES (true, '[email protected]', '$2a$10$WZzvlwlN6FVtQvGUXw2CIeNQvT5fPfA4qN99NisD2GOyCeuC4W0t2', '$c3VDMSkF)','https://placekitten.com/812/623', 'ROLE_ADMIN', NULL, NULL);
1+
INSERT INTO member (activated, email, password, nickname, profile_image_url, role, oauth_id, oauth_provider) VALUES (true, '[email protected]', '{bcrypt}$2b$12$TK9zyc6f5qjHE1sSUSULieLOJVDBraWqSz2HRrIKgEKjUES0J2kva','&QT5Jklx#t', 'https://www.lorempixel.com/227/245', 'ROLE_ADMIN', NULL, NULL);
2+
INSERT INTO member (activated, email, password, nickname, profile_image_url, role, oauth_id, oauth_provider) VALUES (true, '[email protected]', '{bcrypt}$2b$12$TK9zyc6f5qjHE1sSUSULieLOJVDBraWqSz2HRrIKgEKjUES0J2kva', '!h1nRU1oKH','https://placeimg.com/350/227/any', 'ROLE_USER', 2139, 'google');
3+
INSERT INTO member (activated, email, password, nickname, profile_image_url, role, oauth_id, oauth_provider) VALUES (true, '[email protected]', '{bcrypt}$2b$12$TK9zyc6f5qjHE1sSUSULieLOJVDBraWqSz2HRrIKgEKjUES0J2kva', 'm#T99Yfl@*','https://placekitten.com/101/440', 'ROLE_USER', 5741, 'google');
4+
INSERT INTO member (activated, email, password, nickname, profile_image_url, role, oauth_id, oauth_provider) VALUES (true, '[email protected]', '{bcrypt}$2b$12$TK9zyc6f5qjHE1sSUSULieLOJVDBraWqSz2HRrIKgEKjUES0J2kva','NPy2EpXd$6', 'https://placekitten.com/842/456', 'ROLE_USER', NULL, NULL);
5+
INSERT INTO member (activated, email, password, nickname, profile_image_url, role, oauth_id, oauth_provider) VALUES (true, '[email protected]', '{bcrypt}$2b$12$TK9zyc6f5qjHE1sSUSULieLOJVDBraWqSz2HRrIKgEKjUES0J2kva', '$c3VDMSkF)','https://placekitten.com/812/623', 'ROLE_ADMIN', NULL, NULL);
66
INSERT INTO member (activated, email, password, nickname, profile_image_url, role, oauth_id, oauth_provider) VALUES (true,'[email protected]', '{bcrypt}$2b$12$TK9zyc6f5qjHE1sSUSULieLOJVDBraWqSz2HRrIKgEKjUES0J2kva', 'test','https://placekitten.com/812/624', 'ROLE_USER', NULL, NULL);
77
INSERT INTO member (activated, email, password, nickname, profile_image_url, role, oauth_id, oauth_provider) VALUES (true,'[email protected]', '{bcrypt}$2b$12$TK9zyc6f5qjHE1sSUSULieLOJVDBraWqSz2HRrIKgEKjUES0J2kva', 'test2','https://placekitten.com/812/625', 'ROLE_USER', NULL, NULL);
88
INSERT INTO member (activated, email, password, nickname, profile_image_url, role, oauth_id, oauth_provider) VALUES (true,'[email protected]', '{bcrypt}$2b$12$TK9zyc6f5qjHE1sSUSULieLOJVDBraWqSz2HRrIKgEKjUES0J2kva', 'test3','https://placekitten.com/812/626', 'ROLE_USER', NULL, NULL);

0 commit comments

Comments
 (0)