523096025 před 8 měsíci
rodič
revize
e842c1d18b

+ 2 - 5
musk/src/main/java/com/huimv/farm/musk/controller/DevEnergyController.java

@@ -7,11 +7,7 @@ import com.huimv.farm.musk.entity.BaseBuilding;
 import com.huimv.farm.musk.entity.DevEnergy;
 import com.huimv.farm.musk.service.IDevEnergyService;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import java.util.Map;
 
@@ -25,6 +21,7 @@ import java.util.Map;
  */
 @RestController
 @RequestMapping("/dev-energy")
+@CrossOrigin
 public class DevEnergyController {
 
     @Autowired

+ 2 - 5
musk/src/main/java/com/huimv/farm/musk/controller/DevEnvController.java

@@ -6,11 +6,7 @@ import com.huimv.farm.musk.common.utils.ResultCode;
 import com.huimv.farm.musk.entity.DevEnv;
 import com.huimv.farm.musk.service.IDevEnvService;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import java.util.Map;
 
@@ -24,6 +20,7 @@ import java.util.Map;
  */
 @RestController
 @RequestMapping("/dev-env")
+@CrossOrigin
 public class DevEnvController {
 
     @Autowired

+ 2 - 5
musk/src/main/java/com/huimv/farm/musk/controller/DevThresholdController.java

@@ -8,11 +8,7 @@ import com.huimv.farm.musk.entity.DevThreshold;
 import com.huimv.farm.musk.service.IDevEnvService;
 import com.huimv.farm.musk.service.IDevThresholdService;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import java.util.Map;
 
@@ -26,6 +22,7 @@ import java.util.Map;
  */
 @RestController
 @RequestMapping("/dev-threshold")
+@CrossOrigin
 public class DevThresholdController {
 
     @Autowired

+ 2 - 5
musk/src/main/java/com/huimv/farm/musk/controller/DevWarningController.java

@@ -6,11 +6,7 @@ import com.huimv.farm.musk.common.utils.ResultCode;
 import com.huimv.farm.musk.entity.DevWarning;
 import com.huimv.farm.musk.service.IDevWarningService;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import java.util.Map;
 
@@ -24,6 +20,7 @@ import java.util.Map;
  */
 @RestController
 @RequestMapping("/dev-warning")
+@CrossOrigin
 public class DevWarningController {
 
     @Autowired

+ 0 - 1
musk/src/main/java/com/huimv/farm/musk/service/impl/DevEnvServiceImpl.java

@@ -131,7 +131,6 @@ public class DevEnvServiceImpl extends ServiceImpl<DevEnvMapper, DevEnv> impleme
                     jsonObject.put("humi", "--");
                     jsonObject.put("tem", "--");
                     jsonObject.put("gas", "--");
-
                 }
                 jsonArray.add(jsonObject);
             }