新增:系统消息接口

This commit is contained in:
yystopf 2025-10-09 10:28:10 +08:00
parent 894728f620
commit 536e038657
3 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,8 @@
class Api::V1::SystemNotificationsController < Api::V1::BaseController
def index
@system_notifications = SystemNotification.where(is_top: true)
@system_notifications = kaminary_select_paginate(@system_notifications)
end
end

View File

@ -0,0 +1,4 @@
json.total_count @system_notifications.total_count
json.system_notifications @system_notifications.each do |notification|
json.(notification, :id, :subject, :sub_subject, :content, :is_top)
end

View File

@ -266,6 +266,7 @@ defaults format: :json do
end
resources :system_notifications, only: [:index]
resources :projects, only: [:index]
resources :project_topics, only: [:index, :create, :destroy]
resources :project_datasets, only: [:index]