2018-04-19 03:30:41 +08:00
|
|
|
class AdminDashboardNextData
|
|
|
|
include StatsCacheable
|
|
|
|
|
|
|
|
def initialize(opts = {})
|
|
|
|
@opts = opts
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.fetch_stats
|
2018-07-20 02:33:11 +08:00
|
|
|
self.class.new.as_json
|
2018-04-19 03:30:41 +08:00
|
|
|
end
|
|
|
|
|
2018-07-20 02:33:11 +08:00
|
|
|
def self.fetch_stats
|
|
|
|
new.as_json
|
2018-06-21 05:15:11 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
def get_json
|
2018-07-20 02:33:11 +08:00
|
|
|
{}
|
2018-04-19 03:30:41 +08:00
|
|
|
end
|
|
|
|
|
2018-07-20 02:33:11 +08:00
|
|
|
def as_json(_options = nil)
|
|
|
|
@json ||= get_json
|
2018-04-19 03:30:41 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
def self.reports(source)
|
|
|
|
source.map { |type| Report.find(type).as_json }
|
|
|
|
end
|
2018-07-20 02:33:11 +08:00
|
|
|
|
|
|
|
def self.stats_cache_key
|
|
|
|
'dashboard-next-data'
|
|
|
|
end
|
2018-04-19 03:30:41 +08:00
|
|
|
end
|