feat(notice): v2 최근 활성 공지 조회를 추가한다
This commit is contained in:
@@ -191,6 +191,7 @@ class SecurityConfig(
|
||||
.antMatchers(HttpMethod.GET, "/live/recommend").permitAll()
|
||||
.antMatchers("/ad-tracking/app-launch").permitAll()
|
||||
.antMatchers(HttpMethod.GET, "/notice/latest").permitAll()
|
||||
.antMatchers(HttpMethod.GET, "/api/v2/notices/latest").permitAll()
|
||||
.antMatchers(HttpMethod.GET, "/api/chat/character/main").permitAll()
|
||||
.antMatchers(HttpMethod.GET, "/api/chat/room/list").permitAll()
|
||||
.antMatchers(HttpMethod.GET, "/api/chat/original/list").permitAll()
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package kr.co.vividnext.sodalive.v2.api.notice.adapter.`in`.web
|
||||
|
||||
import kr.co.vividnext.sodalive.common.ApiResponse
|
||||
import kr.co.vividnext.sodalive.v2.api.notice.application.LatestNoticeService
|
||||
import org.springframework.web.bind.annotation.GetMapping
|
||||
import org.springframework.web.bind.annotation.RequestMapping
|
||||
import org.springframework.web.bind.annotation.RestController
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/v2/notices")
|
||||
class LatestNoticeController(private val service: LatestNoticeService) {
|
||||
@GetMapping("/latest")
|
||||
fun getLatestNotices() = ApiResponse.ok(service.getLatestNotices())
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package kr.co.vividnext.sodalive.v2.api.notice.application
|
||||
|
||||
import kr.co.vividnext.sodalive.notice.NoticeItem
|
||||
import kr.co.vividnext.sodalive.notice.ServiceServiceNoticeRepository
|
||||
import org.springframework.data.domain.PageRequest
|
||||
import org.springframework.stereotype.Service
|
||||
import org.springframework.transaction.annotation.Transactional
|
||||
|
||||
@Service
|
||||
@Transactional(readOnly = true)
|
||||
class LatestNoticeService(private val repository: ServiceServiceNoticeRepository) {
|
||||
fun getLatestNotices(): List<NoticeItem> = repository.getNoticeList(PageRequest.of(0, 3))
|
||||
}
|
||||
Reference in New Issue
Block a user