This commit is contained in:
Ваше Имя 2025-04-03 14:54:35 +05:00
parent bd967e1d9e
commit 2c59f6d971
18 changed files with 229 additions and 20 deletions

View File

@ -27,7 +27,7 @@ def test():
}
}
}
req = Request('POST', 'https://new2.spavto96.ru/api/v1.0/show-case/batch-brands', json=data, auth=('qwe', 'qwe'))
req = Request('POST', 'http://localhost/api/v1.0/show-case/batch-brands', json=data, auth=('qwe', 'qwe'))
prepped = req.prepare()
resp = s.send(prepped)
print(resp.status_code)

30
batchCharacteristics.py Normal file
View File

@ -0,0 +1,30 @@
from requests import Request, Session
import hashlib
import string
import random
s = Session()
def id_generator(size=6, chars=string.ascii_lowercase + string.digits):
return ''.join(random.choice(chars) for _ in range(size))
def test():
data = {
'characteristics': {
1: {
'id': 'chtitle_' + id_generator(16),
'title': id_generator(16),
},
2: {
'id': 'chtitle_' + id_generator(16),
'title': id_generator(16),
}
}
}
req = Request('POST', 'http://localhost/api/v1.0/show-case/batch-characteristics', json=data, auth=('qwe', 'qwe'))
prepped = req.prepare()
resp = s.send(prepped)
print(resp.status_code)
print(resp.json())
test()

View File

@ -25,7 +25,7 @@ def test():
}
}
}
req = Request('POST', 'https://new2.spavto96.ru/api/v1.0/show-case/batch-groups', json=data, auth=('qwe', 'qwe'))
req = Request('POST', 'http://localhost/api/v1.0/show-case/batch-groups', json=data, auth=('qwe', 'qwe'))
prepped = req.prepare()
resp = s.send(prepped)
print(resp.status_code)

View File

@ -40,7 +40,7 @@ def test():
},
}
}
req = Request('POST', 'https://new2.spavto96.ru/api/v1.0/show-case/batch-models', json=data, auth=('qwe', 'qwe'))
req = Request('POST', 'http://localhost/api/v1.0/show-case/batch-models', json=data, auth=('qwe', 'qwe'))
prepped = req.prepare()
resp = s.send(prepped)
print(resp.status_code)

View File

@ -14,7 +14,7 @@ def test():
'id': id,
'file_name': id_generator(16) + '.jpg',
}
req = Request('POST', 'https://new2.spavto96.ru/api/v1.0/show-case/picture', json=data, auth=('qwe', 'qwe'))
req = Request('POST', 'http://localhost/api/v1.0/show-case/picture', json=data, auth=('qwe', 'qwe'))
prepped = req.prepare()
resp = s.send(prepped)
print(resp.status_code)

View File

@ -41,7 +41,7 @@ def test():
3: get_data()
}
}
req = Request('POST', 'https://new2.spavto96.ru/api/v1.0/show-case/batch-products', json=data, auth=('qwe', 'qwe'))
req = Request('POST', 'http://localhost/api/v1.0/show-case/batch-products', json=data, auth=('qwe', 'qwe'))
prepped = req.prepare()
resp = s.send(prepped)
print(resp.status_code)

30
batchValues.py Normal file
View File

@ -0,0 +1,30 @@
from requests import Request, Session
import hashlib
import string
import random
s = Session()
def id_generator(size=6, chars=string.ascii_lowercase + string.digits):
return ''.join(random.choice(chars) for _ in range(size))
def test():
data = {
'values': {
1: {
'id': 'chvalue_' + id_generator(16),
'title': id_generator(16),
},
2: {
'id': 'chvalue_' + id_generator(16),
'title': id_generator(16),
}
}
}
req = Request('POST', 'http://localhost/api/v1.0/show-case/batch-values', json=data, auth=('qwe', 'qwe'))
prepped = req.prepare()
resp = s.send(prepped)
print(resp.status_code)
print(resp.json())
test()

View File

@ -18,7 +18,7 @@ def test():
'picture_id': 'picture_75g36ayxk9yvl8lz',
'type': 10,
}
req = Request('POST', 'https://new2.spavto96.ru/api/v1.0/show-case/brand', json=data, auth=('qwe', 'qwe'))
req = Request('POST', 'http://localhost/api/v1.0/show-case/brand', json=data, auth=('qwe', 'qwe'))
prepped = req.prepare()
resp = s.send(prepped)
print(resp.status_code)

23
characteristic.py Normal file
View File

@ -0,0 +1,23 @@
from requests import Request, Session
import hashlib
import string
import random
s = Session()
def id_generator(size=6, chars=string.ascii_lowercase + string.digits):
return ''.join(random.choice(chars) for _ in range(size))
def test():
id = 'chtitle_' + id_generator(16)
data = {
'id': id,
'title': 'test',
}
req = Request('POST', 'http://localhost/api/v1.0/show-case/characteristic', json=data, auth=('qwe', 'qwe'))
prepped = req.prepare()
resp = s.send(prepped)
print(resp.status_code)
print(resp.json())
test()

22
exportOrders.py Normal file
View File

@ -0,0 +1,22 @@
from requests import Request, Session
import hashlib
import string
import random
s = Session()
def id_generator(size=6, chars=string.ascii_lowercase + string.digits):
return ''.join(random.choice(chars) for _ in range(size))
def test():
data = {
'to': 1742974769,
'from': 1742974584,
}
req = Request('POST', 'http://localhost/api/v1.0/show-case/export-orders', json=data, auth=('qwe', 'qwe'))
prepped = req.prepare()
resp = s.send(prepped)
print(resp.status_code)
print(resp.json())
test()

22
exportUsers.py Normal file
View File

@ -0,0 +1,22 @@
from requests import Request, Session
import hashlib
import string
import random
s = Session()
def id_generator(size=6, chars=string.ascii_lowercase + string.digits):
return ''.join(random.choice(chars) for _ in range(size))
def test():
data = {
'from': 0,
'to': 1000000000,
}
req = Request('POST', 'http://localhost/api/v1.0/show-case/export-users', json=data, auth=('qwe', 'qwe'))
prepped = req.prepare()
resp = s.send(prepped)
print(resp.status_code)
print(resp.json())
test()

View File

@ -16,7 +16,7 @@ def test():
'url': id_generator(16),
'picture_src': id_generator(16) + '.jpg',
}
req = Request('POST', 'https://new2.spavto96.ru/api/v1.0/show-case/group', json=data, auth=('qwe', 'qwe'))
req = Request('POST', 'http://localhost/api/v1.0/show-case/group', json=data, auth=('qwe', 'qwe'))
prepped = req.prepare()
resp = s.send(prepped)
print(resp.status_code)

26
importOrders.py Normal file
View File

@ -0,0 +1,26 @@
from requests import Request, Session
import hashlib
import string
import random
s = Session()
def id_generator(size=6, chars=string.ascii_lowercase + string.digits):
return ''.join(random.choice(chars) for _ in range(size))
def test():
data = {
'orders': [
{
'id': 'order_002d2542a1d14de6bc4715fdad05e683',
'stage': 20,
}
],
}
req = Request('POST', 'http://localhost/api/v1.0/show-case/import-orders', json=data, auth=('qwe', 'qwe'))
prepped = req.prepare()
resp = s.send(prepped)
print(resp.status_code)
print(resp.json())
test()

26
importUsers.py Normal file
View File

@ -0,0 +1,26 @@
from requests import Request, Session
import hashlib
import string
import random
s = Session()
def id_generator(size=6, chars=string.ascii_lowercase + string.digits):
return ''.join(random.choice(chars) for _ in range(size))
def test():
data = {
'users': [
{
'id': 'user_003afe5e7be73b786b6250a27685913e',
'status': 10,
}
]
}
req = Request('POST', 'http://localhost/api/v1.0/show-case/import-users', json=data, auth=('qwe', 'qwe'))
prepped = req.prepare()
resp = s.send(prepped)
print(resp.status_code)
print(resp.json())
test()

View File

@ -16,10 +16,10 @@ def test():
'url': id_generator(16),
'year_from': 1999,
'year_to': 2008,
'brand_id': 'brand_rbmjh7flxc9zgr0r',
'picture_id': 'picture_75g36ayxk9yvl8lz',
'brand_id': 'brand_rbmjh7flxc9zgr0r', # Смотри brand.py,
'picture_id': 'picture_75g36ayxk9yvl8lz', # Смотри picture.py,
}
req = Request('POST', 'https://new2.spavto96.ru/api/v1.0/show-case/model', json=data, auth=('qwe', 'qwe'))
req = Request('POST', 'http://localhost/api/v1.0/show-case/model', json=data, auth=('qwe', 'qwe'))
prepped = req.prepare()
resp = s.send(prepped)
print(resp.status_code)

View File

@ -21,7 +21,7 @@ def test():
}
}
}
req = Request('POST', 'https://new2.spavto96.ru/api/v1.0/show-case/batch-pictures', json=data, auth=('qwe', 'qwe'))
req = Request('POST', 'http://localhost/api/v1.0/show-case/batch-pictures', json=data, auth=('qwe', 'qwe'))
prepped = req.prepare()
resp = s.send(prepped)
print(resp.status_code)

View File

@ -13,25 +13,32 @@ def test():
data = {
'id': id,
'name': id_generator(16),
'tag': id_generator(16),
'price': 1999,
'old_price': 2008,
'quantity': 10,
'model_id': 'model_rxbvlglyao59ef2s',
'group_id': 'group_10c8f7l3lu7ydxhk',
'count': 0,
'model_id': 'model_006f52e9102a8d3be2fe5614f42ba989' # Смотри model.py,
'group_id': 'group_1679091c5a880faf6fb5e6087eb1b2dc', # Смотри group.py,
'factory_num': '123qbc',
'vendor_num': '123qbc',
'oem': '123qbc',
'comment': '123qbc',
'is_new': 0,
'is_original': 1,
'pictures_ids': ['picture_75g36ayxk9yvl8lz', 'picture_bpjunqpy94k36got', 'picture_nxyrvt9hggw2rff2', 'picture_y04kt98ernepnh1y',],
'options': {
'left': 1,
'right': 0,
'pictures_ids': [ # Смотри picture.py,
'picture_00003e3b9e5336685200ae85d21b4f5e',
'picture_000053b1e684c9e7ea73727b2238ce18',
'picture_0001261e2060303a06ba6c64d676d639',
'picture_00029153d12ae1c9abe59c17ff2e0895',
],
'characteristics': [
{
'key': 'chtitle_b28354b543375bfa94dabaeda722927f', # Смотри characteristic.py
'value': 'chvalue_a6105c0a611b41b08f1209506350279e', # Смотри value.py
}
]
}
req = Request('POST', 'https://new2.spavto96.ru/api/v1.0/show-case/product', json=data, auth=('qwe', 'qwe'))
req = Request('POST', 'http://localhost/api/v1.0/show-case/product', json=data, auth=('qwe', 'qwe'))
prepped = req.prepare()
resp = s.send(prepped)
print(resp.status_code)

23
value.py Normal file
View File

@ -0,0 +1,23 @@
from requests import Request, Session
import hashlib
import string
import random
s = Session()
def id_generator(size=6, chars=string.ascii_lowercase + string.digits):
return ''.join(random.choice(chars) for _ in range(size))
def test():
id = 'chvalue_' + id_generator(16)
data = {
'id': id,
'title': 'test',
}
req = Request('POST', 'http://localhost/api/v1.0/show-case/value', json=data, auth=('qwe', 'qwe'))
prepped = req.prepare()
resp = s.send(prepped)
print(resp.status_code)
print(resp.json())
test()