Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BE] issue248: 스터디 공지사항 CRUD #260

Merged
merged 13 commits into from
Aug 17, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.woowacourse.moamoa.auth.config;

import static org.springframework.http.HttpMethod.*;

import com.woowacourse.moamoa.auth.controller.matcher.AuthenticationRequestMatcher;
import com.woowacourse.moamoa.auth.controller.matcher.AuthenticationRequestMatcherBuilder;
import lombok.AllArgsConstructor;
Expand All @@ -14,30 +16,23 @@ public class AuthRequestMatchConfig {
@Bean
public AuthenticationRequestMatcher authenticationRequestMatcher() {
return new AuthenticationRequestMatcherBuilder()
.addUpAuthenticationPath(HttpMethod.POST,
.addUpAuthenticationPath(POST,
"/api/studies",
"/api/studies/\\d+/reviews",
"/api/studies/\\d+/reviews/\\d+",
"/api/studies/\\w+/community/articles",
"/api/studies"
)
.addUpAuthenticationPath(HttpMethod.GET,
"/api/studies/\\w+/\\w+/articles",
"/api/studies")
.addUpAuthenticationPath(GET,
"/api/my/studies",
"/api/members/me",
"/api/members/me/role",
"/api/studies/\\w+/community/articles/\\w+",
"/api/studies/\\w+/community/articles",
"/api/studies/\\d+/reference-room/links"
)
.addUpAuthenticationPath(HttpMethod.PUT,
"/api/studies/\\d+/reviews/\\d+",
"/api/studies/\\d+/reference-room/links/\\d+"
)
.addUpAuthenticationPath(HttpMethod.DELETE,
"/api/studies/\\w+/\\w+/articles/\\w+",
"/api/studies/\\w+/\\w+/articles")
.addUpAuthenticationPath(PUT,
"/api/studies/\\d+/reviews/\\d+")
.addUpAuthenticationPath(DELETE,
"/api/studies/\\d+/reviews/\\d+",
"/api/studies/\\w+/community/articles/\\w+",
"/api/studies/\\d+/reference-room/links/\\d+"
)
"/api/studies/\\w+/\\w+/articles/\\w+")
.build();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.woowacourse.moamoa.common.entity;

import org.hibernate.MappingException;
import org.hibernate.cache.CacheException;
import org.hibernate.cache.spi.access.CollectionDataAccess;
import org.hibernate.mapping.Collection;
import org.hibernate.persister.collection.BasicCollectionPersister;
import org.hibernate.persister.spi.PersisterCreationContext;

public class ReadOnlyCollectionPersister extends BasicCollectionPersister {

public ReadOnlyCollectionPersister(final Collection collectionBinding,
final CollectionDataAccess cacheAccessStrategy,
final PersisterCreationContext creationContext)
throws MappingException, CacheException {
super(asInverse(collectionBinding), cacheAccessStrategy, creationContext);
}
Comment on lines +10 to +17
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이전에 hibernate 를 사용해서 ReadOnly 로 설정해주는 것이라고 들었던것 같긴한데..해당 코드가 어떻게 동작하는지 설명이 필요할 것 같습니다..!!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


private static Collection asInverse(Collection collection) {
collection.setInverse(true);
return collection;
}
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading