File tree Expand file tree Collapse file tree 3 files changed +39
-0
lines changed
src/main/kotlin/com/wafflestudio/csereal/core/about Expand file tree Collapse file tree 3 files changed +39
-0
lines changed Original file line number Diff line number Diff line change 11package com.wafflestudio.csereal.core.about.api.req
22
3+
34import com.wafflestudio.csereal.core.about.dto.FacReq
45
56data class CreateFacReq (
Original file line number Diff line number Diff line change 11package com.wafflestudio.csereal.core.about.api.req
22
3+
34import com.wafflestudio.csereal.core.about.dto.FacReq
45
56data class UpdateFacReq (
Original file line number Diff line number Diff line change @@ -434,6 +434,43 @@ class AboutServiceImpl(
434434 }
435435 }
436436
437+ @Transactional
438+ override fun updateDirection (id : Long , request : UpdateDescriptionReq ) {
439+ val direction = aboutRepository.findByIdOrNull(id) ? : throw CserealException .Csereal404 (" direction not found" )
440+
441+ val corresponding = when (direction.language) {
442+ LanguageType .KO -> aboutLanguageRepository.findByKoAbout(direction)!! .enAbout
443+ LanguageType .EN -> aboutLanguageRepository.findByEnAbout(direction)!! .koAbout
444+ }
445+
446+ when (direction.language) {
447+ LanguageType .KO -> {
448+ direction.description = request.koDescription
449+ corresponding.description = request.enDescription
450+ }
451+
452+ LanguageType .EN -> {
453+ direction.description = request.enDescription
454+ corresponding.description = request.koDescription
455+ }
456+ }
457+
458+ direction.syncSearchContent()
459+ corresponding.syncSearchContent()
460+ }
461+
462+ @Transactional
463+ override fun updateFutureCareersPage (request : UpdateDescriptionReq ) {
464+ val ko = aboutRepository.findByLanguageAndPostType(LanguageType .KO , AboutPostType .FUTURE_CAREERS )
465+ val en = aboutRepository.findByLanguageAndPostType(LanguageType .EN , AboutPostType .FUTURE_CAREERS )
466+
467+ ko.description = request.koDescription
468+ en.description = request.enDescription
469+
470+ ko.syncSearchContent()
471+ en.syncSearchContent()
472+ }
473+
437474 @Transactional
438475 override fun readFutureCareers (language : String ): FutureCareersPage {
439476 val languageType = LanguageType .makeStringToLanguageType(language)
You can’t perform that action at this time.
0 commit comments