Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
p x
wsmock
Commits
e0b269ab
Commit
e0b269ab
authored
Jan 22, 2026
by
p x
Browse files
增加获取电子围栏
parent
6314a96d
Changes
7
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
e0b269ab
#
wsmock
WebSockset 服务用来推送模拟数据
#
WebSockset 服务用来推送模拟数据
# main 分支
stomp协议是先链接后订阅是2步骤,前端要新增js依赖,修改代码
#
w
s_netty 分支
netty包实现的 websockset
#
ada
s_netty 分支
netty包实现的 websockset
8088是HTTP 接口 8089是websockset端口
build.gradle.kts
View file @
e0b269ab
...
...
@@ -7,13 +7,24 @@ plugins {
group
=
"com.inzy"
version
=
"1.0"
description
=
"
w
s 模拟"
description
=
"
ada
s 模拟
服务
"
// 禁用普通 JAR 打包
tasks
.
jar
{
enabled
=
false
}
// 配置 Spring Boot 可执行 JAR 的名称(核心配置)
tasks
.
bootJar
{
// 方式1:固定名称(推荐,简洁)
archiveFileName
.
set
(
"adasmock-${project.version}.jar"
)
// 可选:自定义输出目录(默认是 build/libs,无需修改可注释)
// destinationDirectory.set(file("${project.buildDir}/custom-libs"))
}
java
{
toolchain
{
languageVersion
=
JavaLanguageVersion
.
of
(
17
)
...
...
src/main/kotlin/com/inzy/wsmock/PushConfigController.kt
View file @
e0b269ab
package
com.inzy.wsmock
import
com.alibaba.fastjson2.JSON
import
com.inzy.wsmock.bean.DrFenceBean
import
com.inzy.wsmock.bean.NaviMockBean
import
com.inzy.wsmock.bean.ReqFence
import
org.springframework.web.bind.annotation.GetMapping
import
org.springframework.web.bind.annotation.PostMapping
import
org.springframework.web.bind.annotation.RequestBody
import
org.springframework.web.bind.annotation.RequestParam
import
org.springframework.web.bind.annotation.RestController
...
...
@@ -34,4 +39,14 @@ class PushConfigController(
return
naviMockBean
// return JSON.toJSONString(naviMockBean)
}
/**
* 查询电子围栏
*/
@PostMapping
(
"grid/findDrFence/list"
)
fun
findDrFence
(
@RequestBody
reqFence
:
ReqFence
):
DrFenceBean
{
val
json
=
"{\"code\":\"200\",\"msg\":\"访问成功\",\"data\":[{\"id\":\"1950831908083998722\",\"name\":\"dbaweilan\",\"geom\":[[[116.50231138432454,39.81011434693128],[116.50388119486416,39.80812411197068],[116.50172821496639,39.80705948884013],[116.50123998015493,39.808459773403555],[116.50067037287491,39.80938877575314],[116.50231138432454,39.81011434693128]]],\"fenceChildList\":[{\"drFenceId\":\"1950831908083998722\",\"smMapServiceId\":\"6\",\"name\":\"dba_yizhuang\",\"url\":\"https://172.29.128.52/browsemap/wms?service=WMS&version=1.1.0&request=GetMap&layers=dba:dba_yizhuang\",\"modelManagerId\":null,\"type\":\"wms\"},{\"drFenceId\":\"1950831908083998722\",\"smMapServiceId\":null,\"name\":\"yz_3dtiles\",\"url\":\"https://itg-yz.cu-sc.com:13443/gis_data/3dtiles/roadequip/FieldFacility/tileset.json\",\"modelManagerId\":\"1950744468250021890\",\"type\":\"3DTiles\"}]}]}"
val
drFenceBean
=
JSON
.
parseObject
(
json
,
DrFenceBean
::
class
.
java
)
return
drFenceBean
}
}
\ No newline at end of file
src/main/kotlin/com/inzy/wsmock/bean/DrFenceBean.kt
0 → 100644
View file @
e0b269ab
package
com.inzy.wsmock.bean
/**HTT[] 电子围栏查询
* {"code":"200","msg":"访问成功","data":[{"id":"1950831908083998722","name":"dbaweilan","geom":[[[116.49789875227462,39.810124904185365],[116.5028284885632,39.812207046441316],[116.50324062085743,39.81164694419902],[116.50205177770101,39.8110746611073],[116.50344668700454,39.809382136423196],[116.5039380755092,39.8095404318651],[116.50409658793005,39.80923601723024],[116.50365275315167,39.809077721087384],[116.50441361277177,39.80828623490569],[116.5055866046861,39.80878548109681],[116.50585607580153,39.808127936575865],[116.50312966216282,39.80692242195323],[116.50320891837325,39.806605818648634],[116.50270167862652,39.80635009953057],[116.50241635626897,39.80666670401275],[116.50121166187047,39.806155265278406],[116.50067271963958,39.80610655662909],[116.50040324852411,39.80659364156934],[116.50133847180717,39.80699548404725],[116.50026058734534,39.80850541660677],[116.49942047151481,39.808188820592],[116.49907174418891,39.808493239863935],[116.49992771126158,39.80883418784818],[116.49924610785187,39.80984484515198],[116.49827918208464,39.80945519590321],[116.49781949606417,39.80956478497766],[116.49789875227462,39.810124904185365]]],"fenceChildList":[{"drFenceId":"1950831908083998722","smMapServiceId":"6","name":"dba_yizhuang","url":"https://172.29.128.52/browsemap/wms?service=WMS&version=1.1.0&request=GetMap&layers=dba:dba_yizhuang","modelManagerId":null,"type":"wms"},{"drFenceId":"1950831908083998722","smMapServiceId":null,"name":"yz_3dtiles","url":"https://itg-yz.cu-sc.com:13443/gis_data/3dtiles/roadequip/FieldFacility/tileset.json","modelManagerId":"1950744468250021890","type":"3DTiles"}]}]}
* **/
data class
DrFenceBean
(
val
code
:
String
,
val
data
:
List
<
DrData
>,
val
msg
:
String
)
data class
DrData
(
val
fenceChildList
:
List
<
FenceChild
>,
val
geom
:
List
<
List
<
List
<
Double
>>>,
val
id
:
String
,
val
name
:
String
)
data class
FenceChild
(
val
drFenceId
:
String
,
val
modelManagerId
:
String
=
""
,
val
name
:
String
,
val
smMapServiceId
:
String
=
""
,
val
type
:
String
,
val
url
:
String
)
\ No newline at end of file
src/main/kotlin/com/inzy/wsmock/bean/ReqFence.kt
0 → 100644
View file @
e0b269ab
package
com.inzy.wsmock.bean
/**电子围栏请求体
* 名称 类型 说明 是否必须
* name string 地图服务名称 是
* location array 点 否
* routes array 路径 是
* **/
class
ReqFence
{
// var name = ""
// var vehicleId="123456"
//亦庄的点 116.50214284361187,39.809288066222247 39.80919,"longitude":116.5021861
// var location = listOf(116.50214284361187, 39.809288066222247)
var
location
:
List
<
Double
>?
=
null
//路径点串
var
routes
:
List
<
List
<
Double
>>?
=
null
}
src/main/kotlin/com/inzy/wsmock/push/AdasPushTask.kt
View file @
e0b269ab
...
...
@@ -159,7 +159,7 @@ class AdasPushTask(
delay
(
100
)
continue
}
if
(
carPos
==
30
)
{
//驶入 130
if
(
carPos
==
1
30
)
{
//驶入 130
if
(
isFence
.
compareAndSet
(
false
,
true
))
{
val
driveInOrOut
=
DriveInOrOut
().
apply
{
finished
=
true
...
...
src/main/resources/application.yaml
View file @
e0b269ab
...
...
@@ -3,7 +3,7 @@ spring:
encoding
:
UTF-8
application
:
name
:
w
smock
name
:
ada
smock
server
:
port
:
8088
servlet
:
...
...
@@ -28,7 +28,7 @@ logging:
# 日志文件配置
file
:
name
:
logs/
wsmock
.log
name
:
logs/
adas
.log
# 日志格式
pattern
:
...
...
@@ -39,7 +39,7 @@ logging:
max-file-size
:
10MB
max-history
:
30
total-size-cap
:
1GB
file-name-pattern
:
logs/
w
smock-.%d{yyyy-MM-dd}.%i.log
file-name-pattern
:
logs/
ada
smock-.%d{yyyy-MM-dd}.%i.log
# Netty WebSocket配置
netty
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment