From 505eb01bb05d03699a54870c9fd275c138691c90 Mon Sep 17 00:00:00 2001 From: BINGWU Date: Mon, 25 Mar 2024 22:50:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- serve/.idea/.gitignore | 8 +++++ .../inspectionProfiles/Project_Default.xml | 12 ++++++++ .../inspectionProfiles/profiles_settings.xml | 6 ++++ serve/.idea/misc.xml | 7 +++++ serve/.idea/modules.xml | 8 +++++ serve/.idea/serve.iml | 30 +++++++++++++++++++ serve/.idea/vcs.xml | 6 ++++ serve/serve/models/employee.py | 0 serve/serve/models/feedback.py | 0 serve/serve/models/request.py | 0 serve/serve/models/reward.py | 0 serve/serve/models/user.py | 6 ++++ serve/serve/views/employee.py | 0 serve/serve/views/feedback.py | 0 serve/serve/views/index.py | 5 ++++ serve/serve/views/request.py | 0 serve/serve/views/reward.py | 0 serve/serve/views/user.py | 17 +++++++++++ 18 files changed, 105 insertions(+) create mode 100644 serve/.idea/.gitignore create mode 100644 serve/.idea/inspectionProfiles/Project_Default.xml create mode 100644 serve/.idea/inspectionProfiles/profiles_settings.xml create mode 100644 serve/.idea/misc.xml create mode 100644 serve/.idea/modules.xml create mode 100644 serve/.idea/serve.iml create mode 100644 serve/.idea/vcs.xml create mode 100644 serve/serve/models/employee.py create mode 100644 serve/serve/models/feedback.py create mode 100644 serve/serve/models/request.py create mode 100644 serve/serve/models/reward.py create mode 100644 serve/serve/models/user.py create mode 100644 serve/serve/views/employee.py create mode 100644 serve/serve/views/feedback.py create mode 100644 serve/serve/views/index.py create mode 100644 serve/serve/views/request.py create mode 100644 serve/serve/views/reward.py create mode 100644 serve/serve/views/user.py diff --git a/serve/.idea/.gitignore b/serve/.idea/.gitignore new file mode 100644 index 0000000..a7cdac7 --- /dev/null +++ b/serve/.idea/.gitignore @@ -0,0 +1,8 @@ +# 默认忽略的文件 +/shelf/ +/workspace.xml +# 基于编辑器的 HTTP 客户端请求 +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/serve/.idea/inspectionProfiles/Project_Default.xml b/serve/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..3dce9c6 --- /dev/null +++ b/serve/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,12 @@ + + + + \ No newline at end of file diff --git a/serve/.idea/inspectionProfiles/profiles_settings.xml b/serve/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/serve/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/serve/.idea/misc.xml b/serve/.idea/misc.xml new file mode 100644 index 0000000..94ebc5f --- /dev/null +++ b/serve/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/serve/.idea/modules.xml b/serve/.idea/modules.xml new file mode 100644 index 0000000..c798cfc --- /dev/null +++ b/serve/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/serve/.idea/serve.iml b/serve/.idea/serve.iml new file mode 100644 index 0000000..78b182a --- /dev/null +++ b/serve/.idea/serve.iml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/serve/.idea/vcs.xml b/serve/.idea/vcs.xml new file mode 100644 index 0000000..2e3f692 --- /dev/null +++ b/serve/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/serve/serve/models/employee.py b/serve/serve/models/employee.py new file mode 100644 index 0000000..e69de29 diff --git a/serve/serve/models/feedback.py b/serve/serve/models/feedback.py new file mode 100644 index 0000000..e69de29 diff --git a/serve/serve/models/request.py b/serve/serve/models/request.py new file mode 100644 index 0000000..e69de29 diff --git a/serve/serve/models/reward.py b/serve/serve/models/reward.py new file mode 100644 index 0000000..e69de29 diff --git a/serve/serve/models/user.py b/serve/serve/models/user.py new file mode 100644 index 0000000..0823cf5 --- /dev/null +++ b/serve/serve/models/user.py @@ -0,0 +1,6 @@ +import mongoengine + + +class UserModel(mongoengine.Document): + username = mongoengine.StringField(max_length=30) + password = mongoengine.StringField(max_length=30) diff --git a/serve/serve/views/employee.py b/serve/serve/views/employee.py new file mode 100644 index 0000000..e69de29 diff --git a/serve/serve/views/feedback.py b/serve/serve/views/feedback.py new file mode 100644 index 0000000..e69de29 diff --git a/serve/serve/views/index.py b/serve/serve/views/index.py new file mode 100644 index 0000000..7adf145 --- /dev/null +++ b/serve/serve/views/index.py @@ -0,0 +1,5 @@ +from serve.views.user import user_url + + +def initUrls(urlpatterns): + urlpatterns += user_url diff --git a/serve/serve/views/request.py b/serve/serve/views/request.py new file mode 100644 index 0000000..e69de29 diff --git a/serve/serve/views/reward.py b/serve/serve/views/reward.py new file mode 100644 index 0000000..e69de29 diff --git a/serve/serve/views/user.py b/serve/serve/views/user.py new file mode 100644 index 0000000..0d11075 --- /dev/null +++ b/serve/serve/views/user.py @@ -0,0 +1,17 @@ +from django.shortcuts import render, HttpResponse +from serve.models.user import UserModel +import json +from django.urls import path + + +def createUser(request): + print(request.method) + data = json.loads(request.body) + print(data.get('name')) + UserModel.objects.create(username='154782456', password='123456') + return HttpResponse("插入成功") + + +user_url = [ + path('user/create', createUser), +]