Commit 643bfd4a by 周田

mod:协议版本相关

parent d6ceee55
...@@ -59,4 +59,4 @@ class TableXproAllDevinfoSerializer(ModelSerializer): ...@@ -59,4 +59,4 @@ class TableXproAllDevinfoSerializer(ModelSerializer):
class Meta: class Meta:
model = TableXproAllDevinfo model = TableXproAllDevinfo
fields = '__all__' fields = '__all__'
\ No newline at end of file
from django.contrib import admin
# Register your models here.
from django.apps import AppConfig
class ProtocolVersionManageConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'protocol_version_manage'
# Generated by Django 3.2.19 on 2023-08-10 08:56
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='AllDevCmdDefineAndVersion',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('cmd_name', models.TextField()),
('cmd_type', models.TextField()),
('fieldindex', models.IntegerField()),
('fieldname', models.TextField()),
('fieldsize', models.IntegerField()),
('value', models.TextField()),
('minvalue', models.TextField()),
('maxvalue', models.TextField()),
('datatype', models.IntegerField()),
('operation_in', models.IntegerField()),
('operation_in_num', models.IntegerField()),
('operation_out', models.IntegerField()),
('operation_out_num', models.IntegerField()),
('operabo_in', models.IntegerField()),
('operabo_out', models.IntegerField()),
('lua_script_in', models.TextField()),
('lua_script_out', models.TextField()),
('version', models.TextField()),
],
options={
'db_table': 'AllDevCmdDefineAndVersion',
},
),
migrations.CreateModel(
name='AllProtocolChangeLog',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('protocol_name', models.TextField()),
('log', models.TextField()),
],
options={
'db_table': 'AllProtocolChangeLog',
},
),
migrations.CreateModel(
name='AllProtocolDefinAndVersion',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('protocol_name', models.TextField()),
('cmd_name', models.TextField()),
('cmd_type', models.TextField()),
('encode', models.TextField()),
('timing_cmd_cycle_period', models.IntegerField()),
('cmd_explain', models.TextField()),
('version', models.TextField()),
],
options={
'db_table': 'AllProtocolDefinAndVersion',
},
),
migrations.CreateModel(
name='CurrentDevVersion',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('protocol_name', models.TextField()),
('version', models.TextField()),
],
options={
'db_table': 'CurrentDevVersion',
},
),
]
# Generated by Django 3.2.19 on 2023-08-11 07:08
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('protocol_version_manage', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Test',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('json', models.TextField()),
],
options={
'db_table': 'Test',
},
),
]
from django.db import models
# Create your models here.
class AllDevCmdDefineAndVersion(models.Model):
id = models.AutoField(primary_key=True) # Field name made lowercase.
cmd_name = models.TextField() # Field name made lowercase.
cmd_type = models.TextField() # Field name made lowercase.
fieldindex = models.IntegerField() # Field name made lowercase.
fieldname = models.TextField() # Field name made lowercase.
fieldsize = models.IntegerField() # Field name made lowercase.
value = models.TextField()
minvalue = models.TextField() # Field name made lowercase.
maxvalue = models.TextField() # Field name made lowercase.
datatype = models.IntegerField() # Field name made lowercase.
operation_in = models.IntegerField()
operation_in_num = models.IntegerField()
operation_out = models.IntegerField()
operation_out_num = models.IntegerField()
operabo_in = models.IntegerField() # Field name made lowercase.
operabo_out = models.IntegerField() # Field name made lowercase.
lua_script_in = models.TextField() # Field name made lowercase.
lua_script_out = models.TextField() # Field name made lowercase.
version = models.TextField()
class Meta:
db_table = 'AllDevCmdDefineAndVersion'
class AllProtocolDefinAndVersion(models.Model):
id = models.AutoField(primary_key=True) # Field name made lowercase.
protocol_name = models.TextField() # Field name made lowercase.
cmd_name = models.TextField() # Field name made lowercase.
cmd_type = models.TextField() # Field name made lowercase.
encode = models.TextField() # Field name made lowercase.
timing_cmd_cycle_period = models.IntegerField() # Field name made lowercase.
cmd_explain = models.TextField() # Field name made lowercase.
version = models.TextField()
class Meta:
db_table = 'AllProtocolDefinAndVersion'
class CurrentDevVersion(models.Model):
id = models.AutoField(primary_key=True) # Field name made lowercase.
protocol_name = models.TextField() # Field name made lowercase.
version = models.TextField()
class Meta:
db_table = 'CurrentDevVersion'
class AllProtocolChangeLog(models.Model):
id = models.AutoField(primary_key=True) # Field name made lowercase.
protocol_name = models.TextField() # Field name made lowercase.
log = models.TextField()
class Meta:
db_table = 'AllProtocolChangeLog'
class Test(models.Model):
id = models.AutoField(primary_key=True)
json = models.TextField()
class Meta:
db_table = 'Test'
{ [{
"current_version": "20201223", "current_version": "20201223",
"cmds": [ "cmds": [
{ {
...@@ -21,4 +21,15 @@ ...@@ -21,4 +21,15 @@
"fields": ["field1", "field2", "field3"] "fields": ["field1", "field2", "field3"]
} }
] ]
} },
{
"explain": "XY置位指令格式",
"version": "20201223"
},
[
{
"version": "20201223",
"path": "/path/to/file"
}
]
]
from django.test import TestCase
# Create your tests here.
from django.shortcuts import render
from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework import status
# Create your views here.
...@@ -25,7 +25,7 @@ SECRET_KEY = 'django-insecure-68xzqkau2%ulw2t^tpfo0d8$+_8$5z2jixypnxv$#81l&0=)s0 ...@@ -25,7 +25,7 @@ SECRET_KEY = 'django-insecure-68xzqkau2%ulw2t^tpfo0d8$+_8$5z2jixypnxv$#81l&0=)s0
# SECURITY WARNING: don't run with debug turned on in production! # SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True DEBUG = True
ALLOWED_HOSTS = [] ALLOWED_HOSTS = ['*']
# Application definition # Application definition
...@@ -34,6 +34,7 @@ INSTALLED_APPS = [ ...@@ -34,6 +34,7 @@ INSTALLED_APPS = [
# 'daphne', # 'daphne',
# 'chat', # 'chat',
'device_data_op', 'device_data_op',
'protocol_version_manage',
'django.contrib.admin', 'django.contrib.admin',
'django.contrib.auth', 'django.contrib.auth',
......
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment