yf_yzl 2 vuotta sitten
vanhempi
commit
b4aa54bc5b
2 muutettua tiedostoa jossa 9 lisäystä ja 3 poistoa
  1. 6 1
      apps/apply_weather.py
  2. 3 2
      bigdataAPI/urls.py

+ 6 - 1
apps/apply_weather.py

@@ -81,4 +81,9 @@ class GetWeather(APIView):
         except Exception as e:
             print(e)
             return Response({"msg": "请联系管理员", "code": "50001"})
-        
+        
+
+class TestAPI(APIView):
+
+    def post(self, request):
+        return Response({"test": 111})

+ 3 - 2
bigdataAPI/urls.py

@@ -15,7 +15,7 @@ Including another URLconf
 """
 # from django.contrib import admin
 from django.urls import path, include
-from apps.apply_weather import GetWeather
+from apps.apply_weather import GetWeather, TestAPI
 
 urlpatterns = [
     # path('admin/', admin.site.urls),
@@ -24,5 +24,6 @@ urlpatterns = [
     path('equipment/', include('apps.Equipment.urls')),
     path('pestanalysis/', include('apps.PestAnalysis.urls')),
     path('qxzconfig/', include('apps.QxzApp.urls')),
-    path("yf_weather", GetWeather.as_view(), name="weather")
+    path("yf_weather", GetWeather.as_view(), name="weather"),
+    path("test", TestAPI.as_view(), name="test")
 ]