pixelarraythirdparty 1.0.0__tar.gz → 1.0.1__tar.gz

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.
Files changed (22) hide show
  1. {pixelarraythirdparty-1.0.0 → pixelarraythirdparty-1.0.1}/PKG-INFO +1 -1
  2. {pixelarraythirdparty-1.0.0 → pixelarraythirdparty-1.0.1}/pixelarraythirdparty/__init__.py +1 -1
  3. {pixelarraythirdparty-1.0.0 → pixelarraythirdparty-1.0.1}/pixelarraythirdparty/celery/celery.py +2 -18
  4. pixelarraythirdparty-1.0.1/pixelarraythirdparty/client.py +22 -0
  5. {pixelarraythirdparty-1.0.0 → pixelarraythirdparty-1.0.1}/pixelarraythirdparty/order/pay.py +2 -18
  6. {pixelarraythirdparty-1.0.0 → pixelarraythirdparty-1.0.1}/pixelarraythirdparty/product/product.py +2 -18
  7. {pixelarraythirdparty-1.0.0 → pixelarraythirdparty-1.0.1}/pixelarraythirdparty/user/user.py +2 -18
  8. {pixelarraythirdparty-1.0.0 → pixelarraythirdparty-1.0.1}/pixelarraythirdparty.egg-info/PKG-INFO +1 -1
  9. {pixelarraythirdparty-1.0.0 → pixelarraythirdparty-1.0.1}/pixelarraythirdparty.egg-info/SOURCES.txt +1 -1
  10. {pixelarraythirdparty-1.0.0 → pixelarraythirdparty-1.0.1}/pyproject.toml +1 -1
  11. pixelarraythirdparty-1.0.0/pixelarraythirdparty/auth.py +0 -0
  12. {pixelarraythirdparty-1.0.0 → pixelarraythirdparty-1.0.1}/LICENSE +0 -0
  13. {pixelarraythirdparty-1.0.0 → pixelarraythirdparty-1.0.1}/MANIFEST.in +0 -0
  14. {pixelarraythirdparty-1.0.0 → pixelarraythirdparty-1.0.1}/pixelarraythirdparty/celery/__init__.py +0 -0
  15. {pixelarraythirdparty-1.0.0 → pixelarraythirdparty-1.0.1}/pixelarraythirdparty/order/__init__.py +0 -0
  16. {pixelarraythirdparty-1.0.0 → pixelarraythirdparty-1.0.1}/pixelarraythirdparty/order/order.py +0 -0
  17. {pixelarraythirdparty-1.0.0 → pixelarraythirdparty-1.0.1}/pixelarraythirdparty/product/__init__.py +0 -0
  18. {pixelarraythirdparty-1.0.0 → pixelarraythirdparty-1.0.1}/pixelarraythirdparty/user/__init__.py +0 -0
  19. {pixelarraythirdparty-1.0.0 → pixelarraythirdparty-1.0.1}/pixelarraythirdparty.egg-info/dependency_links.txt +0 -0
  20. {pixelarraythirdparty-1.0.0 → pixelarraythirdparty-1.0.1}/pixelarraythirdparty.egg-info/requires.txt +0 -0
  21. {pixelarraythirdparty-1.0.0 → pixelarraythirdparty-1.0.1}/pixelarraythirdparty.egg-info/top_level.txt +0 -0
  22. {pixelarraythirdparty-1.0.0 → pixelarraythirdparty-1.0.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pixelarraythirdparty
3
- Version: 1.0.0
3
+ Version: 1.0.1
4
4
  Summary: PixelArray 第三方微服务客户端
5
5
  Author-email: Lu qi <qi.lu@pixelarrayai.com>
6
6
  License-Expression: MIT
@@ -10,7 +10,7 @@ PixelArray 第三方微服务客户端
10
10
  - user: 用户管理模块
11
11
  """
12
12
 
13
- __version__ = "1.0.0"
13
+ __version__ = "1.0.1"
14
14
  __author__ = "Lu qi"
15
15
  __email__ = "qi.lu@pixelarrayai.com"
16
16
 
@@ -1,23 +1,7 @@
1
- import requests
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 requests
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 requests
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,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pixelarraythirdparty
3
- Version: 1.0.0
3
+ Version: 1.0.1
4
4
  Summary: PixelArray 第三方微服务客户端
5
5
  Author-email: Lu qi <qi.lu@pixelarrayai.com>
6
6
  License-Expression: MIT
@@ -2,7 +2,7 @@ LICENSE
2
2
  MANIFEST.in
3
3
  pyproject.toml
4
4
  pixelarraythirdparty/__init__.py
5
- pixelarraythirdparty/auth.py
5
+ pixelarraythirdparty/client.py
6
6
  pixelarraythirdparty.egg-info/PKG-INFO
7
7
  pixelarraythirdparty.egg-info/SOURCES.txt
8
8
  pixelarraythirdparty.egg-info/dependency_links.txt
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "pixelarraythirdparty"
7
- version = "1.0.0"
7
+ version = "1.0.1"
8
8
  authors = [
9
9
  {name = "Lu qi", email = "qi.lu@pixelarrayai.com"},
10
10
  ]
File without changes