Skip to content

Commit

Permalink
문제 파악을 위해 롤백 (#45)
Browse files Browse the repository at this point in the history
* Revert "모든 멘토 리스트에 필터링 기능을 추가 (#43)"

This reverts commit 6dfffec.

* Revert "prod yml에 actuator설정 안된 부분 수정 (#44)"

This reverts commit 1416f35.

* Revert "CompanyUrl 컬럼 nullable 로 수정 (#42)"

This reverts commit 0ded054.

* Revert "TempMentor 삭제하는 기능 구현 (#40)"

This reverts commit 45e70b7.

* Revert "CICD 구현 (#34)"

This reverts commit 5ee7d07.

* Revert "spring actuator 추가 (#38)"

This reverts commit c7d1e68.
  • Loading branch information
hajeu committed Nov 6, 2023
1 parent 6dfffec commit 5c9f5d2
Show file tree
Hide file tree
Showing 17 changed files with 15 additions and 281 deletions.
62 changes: 0 additions & 62 deletions .github/workflows/GSM-Networking-CD.yml

This file was deleted.

36 changes: 0 additions & 36 deletions .github/workflows/GSM-Networking-CI.yml

This file was deleted.

36 changes: 0 additions & 36 deletions .github/workflows/GSm-Networking-Develop-Merge-CI.yml

This file was deleted.

20 changes: 0 additions & 20 deletions appspec.yml

This file was deleted.

3 changes: 0 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,6 @@ dependencies {

/* websocket */
implementation("org.springframework.boot:spring-boot-starter-websocket")

/* actuator */
implementation("org.springframework.boot:spring-boot-starter-actuator")
}

tasks.withType<KotlinCompile> {
Expand Down
16 changes: 0 additions & 16 deletions scripts/deploy.sh

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
package team.themoment.gsmNetworking.domain.mentor.controller

import org.springframework.http.HttpStatus
import org.springframework.http.ResponseEntity
import org.springframework.web.bind.annotation.DeleteMapping
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PathVariable
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController
import team.themoment.gsmNetworking.domain.mentor.dto.SearchTempMentorInfoDto
import team.themoment.gsmNetworking.domain.mentor.dto.TempMentorInfoDto
import team.themoment.gsmNetworking.domain.mentor.service.DeleteTempMentorService
import team.themoment.gsmNetworking.domain.mentor.service.QueryTempMentorListService
import team.themoment.gsmNetworking.domain.mentor.service.SearchTempMentorListService

@RestController
@RequestMapping("/api/v1/temp-mentor")
class TempMentorController(
class TempMentorController (
private val queryTempMentorListService: QueryTempMentorListService,
private val searchTempMentorListService: SearchTempMentorListService,
private val deleteTempMentorService: DeleteTempMentorService
private val searchTempMentorListService: SearchTempMentorListService
) {

@GetMapping
Expand All @@ -28,15 +24,9 @@ class TempMentorController(
}

@GetMapping("/{name}")
fun searchTempMentorListByName(@PathVariable name: String): ResponseEntity<List<SearchTempMentorInfoDto>> {
fun searchTempMentorListByName(@PathVariable name: String): ResponseEntity<List<SearchTempMentorInfoDto>>{
val searchTempMentorList = searchTempMentorListService.execute(name)
return ResponseEntity.ok(searchTempMentorList)
}

@DeleteMapping("/{firebaseId}")
fun deleteTempMentor(@PathVariable firebaseId: String): ResponseEntity<Void> {
deleteTempMentorService.execute(firebaseId)
return ResponseEntity.status(HttpStatus.RESET_CONTENT).build()
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Career(
@Column(nullable = false)
val companyName: String,

@Column(nullable = true)
@Column(nullable = false)
val companyUrl: String,

@Column(nullable = false)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
package team.themoment.gsmNetworking.domain.mentor.domain

import org.hibernate.annotations.SQLDelete
import org.hibernate.annotations.Where
import javax.persistence.*

@Entity
@Table(name = "temp_mentor")
@Where(clause = "deleted = false")
class TempMentor(
@Id
@Column(name = "real_id")
Expand Down Expand Up @@ -34,8 +31,5 @@ class TempMentor(
val companyName: String,

@Column(nullable = false, name = "position")
val position: String,

@Column(nullable = false, name = "deleted")
var deleted: Boolean = false
val position: String
)
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import com.fasterxml.jackson.annotation.JsonProperty

data class TempMentorInfoDto(
var id: Long,
val firebaseId: String,
val name: String,
val email: String,
val generation: Int,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ package team.themoment.gsmNetworking.domain.mentor.repository
import org.springframework.data.repository.CrudRepository
import team.themoment.gsmNetworking.domain.mentor.domain.TempMentor

interface TempMentorRepository : CrudRepository<TempMentor, Long> {

interface TempMentorRepository : CrudRepository<TempMentor, Int> {
fun findByNameContaining(name: String): List<TempMentor>

fun findByFirebaseId(firebaseId: String): TempMentor?

}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,17 @@ class QueryAllMentorsListService(
*
* @return 모든 멘토 정보가 담긴 dto 리스트
*/
fun execute(): List<MentorInfoDto> {
val allMentors = (
mentorRepository.findAllMentorInfoDto() +
queryTempMentorListService.execute().map(TempMentorInfoDto::toMentorInfoDto)
).distinctBy { Pair(it.generation, it.name) }
fun execute(): List<MentorInfoDto> = listOf(
mentorRepository.findAllMentorInfoDto(),
queryTempMentorListService.execute().map(TempMentorInfoDto::toMentorInfoDto)
).flatten().let(this::increaseMentorInfoCount)

increaseMentorIdCount(allMentors)

return allMentors
}

private fun increaseMentorIdCount(allMentors: List<MentorInfoDto>): List<MentorInfoDto> {
val newId = 1L
private fun increaseMentorInfoCount(allMentors: List<MentorInfoDto>): List<MentorInfoDto> {
var newId = 1L
allMentors.forEach { mentorInfo ->
mentorInfo.id = newId.inc()
mentorInfo.id = newId++
}

return allMentors
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class QueryTempMentorListService(
val tempMentors = tempMentorRepository.findAll().map { tempMentor ->
TempMentorInfoDto(
tempMentor.id,
tempMentor.firebaseId,
tempMentor.name,
tempMentor.email ?: "",
tempMentor.generation,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class SecurityConfig(
http.authorizeHttpRequests()
// /mentor
.mvcMatchers("/api/v1/mentor/*").hasAnyRole(
Authority.USER.name
Authority.USER.name,
)
.mvcMatchers(HttpMethod.GET, "/api/v1/mentor").hasAnyRole(
Authority.TEMP_USER.name,
Expand All @@ -64,13 +64,6 @@ class SecurityConfig(
.mvcMatchers(HttpMethod.POST, "/api/v1/mentor").hasAnyRole(
Authority.TEMP_USER.name
)
// /tempMentor
.mvcMatchers(HttpMethod.GET, "/api/v1/temp-mentor/**").hasAnyRole(
Authority.TEMP_USER.name
)
.mvcMatchers(HttpMethod.DELETE, "/api/v1/temp-mentor/*").hasAnyRole(
Authority.USER.name
)
// /mentee
.mvcMatchers("/api/v1/mentee/*").hasAnyRole(
Authority.USER.name,
Expand Down
19 changes: 0 additions & 19 deletions src/main/resources/application-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,22 +74,3 @@ oauth2:
success:
sign-up-redirect-url: http://localhost:8080/signup
default-redirect-url: http://localhost:8080/

management:
endpoints:
enabled-by-default: false
web:
base-path: ${ACTUATOR_BASE_PATH}
exposure:
include: health
endpoint:
health:
enabled: true
show-details: always
health:
diskspace:
enabled: false
ping:
enabled: false
server:
port: ${ACTUATOR_SERVER_PORT}
Loading

0 comments on commit 5c9f5d2

Please sign in to comment.