sdfds #1
|
@ -1,8 +0,0 @@
|
|||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
|
@ -1,32 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="PYTHON_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="django" name="Django">
|
||||
<configuration>
|
||||
<option name="rootFolder" value="$MODULE_DIR$" />
|
||||
<option name="settingsModule" value="py08test/settings.py" />
|
||||
<option name="manageScript" value="$MODULE_DIR$/manage.py" />
|
||||
<option name="environment" value="<map/>" />
|
||||
<option name="doNotUseTestRunner" value="false" />
|
||||
<option name="trackFilePattern" value="migrations" />
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
<component name="PyDocumentationSettings">
|
||||
<option name="format" value="PLAIN" />
|
||||
<option name="myDocStringFormat" value="Plain" />
|
||||
</component>
|
||||
<component name="TemplatesService">
|
||||
<option name="TEMPLATE_CONFIGURATION" value="Django" />
|
||||
<option name="TEMPLATE_FOLDERS">
|
||||
<list>
|
||||
<option value="$MODULE_DIR$/templates" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
</module>
|
|
@ -1,64 +0,0 @@
|
|||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="PyPackageRequirementsInspection" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="ignoredPackages">
|
||||
<value>
|
||||
<list size="51">
|
||||
<item index="0" class="java.lang.String" itemvalue="bs4" />
|
||||
<item index="1" class="java.lang.String" itemvalue="greenlet" />
|
||||
<item index="2" class="java.lang.String" itemvalue="logzero" />
|
||||
<item index="3" class="java.lang.String" itemvalue="typed-ast" />
|
||||
<item index="4" class="java.lang.String" itemvalue="atomicwrites" />
|
||||
<item index="5" class="java.lang.String" itemvalue="python-dateutil" />
|
||||
<item index="6" class="java.lang.String" itemvalue="py" />
|
||||
<item index="7" class="java.lang.String" itemvalue="astroid" />
|
||||
<item index="8" class="java.lang.String" itemvalue="Faker" />
|
||||
<item index="9" class="java.lang.String" itemvalue="certifi" />
|
||||
<item index="10" class="java.lang.String" itemvalue="lxml" />
|
||||
<item index="11" class="java.lang.String" itemvalue="gevent" />
|
||||
<item index="12" class="java.lang.String" itemvalue="pyparsing" />
|
||||
<item index="13" class="java.lang.String" itemvalue="beautifulsoup4" />
|
||||
<item index="14" class="java.lang.String" itemvalue="pywin32" />
|
||||
<item index="15" class="java.lang.String" itemvalue="idna-ssl" />
|
||||
<item index="16" class="java.lang.String" itemvalue="pytest-metadata" />
|
||||
<item index="17" class="java.lang.String" itemvalue="wrapt" />
|
||||
<item index="18" class="java.lang.String" itemvalue="zope.interface" />
|
||||
<item index="19" class="java.lang.String" itemvalue="attrdict" />
|
||||
<item index="20" class="java.lang.String" itemvalue="BeautifulReport" />
|
||||
<item index="21" class="java.lang.String" itemvalue="attrs" />
|
||||
<item index="22" class="java.lang.String" itemvalue="weditor" />
|
||||
<item index="23" class="java.lang.String" itemvalue="PyMySQL" />
|
||||
<item index="24" class="java.lang.String" itemvalue="idna" />
|
||||
<item index="25" class="java.lang.String" itemvalue="decorator" />
|
||||
<item index="26" class="java.lang.String" itemvalue="more-itertools" />
|
||||
<item index="27" class="java.lang.String" itemvalue="cffi" />
|
||||
<item index="28" class="java.lang.String" itemvalue="wcwidth" />
|
||||
<item index="29" class="java.lang.String" itemvalue="importlib-metadata" />
|
||||
<item index="30" class="java.lang.String" itemvalue="cookies" />
|
||||
<item index="31" class="java.lang.String" itemvalue="jdcal" />
|
||||
<item index="32" class="java.lang.String" itemvalue="uiautomator2" />
|
||||
<item index="33" class="java.lang.String" itemvalue="Deprecated" />
|
||||
<item index="34" class="java.lang.String" itemvalue="zipp" />
|
||||
<item index="35" class="java.lang.String" itemvalue="cached-property" />
|
||||
<item index="36" class="java.lang.String" itemvalue="urllib3" />
|
||||
<item index="37" class="java.lang.String" itemvalue="zope.event" />
|
||||
<item index="38" class="java.lang.String" itemvalue="six" />
|
||||
<item index="39" class="java.lang.String" itemvalue="tornado" />
|
||||
<item index="40" class="java.lang.String" itemvalue="pytest" />
|
||||
<item index="41" class="java.lang.String" itemvalue="packaging" />
|
||||
<item index="42" class="java.lang.String" itemvalue="et-xmlfile" />
|
||||
<item index="43" class="java.lang.String" itemvalue="facebook-wda" />
|
||||
<item index="44" class="java.lang.String" itemvalue="lazy-object-proxy" />
|
||||
<item index="45" class="java.lang.String" itemvalue="pytest-testreport" />
|
||||
<item index="46" class="java.lang.String" itemvalue="ddt" />
|
||||
<item index="47" class="java.lang.String" itemvalue="progress" />
|
||||
<item index="48" class="java.lang.String" itemvalue="openpyxl" />
|
||||
<item index="49" class="java.lang.String" itemvalue="Pillow" />
|
||||
<item index="50" class="java.lang.String" itemvalue="unittestreport" />
|
||||
</list>
|
||||
</value>
|
||||
</option>
|
||||
</inspection_tool>
|
||||
</profile>
|
||||
</component>
|
|
@ -1,6 +0,0 @@
|
|||
<component name="InspectionProjectProfileManager">
|
||||
<settings>
|
||||
<option name="USE_PROJECT_PROFILE" value="false" />
|
||||
<version value="1.0" />
|
||||
</settings>
|
||||
</component>
|
|
@ -1,4 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Pipenv (home)" project-jdk-type="Python SDK" />
|
||||
</project>
|
|
@ -1,8 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/home.iml" filepath="$PROJECT_DIR$/.idea/home.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
|
@ -1,6 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
12
Pipfile
12
Pipfile
|
@ -1,12 +0,0 @@
|
|||
[[source]]
|
||||
url = "https://pypi.douban.com/simple"
|
||||
verify_ssl = true
|
||||
name = "pypi"
|
||||
|
||||
[packages]
|
||||
django = "*"
|
||||
|
||||
[dev-packages]
|
||||
|
||||
[requires]
|
||||
python_version = "3.9"
|
|
@ -1,52 +0,0 @@
|
|||
{
|
||||
"_meta": {
|
||||
"hash": {
|
||||
"sha256": "3ea235286f3cb02870378097b40744aa50d1ae64a1116afeb73088d0af9c1d23"
|
||||
},
|
||||
"pipfile-spec": 6,
|
||||
"requires": {
|
||||
"python_version": "3.9"
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"name": "pypi",
|
||||
"url": "https://pypi.douban.com/simple",
|
||||
"verify_ssl": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"default": {
|
||||
"asgiref": {
|
||||
"hashes": [
|
||||
"sha256:4ef1ab46b484e3c706329cedeff284a5d40824200638503f5768edb6de7d58e9",
|
||||
"sha256:ffc141aa908e6f175673e7b1b3b7af4fdb0ecb738fc5c8b88f69f055c2415214"
|
||||
],
|
||||
"markers": "python_version >= '3.6'",
|
||||
"version": "==3.4.1"
|
||||
},
|
||||
"django": {
|
||||
"hashes": [
|
||||
"sha256:95b318319d6997bac3595517101ad9cc83fe5672ac498ba48d1a410f47afecd2",
|
||||
"sha256:e93c93565005b37ddebf2396b4dc4b6913c1838baa82efdfb79acedd5816c240"
|
||||
],
|
||||
"index": "pypi",
|
||||
"version": "==3.2.7"
|
||||
},
|
||||
"pytz": {
|
||||
"hashes": [
|
||||
"sha256:83a4a90894bf38e243cf052c8b58f381bfe9a7a483f6a9cab140bc7f702ac4da",
|
||||
"sha256:eb10ce3e7736052ed3623d49975ce333bcd712c7bb19a58b9e2089d4057d0798"
|
||||
],
|
||||
"version": "==2021.1"
|
||||
},
|
||||
"sqlparse": {
|
||||
"hashes": [
|
||||
"sha256:0c00730c74263a94e5a9919ade150dfc3b19c574389985446148402998287dae",
|
||||
"sha256:48719e356bb8b42991bdbb1e8b83223757b93789c00910a616a071910ca4a64d"
|
||||
],
|
||||
"markers": "python_version >= '3.5'",
|
||||
"version": "==0.4.2"
|
||||
}
|
||||
},
|
||||
"develop": {}
|
||||
}
|
102
README.md
102
README.md
|
@ -1,102 +0,0 @@
|
|||

|
||||
|
||||
[查看中文](https://forgeplus.trustie.net/projects/nudtpc/JCCPlatform/tree/master/README_CN.md)
|
||||
|
||||
<!-- TOC -->
|
||||
|
||||
- [What Is JCCE](#what-is-JCCE)
|
||||
- [Resource Panel](#resource-panel)
|
||||
- [Control Panel](#control-panel)
|
||||
- [Business Panel](#business-panel)
|
||||
- [Information Panel](#Information-panel)
|
||||
- [Installation](#installation)
|
||||
- [Quickstart](#quickstart)
|
||||
- [Docs](#docs)
|
||||
- [Community](#community)
|
||||
- [Governance](#governance)
|
||||
- [Communication](#communication)
|
||||
- [Contributing](#contributing)
|
||||
- [Maintenance phases](#maintenance-phases)
|
||||
- [Maintenance status](#maintenance-status)
|
||||
- [Release Notes](#release-notes)
|
||||
- [License](#license)
|
||||
|
||||
<!-- /TOC -->
|
||||
|
||||
## What Is JCCE
|
||||
|
||||
JCCE management platform is a set of comprehensive open source platform to realize the wide area management of computing resources and intelligent operation and maintenance. Designed to provide "maximum benefit" solutions that are heterogeneous across the cloud, diversified storage, open to service, and intelligently regulated. Meet multi-tenant, highly elastic, widely distributed demand scenarios to help users free themselves from cumbersome and complex basic resource operations, scheduling, statistical operations, and focus more on the business itself.
|
||||
|
||||
<img src="https://forgeplus.trustie.net/api/attachments/357740?raw=true" alt="JCCE Architecture" width="600"/>
|
||||
|
||||
For more details please check out our [Architecture Guide](https://www.mindspore.cn/doc/note/en/master/design/mindspore/architecture.html).
|
||||
|
||||
### Resource Panel
|
||||
Based on Kubernetes container cluster, it supports the operation of cloud-native computing, cloud-native storage, and cloud-native network. In cloud-native computing, bare metal nodes and edge nodes are containerized, cloud-native storage is supported by various types of storage plug-ins and storage managers, and cloud-native networks are built with network plug-ins and network managers.
|
||||
|
||||
### Control Panel
|
||||
|
||||
Supports intelligent management of basic resources, management scheduling and operational monitoring. In the control layer, the cluster from nodes, containers, storage, mirroring, virtual machine multidimensional management, the construction, use, destruction of resources for unified configuration and scheduling, the container life cycle of all-round operation and maintenance monitoring, for abnormal situations, issued alarms, and according to different alarm status to enable intelligent scheduling algorithm, timely adjustment of the job.
|
||||
|
||||
- **Negotiate based on smartcontract**:
|
||||
Intelligent consultation between supply and demand parties, aimed at the most cost-effective solution to achieve user goals.
|
||||
- **Operations monitoring**:
|
||||
The full stack covers the overall operation process and quickly locates alarms and anomalies from top to bottom.
|
||||
- **Manage and schedule**:
|
||||
The full life cycle management of cloud resource services is carried out to maximize the utilization of cloud resources through flexible management and rational allocation.
|
||||
|
||||
### Business Panel
|
||||
Presents control business functions that users care about. Includes two-dimensional control of containers and virtual machines to support storage, networking, billing capabilities in the deployment environment. The following will be different industries, different disciplines into the business application plane, unified management, use.
|
||||
|
||||
### Information Panel
|
||||
- **JointCloud Ledger**
|
||||
Static trading commitment certificate, dynamic API economic behavior certificate, attribution and income right confirmation
|
||||
Move intensive processing operations under the chain to improve scalability and reduce latency, and off-chain computing ensures data privacy and auditability of behavioral processes. The chain is responsible for the verification, audit, the chain is responsible for the calculation.
|
||||
|
||||
## Installation
|
||||
See the [Installation](https://forgeplus.trustie.net/projects/nudtpc/JCCPlatform/tree/master/Installation.md)
|
||||
to implement the image classification.
|
||||
|
||||
|
||||
## Quickstart
|
||||
|
||||
See the [Quick Start]()
|
||||
to implement the image classification.
|
||||
|
||||
## Docs
|
||||
|
||||
More details about installation guide, tutorials and APIs, please see the
|
||||
[User Documentation]().
|
||||
|
||||
## Community
|
||||
|
||||
### Governance
|
||||
|
||||
Check out how jcce Open Governance [works]().
|
||||
|
||||
### Communication
|
||||
|
||||
- [JCCE Slack]() - Communication platform for developers.
|
||||
- IRC channel: TBD
|
||||
- Video Conferencing: TBD
|
||||
- Mailing-list: <https://mailweb.jcce.cn/postorius/lists>
|
||||
|
||||
## Contributing
|
||||
|
||||
Welcome contributions. See our [Contributor Wiki]() for
|
||||
more details.
|
||||
|
||||
## Maintenance phases
|
||||
|
||||
Project stable branches will be in one of the following states:
|
||||
|
||||
## Maintenance status
|
||||
|
||||
|
||||
## Release Notes
|
||||
|
||||
The release notes, see our [RELEASE]().
|
||||
|
||||
## License
|
||||
|
||||
[Apache License 2.0]()
|
|
@ -1,14 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# @Time : 2021/8/28 22:19
|
||||
# @Author : Flora.Chen
|
||||
# @File : __init__.py.py
|
||||
# @Software: PyCharm
|
||||
# @Desc:
|
||||
import os
|
||||
import pytest
|
||||
from py.xml import html
|
||||
from selenium import webdriver
|
||||
from selenium.webdriver import Remote
|
||||
from selenium.webdriver.chrome.options import Options as CH_Options
|
||||
from selenium.webdriver.firefox.options import Options as FF_Options
|
||||
from config import RunConfig
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,3 +0,0 @@
|
|||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
|
@ -1,6 +0,0 @@
|
|||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class ConfiguresConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'configures'
|
|
@ -1,34 +0,0 @@
|
|||
# Generated by Django 3.2.6 on 2021-09-13 16:08
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
('interfaces', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Configures',
|
||||
fields=[
|
||||
('id', models.AutoField(help_text='ID', primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('create_time', models.DateTimeField(auto_now_add=True, help_text='创建时间', verbose_name='创建时间')),
|
||||
('update_time', models.DateTimeField(auto_now=True, help_text='更新时间', verbose_name='更新时间')),
|
||||
('name', models.CharField(help_text='配置名称', max_length=50, unique=True, verbose_name='配置名称')),
|
||||
('author', models.CharField(help_text='编写人员', max_length=50, verbose_name='编写人员')),
|
||||
('request', models.TextField(help_text='请求信息', verbose_name='请求信息')),
|
||||
('interface', models.ForeignKey(help_text='所属接口', on_delete=django.db.models.deletion.CASCADE, related_name='configures', to='interfaces.interfaces', verbose_name='所属接口')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': '配置表',
|
||||
'verbose_name_plural': '配置表',
|
||||
'db_table': 'tb_configures',
|
||||
'ordering': ['id'],
|
||||
},
|
||||
),
|
||||
]
|
Binary file not shown.
Binary file not shown.
|
@ -1,21 +0,0 @@
|
|||
from django.db import models
|
||||
from utils.base_models import BaseModel
|
||||
|
||||
|
||||
class Configures(BaseModel):
|
||||
# id = models.AutoField(primary_key=True, verbose_name="ID", help_text="ID")
|
||||
name = models.CharField(unique=True, max_length=50, help_text="配置名称", verbose_name="配置名称")
|
||||
interface = models.ForeignKey("interfaces.Interfaces", on_delete=models.CASCADE,
|
||||
help_text="所属接口", verbose_name="所属接口", related_name="configures")
|
||||
author = models.CharField(max_length=50, help_text="编写人员", verbose_name="编写人员")
|
||||
request = models.TextField(help_text="请求信息", verbose_name="请求信息")
|
||||
|
||||
class Meta:
|
||||
"""内部类"""
|
||||
db_table = "tb_configures"
|
||||
verbose_name = "配置表"
|
||||
ordering = ["id"]
|
||||
verbose_name_plural = verbose_name
|
||||
|
||||
def __str__(self):
|
||||
return f"<{self.name}>"
|
|
@ -1,19 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# @Time : 2021/9/16 23:48
|
||||
# @Author : Flora.Chen
|
||||
# @File : serializers.py
|
||||
# @Software: PyCharm
|
||||
# @Desc:
|
||||
from rest_framework import serializers
|
||||
from .models import Configures
|
||||
|
||||
|
||||
class ConfiguresModelSerializers(serializers.ModelSerializer):
|
||||
"""配置管理的序列化器类"""
|
||||
|
||||
class Meta:
|
||||
model = Configures
|
||||
exclude = ("create_time", "update_time")
|
||||
extra_kwargs = {
|
||||
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
|
@ -1,16 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# @Time : 2021/9/16 23:46
|
||||
# @Author : Flora.Chen
|
||||
# @File : urls.py
|
||||
# @Software: PyCharm
|
||||
# @Desc:
|
||||
|
||||
from rest_framework.routers import SimpleRouter
|
||||
from django.urls import path, re_path
|
||||
from . import views
|
||||
|
||||
router = SimpleRouter()
|
||||
router.register(r"configures", views.ConfiguresView)
|
||||
urlpatterns = []
|
||||
|
||||
urlpatterns += router.urls
|
|
@ -1,8 +0,0 @@
|
|||
from rest_framework.viewsets import ModelViewSet
|
||||
from .models import Configures
|
||||
from . import serializers
|
||||
|
||||
|
||||
class ConfiguresView(ModelViewSet):
|
||||
queryset = Configures.objects.all()
|
||||
serializer_class = serializers.ConfiguresModelSerializers
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,3 +0,0 @@
|
|||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
|
@ -1,6 +0,0 @@
|
|||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class DebugtalksConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'debugtalks'
|
|
@ -1,33 +0,0 @@
|
|||
# Generated by Django 3.2.6 on 2021-09-13 16:08
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
('projects', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='DebugTalks',
|
||||
fields=[
|
||||
('id', models.AutoField(help_text='ID', primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('create_time', models.DateTimeField(auto_now_add=True, help_text='创建时间', verbose_name='创建时间')),
|
||||
('update_time', models.DateTimeField(auto_now=True, help_text='更新时间', verbose_name='更新时间')),
|
||||
('name', models.CharField(help_text='debugtalk文件名称', max_length=200, unique=True, verbose_name='debugtalk文件名称')),
|
||||
('debugtalk', models.TextField(default='#debugtalk.py', help_text='debugtalk.py文件', null=True)),
|
||||
('project', models.OneToOneField(help_text='所属项目', on_delete=django.db.models.deletion.CASCADE, related_name='debugtalks', to='projects.projects')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'debugtalk文件',
|
||||
'verbose_name_plural': 'debugtalk文件',
|
||||
'db_table': 'tb_debugtalks',
|
||||
'ordering': ['id'],
|
||||
},
|
||||
),
|
||||
]
|
|
@ -1,18 +0,0 @@
|
|||
# Generated by Django 3.2.6 on 2021-09-13 16:10
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('debugtalks', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='debugtalks',
|
||||
name='name',
|
||||
field=models.CharField(help_text='debugtalk文件名称', max_length=200, verbose_name='debugtalk文件名称'),
|
||||
),
|
||||
]
|
|
@ -1,17 +0,0 @@
|
|||
# Generated by Django 3.2.6 on 2021-09-13 16:11
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('debugtalks', '0002_alter_debugtalks_name'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='debugtalks',
|
||||
options={'verbose_name': 'debugtalk文件', 'verbose_name_plural': 'debugtalk文件'},
|
||||
),
|
||||
]
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,20 +0,0 @@
|
|||
from django.db import models
|
||||
from utils.base_models import BaseModel
|
||||
|
||||
|
||||
class DebugTalks(BaseModel):
|
||||
# id = models.AutoField(primary_key=True, verbose_name="ID", help_text="ID")
|
||||
name = models.CharField(max_length=200, help_text="debugtalk文件名称", default='debugtalk.py',
|
||||
verbose_name="debugtalk文件名称")
|
||||
debugtalk = models.TextField(null=True, default="#debugtalk.py", help_text="debugtalk.py文件")
|
||||
project = models.OneToOneField("projects.Projects", on_delete=models.CASCADE, related_name="debugtalks",
|
||||
help_text="所属项目")
|
||||
|
||||
class Meta:
|
||||
"""内部类"""
|
||||
db_table = "tb_debugtalks"
|
||||
verbose_name = "debugtalk文件"
|
||||
verbose_name_plural = verbose_name
|
||||
|
||||
def __str__(self):
|
||||
return f"<{self.name}>"
|
|
@ -1,37 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# @Time : 2021/9/16 23:50
|
||||
# @Author : Flora.Chen
|
||||
# @File : serializers.py
|
||||
# @Software: PyCharm
|
||||
# @Desc:
|
||||
from rest_framework import serializers
|
||||
from .models import DebugTalks
|
||||
|
||||
|
||||
class DebugtalksModelSerailizers(serializers.ModelSerializer):
|
||||
"""内置函数的序列化器类"""
|
||||
project = serializers.SlugRelatedField(slug_field="name", read_only=True, label="所属项目", help_text="所属项目")
|
||||
|
||||
class Meta:
|
||||
model = DebugTalks
|
||||
exclude = ("create_time", "update_time")
|
||||
extra_kwargs = {
|
||||
"debugtalk": {
|
||||
"write_only": "True",
|
||||
"error_messages": {
|
||||
"null": "debugtalk文件不能为空"
|
||||
}
|
||||
},
|
||||
"name": {
|
||||
"max_length": 50,
|
||||
"error_messages": {
|
||||
"max_length": "name最大长度为50"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class DebugtalkSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
model = DebugTalks
|
||||
fields = ('id', 'debugtalk')
|
|
@ -1,3 +0,0 @@
|
|||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
|
@ -1,14 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# @Time : 2021/9/16 23:50
|
||||
# @Author : Flora.Chen
|
||||
# @File : urls.py
|
||||
# @Software: PyCharm
|
||||
# @Desc:
|
||||
|
||||
from rest_framework.routers import SimpleRouter
|
||||
from .views import DebugtalksView
|
||||
|
||||
router = SimpleRouter()
|
||||
router.register(r"debugtalks", DebugtalksView)
|
||||
urlpatterns = []
|
||||
urlpatterns += router.urls
|
|
@ -1,14 +0,0 @@
|
|||
from rest_framework.viewsets import GenericViewSet
|
||||
from rest_framework.mixins import ListModelMixin, RetrieveModelMixin, UpdateModelMixin
|
||||
from . import serializers
|
||||
from .models import DebugTalks
|
||||
from rest_framework import permissions
|
||||
|
||||
|
||||
class DebugtalksView(GenericViewSet, ListModelMixin, RetrieveModelMixin, UpdateModelMixin):
|
||||
queryset = DebugTalks.objects.all()
|
||||
serializer_class = serializers.DebugtalksModelSerailizers
|
||||
permission_classes = [permissions.IsAuthenticated]
|
||||
|
||||
def get_serializer_class(self):
|
||||
return serializers.DebugtalkSerializer if self.action == "retrieve" else super().get_serializer_class()
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,3 +0,0 @@
|
|||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
|
@ -1,6 +0,0 @@
|
|||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class EnvsConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'envs'
|
|
@ -1,31 +0,0 @@
|
|||
# Generated by Django 3.2.6 on 2021-09-13 16:08
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Envs',
|
||||
fields=[
|
||||
('id', models.AutoField(help_text='ID', primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('create_time', models.DateTimeField(auto_now_add=True, help_text='创建时间', verbose_name='创建时间')),
|
||||
('update_time', models.DateTimeField(auto_now=True, help_text='更新时间', verbose_name='更新时间')),
|
||||
('name', models.CharField(help_text='环境名称', max_length=200, unique=True, verbose_name='环境名称')),
|
||||
('base_url', models.URLField(help_text='请求base_url', verbose_name='请求base_url')),
|
||||
('desc', models.CharField(help_text='简要描述', max_length=200, verbose_name='简要描述')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': '环境信息',
|
||||
'verbose_name_plural': '环境信息',
|
||||
'db_table': 'tb_envs',
|
||||
'ordering': ['id'],
|
||||
},
|
||||
),
|
||||
]
|
Binary file not shown.
Binary file not shown.
|
@ -1,19 +0,0 @@
|
|||
from django.db import models
|
||||
from utils.base_models import BaseModel
|
||||
|
||||
|
||||
class Envs(BaseModel):
|
||||
# id = models.AutoField(primary_key=True, verbose_name="ID", help_text="ID")
|
||||
name = models.CharField(unique=True, max_length=200, help_text="环境名称", verbose_name="环境名称")
|
||||
base_url = models.URLField(verbose_name="请求base_url", max_length=200, help_text="请求base_url")
|
||||
desc = models.CharField(verbose_name="简要描述", help_text="简要描述", max_length=200)
|
||||
|
||||
class Meta:
|
||||
"""内部类"""
|
||||
db_table = "tb_envs"
|
||||
verbose_name = "环境信息"
|
||||
ordering = ["id"]
|
||||
verbose_name_plural = verbose_name
|
||||
|
||||
def __str__(self):
|
||||
return f"<{self.name}>"
|
|
@ -1,50 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# @Time : 2021/9/16 23:20
|
||||
# @Author : Flora.Chen
|
||||
# @File : serializers.py
|
||||
# @Software: PyCharm
|
||||
# @Desc:
|
||||
from rest_framework import serializers
|
||||
from .models import Envs
|
||||
|
||||
|
||||
class EnvsModelSerializer(serializers.ModelSerializer):
|
||||
"""环境管理的序列化器类"""
|
||||
|
||||
class Meta:
|
||||
model = Envs
|
||||
exclude = ("update_time",)
|
||||
extra_kwargs = {
|
||||
"name": {
|
||||
"min_length": 1,
|
||||
"max_length": 50,
|
||||
"error_messages": {
|
||||
"unique": "环境名称不能重复",
|
||||
"max_length": "环境名称不能超过50个字符",
|
||||
"min_length": "环境名称至少输入1个字符"
|
||||
}
|
||||
},
|
||||
"base_url": {
|
||||
"max_length": 50,
|
||||
"error_messages": {
|
||||
"max_length": "base_url不能超过50个字符",
|
||||
}
|
||||
},
|
||||
"desc": {
|
||||
"error_messages": {
|
||||
"max_length": "描述不能超过200个字符",
|
||||
}
|
||||
},
|
||||
"create_time": {
|
||||
"format": "%Y-%m-%d %H:%M:%S"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
class EnvsNameSerializer(serializers.ModelSerializer):
|
||||
"""返回环境的名称"""
|
||||
|
||||
class Meta:
|
||||
model = Envs
|
||||
fields = ("id", "name")
|
|
@ -1,3 +0,0 @@
|
|||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
|
@ -1,16 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# @Time : 2021/9/16 23:14
|
||||
# @Author : Flora.Chen
|
||||
# @File : urls.py
|
||||
# @Software: PyCharm
|
||||
# @Desc:
|
||||
|
||||
from django.urls import path, re_path
|
||||
from rest_framework.routers import SimpleRouter
|
||||
from .views import EnvView
|
||||
|
||||
router = SimpleRouter()
|
||||
router.register(r"envs", EnvView)
|
||||
urlpatterns = []
|
||||
urlpatterns += router.urls
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
from rest_framework.decorators import action
|
||||
|
||||
from .models import Envs
|
||||
from . import serializers
|
||||
from rest_framework.viewsets import ModelViewSet
|
||||
from rest_framework import filters
|
||||
from rest_framework import permissions
|
||||
from utils.mixins import GetDataMinxin
|
||||
|
||||
|
||||
class EnvView(ModelViewSet, GetDataMinxin):
|
||||
queryset = Envs.objects.all()
|
||||
serializer_class = serializers.EnvsModelSerializer
|
||||
|
||||
# filter_backends = [filters.SearchFilter, filters.OrderingFilter]
|
||||
# search_fields = ['id', 'name', 'tester']
|
||||
# ordering_fields = ['name', 'tester']
|
||||
# permission_classes = [permissions.IsAuthenticated]
|
||||
|
||||
@action(detail=False)
|
||||
def names(self, request, *args, **kwargs):
|
||||
"""获取所有的环境名称"""
|
||||
response = super().list(request, *args, **kwargs)
|
||||
return response
|
||||
|
||||
def get_serializer_class(self):
|
||||
if self.action == "names":
|
||||
return serializers.EnvsNameSerializer
|
||||
else:
|
||||
return super(EnvView, self).get_serializer_class()
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,3 +0,0 @@
|
|||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
|
@ -1,6 +0,0 @@
|
|||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class InterfacesConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'interfaces'
|
|
@ -1,34 +0,0 @@
|
|||
# Generated by Django 3.2.6 on 2021-09-13 16:08
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
('projects', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Interfaces',
|
||||
fields=[
|
||||
('id', models.AutoField(help_text='ID', primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('create_time', models.DateTimeField(auto_now_add=True, help_text='创建时间', verbose_name='创建时间')),
|
||||
('update_time', models.DateTimeField(auto_now=True, help_text='更新时间', verbose_name='更新时间')),
|
||||
('name', models.CharField(help_text='接口名称', max_length=200, unique=True, verbose_name='接口名称')),
|
||||
('tester', models.CharField(help_text='测试人员', max_length=50, verbose_name='测试人员')),
|
||||
('desc', models.TextField(blank=True, default='', help_text='描述', max_length=200, null=True, verbose_name='描述')),
|
||||
('project', models.ForeignKey(help_text='所属项目', on_delete=django.db.models.deletion.CASCADE, related_name='interfaces', to='projects.projects', verbose_name='所属项目')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': '接口表',
|
||||
'verbose_name_plural': '接口表',
|
||||
'db_table': 'tb_interfaces',
|
||||
'ordering': ['id'],
|
||||
},
|
||||
),
|
||||
]
|
Binary file not shown.
Binary file not shown.
|
@ -1,21 +0,0 @@
|
|||
from django.db import models
|
||||
from utils.base_models import BaseModel
|
||||
|
||||
|
||||
class Interfaces(BaseModel):
|
||||
# id = models.AutoField(primary_key=True, verbose_name="ID", help_text="ID")
|
||||
name = models.CharField(unique=True, max_length=200, help_text="接口名称", verbose_name="接口名称")
|
||||
tester = models.CharField(max_length=50, help_text="测试人员", verbose_name="测试人员")
|
||||
desc = models.TextField(help_text="描述", verbose_name="描述", null=True, blank=True, default="", max_length=200)
|
||||
project = models.ForeignKey("projects.Projects", on_delete=models.CASCADE, related_name="interfaces",
|
||||
help_text="所属项目", verbose_name="所属项目")
|
||||
|
||||
class Meta:
|
||||
"""内部类"""
|
||||
db_table = "tb_interfaces"
|
||||
verbose_name = "接口表"
|
||||
ordering = ["id"]
|
||||
verbose_name_plural = verbose_name
|
||||
|
||||
def __str__(self):
|
||||
return f"<{self.name}>"
|
|
@ -1,79 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# @Time : 2021/9/14 23:24
|
||||
# @Author : Flora.Chen
|
||||
# @File : serializers.py
|
||||
# @Software: PyCharm
|
||||
# @Desc:
|
||||
from rest_framework import serializers
|
||||
from .models import Interfaces
|
||||
from projects.models import Projects
|
||||
from configures.models import Configures
|
||||
from testcases.models import TestCases
|
||||
from projects.models import Projects
|
||||
|
||||
|
||||
class InterfacesModelSerializer(serializers.ModelSerializer):
|
||||
"""接口序列化器类"""
|
||||
project_id = serializers.PrimaryKeyRelatedField(queryset=Projects.objects.all(), label="所属项目id", help_text="所属项目id")
|
||||
project = serializers.SlugRelatedField(slug_field="name", read_only=True, label="所属项目名称", help_text="所属项目名称")
|
||||
|
||||
class Meta:
|
||||
model = Interfaces
|
||||
exclude = ("update_time",)
|
||||
extra_kwargs = {
|
||||
"name": {
|
||||
"error_messages": {"required": "请输入接口名称", "null": "接口名称不能为null", "blank": "接口名称不能为空字符串",
|
||||
"max_length": "接口名称长度不能超过200"}
|
||||
|
||||
},
|
||||
"tester": {
|
||||
"error_messages": {"required": "请输入测试人员", "null": "测试人员不能为null", "blank": "测试人员不能为空字符串",
|
||||
"max_length": "测试人员长度不能超过50"}
|
||||
},
|
||||
"desc": {
|
||||
"error_messages": {"max_length": "简要描述长度不能超过200"}
|
||||
},
|
||||
"project": {
|
||||
"error_messages": {"required": "请选择所属项目", }
|
||||
},
|
||||
"create_time": {
|
||||
"format": "%Y-%m-%d %H:%M:%S"
|
||||
}
|
||||
}
|
||||
|
||||
def to_internal_value(self, data):
|
||||
result = super(InterfacesModelSerializer, self).to_internal_value(data)
|
||||
result["project"] = result.pop("project_id")
|
||||
return result
|
||||
|
||||
|
||||
class TestcasesNameSerializer(serializers.ModelSerializer):
|
||||
"""获取用例名称"""
|
||||
|
||||
class Meta:
|
||||
model = TestCases
|
||||
fields = ('id', 'name')
|
||||
|
||||
|
||||
class TestCasesInterfaceSerializer(serializers.ModelSerializer):
|
||||
testcases = TestcasesNameSerializer(many=True)
|
||||
|
||||
class Meta:
|
||||
model = Interfaces
|
||||
fields = ("testcases", )
|
||||
|
||||
|
||||
class ConfiguresNameSerializer(serializers.ModelSerializer):
|
||||
"""获取配置名称"""
|
||||
|
||||
class Meta:
|
||||
model = Configures
|
||||
fields = ('id', 'name')
|
||||
|
||||
|
||||
class ConfiguresInterfaceSerializer(serializers.ModelSerializer):
|
||||
configures = ConfiguresNameSerializer(many=True)
|
||||
|
||||
class Meta:
|
||||
model = Interfaces
|
||||
fields = ("configures", )
|
|
@ -1,3 +0,0 @@
|
|||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
|
@ -1,14 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# @Time : 2021/8/31 23:20
|
||||
# @Author : Flora.Chen
|
||||
# @File : urls.py
|
||||
# @Software: PyCharm
|
||||
# @Desc:
|
||||
|
||||
from . import views
|
||||
from rest_framework import routers
|
||||
|
||||
router = routers.SimpleRouter()
|
||||
router.register(r"interfaces", views.InterfacesViewSet)
|
||||
urlpatterns = []
|
||||
urlpatterns += router.urls
|
|
@ -1,79 +0,0 @@
|
|||
import logging
|
||||
|
||||
from rest_framework.decorators import action
|
||||
from rest_framework.viewsets import ModelViewSet
|
||||
from .models import Interfaces
|
||||
from . import serializers
|
||||
from interfaces.models import Interfaces
|
||||
from testcases.models import TestCases
|
||||
from configures.models import Configures
|
||||
from rest_framework import filters
|
||||
from rest_framework import permissions
|
||||
from utils.mixins import GetDataMinxin
|
||||
|
||||
logger = logging.getLogger("mytest")
|
||||
|
||||
|
||||
class InterfacesViewSet(ModelViewSet, GetDataMinxin):
|
||||
"""接口"""
|
||||
queryset = Interfaces.objects.all()
|
||||
serializer_class = serializers.InterfacesModelSerializer
|
||||
filter_backends = [filters.SearchFilter, filters.OrderingFilter]
|
||||
search_fields = ['id', 'name', 'tester']
|
||||
ordering_fields = ['name', 'tester']
|
||||
permission_classes = [permissions.IsAuthenticated]
|
||||
|
||||
def list(self, request, *args, **kwargs):
|
||||
response = super().list(request, *args, **kwargs)
|
||||
for item in response.data["results"]:
|
||||
item["testcases"] = TestCases.objects.filter(interface_id=item.get("id")).count()
|
||||
item["configures"] = Configures.objects.filter(interface_id=item.get("id")).count()
|
||||
return response
|
||||
|
||||
@action(detail=False)
|
||||
def names(self, request, *args, **kwargs):
|
||||
"""获取所有接口的名称"""
|
||||
response = super().list(request, *args, **kwargs)
|
||||
logger.error(response.data)
|
||||
return response
|
||||
|
||||
# def get_data_by_ation(self, request, *args, **kwargs):
|
||||
# response = self.retrieve(request, *args, **kwargs)
|
||||
# response.data = response.data.get(self.action)
|
||||
# logger.error(response.data)
|
||||
# return response
|
||||
#
|
||||
# @action(detail=True, url_name="configs", url_path="configs")
|
||||
# def configures(self, request, *args, **kwargs):
|
||||
# """获取接口下的配置信息"""
|
||||
# return self.get_data_by_ation(request, *args, **kwargs)
|
||||
#
|
||||
# @action(detail=True)
|
||||
# def testcases(self, request, *args, **kwargs):
|
||||
# """获取接口下的配置信息"""
|
||||
# return self.get_data_by_ation(request, *args, **kwargs)
|
||||
|
||||
# ----------------- 使用继承的GetDataMinxin ------------------------ #
|
||||
@action(detail=True, url_name="configs", url_path="configs")
|
||||
def configures(self, request, *args, **kwargs):
|
||||
"""获取接口下的配置信息"""
|
||||
return self.get_data_by_ation(request, *args, **kwargs)
|
||||
|
||||
@action(detail=True)
|
||||
def testcases(self, request, *args, **kwargs):
|
||||
"""获取接口下的配置信息"""
|
||||
return self.get_data_by_ation(request, *args, **kwargs)
|
||||
|
||||
# ----------------- 使用继承的GetDataMinxin ------------------------ #
|
||||
|
||||
def get_serializer_class(self):
|
||||
if self.action == "names":
|
||||
return serializers.TestcasesNameSerializer
|
||||
elif self.action == "configs":
|
||||
return serializers.ConfiguresInterfaceSerializer
|
||||
elif self.action == "testcases":
|
||||
return serializers.TestCasesInterfaceSerializer
|
||||
else:
|
||||
return super().get_serializer_class()
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,3 +0,0 @@
|
|||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue