|
@@ -4,8 +4,10 @@ import com.bosshand.virgo.api.model.Project;
|
|
import com.bosshand.virgo.api.service.ProjectItemTargetRoomService;
|
|
import com.bosshand.virgo.api.service.ProjectItemTargetRoomService;
|
|
import com.bosshand.virgo.api.service.ProjectService;
|
|
import com.bosshand.virgo.api.service.ProjectService;
|
|
import com.bosshand.virgo.api.service.QuartzService;
|
|
import com.bosshand.virgo.api.service.QuartzService;
|
|
|
|
+import com.bosshand.virgo.api.util.CityUtil;
|
|
import com.bosshand.virgo.core.config.OperationControllerLog;
|
|
import com.bosshand.virgo.core.config.OperationControllerLog;
|
|
import com.bosshand.virgo.core.response.Response;
|
|
import com.bosshand.virgo.core.response.Response;
|
|
|
|
+import com.bosshand.virgo.core.utils.HttpsUtils;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -112,4 +114,15 @@ public class ProjectController {
|
|
return Response.ok(projectService.bimList(id));
|
|
return Response.ok(projectService.bimList(id));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @ApiOperation(value = "获取天气", notes = "获取天气")
|
|
|
|
+ @RequestMapping(value = "/weather/{city}", method = RequestMethod.GET)
|
|
|
|
+ public Response bimList(@PathVariable String city) {
|
|
|
|
+ String code = CityUtil.getCode(city);
|
|
|
|
+ if (code != null) {
|
|
|
|
+ String url = "https://www.weatherol.cn/api/home/getCurrAnd15dAnd24h?cityid=" + code;
|
|
|
|
+ return Response.ok(HttpsUtils.getResult(url));
|
|
|
|
+ }
|
|
|
|
+ return Response.fail(200000, "未找到这个城市");
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|