mirror of
https://gitee.com/mao-peng/MangoTestingPlatform.git
synced 2025-12-06 11:59:15 +08:00
修改docker为daphne启动的尝试
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Project: 芒果测试平台
|
||||
# @Description:
|
||||
# @Time : 2024-09-13 11:13
|
||||
# @Author : 毛鹏
|
||||
from .api_case import ApiCase
|
||||
from .api_case_detailed import ApiCaseDetailed
|
||||
from .api_headers import ApiHeaders
|
||||
from .api_info import ApiInfo
|
||||
from .api_pulic import ApiPublic
|
||||
|
||||
|
||||
class ApiApi:
|
||||
info = ApiInfo
|
||||
case = ApiCase
|
||||
public = ApiPublic
|
||||
case_detailed = ApiCaseDetailed
|
||||
headers = ApiHeaders
|
||||
@@ -1,55 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Project: 芒果测试平台
|
||||
# @Description:
|
||||
# @Time : 2024-11-05 11:16
|
||||
# @Author : 毛鹏
|
||||
from src.network.http.http_base import HttpBase
|
||||
|
||||
|
||||
class ApiCase(HttpBase):
|
||||
_url = '/api/case'
|
||||
|
||||
@classmethod
|
||||
def get_api_case(cls, page=1, page_size=100, params: dict = None):
|
||||
_params = {
|
||||
'page': page,
|
||||
'pageSize': page_size
|
||||
}
|
||||
if params:
|
||||
_params.update(params)
|
||||
return cls.get(ApiCase._url, params=_params)
|
||||
|
||||
@classmethod
|
||||
def post_api_case(cls, json_data: dict):
|
||||
return cls.post(ApiCase._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def put_api_case(cls, json_data: dict):
|
||||
return cls.put(ApiCase._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def delete_api_case(cls, _id, ):
|
||||
return cls.delete(ApiCase._url, params={
|
||||
'id': _id
|
||||
})
|
||||
|
||||
@classmethod
|
||||
def get_api_test_case(cls, case_id, test_env, case_sort: int | None = None):
|
||||
return cls.get(f'{ApiCase._url}/test', params={
|
||||
'case_id': case_id,
|
||||
'test_env': test_env,
|
||||
'case_sort': case_sort,
|
||||
})
|
||||
|
||||
@classmethod
|
||||
def get_api_test_case_batch(cls, case_id_list: list, test_env):
|
||||
return cls.post(f'{ApiCase._url}/batch', json={
|
||||
'test_env': test_env,
|
||||
'case_id_list': case_id_list,
|
||||
})
|
||||
|
||||
@classmethod
|
||||
def case_copy(cls, case_id):
|
||||
return cls.post(f'{ApiCase._url}/copy', json={
|
||||
'case_id': case_id,
|
||||
})
|
||||
@@ -1,49 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Project: 芒果测试平台
|
||||
# @Description:
|
||||
# @Time : 2024-11-05 11:16
|
||||
# @Author : 毛鹏
|
||||
from src.network.http.http_base import HttpBase
|
||||
|
||||
|
||||
class ApiCaseDetailed(HttpBase):
|
||||
_url = '/api/case/detailed'
|
||||
|
||||
@classmethod
|
||||
def get_api_case_detailed(cls, page=1, page_size=100, params: dict = None):
|
||||
_params = {
|
||||
'page': page,
|
||||
'pageSize': page_size
|
||||
}
|
||||
if params:
|
||||
_params.update(params)
|
||||
return cls.get(ApiCaseDetailed._url, params=_params)
|
||||
|
||||
@classmethod
|
||||
def post_api_case_detailed(cls, parent_id, json_data: dict):
|
||||
json_data['parent_id'] = parent_id
|
||||
return cls.post(ApiCaseDetailed._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def put_api_case_detailed(cls, parent_id, json_data: dict):
|
||||
json_data['parent_id'] = parent_id
|
||||
return cls.put(ApiCaseDetailed._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def delete_api_case_detailed(cls, _id, parent_id):
|
||||
return cls.delete(ApiCaseDetailed._url, params={
|
||||
'id': _id,
|
||||
'parent_id': parent_id
|
||||
})
|
||||
|
||||
@classmethod
|
||||
def put_api_case_sort(cls, case_sort_list: list[dict]):
|
||||
return cls.put(f'{ApiCaseDetailed._url}/sort', json={
|
||||
'case_sort_list': case_sort_list
|
||||
})
|
||||
|
||||
@classmethod
|
||||
def put_api_case_refresh(cls, _id: int):
|
||||
return cls.put(f'{ApiCaseDetailed._url}/refresh', json={
|
||||
'id': _id
|
||||
})
|
||||
@@ -1,34 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Project: 芒果测试平台
|
||||
# @Description:
|
||||
# @Time : 2024-11-05 11:17
|
||||
# @Author : 毛鹏
|
||||
from src.network.http.http_base import HttpBase
|
||||
|
||||
|
||||
class ApiHeaders(HttpBase):
|
||||
_url = '/api/headers'
|
||||
|
||||
@classmethod
|
||||
def get_api_headers(cls, page, page_size, params: dict = None):
|
||||
_params = {
|
||||
'page': page,
|
||||
'pageSize': page_size
|
||||
}
|
||||
if params:
|
||||
_params.update(params)
|
||||
return cls.get(ApiHeaders._url, params=_params)
|
||||
|
||||
@classmethod
|
||||
def post_api_headers(cls, json_data: dict):
|
||||
return cls.post(ApiHeaders._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def put_api_headers(cls, json_data: dict):
|
||||
return cls.put(ApiHeaders._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def delete_api_headers(cls, _id, ):
|
||||
return cls.delete(ApiHeaders._url, params={
|
||||
'id': _id
|
||||
})
|
||||
@@ -1,67 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Project: 芒果测试平台
|
||||
# @Description:
|
||||
# @Time : 2024-11-05 11:16
|
||||
# @Author : 毛鹏
|
||||
from src.network.http.http_base import HttpBase
|
||||
|
||||
|
||||
class ApiInfo(HttpBase):
|
||||
_url = '/api/info'
|
||||
|
||||
@classmethod
|
||||
def get_api_info(cls, page, page_size, params: dict = None):
|
||||
_params = {
|
||||
'page': page,
|
||||
'pageSize': page_size
|
||||
}
|
||||
if params:
|
||||
_params.update(params)
|
||||
return cls.get(ApiInfo._url, params=_params)
|
||||
|
||||
@classmethod
|
||||
def post_api_info(cls, json_data: dict):
|
||||
return cls.post(ApiInfo._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def put_api_info(cls, json_data: dict):
|
||||
return cls.put(ApiInfo._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def delete_api_info(cls, _id, ):
|
||||
return cls.delete(ApiInfo._url, params={
|
||||
'id': _id
|
||||
})
|
||||
|
||||
@classmethod
|
||||
def get_api_run(cls, _id, test_env, _id_list: list = None):
|
||||
_params = {
|
||||
'id': _id,
|
||||
'test_env': test_env,
|
||||
}
|
||||
if _id_list:
|
||||
_params['id'] = _id_list
|
||||
return cls.get(f'{ApiInfo._url}/test', params=_params)
|
||||
|
||||
@classmethod
|
||||
def get_api_name(cls, module_id):
|
||||
return cls.get(f'{ApiInfo._url}/name', params={
|
||||
'module_id': module_id,
|
||||
})
|
||||
|
||||
@classmethod
|
||||
def put_api_type(cls, type: int, id_list: list):
|
||||
return cls.put(f'{ApiInfo._url}/type', json={
|
||||
'id_list': id_list,
|
||||
'type': type,
|
||||
})
|
||||
|
||||
@classmethod
|
||||
def post_copy_api_info(cls, _id: int):
|
||||
return cls.post(f'{ApiInfo._url}/copy', json={
|
||||
'id': _id,
|
||||
})
|
||||
|
||||
@classmethod
|
||||
def post_import_api_info(cls, _json: dict):
|
||||
return cls.post(f'{ApiInfo._url}/import/api', json=_json)
|
||||
@@ -1,40 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Project: 芒果测试平台
|
||||
# @Description:
|
||||
# @Time : 2024-11-05 11:17
|
||||
# @Author : 毛鹏
|
||||
from src.network.http.http_base import HttpBase
|
||||
|
||||
|
||||
class ApiPublic(HttpBase):
|
||||
_url = '/api/public'
|
||||
|
||||
@classmethod
|
||||
def get_api_public(cls, page, page_size, params: dict = None):
|
||||
_params = {
|
||||
'page': page,
|
||||
'pageSize': page_size
|
||||
}
|
||||
if params:
|
||||
_params.update(params)
|
||||
return cls.get(ApiPublic._url, params=_params)
|
||||
|
||||
@classmethod
|
||||
def post_api_public(cls, json_data: dict):
|
||||
return cls.post(ApiPublic._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def put_api_public(cls, json_data: dict):
|
||||
return cls.put(ApiPublic._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def delete_api_public(cls, _id, ):
|
||||
return cls.delete(ApiPublic._url, params={
|
||||
'id': _id
|
||||
})
|
||||
|
||||
@classmethod
|
||||
def put_api_public_status(cls, _id, status):
|
||||
return cls.put(f'{ApiPublic._url}/status', json={
|
||||
'id': _id, 'status': status
|
||||
})
|
||||
@@ -76,7 +76,7 @@ class HttpClientApi(HttpBase):
|
||||
cls.headers['Authorization'] = response.data.get('token')
|
||||
return response
|
||||
except Exception as error:
|
||||
if settings.IS_OPEN and retry < 100:
|
||||
if settings.IS_OPEN and retry > 100:
|
||||
time.sleep(3)
|
||||
return cls.login(username, password, retry + 1)
|
||||
else:
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Project: 芒果测试平台
|
||||
# @Description:
|
||||
# @Time : 2024-09-13 11:13
|
||||
# @Author : 毛鹏
|
||||
from .cache_data import CacheData
|
||||
from .database import Database
|
||||
from .file_data import FileData
|
||||
from .index import Index
|
||||
from .module import Module
|
||||
from .notice import Notice
|
||||
from .product import Product
|
||||
from .project import Project
|
||||
from .tasks import Tasks
|
||||
from .tasks_details import TasksDetails
|
||||
from .test_object import TestObject
|
||||
from .test_suite import TestSuite
|
||||
from .test_suite_details import TestSuiteDetails
|
||||
from .time import Time
|
||||
|
||||
|
||||
class SystemApi:
|
||||
test_object = TestObject
|
||||
database = Database
|
||||
notice = Notice
|
||||
tasks = Tasks
|
||||
tasks_details = TasksDetails
|
||||
test_suite = TestSuite
|
||||
test_suite_details = TestSuiteDetails
|
||||
index = Index
|
||||
time = Time
|
||||
cache_data = CacheData
|
||||
file_data = FileData
|
||||
project = Project
|
||||
product = Product
|
||||
module = Module
|
||||
@@ -1,32 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Project: 芒果测试平台
|
||||
# @Description:
|
||||
# @Time : 2024-09-24 10:01
|
||||
# @Author : 毛鹏
|
||||
from src.network.http.http_base import HttpBase
|
||||
|
||||
|
||||
class CacheData(HttpBase):
|
||||
_url = '/system/cache/data'
|
||||
|
||||
@classmethod
|
||||
def get_cache_data(cls, page=1, page_size=100, params: dict = None):
|
||||
_params = {
|
||||
'page': page,
|
||||
'pageSize': page_size
|
||||
}
|
||||
if params:
|
||||
_params.update(params)
|
||||
return cls.get(CacheData._url, params=_params)
|
||||
|
||||
@classmethod
|
||||
def post_cache_data(cls, json_data: dict):
|
||||
return cls.post(CacheData._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def put_cache_data(cls, json_data: dict | list):
|
||||
return cls.put(CacheData._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def delete_cache_data(cls, _id, ):
|
||||
return cls.delete(CacheData._url, params={'id': _id})
|
||||
@@ -1,44 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Project: 芒果测试平台
|
||||
# @Description:
|
||||
# @Time : 2024-09-24 10:01
|
||||
# @Author : 毛鹏
|
||||
from src.network.http.http_base import HttpBase
|
||||
|
||||
|
||||
class Database(HttpBase):
|
||||
_url = '/system/database'
|
||||
|
||||
@classmethod
|
||||
def get_database(cls, page=1, page_size=100, params: dict = None):
|
||||
_params = {
|
||||
'page': page,
|
||||
'pageSize': page_size
|
||||
}
|
||||
if params:
|
||||
_params.update(params)
|
||||
return cls.get(Database._url, params=_params)
|
||||
|
||||
@classmethod
|
||||
def post_database(cls, json_data: dict):
|
||||
return cls.post(Database._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def put_database(cls, json_data: dict):
|
||||
return cls.put(Database._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def delete_database(cls, _id, ):
|
||||
return cls.delete(Database._url, params={'id': _id})
|
||||
|
||||
@classmethod
|
||||
def put_database_status(cls, _id: int, environment: int, status: int):
|
||||
return cls.put(f'{Database._url}/status', json={
|
||||
'id': _id,
|
||||
'status': status,
|
||||
'test_object': environment
|
||||
})
|
||||
|
||||
@classmethod
|
||||
def get_database_test(cls, _id):
|
||||
return cls.get(f'{Database._url}/test', params={'id': _id})
|
||||
@@ -1,33 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Project: 芒果测试平台
|
||||
# @Description:
|
||||
# @Time : 2024-09-24 10:01
|
||||
# @Author : 毛鹏
|
||||
from src.network.http.http_base import HttpBase
|
||||
|
||||
|
||||
class FileData(HttpBase):
|
||||
_url = 'system/file'
|
||||
|
||||
@classmethod
|
||||
def get_file(cls, page, page_size, params: dict = None):
|
||||
_params = {
|
||||
'page': page,
|
||||
'pageSize': page_size,
|
||||
'type': 0,
|
||||
}
|
||||
if params:
|
||||
_params.update(params)
|
||||
return cls.get(FileData._url, params=_params)
|
||||
|
||||
@classmethod
|
||||
def post_file(cls, data: dict, files):
|
||||
return cls.post(FileData._url, data=data, files=files)
|
||||
|
||||
@classmethod
|
||||
def delete_file(cls, _id):
|
||||
return cls.delete(FileData._url, params={'id': _id})
|
||||
|
||||
@classmethod
|
||||
def download(cls, name: str):
|
||||
return cls.get(name)
|
||||
@@ -1,27 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Project: 芒果测试平台
|
||||
# @Description:
|
||||
# @Time : 2024-10-24 14:36
|
||||
# @Author : 毛鹏
|
||||
|
||||
from src.network.http.http_base import HttpBase
|
||||
|
||||
|
||||
class Index(HttpBase):
|
||||
_url = '/system/index'
|
||||
|
||||
@classmethod
|
||||
def case_run_trends(cls):
|
||||
return cls.get(f'{Index._url}/result/week/sum', cls.headers)
|
||||
|
||||
@classmethod
|
||||
def case_run_sum(cls):
|
||||
return cls.get(f'{Index._url}/run/sum', cls.headers)
|
||||
|
||||
@classmethod
|
||||
def case_sum(cls):
|
||||
return cls.get(f'{Index._url}/sum', cls.headers)
|
||||
|
||||
@classmethod
|
||||
def activity_level(cls):
|
||||
return cls.get(f'{Index._url}/activity/level', cls.headers)
|
||||
@@ -1,36 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Project: 芒果测试平台
|
||||
# @Description:
|
||||
# @Time : 2024-09-24 10:01
|
||||
# @Author : 毛鹏
|
||||
from src.network.http.http_base import HttpBase
|
||||
|
||||
|
||||
class Module(HttpBase):
|
||||
_url = '/system/module'
|
||||
|
||||
@classmethod
|
||||
def get_module(cls, page, page_size, params: dict = None):
|
||||
_params = {
|
||||
'page': page,
|
||||
'pageSize': page_size
|
||||
}
|
||||
if params:
|
||||
_params.update(params)
|
||||
return cls.get(Module._url, params=_params)
|
||||
|
||||
@classmethod
|
||||
def post_module(cls, json_data: dict):
|
||||
return cls.post(Module._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def put_module(cls, json_data: dict):
|
||||
return cls.put(Module._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def delete_module(cls, _id, ):
|
||||
return cls.delete(Module._url, params={'id': _id, })
|
||||
|
||||
@classmethod
|
||||
def get_module_name(cls, project_product_id):
|
||||
return cls.get(f'{Module._url}/name', params={'project_product_id': project_product_id})
|
||||
@@ -1,44 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Project: 芒果测试平台
|
||||
# @Description:
|
||||
# @Time : 2024-09-24 10:01
|
||||
# @Author : 毛鹏
|
||||
from src.network.http.http_base import HttpBase
|
||||
|
||||
|
||||
class Notice(HttpBase):
|
||||
_url = '/system/notice'
|
||||
|
||||
@classmethod
|
||||
def get_notice(cls, page=1, page_size=100, params: dict = None):
|
||||
_params = {
|
||||
'page': page,
|
||||
'pageSize': page_size
|
||||
}
|
||||
if params:
|
||||
_params.update(params)
|
||||
return cls.get(Notice._url, params=_params)
|
||||
|
||||
@classmethod
|
||||
def post_notice(cls, json_data: dict):
|
||||
return cls.post(Notice._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def put_notice(cls, json_data: dict):
|
||||
return cls.put(Notice._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def delete_notice(cls, _id, ):
|
||||
return cls.delete(Notice._url, params={'id': _id, })
|
||||
|
||||
@classmethod
|
||||
def put_notice_status(cls, _id: int, environment: int, status: int):
|
||||
return cls.put(f'{Notice._url}/status', json={
|
||||
'id': _id,
|
||||
'status': status,
|
||||
'test_object': environment
|
||||
})
|
||||
|
||||
@classmethod
|
||||
def get_notice_test(cls, _id):
|
||||
return cls.get(f'{Notice._url}/test', params={'id': _id})
|
||||
@@ -1,40 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Project: 芒果测试平台
|
||||
# @Description:
|
||||
# @Time : 2024-09-24 10:01
|
||||
# @Author : 毛鹏
|
||||
from src.network.http.http_base import HttpBase
|
||||
|
||||
|
||||
class Product(HttpBase):
|
||||
_url = '/system/product'
|
||||
|
||||
@classmethod
|
||||
def get_product(cls, page, page_size, params: dict = None):
|
||||
_params = {
|
||||
'page': page,
|
||||
'pageSize': page_size
|
||||
}
|
||||
if params:
|
||||
_params.update(params)
|
||||
return cls.get(Product._url, params=_params)
|
||||
|
||||
@classmethod
|
||||
def post_product(cls, json_data: dict):
|
||||
return cls.post(Product._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def put_product(cls, json_data: dict):
|
||||
return cls.put(Product._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def delete_product(cls, _id, ):
|
||||
return cls.delete(Product._url, params={'id': _id, })
|
||||
|
||||
@classmethod
|
||||
def get_product_name(cls, project_id):
|
||||
return cls.get(f'{Product._url}/name', params={'project_id': project_id})
|
||||
|
||||
@classmethod
|
||||
def product_all_module_name(cls, project_id):
|
||||
return cls.get(f'{Product._url}/all/module/name', params={'project_id': project_id})
|
||||
@@ -1,47 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Project: 芒果测试平台
|
||||
# @Description:
|
||||
# @Time : 2024-09-24 10:01
|
||||
# @Author : 毛鹏
|
||||
from src.network.http.http_base import HttpBase
|
||||
|
||||
|
||||
class Project(HttpBase):
|
||||
_url = '/system/project'
|
||||
|
||||
@classmethod
|
||||
def get_project(cls, page, page_size, params: dict = None):
|
||||
_params = {
|
||||
'page': page,
|
||||
'pageSize': page_size
|
||||
}
|
||||
if params:
|
||||
_params.update(params)
|
||||
return cls.get(Project._url, params=_params)
|
||||
|
||||
@classmethod
|
||||
def post_project(cls, json_data: dict):
|
||||
return cls.post(Project._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def put_project(cls, json_data: dict):
|
||||
return cls.put(Project._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def delete_project(cls, _id, ):
|
||||
_params = {
|
||||
'id': _id,
|
||||
}
|
||||
return cls.delete(Project._url, params=_params)
|
||||
|
||||
@classmethod
|
||||
def project_info(cls):
|
||||
return cls.get(f'{Project._url}/all')
|
||||
|
||||
@classmethod
|
||||
def project_product_name(cls, client_type):
|
||||
return cls.get(f'{Project._url}/product/name', params={'client_type': client_type})
|
||||
|
||||
@classmethod
|
||||
def project_environment_name(cls):
|
||||
return cls.get(f'{Project._url}/environment/name')
|
||||
@@ -1,22 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Project: 芒果测试平台
|
||||
# @Description:
|
||||
# @Time : 2024-09-24 10:01
|
||||
# @Author : 毛鹏
|
||||
from src.network.http.http_base import HttpBase
|
||||
|
||||
|
||||
class Tasks(HttpBase):
|
||||
_url = 'system'
|
||||
|
||||
@classmethod
|
||||
def common_variable(cls):
|
||||
return cls.get(f'{Tasks._url}/variable/random/list')
|
||||
|
||||
@classmethod
|
||||
def random_data(cls, name):
|
||||
return cls.get(f'{Tasks._url}/variable/value', params={'name': name})
|
||||
|
||||
@classmethod
|
||||
def enum_api(cls):
|
||||
return cls.get(f'{Tasks._url}/enum')
|
||||
@@ -1,48 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Project: 芒果测试平台
|
||||
# @Description:
|
||||
# @Time : 2024-09-24 10:01
|
||||
# @Author : 毛鹏
|
||||
from src.network.http.http_base import HttpBase
|
||||
|
||||
|
||||
class Tasks(HttpBase):
|
||||
_url = 'system/tasks'
|
||||
|
||||
@classmethod
|
||||
def get_tasks(cls, page, page_size, params: dict = None):
|
||||
_params = {
|
||||
'page': page,
|
||||
'pageSize': page_size
|
||||
}
|
||||
if params:
|
||||
_params.update(params)
|
||||
return cls.get(Tasks._url, params=_params)
|
||||
|
||||
@classmethod
|
||||
def post_tasks(cls, json_data: dict):
|
||||
return cls.post(Tasks._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def put_tasks(cls, json_data: dict):
|
||||
return cls.put(Tasks._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def delete_tasks(cls, _id, ):
|
||||
return cls.delete(Tasks._url, params={'id': _id, })
|
||||
|
||||
@classmethod
|
||||
def put_status(cls, _id, status):
|
||||
return cls.put(f'{Tasks._url}/status', params={'id': _id, 'status': status})
|
||||
|
||||
@classmethod
|
||||
def put_notice(cls, _id, status):
|
||||
return cls.put(f'{Tasks._url}/notice', params={'id': _id, 'status': status})
|
||||
|
||||
@classmethod
|
||||
def get_id_name(cls, case_type, ):
|
||||
return cls.put(f'{Tasks._url}/name', params={'case_type': case_type})
|
||||
|
||||
@classmethod
|
||||
def trigger_timing(cls, _id, ):
|
||||
return cls.get(f'{Tasks._url}/trigger/timing', params={'id': _id})
|
||||
@@ -1,53 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Project: 芒果测试平台
|
||||
# @Description:
|
||||
# @Time : 2024-09-24 10:01
|
||||
# @Author : 毛鹏
|
||||
from src.network.http.http_base import HttpBase
|
||||
|
||||
|
||||
class TasksDetails(HttpBase):
|
||||
_url = 'system/tasks/details'
|
||||
|
||||
@classmethod
|
||||
def get_tasks_list(cls, page, page_size, params: dict = None):
|
||||
_params = {
|
||||
'page': page,
|
||||
'pageSize': page_size
|
||||
}
|
||||
if params:
|
||||
_params.update(params)
|
||||
return cls.get(TasksDetails._url, params=_params)
|
||||
|
||||
@classmethod
|
||||
def post_tasks_list(cls, json_data: dict):
|
||||
return cls.post(TasksDetails._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def put_tasks_list(cls, json_data: dict):
|
||||
return cls.put(TasksDetails._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def delete_tasks_list(cls, _id, ):
|
||||
return cls.delete(TasksDetails._url, params={'id': _id, })
|
||||
|
||||
@classmethod
|
||||
def get_type_case_name(cls, _type, module_id):
|
||||
return cls.get(f'{TasksDetails._url}/type/case/name', params={
|
||||
'type': _type,
|
||||
'module_id': module_id
|
||||
})
|
||||
|
||||
@classmethod
|
||||
def batch_set_cases(cls, case_id_list, tasks_id):
|
||||
return cls.post(f'{TasksDetails._url}/batch/set/cases', json={
|
||||
'case_id_list': case_id_list,
|
||||
'scheduled_tasks_id': tasks_id
|
||||
})
|
||||
|
||||
@classmethod
|
||||
def put_tasks_case_test_object(cls, case_list, test_obj_id):
|
||||
return cls.put(f'{TasksDetails._url}/case/test/object', json={
|
||||
'case_list': case_list,
|
||||
'test_obj_id': test_obj_id
|
||||
})
|
||||
@@ -1,35 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Project: 芒果测试平台
|
||||
# @Description:
|
||||
# @Time : 2024-09-24 10:01
|
||||
# @Author : 毛鹏
|
||||
from src.network.http.http_base import HttpBase
|
||||
|
||||
|
||||
class TestObject(HttpBase):
|
||||
_url = 'system/test/object'
|
||||
|
||||
@classmethod
|
||||
def get_test_object(cls, page, page_size, params: dict = None):
|
||||
_params = {
|
||||
'page': page,
|
||||
'pageSize': page_size
|
||||
}
|
||||
if params:
|
||||
_params.update(params)
|
||||
return cls.get(TestObject._url, params=_params)
|
||||
|
||||
@classmethod
|
||||
def post_test_object(cls, json_data: dict):
|
||||
return cls.post(TestObject._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def put_test_object(cls, json_data: dict):
|
||||
return cls.put(TestObject._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def delete_test_object(cls, _id, ):
|
||||
_params = {
|
||||
'id': _id,
|
||||
}
|
||||
return cls.delete(TestObject._url, params=_params)
|
||||
@@ -1,34 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Project: 芒果测试平台
|
||||
# @Description:
|
||||
# @Time : 2024-09-24 10:01
|
||||
# @Author : 毛鹏
|
||||
from src.network.http.http_base import HttpBase
|
||||
|
||||
|
||||
class TestSuite(HttpBase):
|
||||
_url = 'system/test/suite'
|
||||
|
||||
@classmethod
|
||||
def get_test_suite(cls, page, page_size, params=None):
|
||||
if params is None:
|
||||
params = {'type': 0}
|
||||
_params = {
|
||||
'page': page,
|
||||
'pageSize': page_size
|
||||
}
|
||||
if params:
|
||||
_params.update(params)
|
||||
return cls.get(TestSuite._url, params=_params)
|
||||
|
||||
@classmethod
|
||||
def post_test_suite(cls, json_data: dict):
|
||||
return cls.post(TestSuite._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def put_test_suite(cls, json_data: dict):
|
||||
return cls.put(TestSuite._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def delete_test_suite(cls, _id, ):
|
||||
return cls.delete(TestSuite._url, params={'id': _id, })
|
||||
@@ -1,46 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Project: 芒果测试平台
|
||||
# @Description:
|
||||
# @Time : 2024-09-24 10:01
|
||||
# @Author : 毛鹏
|
||||
from src.network.http.http_base import HttpBase
|
||||
|
||||
|
||||
class TestSuiteDetails(HttpBase):
|
||||
_url = 'system/test/suite/details'
|
||||
|
||||
@classmethod
|
||||
def get_test_suite_details(cls, page, page_size, params=None):
|
||||
if params is None:
|
||||
params = {'type': 0}
|
||||
_params = {
|
||||
'page': page,
|
||||
'pageSize': page_size
|
||||
}
|
||||
if params:
|
||||
_params.update(params)
|
||||
return cls.get(TestSuiteDetails._url, params=_params)
|
||||
|
||||
@classmethod
|
||||
def post_test_suite_details(cls, json_data: dict):
|
||||
return cls.post(TestSuiteDetails._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def put_test_suite_details(cls, json_data: dict):
|
||||
return cls.put(TestSuiteDetails._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def delete_test_suite_details(cls, _id, ):
|
||||
return cls.delete(TestSuiteDetails._url, params={'id': _id, })
|
||||
|
||||
@classmethod
|
||||
def get_test_suite_report(cls, ):
|
||||
return cls.get(f'{TestSuiteDetails._url}/report', )
|
||||
|
||||
@classmethod
|
||||
def get_all_retry(cls, test_suite_id):
|
||||
return cls.get(f'{TestSuiteDetails._url}/all/retry', params={'test_suite_id': test_suite_id})
|
||||
|
||||
@classmethod
|
||||
def get_retry(cls, _id):
|
||||
return cls.get(f'{TestSuiteDetails._url}/retry', params={'id': _id})
|
||||
@@ -1,36 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Project: 芒果测试平台
|
||||
# @Description:
|
||||
# @Time : 2024-11-02 15:47
|
||||
# @Author : 毛鹏
|
||||
from src.network.http.http_base import HttpBase
|
||||
|
||||
|
||||
class Time(HttpBase):
|
||||
_url = '/system/time'
|
||||
|
||||
@classmethod
|
||||
def get_time_tasks(cls, page, page_size, params: dict = None):
|
||||
_params = {
|
||||
'page': page,
|
||||
'pageSize': page_size
|
||||
}
|
||||
if params:
|
||||
_params.update(params)
|
||||
return cls.get(Time._url, params=_params)
|
||||
|
||||
@classmethod
|
||||
def post_time_tasks(cls, json_data: dict):
|
||||
return cls.post(Time._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def put_time_tasks(cls, json_data: dict):
|
||||
return cls.put(Time._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def delete_time_tasks(cls, _id, ):
|
||||
return cls.delete(Time._url, params={'id': _id, })
|
||||
|
||||
@classmethod
|
||||
def system_time_name(cls):
|
||||
return cls.get(f'{Time._url}/name')
|
||||
@@ -1,24 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Project: 芒果测试平台
|
||||
# @Description:
|
||||
# @Time : 2024-09-13 11:09
|
||||
# @Author : 毛鹏
|
||||
from .config import Config
|
||||
from .page import Page
|
||||
from .page_element import Element
|
||||
from .page_steps import PageSteps
|
||||
from .page_steps_detailed import PageStepsDetailed
|
||||
from .public import Public
|
||||
from .ui_case import Case
|
||||
from .ui_case_steps_detailed import CaseStepsDetailed
|
||||
|
||||
|
||||
class UiApi:
|
||||
case = Case
|
||||
case_steps_detailed = CaseStepsDetailed
|
||||
config = Config
|
||||
element = Element
|
||||
page = Page
|
||||
page_steps = PageSteps
|
||||
page_steps_detailed = PageStepsDetailed
|
||||
public = Public
|
||||
@@ -1,47 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Project: 芒果测试平台
|
||||
# @Description:
|
||||
# @Time : 2024-09-13 11:11
|
||||
# @Author : 毛鹏
|
||||
from src.network.http.http_base import HttpBase
|
||||
|
||||
|
||||
class Config(HttpBase):
|
||||
_url = '/ui/config'
|
||||
|
||||
@classmethod
|
||||
def get_config(cls, page, page_size, params: dict = None):
|
||||
_params = {
|
||||
'page': page,
|
||||
'pageSize': page_size
|
||||
}
|
||||
if params:
|
||||
_params.update(params)
|
||||
return cls.get(Config._url, params=_params)
|
||||
|
||||
@classmethod
|
||||
def post_config(cls, json_data: dict):
|
||||
return cls.post(Config._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def put_config(cls, json_data: dict):
|
||||
return cls.put(Config._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def delete_config(cls, _id, ):
|
||||
return cls.delete(Config._url, params={
|
||||
'id': _id,
|
||||
})
|
||||
|
||||
@classmethod
|
||||
def put_ui_config_status(cls, _id: int, status: int):
|
||||
return cls.put(f'{Config._url}/status', json={
|
||||
'status': status,
|
||||
'id': _id,
|
||||
})
|
||||
|
||||
@classmethod
|
||||
def new_browser_obj(cls, is_recording: str):
|
||||
return cls.get(f'{Config._url}/new/browser', params={
|
||||
'is_recording': is_recording,
|
||||
})
|
||||
@@ -1,46 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Project: 芒果测试平台
|
||||
# @Description:
|
||||
# @Time : 2024-09-03 16:25
|
||||
# @Author : 毛鹏
|
||||
from src.network.http.http_base import HttpBase
|
||||
|
||||
|
||||
class Page(HttpBase):
|
||||
_url = '/ui/page'
|
||||
|
||||
@classmethod
|
||||
def get_page(cls, page, page_size, params: dict = None):
|
||||
_params = {
|
||||
'page': page,
|
||||
'pageSize': page_size
|
||||
}
|
||||
if params:
|
||||
_params.update(params)
|
||||
return cls.get(Page._url, params=_params)
|
||||
|
||||
@classmethod
|
||||
def post_page(cls, json_data: dict):
|
||||
return cls.post(Page._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def put_page(cls, json_data: dict):
|
||||
return cls.put(Page._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def delete_page(cls, _id, ):
|
||||
return cls.delete(Page._url, params={
|
||||
'id': _id,
|
||||
})
|
||||
|
||||
@classmethod
|
||||
def module_page_name(cls, module_id, ):
|
||||
return cls.get(f'{Page._url}/name', params={
|
||||
'module_id': module_id,
|
||||
})
|
||||
|
||||
@classmethod
|
||||
def page_copy(cls, page_id, ):
|
||||
return cls.post(f'{Page._url}/copy', json={
|
||||
'page_id': page_id,
|
||||
})
|
||||
@@ -1,60 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Project: 芒果测试平台
|
||||
# @Description:
|
||||
# @Time : 2024-09-13 11:11
|
||||
# @Author : 毛鹏
|
||||
from src.network.http.http_base import HttpBase
|
||||
|
||||
|
||||
class Element(HttpBase):
|
||||
_url = '/ui/element'
|
||||
|
||||
@classmethod
|
||||
def get_page_element(cls, page, page_size, params: dict = None):
|
||||
_params = {
|
||||
'page': page,
|
||||
'pageSize': page_size
|
||||
}
|
||||
if params:
|
||||
_params.update(params)
|
||||
return cls.get(Element._url, params=_params)
|
||||
|
||||
@classmethod
|
||||
def post_page_element(cls, json_data: dict):
|
||||
return cls.post(Element._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def put_page_element(cls, json_data: dict):
|
||||
return cls.put(Element._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def delete_page_element(cls, _id, ):
|
||||
return cls.delete(Element._url, params={
|
||||
'id': _id,
|
||||
})
|
||||
|
||||
@classmethod
|
||||
def test_element(cls, test_env, page_id, element_id, project_product_id, _type, ope_key, ope_value):
|
||||
return cls.post(f'{Element._url}/test', json={
|
||||
'project_product_id': project_product_id,
|
||||
'test_env': test_env,
|
||||
'page_id': page_id,
|
||||
'id': element_id,
|
||||
'type': _type,
|
||||
'ope_key': ope_key,
|
||||
'ope_value': ope_value,
|
||||
'is_send': True
|
||||
})
|
||||
|
||||
@classmethod
|
||||
def get_element_name(cls, page_id, ):
|
||||
return cls.get(f'{Element._url}/name', params={
|
||||
'id': page_id,
|
||||
})
|
||||
|
||||
@classmethod
|
||||
def put_is_iframe(cls, _id, is_iframe):
|
||||
return cls.put(f'{Element._url}/iframe', params={
|
||||
'id': _id,
|
||||
'is_iframe': is_iframe,
|
||||
})
|
||||
@@ -1,54 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Project: 芒果测试平台
|
||||
# @Description:
|
||||
# @Time : 2024-09-13 11:12
|
||||
# @Author : 毛鹏
|
||||
from src.network.http.http_base import HttpBase
|
||||
|
||||
|
||||
class PageSteps(HttpBase):
|
||||
_url = '/ui/page/steps'
|
||||
|
||||
@classmethod
|
||||
def get_page_steps(cls, page, page_size, params: dict = None):
|
||||
_params = {
|
||||
'page': page,
|
||||
'pageSize': page_size
|
||||
}
|
||||
if params:
|
||||
_params.update(params)
|
||||
return cls.get(PageSteps._url, params=_params)
|
||||
|
||||
@classmethod
|
||||
def post_page_steps(cls, json_data: dict):
|
||||
return cls.post(PageSteps._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def put_page_steps(cls, json_data: dict):
|
||||
return cls.put(PageSteps._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def delete_page_steps(cls, _id, ):
|
||||
return cls.delete(PageSteps._url, params={
|
||||
'id': _id,
|
||||
})
|
||||
|
||||
@classmethod
|
||||
def ui_steps_run(cls, test_env, page_step_id, is_send=1):
|
||||
return cls.get(f'{PageSteps._url}/test', params={
|
||||
'te': test_env,
|
||||
'page_step_id': page_step_id,
|
||||
'is_send': is_send
|
||||
})
|
||||
|
||||
@classmethod
|
||||
def get_page_steps_name(cls, page_id):
|
||||
return cls.get(f'{PageSteps._url}/name', params={
|
||||
'page_id': page_id,
|
||||
})
|
||||
|
||||
@classmethod
|
||||
def copy_page_steps(cls, page_step_id):
|
||||
return cls.post(f'{PageSteps._url}/copy', json={
|
||||
'page_id': page_step_id,
|
||||
})
|
||||
@@ -1,44 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Project: 芒果测试平台
|
||||
# @Description:
|
||||
# @Time : 2024-09-13 11:12
|
||||
# @Author : 毛鹏
|
||||
from src.network.http.http_base import HttpBase
|
||||
|
||||
|
||||
class PageStepsDetailed(HttpBase):
|
||||
_url = '/ui/page/steps/detailed'
|
||||
|
||||
@classmethod
|
||||
def get_page_steps_detailed(cls, page, page_size, params: dict = None):
|
||||
_params = {
|
||||
'page': page,
|
||||
'pageSize': page_size
|
||||
}
|
||||
if params:
|
||||
_params.update(params)
|
||||
return cls.get(PageStepsDetailed._url, params=_params)
|
||||
|
||||
@classmethod
|
||||
def post_page_steps_detailed(cls, parent_id, json_data: dict):
|
||||
json_data['parent_id'] = parent_id
|
||||
return cls.post(PageStepsDetailed._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def put_page_steps_detailed(cls, parent_id, json_data: dict):
|
||||
json_data['parent_id'] = parent_id
|
||||
return cls.put(PageStepsDetailed._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def delete_page_steps_detailed(cls, _id, parent_id, ):
|
||||
return cls.delete(PageStepsDetailed._url, params={
|
||||
'id': _id,
|
||||
'parent_id': parent_id,
|
||||
})
|
||||
|
||||
@classmethod
|
||||
def put_step_sort(cls, step_sort_list: list[dict]):
|
||||
""" {id:1, step_sort:1 }"""
|
||||
return cls.put(f'{PageStepsDetailed._url}/sort', json={
|
||||
'step_sort_list': step_sort_list,
|
||||
})
|
||||
@@ -1,41 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Project: 芒果测试平台
|
||||
# @Description:
|
||||
# @Time : 2024-09-13 11:13
|
||||
# @Author : 毛鹏
|
||||
from src.network.http.http_base import HttpBase
|
||||
|
||||
|
||||
class Public(HttpBase):
|
||||
_url = '/ui/public'
|
||||
|
||||
@classmethod
|
||||
def get_public(cls, page, page_size, params: dict = None):
|
||||
_params = {
|
||||
'page': page,
|
||||
'pageSize': page_size
|
||||
}
|
||||
if params:
|
||||
_params.update(params)
|
||||
return cls.get(Public._url, params=_params)
|
||||
|
||||
@classmethod
|
||||
def post_public(cls, json_data: dict):
|
||||
return cls.post(Public._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def put_public(cls, json_data: dict):
|
||||
return cls.put(Public._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def delete_public(cls, _id, ):
|
||||
return cls.delete(Public._url, params={
|
||||
'id': _id,
|
||||
})
|
||||
|
||||
@classmethod
|
||||
def put_status(cls, _id, status):
|
||||
return cls.put(f'{Public._url}/status', json={
|
||||
'id': _id,
|
||||
'status': status,
|
||||
})
|
||||
@@ -1,54 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Project: 芒果测试平台
|
||||
# @Description:
|
||||
# @Time : 2024-09-13 11:11
|
||||
# @Author : 毛鹏
|
||||
from src.network.http.http_base import HttpBase
|
||||
|
||||
|
||||
class Case(HttpBase):
|
||||
_url = '/ui/case'
|
||||
|
||||
@classmethod
|
||||
def get_case(cls, page, page_size, params: dict = None):
|
||||
_params = {
|
||||
'page': page,
|
||||
'pageSize': page_size
|
||||
}
|
||||
if params:
|
||||
_params.update(params)
|
||||
return cls.get(Case._url, params=_params)
|
||||
|
||||
@classmethod
|
||||
def post_case(cls, json_data: dict):
|
||||
return cls.post(Case._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def put_case(cls, json_data: dict):
|
||||
return cls.put(Case._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def delete_case(cls, _id, ):
|
||||
return cls.delete(Case._url, params={
|
||||
'id': _id,
|
||||
})
|
||||
|
||||
@classmethod
|
||||
def copy_case(cls, _id, ):
|
||||
return cls.post(f'{Case._url}/copy', json={
|
||||
'case_id': _id,
|
||||
})
|
||||
|
||||
@classmethod
|
||||
def ui_test_case(cls, case_id, test_env):
|
||||
return cls.get(f'{Case._url}/test', params={
|
||||
'case_id': case_id,
|
||||
'test_env': test_env,
|
||||
})
|
||||
|
||||
@classmethod
|
||||
def ui_test_case_batch(cls, case_id_list, test_env):
|
||||
return cls.post(f'{Case._url}/batch', json={
|
||||
'case_id_list': case_id_list,
|
||||
'test_env': test_env,
|
||||
})
|
||||
@@ -1,53 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Project: 芒果测试平台
|
||||
# @Description:
|
||||
# @Time : 2024-09-13 11:11
|
||||
# @Author : 毛鹏
|
||||
from src.network.http.http_base import HttpBase
|
||||
|
||||
|
||||
class CaseStepsDetailed(HttpBase):
|
||||
_url = '/ui/case/steps/detailed'
|
||||
|
||||
@classmethod
|
||||
def get_case_steps_detailed(cls, page, page_size, params: dict = None):
|
||||
_params = {
|
||||
'page': page,
|
||||
'pageSize': page_size
|
||||
}
|
||||
if params:
|
||||
_params.update(params)
|
||||
return cls.get(CaseStepsDetailed._url, params=_params)
|
||||
|
||||
@classmethod
|
||||
def post_case_steps_detailed(cls, parent_id, json_data: dict):
|
||||
json_data['parent_id'] = parent_id
|
||||
return cls.post(CaseStepsDetailed._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def put_case_steps_detailed(cls, parent_id, json_data: dict):
|
||||
json_data['parent_id'] = parent_id
|
||||
|
||||
return cls.put(CaseStepsDetailed._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def delete_case_steps_detailed(cls, _id, parent_id):
|
||||
return cls.delete(CaseStepsDetailed._url, params={
|
||||
'id': _id,
|
||||
'parent_id': parent_id
|
||||
})
|
||||
|
||||
@classmethod
|
||||
def post_case_cache_data(cls, _id):
|
||||
_params = {
|
||||
'id': _id,
|
||||
}
|
||||
if _params:
|
||||
_params.update(_params)
|
||||
return cls.get(f'{CaseStepsDetailed._url}/refresh', params=_params)
|
||||
|
||||
@classmethod
|
||||
def put_case_sort(cls, case_sort_list: list[dict]):
|
||||
return cls.put(f'{CaseStepsDetailed._url}/sort', json={
|
||||
'case_sort_list': case_sort_list,
|
||||
})
|
||||
@@ -1,14 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Project: 芒果测试平台
|
||||
# @Description:
|
||||
# @Time : 2024-09-13 11:13
|
||||
# @Author : 毛鹏
|
||||
from .role import Role
|
||||
from .user import User
|
||||
from .user_log import UserLog
|
||||
|
||||
|
||||
class UserApi:
|
||||
role = Role
|
||||
info = User
|
||||
user_logs = UserLog
|
||||
@@ -1,36 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Project: 芒果测试平台
|
||||
# @Description:
|
||||
# @Time : 2024-09-24 10:01
|
||||
# @Author : 毛鹏
|
||||
from src.network.http.http_base import HttpBase
|
||||
|
||||
|
||||
class Role(HttpBase):
|
||||
_url = '/user/role'
|
||||
|
||||
@classmethod
|
||||
def get_role(cls, page, page_size, params: dict = None):
|
||||
_params = {
|
||||
'page': page,
|
||||
'pageSize': page_size
|
||||
}
|
||||
if params:
|
||||
_params.update(params)
|
||||
return cls.get(Role._url, params=_params)
|
||||
|
||||
@classmethod
|
||||
def post_role(cls, json_data: dict):
|
||||
return cls.post(Role._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def put_role(cls, json_data: dict):
|
||||
return cls.put(Role._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def delete_role(cls, _id, ):
|
||||
return cls.delete(Role._url, params={'id': _id, })
|
||||
|
||||
@classmethod
|
||||
def get_role_name(cls):
|
||||
return cls.get(f'{Role._url}/all')
|
||||
@@ -1,81 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Project: 芒果测试平台
|
||||
# @Description:
|
||||
# @Time : 2024-09-21 11:19
|
||||
# @Author : 毛鹏
|
||||
import json
|
||||
|
||||
from src.models.user_model import UserModel
|
||||
from src.network.http.http_base import HttpBase
|
||||
|
||||
|
||||
class User(HttpBase):
|
||||
_url = 'user/info'
|
||||
|
||||
@classmethod
|
||||
def get_user_info(cls, page, page_size, params: dict = None):
|
||||
_params = {
|
||||
'page': page,
|
||||
'pageSize': page_size
|
||||
}
|
||||
if params:
|
||||
_params.update(params)
|
||||
return cls.get(User._url, params=_params)
|
||||
|
||||
@classmethod
|
||||
def post_user_info(cls, json_data: dict):
|
||||
return cls.post(User._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def put_user_info(cls, json_data: dict):
|
||||
if json_data.get('mailbox') and isinstance(json_data.get('mailbox'), str):
|
||||
json_data['mailbox'] = json.loads(json_data.get('mailbox'))
|
||||
for k, v in json_data.items():
|
||||
if isinstance(v, dict) and v.get('id'):
|
||||
json_data[k] = v.get('id')
|
||||
return cls.put(User._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def delete_user_info(cls, _id, ):
|
||||
return cls.delete(User._url, params={
|
||||
'id': _id,
|
||||
})
|
||||
|
||||
@classmethod
|
||||
def get_userinfo(cls, _id: int):
|
||||
response = cls.get(f'/user/info?id={_id}')
|
||||
if response.data:
|
||||
user_model = UserModel(**response.data[0])
|
||||
if user_model.selected_project:
|
||||
cls.headers['Project'] = str(user_model.selected_project)
|
||||
if user_model.config is None:
|
||||
user_model.config = {}
|
||||
cls.put_user_info(response.data[0])
|
||||
return response
|
||||
|
||||
@classmethod
|
||||
def put_user_project(cls, _id, selected_project):
|
||||
return cls.put(f'{User._url}/project', json={
|
||||
'id': _id,
|
||||
'selected_project': selected_project
|
||||
})
|
||||
|
||||
@classmethod
|
||||
def put_environment(cls, _id, selected_environment):
|
||||
return cls.put(f'{User._url}/environment', json={
|
||||
'id': _id,
|
||||
'selected_environment': selected_environment
|
||||
})
|
||||
|
||||
@classmethod
|
||||
def put_password(cls, _id, password: str, new_password: str, confirm_password: str):
|
||||
return cls.put(f'{User._url}/password', json={
|
||||
'id': _id,
|
||||
'password': password,
|
||||
'new_password': new_password,
|
||||
'confirm_password': confirm_password,
|
||||
})
|
||||
|
||||
@classmethod
|
||||
def get_name(cls, ):
|
||||
return cls.get(f'{User._url}/name', )
|
||||
@@ -1,32 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Project: 芒果测试平台
|
||||
# @Description:
|
||||
# @Time : 2024-09-24 10:01
|
||||
# @Author : 毛鹏
|
||||
from src.network.http.http_base import HttpBase
|
||||
|
||||
|
||||
class UserLog(HttpBase):
|
||||
_url = 'user/user/logs'
|
||||
|
||||
@classmethod
|
||||
def get_user_log(cls, page, page_size, params: dict = None):
|
||||
_params = {
|
||||
'page': page,
|
||||
'pageSize': page_size
|
||||
}
|
||||
if params:
|
||||
_params.update(params)
|
||||
return cls.get(UserLog._url, params=_params)
|
||||
|
||||
@classmethod
|
||||
def post_user_log(cls, json_data: dict):
|
||||
return cls.post(UserLog._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def put_user_log(cls, json_data: dict):
|
||||
return cls.put(UserLog._url, json=json_data)
|
||||
|
||||
@classmethod
|
||||
def delete_user_log(cls, _id, ):
|
||||
return cls.delete(UserLog._url, params={'id': _id, })
|
||||
@@ -4,6 +4,6 @@ docker rmi $(docker images -f "dangling=true" -q) 2>/dev/null || true
|
||||
git pull
|
||||
docker compose build
|
||||
docker compose up -d
|
||||
sleep 8
|
||||
sleep 10
|
||||
docker logs mangotestingplatform-mango_server-1
|
||||
docker logs mangotestingplatform-mango_actuator-1
|
||||
Reference in New Issue
Block a user