Skip to content

Instantly share code, notes, and snippets.

@msbaek
msbaek / sed
Created February 28, 2024 01:40
# sql.sed ─╯
s/^.*rest"://g
/jobScheduler/d
s/\\[n|t]/ /g
/baseParms: null/d
/parmsList: null"/d
/parmsList: \[\]/d
s/"//g
s/ queryID/queryID/g
s/Query: //g
spring:
profiles: local
datasource:
platform: h2
url: jdbc:h2:tcp://localhost:9092/mem:testdb;MVCC=TRUE
username: sa
password:
driver-class-name: org.h2.Driver
jpa:
database-platform: H2
# git grep으로 파일 내용 검색하기
git grep -l Annotation.*ApplicationContext
git grep -E Annotation.*ApplicationContext develop spring-framework-reference
# git 로그 검색하기
git log —grep 8장 // 커밋 메시지 검색
git log -Gwebsocket // 변경 사항에 websocket이 포함된 커밋 조회

title: {{title}} version: 1.0.0 theme: dracula header: {{header}} footer: {{footer}} paginate: true marp: true size: 4K


### 배너 조회
GRAPHQL http://localhost:8080/api/graphql
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2OTQyMjYyMjQsImlhdCI6MTY5Mzc5NDIyNCwiaXNzIjoiZGV2LWt0b3duNHUuY29tIiwidWlkIjoia3VZQTk0NWU1MFRPWjczSndaeHBQSXRLOGJoblpPd2Z4dVRaZ3V2YVNwQmFXcHRtd3J3SmpkdytHN3dLOUpKNiIsInJvbGVzIjpbIlJPTEVfQURNSU4iLCJST0xFX01BTkFHRVIiLCJNYWxsIE1hc3RlcnMiLCJST0xFX0RFVkVMT1BFUiJdfQ.m7B3plrw0NLWJ6dzvjlrtXZ1EP234xMUS_mmTXf6S-Q
query banners($request: BannerRequest!) {
banners(request: $request) {
banners {
bannerNo
shopNo
bizNo
glpublic class CycleTest {
@Test
void test_for_cycles() {
slices().matching("com.ktown4u.gms.(*)..").should().beFreeOfCycles();
}
}
// 숨김 허용
// foo <--- source ---> target
noClasses().that().resideInAPackage(" ..source..")
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@Transactional
class PostControllerTest extends AbstractTestContainerTest {
@LocalServerPort
int port;
ObjectMapper objectMapper = new ObjectMapper();
@Autowired
private PostRepfpsository postRepository;
@Repository
public interface PostCommentRepository
extends BaseJpaRepository<PostComment, Long>,
JpaSpecificationExecutor<PostComment> {
interface Specs {
static Specification<PostComment> byPost(Post post) {
return (root, query, builder) ->
builder.equal(root.get("id"), post);
@msbaek
msbaek / p6spy.txt
Created February 28, 2024 01:33
p3spy 사용
// p6spy
implementation 'com.github.gavlyukovskiy:p6spy-spring-boot-starter:1.9.0'
application.yml
decorator:
datasource:
p6spy:
enable-logging: true
spy.properties
@msbaek
msbaek / lombok.java
Last active February 28, 2024 01:33
lombok usage builder with necessary arguments
@Getter
@Accessors(fluent = true)
@RequiredArgsConstructor
---------------------------------------------------------------------------------------------
// src/main/java/lombok.config
# generated setter return 'this', to ease filling instances with data
lombok.accessors.chain=true
# @Value("${prop}") private final String prop; works with the @RequiredArgsConstructor
lombok.copyableAnnotations+=org.springframework.beans.factory.annotation.Value