2020-01-29 14:31:01 +08:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
"""
|
|
|
|
Yuuki_Libs
|
2020-02-01 13:58:50 +08:00
|
|
|
(c) 2020 Star Inc.
|
2020-01-29 14:31:01 +08:00
|
|
|
This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
2020-02-07 22:11:44 +08:00
|
|
|
"""
|
|
|
|
from .reader import Yuuki_WebDataReader
|
|
|
|
|
|
|
|
class Yuuki_WebAdminAPI:
|
|
|
|
def __init__(self, YuukiData):
|
|
|
|
self.YukkiData = YuukiData
|
|
|
|
self.Yuuki_DataHandle = Yuuki_WebDataReader(YuukiData)
|
|
|
|
self.events = {
|
|
|
|
"": self.nothing,
|
|
|
|
"get_logs": self.get_logs,
|
|
|
|
"get_groups_joined": self.get_groups_joined,
|
|
|
|
}
|
|
|
|
|
2020-02-08 00:55:19 +08:00
|
|
|
def init(self, *, task="", data=None):
|
|
|
|
return self.events[task](data)
|
2020-02-07 22:11:44 +08:00
|
|
|
|
2020-02-08 00:55:19 +08:00
|
|
|
def get_groups_joined(self, data):
|
|
|
|
if data:
|
|
|
|
pass
|
2020-02-07 22:11:44 +08:00
|
|
|
return self.YukkiData.getData(["Global", "GroupJoined"])
|
|
|
|
|
2020-02-08 13:36:30 +08:00
|
|
|
def get_helpers(self, data):
|
|
|
|
if data:
|
|
|
|
pass
|
|
|
|
return self.YukkiData.getData(["Global", "GroupJoined"])
|
|
|
|
|
2020-02-08 00:55:19 +08:00
|
|
|
def get_logs(self, data):
|
|
|
|
return self.Yuuki_DataHandle.get_logs(data)
|
2020-02-07 22:11:44 +08:00
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
def nothing(data):
|
|
|
|
if data:
|
|
|
|
pass
|