-
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.
* 교과목 정렬, 쿠키 secure 옵션 추가 (#308) * feat: 교과목 정렬 * feat: 쿠키 secure 옵션 추가 * referrer policy 헤더 추가 (#311) * referrer policy 헤더 추가 * 헤더 수정 * feat: scholarship CRUD (#309) * feat: scholarship CRUD * 불필요한 라인 삭제 * 리뷰 반영 * Update deploy_dev.yaml * 강의실 예약 제한 (#312) * feat: 소개 탭 CRUD (#314) * feat: 소개 탭 CRUD * fix: 권한 체크 추가 * fix: 동아리 id 기준으로 로직 변경 * fix: 쿠키 same-site: strict * 리뷰 반영 * 리뷰 반영 * 로그인 핫픽스 (#316) * Feat: Research Group & Center 언어포함 CRUD 생성 (#315) * refactor: deprecated v1 controller * refactor: extract types in seperate package, remove unused attachment from research * feat: make lab's research as nullable * feat: add research language entity & repository * feat: add language & sealed dtos * feat: remove migrate methods & seperate update index methods * feat: add CRUD language considered methods * feat: add v2 reserach controller * fix: fix test compiling * test: fix professerservice test * refactor: fix ktlint formatting * review: research -> fetch lazy * Refactor: 구성원 POST API image => mainImage 리펙토링 #317 * Refactor: PUT API newImage => newMainImage 수정 #318 * Feat: Lab CRUD (#319) * feat: add request body * feat: modify dto nullability * feat: extract lab service && implement CRUD * feat: add lab language dto * feat: add lab events * fix: fix unique constraints for research language entity * feat: add methods to repositories * feat: add LAB CRUD APIs * refactor: seperate event services * refactor: professors to mutable var * fix: fix typos * comment: add comment to professor service method * test: remove unneed test file * feat: split search service and event service * feat: implement professor, research event service * fix: apply ktlint * cascade 제거 (#321) * cascade 제거 * 이미지 제거 추가 --------- Co-authored-by: Junhyeong Kim <[email protected]>
- Loading branch information
Showing
58 changed files
with
2,158 additions
and
1,623 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
src/main/kotlin/com/wafflestudio/csereal/core/about/api/req/CreateClubReq.kt
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,11 @@ | ||
package com.wafflestudio.csereal.core.about.api.req | ||
|
||
data class CreateClubReq( | ||
val ko: ClubReqBody, | ||
val en: ClubReqBody | ||
) | ||
|
||
data class ClubReqBody( | ||
val name: String, | ||
val description: String | ||
) |
7 changes: 7 additions & 0 deletions
7
src/main/kotlin/com/wafflestudio/csereal/core/about/api/req/CreateCompanyReq.kt
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,7 @@ | ||
package com.wafflestudio.csereal.core.about.api.req | ||
|
||
data class CreateCompanyReq( | ||
val name: String, | ||
val url: String?, | ||
val year: Int | ||
) |
12 changes: 12 additions & 0 deletions
12
src/main/kotlin/com/wafflestudio/csereal/core/about/api/req/CreateFacReq.kt
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,12 @@ | ||
package com.wafflestudio.csereal.core.about.api.req | ||
|
||
data class CreateFacReq( | ||
val ko: FacDto, | ||
val en: FacDto | ||
) | ||
|
||
data class FacDto( | ||
val name: String, | ||
val description: String, | ||
val locations: MutableList<String> | ||
) |
12 changes: 12 additions & 0 deletions
12
src/main/kotlin/com/wafflestudio/csereal/core/about/api/req/UpdateAboutReq.kt
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,12 @@ | ||
package com.wafflestudio.csereal.core.about.api.req | ||
|
||
data class UpdateAboutReq( | ||
val ko: BasicAbout, | ||
val en: BasicAbout, | ||
val removeImage: Boolean | ||
) | ||
|
||
data class BasicAbout( | ||
val description: String, | ||
val deleteIds: List<Long> | ||
) |
9 changes: 9 additions & 0 deletions
9
src/main/kotlin/com/wafflestudio/csereal/core/about/api/req/UpdateClubReq.kt
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 com.wafflestudio.csereal.core.about.api.req | ||
|
||
import com.wafflestudio.csereal.core.about.dto.ClubDto | ||
|
||
data class UpdateClubReq( | ||
val ko: ClubDto, | ||
val en: ClubDto, | ||
val removeImage: Boolean | ||
) |
6 changes: 6 additions & 0 deletions
6
src/main/kotlin/com/wafflestudio/csereal/core/about/api/req/UpdateDescriptionReq.kt
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,6 @@ | ||
package com.wafflestudio.csereal.core.about.api.req | ||
|
||
data class UpdateDescriptionReq( | ||
val koDescription: String, | ||
val enDescription: String | ||
) |
7 changes: 7 additions & 0 deletions
7
src/main/kotlin/com/wafflestudio/csereal/core/about/api/req/UpdateFacReq.kt
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,7 @@ | ||
package com.wafflestudio.csereal.core.about.api.req | ||
|
||
data class UpdateFacReq( | ||
val ko: FacDto, | ||
val en: FacDto, | ||
val removeImage: Boolean | ||
) |
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
84 changes: 84 additions & 0 deletions
84
src/main/kotlin/com/wafflestudio/csereal/core/about/api/v2/AboutController.kt
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,84 @@ | ||
package com.wafflestudio.csereal.core.about.api.v2 | ||
|
||
import com.wafflestudio.csereal.common.aop.AuthenticatedStaff | ||
import com.wafflestudio.csereal.core.about.api.req.* | ||
import com.wafflestudio.csereal.core.about.dto.GroupedClubDto | ||
import com.wafflestudio.csereal.core.about.service.AboutService | ||
import org.springframework.web.bind.annotation.* | ||
import org.springframework.web.multipart.MultipartFile | ||
|
||
@RequestMapping("/api/v2/about") | ||
@RestController | ||
class AboutController( | ||
private val aboutService: AboutService | ||
) { | ||
@GetMapping("/student-clubs") | ||
fun readAllClubs(): List<GroupedClubDto> = aboutService.readAllGroupedClubs() | ||
|
||
@AuthenticatedStaff | ||
@PostMapping("/student-clubs") | ||
fun createClub( | ||
@RequestPart request: CreateClubReq, | ||
@RequestPart mainImage: MultipartFile? | ||
) = aboutService.createClub(request, mainImage) | ||
|
||
@AuthenticatedStaff | ||
@PutMapping("/student-clubs") | ||
fun updateClub( | ||
@RequestPart request: UpdateClubReq, | ||
@RequestPart newMainImage: MultipartFile? | ||
) = aboutService.updateClub(request, newMainImage) | ||
|
||
@AuthenticatedStaff | ||
@DeleteMapping("/student-clubs/{id}") | ||
fun deleteClub(@PathVariable id: Long) = aboutService.deleteClub(id) | ||
|
||
@AuthenticatedStaff | ||
@PutMapping("/{postType}") | ||
fun updateAbout( | ||
@PathVariable postType: String, | ||
@RequestPart request: UpdateAboutReq, | ||
@RequestPart newMainImage: MultipartFile?, | ||
@RequestPart newAttachments: List<MultipartFile>? | ||
) = aboutService.updateAbout(postType, request, newMainImage, newAttachments) | ||
|
||
@AuthenticatedStaff | ||
@PostMapping("/facilities") | ||
fun createFacilities(@RequestPart request: CreateFacReq, @RequestPart mainImage: MultipartFile?) = | ||
aboutService.createFacilities(request, mainImage) | ||
|
||
@AuthenticatedStaff | ||
@PutMapping("/facilities/{id}") | ||
fun updateFacility( | ||
@PathVariable id: Long, | ||
@RequestPart request: UpdateFacReq, | ||
@RequestPart newMainImage: MultipartFile? | ||
) = aboutService.updateFacility(id, request, newMainImage) | ||
|
||
@AuthenticatedStaff | ||
@DeleteMapping("/facilities/{id}") | ||
fun deleteFacility(@PathVariable id: Long) = aboutService.deleteFacility(id) | ||
|
||
@AuthenticatedStaff | ||
@PutMapping("/directions/{id}") | ||
fun updateDirection(@PathVariable id: Long, @RequestBody request: UpdateDescriptionReq) = | ||
aboutService.updateDirection(id, request) | ||
|
||
@AuthenticatedStaff | ||
@PutMapping("/future-careers") | ||
fun updateFutureCareersPage(@RequestBody request: UpdateDescriptionReq) = | ||
aboutService.updateFutureCareersPage(request) | ||
|
||
@AuthenticatedStaff | ||
@PostMapping("/future-careers/company") | ||
fun createCompany(@RequestBody request: CreateCompanyReq) = aboutService.createCompany(request) | ||
|
||
@AuthenticatedStaff | ||
@PutMapping("/future-careers/company/{id}") | ||
fun updateCompany(@PathVariable id: Long, @RequestBody request: CreateCompanyReq) = | ||
aboutService.updateCompany(id, request) | ||
|
||
@AuthenticatedStaff | ||
@DeleteMapping("/future-careers/company/{id}") | ||
fun deleteCompany(@PathVariable id: Long) = aboutService.deleteCompany(id) | ||
} |
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
15 changes: 15 additions & 0 deletions
15
src/main/kotlin/com/wafflestudio/csereal/core/about/database/AboutLanguageEntity.kt
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,15 @@ | ||
package com.wafflestudio.csereal.core.about.database | ||
|
||
import com.wafflestudio.csereal.common.config.BaseTimeEntity | ||
import jakarta.persistence.* | ||
|
||
@Entity(name = "about_language") | ||
class AboutLanguageEntity( | ||
@OneToOne | ||
@JoinColumn(name = "korean_id") | ||
val koAbout: AboutEntity, | ||
|
||
@OneToOne | ||
@JoinColumn(name = "english_id") | ||
val enAbout: AboutEntity | ||
) : BaseTimeEntity() |
8 changes: 8 additions & 0 deletions
8
src/main/kotlin/com/wafflestudio/csereal/core/about/database/AboutLanguageRepository.kt
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 com.wafflestudio.csereal.core.about.database | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository | ||
|
||
interface AboutLanguageRepository : JpaRepository<AboutLanguageEntity, Long> { | ||
fun findByKoAbout(koAboutEntity: AboutEntity): AboutLanguageEntity? | ||
fun findByEnAbout(enAboutEntity: AboutEntity): AboutLanguageEntity? | ||
} |
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
21 changes: 21 additions & 0 deletions
21
src/main/kotlin/com/wafflestudio/csereal/core/about/dto/GroupedClubDto.kt
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,21 @@ | ||
package com.wafflestudio.csereal.core.about.dto | ||
|
||
import com.wafflestudio.csereal.core.about.database.AboutEntity | ||
|
||
data class GroupedClubDto( | ||
val ko: ClubDto, | ||
val en: ClubDto | ||
) | ||
|
||
data class ClubDto( | ||
val id: Long, | ||
val name: String, | ||
val description: String, | ||
val imageURL: String? | ||
) { | ||
companion object { | ||
fun of(aboutEntity: AboutEntity, imageURL: String?): ClubDto { | ||
return ClubDto(aboutEntity.id, aboutEntity.name!!, aboutEntity.description, imageURL) | ||
} | ||
} | ||
} |
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
Oops, something went wrong.