Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
4 changes: 0 additions & 4 deletions BE/peaktime/.gitattributes

This file was deleted.

44 changes: 41 additions & 3 deletions BE/peaktime/.gitignore
Git LFS file not shown
105 changes: 102 additions & 3 deletions BE/peaktime/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,102 @@
version https://git-lfs.github.com/spec/v1
oid sha256:987fff066d93ed7a02e8f1b4b28a48ab2b45ef0f893deef335721c7cf5d07aa7
size 3436
plugins {
id 'java'
id 'org.springframework.boot' version '3.3.3'
id 'io.spring.dependency-management' version '1.1.6'
}

group = 'com'
version = '0.0.1-SNAPSHOT'

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}

configurations {
compileOnly {
extendsFrom annotationProcessor
}
}

repositories {
mavenCentral()
}

dependencies {

// spring-boot-starter
implementation 'org.springframework.boot:spring-boot-starter'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-aop'

// async retry dependency
implementation 'org.springframework.retry:spring-retry'
implementation 'org.springframework:spring-aspects'

// postgreSQL and Redis
implementation 'org.postgresql:postgresql:42.7.3'
implementation 'org.springframework.boot:spring-boot-starter-data-redis'

// 레디스 직렬화 추가
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310'

// SMTP
implementation 'org.springframework.boot:spring-boot-starter-mail:3.2.2'
implementation 'org.springframework.boot:spring-boot-starter-validation'

// Hibernate Types 라이브러리 추가
implementation 'io.hypersistence:hypersistence-utils-hibernate-63:3.7.3'

// Lombok
compileOnly 'org.projectlombok:lombok:1.18.34'
annotationProcessor 'org.projectlombok:lombok:1.18.34'

// Log4j
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.23.1'

// querydsl 추가
implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta'
annotationProcessor "com.querydsl:querydsl-apt:${dependencyManagement.importedProperties['querydsl.version']}:jakarta"
annotationProcessor "jakarta.annotation:jakarta.annotation-api"
annotationProcessor "jakarta.persistence:jakarta.persistence-api"

// Spring Security
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.security:spring-security-oauth2-jose'

// Swagger
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.6.0'
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-api:2.6.0'


// JJWT (Java JSON Web Token)
implementation 'io.jsonwebtoken:jjwt-api:0.11.2'
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.11.2'
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.11.2'

// Jakarta Validation API
implementation 'jakarta.validation:jakarta.validation-api:3.0.2'

// Jackson module (for using 'LocalDateTime')
implementation 'com.fasterxml.jackson.core:jackson-databind:2.14.3'

// Hibernate Validator (Reference Implementation)
implementation 'org.hibernate.validator:hibernate-validator:7.0.4.Final'

// Test dependencies
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
testImplementation 'javax.servlet:javax.servlet-api:4.0.1'

// Lombok in tests
testCompileOnly 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'
}

tasks.named('test') {
useJUnitPlatform()
}
1 change: 0 additions & 1 deletion BE/peaktime/gradle/wrapper/.gitattributes

This file was deleted.

Binary file modified BE/peaktime/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
97 changes: 94 additions & 3 deletions BE/peaktime/gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,3 +1,129 @@
version https://git-lfs.github.com/spec/v1
oid sha256:70d469693c11e04eb46a9d7feac5928623be61893507de2fbe30d691682e44f0
size 7536
package com.dinnertime.peaktime.domain.child.controller;

import com.dinnertime.peaktime.domain.child.service.ChildService;
import com.dinnertime.peaktime.domain.child.service.dto.request.ChangeChildPasswordRequestDto;
import com.dinnertime.peaktime.domain.child.service.dto.request.CreateChildRequestDto;
import com.dinnertime.peaktime.domain.child.service.dto.request.UpdateChildRequestDto;
import com.dinnertime.peaktime.global.util.CommonSwaggerResponse;
import com.dinnertime.peaktime.global.util.ResultDto;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.logging.log4j.core.Filter;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@RequiredArgsConstructor
@RequestMapping("/children")
public class ChildController {

private final ChildService childService;

@Operation(summary = "자식 계정 생성", description = "루트 유저가 자식 계정을 생성")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "자식 계정 생성에 성공하였습니다.",
content = {@Content(schema = @Schema(implementation = ResultDto.class))}),
@ApiResponse(responseCode = "404", description = "존재하지 않는 계정입니다.",
content = {@Content(schema = @Schema(implementation = ResultDto.class))}),
@ApiResponse(responseCode = "422", description = "그룹에는 최대 30명의 자식 계정만 존재할 수 있습니다.",
content = {@Content(schema = @Schema(implementation = ResultDto.class))}),
@ApiResponse(responseCode = "500", description = "자식 계정 생성에 실패하였습니다.",
content = {@Content(schema = @Schema(implementation = ResultDto.class))})
})
@CommonSwaggerResponse.CommonResponses
@PostMapping("")
public ResponseEntity<?> createChild(@Valid @RequestBody CreateChildRequestDto requestDto){

childService.createChild(requestDto);

return ResponseEntity.status(HttpStatus.OK)
.body(ResultDto.res(HttpStatus.OK.value(), "자식 계정 생성에 성공하였습니다."));
}

@Operation(summary = "자식 계정 삭제", description = "루트 유저가 자식 계정을 삭제")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "자식 계정 삭제에 성공하였습니다.",
content = {@Content(schema = @Schema(implementation = ResultDto.class))}),
@ApiResponse(responseCode = "404", description = "존재하지 않는 계정입니다.",
content = {@Content(schema = @Schema(implementation = ResultDto.class))}),
@ApiResponse(responseCode = "500", description = "자식 계정 삭제에 실패하였습니다.",
content = {@Content(schema = @Schema(implementation = ResultDto.class))})
})
@CommonSwaggerResponse.CommonResponses
@DeleteMapping("/{child-id}")
public ResponseEntity<?> deleteChild(@PathVariable("child-id") Long childId){

childService.deleteChild(childId);

return ResponseEntity.status(HttpStatus.OK)
.body(ResultDto.res(HttpStatus.OK.value(), "자식 계정 삭제에 성공하였습니다."));
}

@Operation(summary = "자식 계정 수정", description = "루트 유저가 자식 계정을 수정")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "자식 계정 수정에 성공하였습니다.",
content = {@Content(schema = @Schema(implementation = ResultDto.class))}),
@ApiResponse(responseCode = "404", description = "존재하지 않는 계정입니다.",
content = {@Content(schema = @Schema(implementation = ResultDto.class))}),
@ApiResponse(responseCode = "500", description = "자식 계정 수정에 실패하였습니다.",
content = {@Content(schema = @Schema(implementation = ResultDto.class))})
})
@CommonSwaggerResponse.CommonResponses
@PutMapping("/{child-id}")
public ResponseEntity<?> updateChild(@PathVariable("child-id") Long childId,
@Valid @RequestBody UpdateChildRequestDto requestDto){

childService.updateChild(childId, requestDto);

return ResponseEntity.status(HttpStatus.OK)
.body(ResultDto.res(HttpStatus.OK.value(), "자식 계정 수정에 성공하였습니다."));
}

@Operation(summary = "자식 계정 비밀번호 변경", description = "루트 유저가 자식 계정의 비밀번호 변경")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "자식 계정 비밀번호 변경에 성공하였습니다.",
content = {@Content(schema = @Schema(implementation = ResultDto.class))}),
@ApiResponse(responseCode = "404", description = "존재하지 않는 계정입니다.",
content = {@Content(schema = @Schema(implementation = ResultDto.class))}),
@ApiResponse(responseCode = "500", description = "자식 계정 비밀번호 변경에 실패하였습니다.",
content = {@Content(schema = @Schema(implementation = ResultDto.class))})
})
@CommonSwaggerResponse.CommonResponses
@PutMapping("/{child-id}/password")
public ResponseEntity<?> changeChildPassword(@PathVariable("child-id") Long childId,
@Valid @RequestBody ChangeChildPasswordRequestDto requestDto){

childService.changeChildPassword(childId, requestDto);

return ResponseEntity.status(HttpStatus.OK)
.body(ResultDto.res(HttpStatus.OK.value(), "자식 계정 수정에 성공하였습니다."));
}

@Operation(summary = "자식 계정 비밀번호 초기화", description = "루트 유저가 자식 계정의 비밀번호 초기화")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "자식 계정 비밀번호 초기화에 성공하였습니다.",
content = {@Content(schema = @Schema(implementation = ResultDto.class))}),
@ApiResponse(responseCode = "404", description = "존재하지 않는 계정입니다.",
content = {@Content(schema = @Schema(implementation = ResultDto.class))}),
@ApiResponse(responseCode = "500", description = "자식 계정 비밀번호 초기화에 실패하였습니다.",
content = {@Content(schema = @Schema(implementation = ResultDto.class))})
})
@CommonSwaggerResponse.CommonResponses
@PutMapping("/{child-id}/init-password")
public ResponseEntity<?> initChildPassword(@PathVariable("child-id") Long childId){

childService.initChildPassword(childId);

return ResponseEntity.status(HttpStatus.OK)
.body(ResultDto.res(HttpStatus.OK.value(), "자식 계정 비밀번호 초기화에 성공하였습니다."));
}
}
Loading