UPDATE
This commit is contained in:
+4
-4
@@ -107,7 +107,7 @@ class IrrigationMethodListCreateView(APIView):
|
||||
class IrrigationRecommendView(APIView):
|
||||
"""
|
||||
توصیه آبیاری به صورت مستقیم.
|
||||
POST با sensor_uuid، plant_name، growth_stage، irrigation_method_name.
|
||||
POST با farm_uuid، plant_name، growth_stage، irrigation_method_name.
|
||||
اطلاعات گیاه از plant app و روش آبیاری از irrigation app دریافت میشود.
|
||||
"""
|
||||
|
||||
@@ -139,7 +139,7 @@ class IrrigationRecommendView(APIView):
|
||||
OpenApiExample(
|
||||
"نمونه درخواست",
|
||||
value={
|
||||
"sensor_uuid": "550e8400-e29b-41d4-a716-446655440000",
|
||||
"farm_uuid": "550e8400-e29b-41d4-a716-446655440000",
|
||||
"plant_name": "گوجهفرنگی",
|
||||
"growth_stage": "گلدهی",
|
||||
"irrigation_method_name": "آبیاری قطرهای",
|
||||
@@ -159,7 +159,7 @@ class IrrigationRecommendView(APIView):
|
||||
)
|
||||
|
||||
validated = serializer.validated_data
|
||||
sensor_uuid = validated["sensor_uuid"]
|
||||
farm_uuid = validated["farm_uuid"]
|
||||
plant_name = validated.get("plant_name")
|
||||
growth_stage = validated.get("growth_stage")
|
||||
irrigation_method_name = validated.get("irrigation_method_name")
|
||||
@@ -167,7 +167,7 @@ class IrrigationRecommendView(APIView):
|
||||
|
||||
try:
|
||||
result = get_irrigation_recommendation(
|
||||
sensor_uuid=sensor_uuid,
|
||||
farm_uuid=farm_uuid,
|
||||
plant_name=plant_name,
|
||||
growth_stage=growth_stage,
|
||||
irrigation_method_name=irrigation_method_name,
|
||||
|
||||
Reference in New Issue
Block a user