当前位置: 首页 > news >正文

自己ip做网站网站没有做301的后果是什么

自己ip做网站,网站没有做301的后果是什么,功能型网站开发价格,wordpress 显示选项打不开实现基于北斗卫星的车辆定位和轨迹图的Maven工程#xff08;使用模拟数据#xff09;#xff0c;我们将使用以下技术#xff1a; Spring Boot#xff1a;作为后端框架#xff0c;用来提供数据接口。Thymeleaf#xff1a;作为前端模板引擎#xff0c;呈现网页。Leaflet…实现基于北斗卫星的车辆定位和轨迹图的Maven工程使用模拟数据我们将使用以下技术 Spring Boot作为后端框架用来提供数据接口。Thymeleaf作为前端模板引擎呈现网页。Leaflet.js一个开源的JavaScript库用于显示交互式地图。Simulated Data使用随机生成的模拟GPS数据来模拟北斗卫星车辆位置。WebSocket用于实现实时数据推送确保地图位置每秒更新。 目录 1. 项目结构 2. Maven依赖配置 (pom.xml) 3. 实现后端服务 3.1 BeidouApplication.java 4. 配置文件 (application.properties) 5. 启动项目 6. 访问页面 1. 项目结构 创建一个Maven项目基本结构如下 项目结构图  2. Maven依赖配置 (pom.xml) 首先在pom.xml中添加必要的依赖确保使用Spring Boot、WebSocket和Thymeleaf dependencies!-- Spring Boot --dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-web/artifactId/dependency!-- Thymeleaf for rendering HTML --dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-thymeleaf/artifactId/dependency!-- WebSocket for real-time communication --dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-websocket/artifactId/dependency!-- Lombok (Optional, for cleaner code) --dependencygroupIdorg.projectlombok/groupIdartifactIdlombok/artifactIdscopeprovided/scope/dependency /dependencies3. 实现后端服务 3.1 BeidouApplication.java 这是Spring Boot的启动类 package com.example.beidou;import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;SpringBootApplication public class BeidouApplication {public static void main(String[] args) {SpringApplication.run(BeidouApplication.class, args);} }4. 配置文件 (application.properties) server.port8080 5. 启动项目 确保你有Java和Maven环境在项目根目录执行以下命令启动应用 mvn spring-boot:run 6. 访问页面 在浏览器中访问 http://localhost:8080你应该可以看到一个地图显示车辆的实时位置和轨迹更新。 效果图 Controller package com.example.beidou.controller;import org.springframework.beans.factory.annotation.Autowired; import org.springframework.messaging.simp.SimpMessagingTemplate; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController;import java.util.HashMap; import java.util.Map; import java.util.Random; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit;RestController public class VehicleController {private ScheduledExecutorService executorService Executors.newScheduledThreadPool(1);Autowiredprivate SimpMessagingTemplate messagingTemplate;private MapString, MapString, Double vehiclePositions new HashMapString, MapString, Double() {{put(Vehicle 1, new HashMapString, Double() {{put(latitude, 39.9042);//北京put(longitude, 116.4074);}});put(Vehicle 2, new HashMapString, Double() {{put(latitude, 31.2304);//上海put(longitude, 121.4737);}});put(Vehicle 3, new HashMapString, Double() {{put(latitude, 22.3964);// 香港put(longitude, 114.1095);}});put(Vehicle 4, new HashMapString, Double() {{put(latitude, 30.5728);//成都put(longitude, 104.0668);}});put(Vehicle 5, new HashMapString, Double() {{put(latitude, 34.3416);// 西安put(longitude, 108.9398);}});}};private MapString, MapString, Double vehicleTargets new HashMapString, MapString, Double() {{put(Vehicle 1, new HashMapString, Double() {{put(latitude, 31.2304);//上海put(longitude, 121.4737);}});put(Vehicle 2, new HashMapString, Double() {{put(latitude, 39.9042);//北京put(longitude, 116.4074);}});put(Vehicle 3, new HashMapString, Double() {{put(latitude, 34.3416);// 西安put(longitude, 108.9398);}});put(Vehicle 4, new HashMapString, Double() {{put(latitude, 22.3964);// 香港put(longitude, 114.1095);}});put(Vehicle 5, new HashMapString, Double() {{put(latitude, 30.5728);//成都put(longitude, 104.0668);}});}};GetMapping(/startSimulation)public String startSimulation() {executorService.scheduleAtFixedRate(this::sendVehicleUpdates, 0, 500, TimeUnit.MILLISECONDS);return Simulation started!;}GetMapping(/stopSimulation)public String stopSimulation() {executorService.shutdownNow();return Simulation stopped!;}private void sendVehicleUpdates() {MapString, MapString, Double updatedPositions new HashMap();for (Map.EntryString, MapString, Double entry : vehiclePositions.entrySet()) {String vehicleId entry.getKey();MapString, Double position entry.getValue();MapString, Double target vehicleTargets.get(vehicleId);// 按一定速度向目标移动double latDiff target.get(latitude) - position.get(latitude);double lonDiff target.get(longitude) - position.get(longitude);// 每次移动经纬度的 1/100double newLatitude position.get(latitude) latDiff * 0.02;double newLongitude position.get(longitude) lonDiff * 0.02;position.put(latitude, newLatitude);position.put(longitude, newLongitude);updatedPositions.put(vehicleId, new HashMap(position));}messagingTemplate.convertAndSend(/topic/vehicleLocation, updatedPositions);} }WebSocketConfig package com.example.beidou.config;import org.springframework.context.annotation.Configuration; import org.springframework.messaging.simp.config.MessageBrokerRegistry; import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker; import org.springframework.web.socket.config.annotation.StompEndpointRegistry; import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer;Configuration EnableWebSocketMessageBroker public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {Overridepublic void configureMessageBroker(MessageBrokerRegistry config) {config.enableSimpleBroker(/topic);config.setApplicationDestinationPrefixes(/app);}Overridepublic void registerStompEndpoints(StompEndpointRegistry registry) {registry.addEndpoint(/vehicle-location).setAllowedOriginPatterns(*).withSockJS();} }前端页面代码有需要的请私信我有偿提供代码白嫖党勿扰
http://www.hkea.cn/news/14345063/

相关文章:

  • 网站设计公司天津人和动物做的电影网站
  • 建设部网站查不到注册证怎么回事制作网页模板适应不同分辨率
  • 官方网站建设合同玉山电商网站建设
  • 网站建设论文500字万网域名查询官网
  • 网站目录结构头像字体图片制作
  • 北京品牌网站建设做网站 业务流程图
  • 网站建设电销职责南昌网站建设大全
  • 福州企业网站建站系统php论坛源码
  • 湖南建设监理官方网站福建微网站建设公司
  • 站群网站内容昆明企业网站制作公司
  • php网站开发说明文档上海网站建设yes404
  • 做爰全的网站做万词霸屏后网站关键词没有排名
  • 想学编程做网站有好看图片的软件网站模板
  • 郑州建设厅官方网站海南信息港官网
  • 长沙网站建设开发WordPress添加弹窗下载按钮
  • 太原网站建设开发公司申请建设部门网站的报告
  • 南乐网站建设电话wordpress后台自定义面版上传
  • 优秀的网页设计网站九一人才网
  • 外贸自助建站哪个好怎么促成客户做网站
  • 成都极客联盟网站建设公司自建网站 微信网页版
  • 能通过淘宝网站做淘宝客吗dedecms导航网站
  • 福田做网站公司影视传媒公司
  • 电商网站主题网站后台程序如何做
  • 社区网站 备案广州知名网站建设
  • 绥化市网站建设建设商务网站的方案
  • 中级网站开发工程师 试题一般使用的分辨率的显示密度最优是多少dpi
  • 山东济南网站建设公司如何建设网站视频教程
  • 微信网站开发需要什么知识windows7系统优化工具
  • 网站排行榜上升代码昌平网站制作公司
  • wordpress网站百度收录首页网站开发程序哪个好