cats_core 1.0.10 → 1.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/cats/core/menus_controller.rb +19 -0
- data/app/models/cats/core/role_menu.rb +3 -0
- data/app/notifications/cats/core/simple_notification.rb +15 -4
- data/app/serializers/cats/core/role_menu_serializer.rb +11 -0
- data/app/services/cats/core/menu_service.rb +9 -0
- data/config/routes.rb +2 -1
- data/lib/cats/core/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32c70181bd52a346e553ef01325a87cb1c72ba19d831bc1b9ebe6e735b792a32
|
4
|
+
data.tar.gz: 00f2b8a381e9d969547fe5a16338b8f02ad374f0dfe40db14b1074614877e6bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5810cd3ad764b6e64d5ec9ba1a86591b0bd25d26051aea58da57ec8bb2fd768d62566aa08092d82a045b46c6af0327d57a40b2dc4062dae69456686135cb9e35
|
7
|
+
data.tar.gz: d25a81609c51dbce17369920073f40295d88c93f91533199e795fc06362f690d36e3c754d5b86c3b2893fc7212b02334e9a02eea820d5565c8a5dc11b4ba317f
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Cats
|
2
|
+
module Core
|
3
|
+
class MenusController < ApplicationController
|
4
|
+
before_action :set_service
|
5
|
+
|
6
|
+
def index
|
7
|
+
menu = @service.fetch_menu(current_user)
|
8
|
+
data = ActiveModelSerializers::SerializableResource.new(menu, each_serializer: RoleMenuSerializer)
|
9
|
+
render json: { success: true, data: data }
|
10
|
+
end
|
11
|
+
|
12
|
+
private
|
13
|
+
|
14
|
+
def set_service
|
15
|
+
@service = MenuService.new
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -1,9 +1,20 @@
|
|
1
1
|
# This is a simple notification class which delivers a
|
2
2
|
# message via database delivery method. It requires a
|
3
|
-
# +
|
3
|
+
# +body+ and +title+ parameter to instantiate, which represents the
|
4
4
|
# text message to deliver.
|
5
|
-
|
6
|
-
|
5
|
+
module Cats
|
6
|
+
module Core
|
7
|
+
class SimpleNotification < Noticed::Base
|
8
|
+
deliver_by :database
|
7
9
|
|
8
|
-
|
10
|
+
param :body
|
11
|
+
param :title
|
12
|
+
|
13
|
+
def message
|
14
|
+
title = params[:title]
|
15
|
+
body = params[:body]
|
16
|
+
{ title: title, body: body }
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
9
20
|
end
|
data/config/routes.rb
CHANGED
@@ -2,7 +2,8 @@ Cats::Core::Engine.routes.draw do
|
|
2
2
|
post '/login', controller: :access, action: :login
|
3
3
|
get '/notifications/unread', controller: :notifications, action: :unread
|
4
4
|
get '/notifications/read', controller: :notifications, action: :read
|
5
|
-
|
5
|
+
|
6
|
+
resources :menus, only: [:index]
|
6
7
|
resources :notifications, only: [:index] do
|
7
8
|
member do
|
8
9
|
post 'mark_as_read', controller: :notifications, action: :mark_as_read
|
data/lib/cats/core/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cats_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henock L.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-08-
|
11
|
+
date: 2021-08-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_model_serializers
|
@@ -218,6 +218,7 @@ files:
|
|
218
218
|
- Rakefile
|
219
219
|
- app/controllers/cats/core/access_controller.rb
|
220
220
|
- app/controllers/cats/core/application_controller.rb
|
221
|
+
- app/controllers/cats/core/menus_controller.rb
|
221
222
|
- app/controllers/cats/core/notifications_controller.rb
|
222
223
|
- app/controllers/cats/core/roles_controller.rb
|
223
224
|
- app/controllers/cats/core/users_controller.rb
|
@@ -245,6 +246,8 @@ files:
|
|
245
246
|
- app/models/cats/core/way_bill.rb
|
246
247
|
- app/models/cats/core/way_bill_item.rb
|
247
248
|
- app/notifications/cats/core/simple_notification.rb
|
249
|
+
- app/serializers/cats/core/role_menu_serializer.rb
|
250
|
+
- app/services/cats/core/menu_service.rb
|
248
251
|
- app/services/cats/core/notification_service.rb
|
249
252
|
- app/services/cats/core/token_auth_service.rb
|
250
253
|
- config/routes.rb
|