[fix] 尝试修复公告的对外开放接口

pull/445/head
hsdllcw 2025-04-14 10:31:00 +08:00
parent 4d79135b72
commit 1eb48a1557
3 changed files with 7 additions and 8 deletions

View File

@ -16,7 +16,7 @@ open class RemoteSysNoticeFallbackFactory : FallbackFactory<RemoteSysNoticeServi
override fun create(throwable: Throwable): RemoteSysNoticeService { override fun create(throwable: Throwable): RemoteSysNoticeService {
log.error("公告服务调用失败:{}", throwable.message) log.error("公告服务调用失败:{}", throwable.message)
return object : RemoteSysNoticeService { return object : RemoteSysNoticeService {
override fun getById_Inner(noticeId: Long?, source: String?): R<Any> { override fun getById_Inner(noticeId: Long, source: String): R<Any> {
return R.fail("获取公告失败") return R.fail("获取公告失败")
} }
} }

View File

@ -12,10 +12,9 @@ interface InnerRemoteSysNoticeService {
* @param noticeId 公告ID * @param noticeId 公告ID
* @return 公告信息 * @return 公告信息
*/ */
@GetMapping("/inner/notice/detail/{noticeId}") @GetMapping("/inner/notice/detail/{noticeId:\\d+}")
fun getById_Inner( fun getById_Inner(
@PathVariable("noticeId") noticeId: Long?, @RequestHeader( @PathVariable("noticeId") noticeId: Long,
SecurityConstants.FROM_SOURCE @RequestHeader(SecurityConstants.FROM_SOURCE) source: String
) source: String? ): R<Any>
): R<Any>?
} }

View File

@ -24,8 +24,8 @@ open class InnerSysNoticeController : BaseController() {
* 根据ID获取公告信息 * 根据ID获取公告信息
*/ */
@InnerAuth @InnerAuth
@GetMapping("/detail/{noticeId}") @GetMapping("/detail/{noticeId:\\d+}")
fun infoById(@PathVariable("noticeId") noticeId: Long): R<SysNotice> { fun infoById(@PathVariable("noticeId") noticeId: Long): R<Any> {
return R.ok(noticeService.selectNoticeById(noticeId)) return R.ok(noticeService.selectNoticeById(noticeId))
} }
} }