mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-22 20:55:46 +08:00
add: notice system api
This commit is contained in:
27
app/services/notice/write/delete_service.rb
Normal file
27
app/services/notice/write/delete_service.rb
Normal file
@@ -0,0 +1,27 @@
|
||||
class Notice::Write::DeleteService < Notice::Write::ClientService
|
||||
attr_accessor :notification_ids, :receiver
|
||||
|
||||
def initialize(notification_ids, receiver)
|
||||
@notification_ids = notification_ids
|
||||
@receiver = receiver
|
||||
end
|
||||
|
||||
def call
|
||||
result = delete("", request_params)
|
||||
response = render_response(result)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def request_notification_ids
|
||||
notification_ids.join(",")
|
||||
end
|
||||
|
||||
def request_params
|
||||
Hash.new.merge(data: {
|
||||
notificationIds: request_notification_ids,
|
||||
receiver: receiver
|
||||
}.stringify_keys)
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user