Skip to content

Commit

Permalink
⭐️ :: Add Badword
Browse files Browse the repository at this point in the history
  • Loading branch information
gurdl0525 committed Nov 16, 2023
1 parent ff2b135 commit 40cfdf6
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import com.example.onui.domain.mission.presentation.dto.request.CreateMissionReq
import com.example.onui.domain.mission.presentation.dto.response.MissionResponse
import com.example.onui.domain.mission.service.MissionService
import com.example.onui.domain.user.service.UserService
import com.vane.badwordfiltering.BadWordFiltering
import org.springframework.http.HttpStatus
import org.springframework.validation.annotation.Validated
import org.springframework.web.bind.annotation.*
Expand All @@ -14,7 +15,8 @@ import javax.validation.Valid
@Validated
class AdminController(
private val userService: UserService,
private val missionService: MissionService
private val missionService: MissionService,
private val badWordFiltering: BadWordFiltering
) {

@PostMapping("/theme")
Expand All @@ -34,4 +36,13 @@ class AdminController(
@RequestBody @Valid
req: CreateMissionRequest
): MissionResponse = missionService.createMission(req)

@PostMapping("/badword")
@ResponseStatus(HttpStatus.CREATED)
fun addBadWord(
@RequestParam("text", required = true)
text: String
) {
badWordFiltering.add(text)
}
}

0 comments on commit 40cfdf6

Please sign in to comment.