修改一些功能
This commit is contained in:
@@ -1,6 +1,19 @@
|
||||
###调用服务器API
|
||||
###By Liang-work(NRFF&nanci)
|
||||
###Version 1.0
|
||||
###License: BSD
|
||||
from ProjectCfg import DOMAIN
|
||||
from .SNAPI.CallServer import _make_request
|
||||
from .SNAPI import *
|
||||
import httpx
|
||||
|
||||
|
||||
def OPITIONS(self,path,params):
|
||||
response = httpx.options(f"{self.url}{path}",params=params,headers=self.headers)
|
||||
if response:
|
||||
return {"status": response.status_code, "data": response.json()}
|
||||
else:
|
||||
return {"status": response.status_code, "data": {}}
|
||||
|
||||
###=========================活动API=================================
|
||||
|
||||
@@ -43,3 +56,22 @@ def GetServerVersion() -> dict:
|
||||
url = f"{DOMAIN}/version"
|
||||
headers = {'accept': 'application/json'}
|
||||
return _make_request('GET', url, headers)
|
||||
|
||||
###==========================签到==========================
|
||||
def SignIn(Authorization: str) -> dict:
|
||||
"""
|
||||
签到
|
||||
:return:
|
||||
"""
|
||||
return OPITIONS("/id/accounts/me/check-in",{})
|
||||
|
||||
###==========================获取通知==========================
|
||||
|
||||
def GetNotifications(Authorization: str,offset: int = 0, take: int = 20) -> dict:
|
||||
"""
|
||||
获取通知
|
||||
:param offset:
|
||||
:param take:
|
||||
:return:
|
||||
"""
|
||||
return _make_request("GET","/pusher/notification",{"offset":offset,"take":take})
|
Reference in New Issue
Block a user