Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
esperar authored Sep 24, 2024
2 parents f7243d1 + 3647ca5 commit a7c5344
Show file tree
Hide file tree
Showing 23 changed files with 19 additions and 317 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package com.dotori.v2.domain.member.domain.entity

import com.dotori.v2.domain.member.domain.entity.QMember.member
import com.dotori.v2.domain.member.enums.*
import com.dotori.v2.domain.rule.domain.entity.RuleViolation
import com.dotori.v2.global.thirdparty.aws.s3.S3Service
import com.dotori.v2.domain.student.presentation.data.req.ModifyStudentInfoRequest
import com.dotori.v2.global.entity.BaseTimeEntity
import java.time.LocalDateTime
Expand Down Expand Up @@ -104,6 +102,10 @@ class Member(
this.selfStudyExpiredDate = localDateTime
}

fun updateProfileImage(profileImage: String?) {
this.profileImage = profileImage
}

fun graduate(period: String): Member {
this.stuNum = period
return this
Expand All @@ -115,15 +117,4 @@ class Member(
this.gender = request.gender
this.roles = Collections.singletonList(request.role)
}

fun updateProfileImage(profileImage: String?): Member {
this.profileImage = profileImage
return this
}

fun isProfileImageExists(): Boolean {
return !this.profileImage.isNullOrEmpty()
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@ class UpdateProfileImageServiceImpl(
if (cachedData != null) {
redisCacheService.deleteFromCache(CACHE_KEY)
}
profileImageService.imageUpload(member = member, multipartFiles = multipartFiles, isUpdate = true)
}
}
}
13 changes: 2 additions & 11 deletions src/main/kotlin/com/dotori/v2/domain/music/domain/entity/Music.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,9 @@ class Music(
val thumbnail: String,

@Column(name = "like_count", nullable = false, columnDefinition = "INT default 0")
var likeCount: Int = 0,
val likeCount: Int = 0,

@OneToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "member_id", nullable = false)
val member: Member
) : BaseTimeEntity() {

fun plusLikeCount() {
this.likeCount++
}

fun minusLikeCount() {
this.likeCount--
}
}
) : BaseTimeEntity()

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import java.time.LocalDate
import java.time.LocalDateTime

interface MusicRepository : JpaRepository<Music, Long> {

@Modifying
@Query("update member set member_music = 'CAN'", nativeQuery = true)
fun updateMusicStatusMemberByMember()
Expand All @@ -19,7 +18,4 @@ interface MusicRepository : JpaRepository<Music, Long> {

fun deleteAllByCreatedDateBefore(date: LocalDateTime)

@Query(value = "select * from music where created_date like :date% order by music.like_count desc", nativeQuery = true)
fun findAllByCreatedDateOrderByLikeCountDESC(@Param("date") date: LocalDate): List<Music>

}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
package com.dotori.v2.domain.music.presentation.admin

import com.dotori.v2.domain.music.presentation.data.res.MusicListResDto
import com.dotori.v2.domain.music.presentation.data.res.MusicRankListResDto
import com.dotori.v2.domain.music.presentation.data.res.MusicLikeCountResDto
import com.dotori.v2.domain.music.service.DeleteMusicService
import com.dotori.v2.domain.music.service.FindMusicRankService
import com.dotori.v2.domain.music.service.FindMusicsService
import com.dotori.v2.domain.music.service.ToggleMusicLikeService
import org.springframework.format.annotation.DateTimeFormat
import org.springframework.http.HttpStatus
import org.springframework.http.ResponseEntity
Expand All @@ -17,11 +13,8 @@ import java.time.LocalDate
@RequestMapping("/v2/admin/music")
class AdminMusicController(
private val findMusicsService: FindMusicsService,
private val deleteMusicService: DeleteMusicService,
private val toggleMusicLikeService: ToggleMusicLikeService,
private val findMusicRankService: FindMusicRankService
private val deleteMusicService: DeleteMusicService
) {

@GetMapping
fun findMusics(
@RequestParam(
Expand All @@ -36,16 +29,4 @@ class AdminMusicController(
deleteMusicService.execute(musicId)
.run { ResponseEntity.status(HttpStatus.NO_CONTENT).build() }

@PatchMapping("/{music_id}/like")
fun toggleMusicLike(@PathVariable("music_id") musicId: Long): ResponseEntity<MusicLikeCountResDto> =
ResponseEntity.status(HttpStatus.OK).body(toggleMusicLikeService.execute(musicId))

@GetMapping("/like")
fun findMusicRank(
@RequestParam(
value = "date",
required = true
) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) date: LocalDate
): ResponseEntity<MusicRankListResDto> =
ResponseEntity.status(HttpStatus.OK).body(findMusicRankService.execute(date))
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@ package com.dotori.v2.domain.music.presentation.councillor

import com.dotori.v2.domain.music.presentation.data.req.ApplyMusicReqDto
import com.dotori.v2.domain.music.presentation.data.res.MusicListResDto
import com.dotori.v2.domain.music.presentation.data.res.MusicRankListResDto
import com.dotori.v2.domain.music.presentation.data.res.MusicLikeCountResDto
import com.dotori.v2.domain.music.service.ApplyMusicService
import com.dotori.v2.domain.music.service.DeleteMusicService
import com.dotori.v2.domain.music.service.FindMusicRankService
import com.dotori.v2.domain.music.service.FindMusicsService
import com.dotori.v2.domain.music.service.ToggleMusicLikeService
import org.springframework.format.annotation.DateTimeFormat
import org.springframework.http.HttpStatus
import org.springframework.http.ResponseEntity
Expand All @@ -21,9 +17,7 @@ import java.time.LocalDateTime
class CouncillorMusicController(
private val applyMusicService: ApplyMusicService,
private val findMusicsService: FindMusicsService,
private val deleteMusicService: DeleteMusicService,
private val toggleMusicLikeService: ToggleMusicLikeService,
private val findMusicRankService: FindMusicRankService
private val deleteMusicService: DeleteMusicService
) {
@PostMapping
fun applyMusic(@RequestBody applyMusicReqDto: ApplyMusicReqDto): ResponseEntity<Void> =
Expand All @@ -43,17 +37,4 @@ class CouncillorMusicController(
fun deleteMusic(@PathVariable("music_id") musicId: Long): ResponseEntity<Void> =
deleteMusicService.execute(musicId)
.run { ResponseEntity.status(HttpStatus.NO_CONTENT).build() }

@PatchMapping("/{music_id}/like")
fun toggleMusicLike(@PathVariable("music_id") musicId: Long): ResponseEntity<MusicLikeCountResDto> =
ResponseEntity.status(HttpStatus.OK).body(toggleMusicLikeService.execute(musicId))

@GetMapping("/like")
fun findMusicRank(
@RequestParam(
value = "date",
required = true
) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) date: LocalDate
): ResponseEntity<MusicRankListResDto> =
ResponseEntity.status(HttpStatus.OK).body(findMusicRankService.execute(date))
}

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@ data class MusicResDto(
val username: String,
val email: String,
val createdTime: LocalDateTime,
val stuNum: String,
val likeCount: Int
val stuNum: String
)
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@ package com.dotori.v2.domain.music.presentation.developer

import com.dotori.v2.domain.music.presentation.data.req.ApplyMusicReqDto
import com.dotori.v2.domain.music.presentation.data.res.MusicListResDto
import com.dotori.v2.domain.music.presentation.data.res.MusicRankListResDto
import com.dotori.v2.domain.music.presentation.data.res.MusicLikeCountResDto
import com.dotori.v2.domain.music.service.ApplyMusicService
import com.dotori.v2.domain.music.service.DeleteMusicService
import com.dotori.v2.domain.music.service.FindMusicRankService
import com.dotori.v2.domain.music.service.FindMusicsService
import com.dotori.v2.domain.music.service.ToggleMusicLikeService
import org.springframework.format.annotation.DateTimeFormat
import org.springframework.http.HttpStatus
import org.springframework.http.ResponseEntity
Expand All @@ -21,9 +17,7 @@ import java.time.LocalDateTime
class DeveloperMusicController(
private val applyMusicService: ApplyMusicService,
private val findMusicsService: FindMusicsService,
private val deleteMusicService: DeleteMusicService,
private val toggleMusicLikeService: ToggleMusicLikeService,
private val findMusicRankService: FindMusicRankService
private val deleteMusicService: DeleteMusicService
) {
@PostMapping
fun applyMusic(@RequestBody applyMusicReqDto: ApplyMusicReqDto): ResponseEntity<Void> =
Expand All @@ -43,17 +37,4 @@ class DeveloperMusicController(
fun deleteMusic(@PathVariable("music_id") musicId: Long): ResponseEntity<Void> =
deleteMusicService.execute(musicId)
.run { ResponseEntity.status(HttpStatus.NO_CONTENT).build() }

@PatchMapping("/{music_id}/like")
fun toggleMusicLike(@PathVariable("music_id") musicId: Long): ResponseEntity<MusicLikeCountResDto> =
ResponseEntity.status(HttpStatus.OK).body(toggleMusicLikeService.execute(musicId))

@GetMapping("/like")
fun findMusicRank(
@RequestParam(
value = "date",
required = true
) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) date: LocalDate
): ResponseEntity<MusicRankListResDto> =
ResponseEntity.status(HttpStatus.OK).body(findMusicRankService.execute(date))
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@ package com.dotori.v2.domain.music.presentation.member

import com.dotori.v2.domain.music.presentation.data.req.ApplyMusicReqDto
import com.dotori.v2.domain.music.presentation.data.res.MusicListResDto
import com.dotori.v2.domain.music.presentation.data.res.MusicRankListResDto
import com.dotori.v2.domain.music.presentation.data.res.MusicLikeCountResDto
import com.dotori.v2.domain.music.service.ApplyMusicService
import com.dotori.v2.domain.music.service.DeleteMyMusicService
import com.dotori.v2.domain.music.service.FindMusicRankService
import com.dotori.v2.domain.music.service.FindMusicsService
import com.dotori.v2.domain.music.service.ToggleMusicLikeService
import org.springframework.format.annotation.DateTimeFormat
import org.springframework.http.HttpStatus
import org.springframework.http.ResponseEntity
Expand All @@ -21,9 +17,7 @@ import java.time.LocalDateTime
class MemberMusicController(
private val applyMusicService: ApplyMusicService,
private val findMusicsService: FindMusicsService,
private val deleteMyMusicService: DeleteMyMusicService,
private val toggleMusicLikeService: ToggleMusicLikeService,
private val findMusicRankService: FindMusicRankService
private val deleteMyMusicService: DeleteMyMusicService
) {
@PostMapping
fun applyMusic(@RequestBody applyMusicReqDto: ApplyMusicReqDto): ResponseEntity<Void> =
Expand All @@ -43,17 +37,4 @@ class MemberMusicController(
fun deleteMusic(@PathVariable("music_id") musicId: Long): ResponseEntity<Void> =
deleteMyMusicService.execute(musicId)
.run { ResponseEntity.status(HttpStatus.NO_CONTENT).build() }

@PatchMapping("/{music_id}/like")
fun toggleMusicLike(@PathVariable("music_id") musicId: Long): ResponseEntity<MusicLikeCountResDto> =
ResponseEntity.status(HttpStatus.OK).body(toggleMusicLikeService.execute(musicId))

@GetMapping("/like")
fun findMusicRank(
@RequestParam(
value = "date",
required = true
) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) date: LocalDate
): ResponseEntity<MusicRankListResDto> =
ResponseEntity.status(HttpStatus.OK).body(findMusicRankService.execute(date))
}
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ class ApplyMusicServiceImpl(
username = music.member.memberName,
email = music.member.email,
createdTime = music.createdDate,
stuNum = music.member.stuNum,
likeCount = music.likeCount
stuNum = music.member.stuNum
)

private fun validDayOfWeek(dayOfWeek: DayOfWeek) {
Expand Down
Loading

0 comments on commit a7c5344

Please sign in to comment.