-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #228 from sopt-makers/sohyeon_#227
[REFACTOR] app, web 분리
- Loading branch information
Showing
275 changed files
with
5,188 additions
and
3,926 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,4 +38,6 @@ out/ | |
.vscode/ | ||
|
||
### config yml ### | ||
application-**.yml | ||
application-**.yml | ||
|
||
*/src/main/generated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,79 +1,55 @@ | ||
buildscript { | ||
ext { | ||
queryDslVersion = "5.0.0" | ||
repositories { | ||
mavenCentral() | ||
} | ||
} | ||
|
||
plugins { | ||
id 'java' | ||
id 'org.springframework.boot' version '2.7.4' | ||
id 'org.springframework.boot' version '3.0.0' | ||
id 'io.spring.dependency-management' version '1.1.0' | ||
id 'com.ewerk.gradle.plugins.querydsl' version '1.0.10' | ||
} | ||
|
||
group = 'org.sopt.makers' | ||
version = '0.0.1-SNAPSHOT' | ||
sourceCompatibility = '17' | ||
allprojects { | ||
apply plugin: 'java' | ||
apply plugin: 'org.springframework.boot' | ||
apply plugin: 'io.spring.dependency-management' | ||
|
||
configurations { | ||
compileOnly { | ||
extendsFrom annotationProcessor | ||
} | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
group = 'org.sopt.makers.operation' | ||
version = '0.0.1-SNAPSHOT' | ||
sourceCompatibility = '17' | ||
|
||
dependencies { | ||
implementation 'org.springframework.boot:spring-boot-starter-data-jpa' | ||
implementation 'org.springframework.boot:spring-boot-starter-validation' | ||
implementation 'org.springframework.boot:spring-boot-starter-web' | ||
implementation 'org.springframework.boot:spring-boot-starter-security' | ||
implementation "com.querydsl:querydsl-jpa:${queryDslVersion}" | ||
implementation "com.querydsl:querydsl-apt:${queryDslVersion}" | ||
testImplementation 'junit:junit:4.13.1' | ||
testImplementation 'junit:junit:4.13.1' | ||
|
||
compileOnly 'org.projectlombok:lombok' | ||
runtimeOnly 'com.h2database:h2' | ||
runtimeOnly 'org.postgresql:postgresql' | ||
annotationProcessor 'org.projectlombok:lombok' | ||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
// jwt | ||
implementation group: 'io.jsonwebtoken', name: 'jjwt-api', version: '0.11.2' | ||
runtimeOnly group: 'io.jsonwebtoken', name: 'jjwt-impl', version: '0.11.2' | ||
runtimeOnly group: 'io.jsonwebtoken', name: 'jjwt-jackson', version: '0.11.2' | ||
configurations { | ||
compileOnly { | ||
extendsFrom annotationProcessor | ||
} | ||
} | ||
|
||
testImplementation 'org.springframework.boot:spring-boot-starter-test' | ||
dependencies { | ||
// lombok | ||
compileOnly 'org.projectlombok:lombok' | ||
annotationProcessor 'org.projectlombok:lombok' | ||
testAnnotationProcessor 'org.projectlombok:lombok' | ||
testCompileOnly 'org.projectlombok:lombok' | ||
|
||
// swagger | ||
implementation 'io.springfox:springfox-boot-starter:3.0.0' | ||
implementation 'io.springfox:springfox-swagger-ui:3.0.0' | ||
// test | ||
testImplementation 'org.springframework.boot:spring-boot-starter-test' | ||
testImplementation 'org.springframework.security:spring-security-test' | ||
} | ||
|
||
// gson | ||
implementation 'com.google.code.gson:gson:2.8.9' | ||
tasks.named('test') { | ||
useJUnitPlatform() | ||
} | ||
} | ||
|
||
tasks.named('test') { | ||
useJUnitPlatform() | ||
jar { | ||
enabled = true | ||
} | ||
|
||
def querydslDir = "$buildDir/generated/querydsl" | ||
|
||
querydsl { | ||
jpa = true | ||
querydslSourcesDir = querydslDir | ||
} | ||
sourceSets { | ||
main.java.srcDir querydslDir | ||
} | ||
compileQuerydsl{ | ||
options.annotationProcessorPath = configurations.querydsl | ||
} | ||
configurations { | ||
compileOnly { | ||
extendsFrom annotationProcessor | ||
} | ||
querydsl.extendsFrom compileClasspath | ||
} | ||
bootJar { | ||
enabled = false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
jar { | ||
enabled = false | ||
} | ||
|
||
bootJar { | ||
enabled = true | ||
} | ||
|
||
dependencies { | ||
// module | ||
implementation project(path: ':operation-auth') | ||
implementation project(path: ':operation-common') | ||
implementation project(path: ':operation-domain') | ||
implementation project(path: ':operation-external') | ||
|
||
implementation 'org.springframework.boot:spring-boot-starter-web' | ||
implementation 'org.springframework.boot:spring-boot-starter-security' | ||
implementation 'org.springframework.boot:spring-boot-starter-data-jpa' | ||
implementation 'org.springframework.boot:spring-boot-starter-validation' | ||
|
||
// swagger | ||
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2' | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
operation-api/src/main/java/org/sopt/makers/operation/OperationApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package org.sopt.makers.operation; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
|
||
@SpringBootApplication( | ||
scanBasePackageClasses = {AuthRoot.class, CommonRoot.class, DomainRoot.class, ExternalRoot.class} | ||
) | ||
public class OperationApplication { | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(OperationApplication.class, args); | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
...tion-api/src/main/java/org/sopt/makers/operation/app/attendance/api/AppAttendanceApi.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package org.sopt.makers.operation.app.attendance.api; | ||
|
||
import java.security.Principal; | ||
|
||
import org.sopt.makers.operation.app.attendance.dto.request.LectureAttendRequest; | ||
import org.sopt.makers.operation.dto.BaseResponse; | ||
import org.springframework.http.ResponseEntity; | ||
|
||
import io.swagger.v3.oas.annotations.Parameter; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.parameters.RequestBody; | ||
import io.swagger.v3.oas.annotations.responses.ApiResponse; | ||
import io.swagger.v3.oas.annotations.security.SecurityRequirement; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import lombok.NonNull; | ||
|
||
@Tag(name = "앱 출석 관련 API") | ||
public interface AppAttendanceApi { | ||
|
||
@Operation( | ||
security = @SecurityRequirement(name = "Authorization"), | ||
summary = "앱 출석 API", | ||
responses = { | ||
@ApiResponse( | ||
responseCode = "200", | ||
description = "출석 성공" | ||
), | ||
@ApiResponse( | ||
responseCode = "400", | ||
description = "잘못된 요청" | ||
), | ||
@ApiResponse( | ||
responseCode = "500", | ||
description = "서버 내부 오류" | ||
) | ||
} | ||
) | ||
ResponseEntity<BaseResponse<?>> attend( | ||
@RequestBody LectureAttendRequest request, | ||
@Parameter(hidden = true) @NonNull Principal principal); | ||
} |
36 changes: 36 additions & 0 deletions
36
...rc/main/java/org/sopt/makers/operation/app/attendance/api/AppAttendanceApiController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package org.sopt.makers.operation.app.attendance.api; | ||
|
||
import static org.sopt.makers.operation.code.success.app.AttendanceSuccessCode.*; | ||
|
||
import java.security.Principal; | ||
|
||
import org.sopt.makers.operation.app.attendance.dto.request.LectureAttendRequest; | ||
import org.sopt.makers.operation.app.attendance.service.AppAttendanceService; | ||
import org.sopt.makers.operation.common.util.CommonUtils; | ||
import org.sopt.makers.operation.util.ApiResponseUtil; | ||
import org.sopt.makers.operation.dto.BaseResponse; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import lombok.val; | ||
|
||
@RestController | ||
@RequiredArgsConstructor | ||
@RequestMapping("/api/v1/app/attendances") | ||
public class AppAttendanceApiController implements AppAttendanceApi { | ||
|
||
private final AppAttendanceService attendanceService; | ||
private final CommonUtils utils; | ||
|
||
@Override | ||
@PostMapping("/attend") | ||
public ResponseEntity<BaseResponse<?>> attend(@RequestBody LectureAttendRequest request, Principal principal) { | ||
val memberId = utils.getMemberId(principal); | ||
val response = attendanceService.attend(memberId, request); | ||
return ApiResponseUtil.success(SUCCESS_ATTEND, response); | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
.../main/java/org/sopt/makers/operation/app/attendance/dto/request/LectureAttendRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package org.sopt.makers.operation.app.attendance.dto.request; | ||
|
||
import lombok.NonNull; | ||
|
||
public record LectureAttendRequest( | ||
long subLectureId, | ||
@NonNull String code | ||
) { | ||
} |
18 changes: 18 additions & 0 deletions
18
...ain/java/org/sopt/makers/operation/app/attendance/dto/response/LectureAttendResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.sopt.makers.operation.app.attendance.dto.response; | ||
|
||
import static lombok.AccessLevel.*; | ||
|
||
import lombok.Builder; | ||
|
||
import org.sopt.makers.operation.attendance.domain.SubAttendance; | ||
|
||
@Builder(access = PRIVATE) | ||
public record LectureAttendResponse( | ||
long subLectureId | ||
) { | ||
public static LectureAttendResponse of(SubAttendance subAttendance) { | ||
return LectureAttendResponse.builder() | ||
.subLectureId(subAttendance.getSubLecture().getId()) | ||
.build(); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
.../src/main/java/org/sopt/makers/operation/app/attendance/service/AppAttendanceService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package org.sopt.makers.operation.app.attendance.service; | ||
|
||
import org.sopt.makers.operation.app.attendance.dto.request.LectureAttendRequest; | ||
import org.sopt.makers.operation.app.attendance.dto.response.LectureAttendResponse; | ||
|
||
public interface AppAttendanceService { | ||
LectureAttendResponse attend(long memberId, LectureAttendRequest request); | ||
} |
Oops, something went wrong.