pixelarraythirdparty 1.0.0__py3-none-any.whl → 1.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pixelarraythirdparty/__init__.py +1 -1
- pixelarraythirdparty/celery/celery.py +2 -18
- pixelarraythirdparty/client.py +22 -0
- pixelarraythirdparty/order/pay.py +2 -18
- pixelarraythirdparty/product/product.py +2 -18
- pixelarraythirdparty/user/user.py +2 -18
- {pixelarraythirdparty-1.0.0.dist-info → pixelarraythirdparty-1.0.1.dist-info}/METADATA +1 -1
- pixelarraythirdparty-1.0.1.dist-info/RECORD +16 -0
- pixelarraythirdparty/auth.py +0 -0
- pixelarraythirdparty-1.0.0.dist-info/RECORD +0 -16
- {pixelarraythirdparty-1.0.0.dist-info → pixelarraythirdparty-1.0.1.dist-info}/WHEEL +0 -0
- {pixelarraythirdparty-1.0.0.dist-info → pixelarraythirdparty-1.0.1.dist-info}/licenses/LICENSE +0 -0
- {pixelarraythirdparty-1.0.0.dist-info → pixelarraythirdparty-1.0.1.dist-info}/top_level.txt +0 -0
pixelarraythirdparty/__init__.py
CHANGED
@@ -1,23 +1,7 @@
|
|
1
|
-
import
|
1
|
+
from pixelarraythirdparty.client import Client
|
2
2
|
|
3
3
|
|
4
|
-
class CeleryManager:
|
5
|
-
def __init__(self, api_key: str):
|
6
|
-
self.base_url = "https://thirdparty.pixelarrayai.com"
|
7
|
-
self.api_key = api_key
|
8
|
-
self.headers = {
|
9
|
-
"Content-Type": "application/json",
|
10
|
-
"X-API-Key": self.api_key,
|
11
|
-
}
|
12
|
-
|
13
|
-
def _request(self, method, url, **kwargs):
|
14
|
-
resp = requests.request(
|
15
|
-
method, f"{self.base_url}{url}", headers=self.headers, **kwargs
|
16
|
-
)
|
17
|
-
if resp.status_code == 200:
|
18
|
-
return resp.json().get("data", {})
|
19
|
-
return {}
|
20
|
-
|
4
|
+
class CeleryManager(Client):
|
21
5
|
def get_celery_status(self):
|
22
6
|
return self._request("GET", "/api/celery/status")
|
23
7
|
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import requests
|
2
|
+
from typing import Dict, Any, Optional
|
3
|
+
|
4
|
+
|
5
|
+
class Client:
|
6
|
+
"""基础认证类,提供公共的 API key 认证和请求方法"""
|
7
|
+
def __init__(self, api_key: str):
|
8
|
+
self.base_url = "https://thirdparty.pixelarrayai.com"
|
9
|
+
self.api_key = api_key
|
10
|
+
self.headers = {
|
11
|
+
"Content-Type": "application/json",
|
12
|
+
"X-API-Key": self.api_key,
|
13
|
+
}
|
14
|
+
|
15
|
+
def _request(self, method: str, url: str, **kwargs) -> Dict[str, Any]:
|
16
|
+
"""统一的请求方法"""
|
17
|
+
resp = requests.request(
|
18
|
+
method, f"{self.base_url}{url}", headers=self.headers, **kwargs
|
19
|
+
)
|
20
|
+
if resp.status_code == 200:
|
21
|
+
return resp.json().get("data", {})
|
22
|
+
return {}
|
@@ -1,23 +1,7 @@
|
|
1
|
-
import
|
1
|
+
from pixelarraythirdparty.client import Client
|
2
2
|
|
3
3
|
|
4
|
-
class WeChatPayManager:
|
5
|
-
def __init__(self, api_key: str):
|
6
|
-
self.base_url = "https://thirdparty.pixelarrayai.com"
|
7
|
-
self.api_key = api_key
|
8
|
-
self.headers = {
|
9
|
-
"Content-Type": "application/json",
|
10
|
-
"X-API-Key": self.api_key,
|
11
|
-
}
|
12
|
-
|
13
|
-
def _request(self, method, url, **kwargs):
|
14
|
-
resp = requests.request(
|
15
|
-
method, f"{self.base_url}{url}", headers=self.headers, **kwargs
|
16
|
-
)
|
17
|
-
if resp.status_code == 200:
|
18
|
-
return resp.json().get("data", {})
|
19
|
-
return {}
|
20
|
-
|
4
|
+
class WeChatPayManager(Client):
|
21
5
|
def generate_qr_code(
|
22
6
|
self,
|
23
7
|
out_trade_no: str,
|
@@ -1,23 +1,7 @@
|
|
1
|
-
import
|
1
|
+
from pixelarraythirdparty.client import Client
|
2
2
|
|
3
3
|
|
4
|
-
class ProductManager:
|
5
|
-
def __init__(self, api_key: str):
|
6
|
-
self.base_url = "https://thirdparty.pixelarrayai.com"
|
7
|
-
self.api_key = api_key
|
8
|
-
self.headers = {
|
9
|
-
"Content-Type": "application/json",
|
10
|
-
"X-API-Key": self.api_key,
|
11
|
-
}
|
12
|
-
|
13
|
-
def _request(self, method, url, **kwargs):
|
14
|
-
resp = requests.request(
|
15
|
-
method, f"{self.base_url}{url}", headers=self.headers, **kwargs
|
16
|
-
)
|
17
|
-
if resp.status_code == 200:
|
18
|
-
return resp.json().get("data", {})
|
19
|
-
return {}
|
20
|
-
|
4
|
+
class ProductManager(Client):
|
21
5
|
def create_product(
|
22
6
|
self,
|
23
7
|
name: str,
|
@@ -1,25 +1,9 @@
|
|
1
|
-
import requests
|
2
1
|
import aiohttp
|
3
2
|
from typing import Optional
|
3
|
+
from pixelarraythirdparty.client import Client
|
4
4
|
|
5
5
|
|
6
|
-
class UserManager:
|
7
|
-
def __init__(self, api_key: str):
|
8
|
-
self.base_url = "https://thirdparty.pixelarrayai.com"
|
9
|
-
self.api_key = api_key
|
10
|
-
self.headers = {
|
11
|
-
"Content-Type": "application/json",
|
12
|
-
"X-API-Key": self.api_key,
|
13
|
-
}
|
14
|
-
|
15
|
-
def _request(self, method, url, **kwargs):
|
16
|
-
resp = requests.request(
|
17
|
-
method, f"{self.base_url}{url}", headers=self.headers, **kwargs
|
18
|
-
)
|
19
|
-
if resp.status_code == 200:
|
20
|
-
return resp.json().get("data", {})
|
21
|
-
return {}
|
22
|
-
|
6
|
+
class UserManager(Client):
|
23
7
|
def list_user(
|
24
8
|
self,
|
25
9
|
page: int = 1,
|
@@ -0,0 +1,16 @@
|
|
1
|
+
pixelarraythirdparty/__init__.py,sha256=fk9_1IcETIUlA8F5IoMrexyHfxQ0ygyplTk8Ur2o1mM,458
|
2
|
+
pixelarraythirdparty/client.py,sha256=oob1iFWsLPPDiXic-H_5twxazQ-pEOHK98H-RaZvnSY,730
|
3
|
+
pixelarraythirdparty/celery/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
|
+
pixelarraythirdparty/celery/celery.py,sha256=NaLf5gJo8BTTJrC6a9f3TPfwaR9YArpcV-EM8HiJWhU,738
|
5
|
+
pixelarraythirdparty/order/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
|
+
pixelarraythirdparty/order/order.py,sha256=K_uhC9CFvzdW33mFoz5aRypi21V5rd58Q5WyCfe6Wes,2571
|
7
|
+
pixelarraythirdparty/order/pay.py,sha256=JpzWEQfq5v9gu9uFLjn5FNAnDNjYGQuZA5aeuEjfDcw,987
|
8
|
+
pixelarraythirdparty/product/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
9
|
+
pixelarraythirdparty/product/product.py,sha256=taX_UNsBJRB_KWCrszagh9TkiY_rybok57PBU-cLbEI,2501
|
10
|
+
pixelarraythirdparty/user/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
11
|
+
pixelarraythirdparty/user/user.py,sha256=nRtTahL1w-gic6vaS7Gh2CVWBvveL_yIuVf3U0eJCPA,1605
|
12
|
+
pixelarraythirdparty-1.0.1.dist-info/licenses/LICENSE,sha256=O-g1dUr0U50rSIvmWE9toiVkSgFpVt72_MHITbWvAqA,1067
|
13
|
+
pixelarraythirdparty-1.0.1.dist-info/METADATA,sha256=MZkNXMe8G6cMRAweo_JIoWM4ywZQcxlsZTFqSGXb_jw,993
|
14
|
+
pixelarraythirdparty-1.0.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
15
|
+
pixelarraythirdparty-1.0.1.dist-info/top_level.txt,sha256=dzG2Ut8j7noUqj_0ZQjcIDAeHYCh_9WtlxjAxtoyufo,21
|
16
|
+
pixelarraythirdparty-1.0.1.dist-info/RECORD,,
|
pixelarraythirdparty/auth.py
DELETED
File without changes
|
@@ -1,16 +0,0 @@
|
|
1
|
-
pixelarraythirdparty/__init__.py,sha256=XcGFz8LtH_OWAIVGfT7aymjYiG7F_utG576HIBx3gsw,458
|
2
|
-
pixelarraythirdparty/auth.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
|
-
pixelarraythirdparty/celery/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
|
-
pixelarraythirdparty/celery/celery.py,sha256=jcK42Qt6KAmWlxVBS4G0saT8nzL2yTcDmPAukYclG8Q,1221
|
5
|
-
pixelarraythirdparty/order/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
|
-
pixelarraythirdparty/order/order.py,sha256=K_uhC9CFvzdW33mFoz5aRypi21V5rd58Q5WyCfe6Wes,2571
|
7
|
-
pixelarraythirdparty/order/pay.py,sha256=hIsrOZfzY0wGHDvggac-JoIxQjZpxxw-wiRx-BwGqtE,1470
|
8
|
-
pixelarraythirdparty/product/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
9
|
-
pixelarraythirdparty/product/product.py,sha256=HA9xKLmv-kINmvSSf-5G86NtmsEWYcR6I5Asa1nIV8k,2984
|
10
|
-
pixelarraythirdparty/user/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
11
|
-
pixelarraythirdparty/user/user.py,sha256=xHyyypMLzEMbbn-TzhYANc3JftGFi3wAFMdk8qTdakk,2088
|
12
|
-
pixelarraythirdparty-1.0.0.dist-info/licenses/LICENSE,sha256=O-g1dUr0U50rSIvmWE9toiVkSgFpVt72_MHITbWvAqA,1067
|
13
|
-
pixelarraythirdparty-1.0.0.dist-info/METADATA,sha256=cz1IOAwa3bOzhDEQrVsAD_-1QyiSybdf7nmz2mTuz4g,993
|
14
|
-
pixelarraythirdparty-1.0.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
15
|
-
pixelarraythirdparty-1.0.0.dist-info/top_level.txt,sha256=dzG2Ut8j7noUqj_0ZQjcIDAeHYCh_9WtlxjAxtoyufo,21
|
16
|
-
pixelarraythirdparty-1.0.0.dist-info/RECORD,,
|
File without changes
|
{pixelarraythirdparty-1.0.0.dist-info → pixelarraythirdparty-1.0.1.dist-info}/licenses/LICENSE
RENAMED
File without changes
|
File without changes
|