调整目录结构

This commit is contained in:
walker 2023-10-26 17:16:07 +08:00
parent 0261158e06
commit b26f72f78a
35 changed files with 62 additions and 65 deletions

View File

@ -7,13 +7,13 @@ import (
jwt "github.com/appleboy/gin-jwt/v2"
"github.com/gin-gonic/gin"
"google.golang.org/protobuf/proto"
"joylink.club/bj-rtsts-server/ats/verify/protos/graphicData"
"joylink.club/bj-rtsts-server/ats/verify/simulation/wayside/memory"
"joylink.club/bj-rtsts-server/db/model"
"joylink.club/bj-rtsts-server/dto"
"joylink.club/bj-rtsts-server/middleware"
"joylink.club/bj-rtsts-server/service"
"joylink.club/bj-rtsts-server/sys_error"
"joylink.club/bj-rtsts-server/ts/protos/graphicData"
"joylink.club/bj-rtsts-server/ts/simulation/wayside/memory"
)
func InitDraftingRouter(api *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {

View File

@ -10,15 +10,15 @@ import (
jwt "github.com/appleboy/gin-jwt/v2"
"github.com/gin-gonic/gin"
"github.com/golang/protobuf/proto"
"joylink.club/bj-rtsts-server/ats/verify/protos/graphicData"
"joylink.club/bj-rtsts-server/ats/verify/protos/state"
"joylink.club/bj-rtsts-server/ats/verify/simulation"
"joylink.club/bj-rtsts-server/ats/verify/simulation/wayside/memory"
"joylink.club/bj-rtsts-server/dto"
"joylink.club/bj-rtsts-server/dto/request_proto"
"joylink.club/bj-rtsts-server/middleware"
"joylink.club/bj-rtsts-server/service"
"joylink.club/bj-rtsts-server/sys_error"
"joylink.club/bj-rtsts-server/ts"
"joylink.club/bj-rtsts-server/ts/protos/graphicData"
"joylink.club/bj-rtsts-server/ts/protos/state"
"joylink.club/bj-rtsts-server/ts/simulation/wayside/memory"
)
func InitSimulationRouter(api *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
@ -94,7 +94,7 @@ func createByProjectId(c *gin.Context) {
if runConfig != nil {
runConfigStr = runConfig.ConfigContent
}
simulationId, err := simulation.CreateSimulation(req.ProjectId, mapIds, runConfigStr)
simulationId, err := ts.CreateSimulation(req.ProjectId, mapIds, runConfigStr)
if err != nil {
panic(sys_error.New("测试启动失败", err))
}
@ -121,7 +121,7 @@ func createByProjectId(c *gin.Context) {
func destroy(c *gin.Context) {
simId := c.Param("id")
slog.Debug("ATS测试仿真-ATS仿真销毁 请求:", simId)
simulation.DestroySimulation(simId)
ts.DestroySimulation(simId)
c.JSON(http.StatusOK, "ok")
}
@ -140,7 +140,7 @@ func destroy(c *gin.Context) {
// @Failure 500 {object} dto.ErrorDto
// @Router /api/v1/simulation/list [get]
func findAllSimulations(c *gin.Context) {
c.JSON(http.StatusOK, simulation.ListAllSimulations())
c.JSON(http.StatusOK, ts.ListAllSimulations())
}
// ATS测试仿真地图数据校验
@ -501,7 +501,7 @@ func relayOperation(c *gin.Context) {
// 获取仿真设备数据并返回
func checkDeviceDataAndReturn(simId string) *memory.VerifySimulation {
deviceMemory := simulation.FindSimulation(simId)
deviceMemory := ts.FindSimulation(simId)
if deviceMemory == nil {
panic(sys_error.New(fmt.Sprintf("仿真[%s]不存在", simId)))
}

View File

@ -1,5 +0,0 @@
package atsVerify
//ats 测试
type Context struct {
}

View File

@ -1,6 +1,6 @@
package dto
import "joylink.club/bj-rtsts-server/ats/verify/protos/graphicData"
import "joylink.club/bj-rtsts-server/ts/protos/graphicData"
type PageDraftingReqDto struct {
PageQueryDto

View File

@ -1,8 +1,8 @@
package dto
import (
"joylink.club/bj-rtsts-server/ats/verify/protos/state"
"joylink.club/bj-rtsts-server/dto/request_proto"
"joylink.club/bj-rtsts-server/ts/protos/state"
)
// 创建仿真请求

View File

@ -4,10 +4,10 @@ import (
"time"
"google.golang.org/protobuf/proto"
"joylink.club/bj-rtsts-server/ats/verify/protos/state"
"joylink.club/bj-rtsts-server/ats/verify/simulation"
"joylink.club/bj-rtsts-server/config"
"joylink.club/bj-rtsts-server/dto"
"joylink.club/bj-rtsts-server/ts"
"joylink.club/bj-rtsts-server/ts/protos/state"
)
var MemoryChangeServerSuffix = "serve-data"
@ -28,7 +28,7 @@ func (t *MemoryChangeServer) getInterval() time.Duration {
// 定时发送数据
func (t *MemoryChangeServer) onTick() []TopicMsg {
simArr := simulation.GetSimulationArr()
simArr := ts.GetSimulationArr()
addArr, delArr := []*state.SimulationStatus{}, []*state.SimulationStatus{}
// 增加的仿真
allSim := make(map[string]bool)

View File

@ -6,10 +6,10 @@ import (
"time"
"google.golang.org/protobuf/proto"
"joylink.club/bj-rtsts-server/ats/verify/protos/graphicData"
"joylink.club/bj-rtsts-server/ats/verify/simulation"
"joylink.club/bj-rtsts-server/ats/verify/simulation/wayside/memory"
"joylink.club/bj-rtsts-server/dto"
"joylink.club/bj-rtsts-server/ts"
"joylink.club/bj-rtsts-server/ts/protos/graphicData"
"joylink.club/bj-rtsts-server/ts/simulation/wayside/memory"
)
type SimulationIBPServer struct{}
@ -26,7 +26,7 @@ func (t *SimulationIBPServer) getInterval() time.Duration {
// 定时发送数据
func (t *SimulationIBPServer) onTick() []TopicMsg {
simArr := simulation.GetSimulationArr()
simArr := ts.GetSimulationArr()
var msgArr []TopicMsg
for _, v := range simArr {
for _, mapId := range v.MapIds {

View File

@ -6,10 +6,10 @@ import (
"time"
"google.golang.org/protobuf/proto"
"joylink.club/bj-rtsts-server/ats/verify/protos/graphicData"
"joylink.club/bj-rtsts-server/ats/verify/simulation"
"joylink.club/bj-rtsts-server/ats/verify/simulation/wayside/memory"
"joylink.club/bj-rtsts-server/dto"
"joylink.club/bj-rtsts-server/ts"
"joylink.club/bj-rtsts-server/ts/protos/graphicData"
"joylink.club/bj-rtsts-server/ts/simulation/wayside/memory"
)
type SimulationPSLServer struct{}
@ -26,7 +26,7 @@ func (t *SimulationPSLServer) getInterval() time.Duration {
// 定时发送数据
func (t *SimulationPSLServer) onTick() []TopicMsg {
simArr := simulation.GetSimulationArr()
simArr := ts.GetSimulationArr()
var msgArr []TopicMsg
for _, v := range simArr {
for _, mapId := range v.MapIds {

View File

@ -6,8 +6,8 @@ import (
"time"
"google.golang.org/protobuf/proto"
"joylink.club/bj-rtsts-server/ats/verify/simulation"
"joylink.club/bj-rtsts-server/dto"
"joylink.club/bj-rtsts-server/ts"
)
type SimulationServer struct{}
@ -24,7 +24,7 @@ func (t *SimulationServer) getInterval() time.Duration {
// 定时发送数据
func (t *SimulationServer) onTick() []TopicMsg {
simArr := simulation.GetSimulationArr()
simArr := ts.GetSimulationArr()
var msgArr []TopicMsg
for _, v := range simArr {
for _, mapId := range v.MapIds {

View File

@ -7,10 +7,10 @@ import (
"time"
"google.golang.org/protobuf/proto"
"joylink.club/bj-rtsts-server/ats/verify/protos/graphicData"
"joylink.club/bj-rtsts-server/ats/verify/protos/state"
"joylink.club/bj-rtsts-server/ats/verify/simulation/wayside/memory"
"joylink.club/bj-rtsts-server/message_server/ms_api"
"joylink.club/bj-rtsts-server/ts/protos/graphicData"
"joylink.club/bj-rtsts-server/ts/protos/state"
"joylink.club/bj-rtsts-server/ts/simulation/wayside/memory"
)
// 综合后备盘IBP消息服务

View File

@ -5,10 +5,10 @@ import (
"time"
"google.golang.org/protobuf/proto"
"joylink.club/bj-rtsts-server/ats/verify/protos/graphicData"
"joylink.club/bj-rtsts-server/ats/verify/protos/state"
"joylink.club/bj-rtsts-server/ats/verify/simulation/wayside/memory"
"joylink.club/bj-rtsts-server/message_server/ms_api"
"joylink.club/bj-rtsts-server/ts/protos/graphicData"
"joylink.club/bj-rtsts-server/ts/protos/state"
"joylink.club/bj-rtsts-server/ts/simulation/wayside/memory"
"joylink.club/ecs"
"joylink.club/rtsssimulation/component"
"joylink.club/rtsssimulation/entity"

View File

@ -4,9 +4,9 @@ import (
"sync"
"time"
"joylink.club/bj-rtsts-server/ats/verify/simulation/wayside/memory"
"joylink.club/bj-rtsts-server/message_server/ms_api"
"joylink.club/bj-rtsts-server/message_server/ms_manage"
"joylink.club/bj-rtsts-server/ts/simulation/wayside/memory"
)
var smsMap sync.Map

View File

@ -6,7 +6,7 @@ import (
"testing"
"google.golang.org/protobuf/proto"
"joylink.club/bj-rtsts-server/ats/verify/protos/graphicData"
"joylink.club/bj-rtsts-server/ts/protos/graphicData"
proto2 "joylink.club/rtsssimulation/repository/model/proto"
)

View File

@ -5,11 +5,11 @@ import (
"sync"
"time"
"joylink.club/bj-rtsts-server/ats/verify/simulation/wayside/memory"
"joylink.club/bj-rtsts-server/db/dbquery"
"joylink.club/bj-rtsts-server/db/model"
"joylink.club/bj-rtsts-server/dto"
"joylink.club/bj-rtsts-server/dto/publishedGi"
"joylink.club/bj-rtsts-server/ts/simulation/wayside/memory"
)
var publishMapMutex sync.Mutex

View File

@ -5,7 +5,7 @@ import (
"math"
"time"
"joylink.club/bj-rtsts-server/ats/verify/protos/state"
"joylink.club/bj-rtsts-server/ts/protos/state"
)
// 接收到的列车控制信息

View File

@ -9,8 +9,8 @@ import (
"sort"
"strings"
"joylink.club/bj-rtsts-server/ats/verify/protos/graphicData"
"joylink.club/bj-rtsts-server/dto"
"joylink.club/bj-rtsts-server/ts/protos/graphicData"
)
// 参与计算的坡度与曲度均为正线公里标,如果有其他坐标系需要转换

View File

@ -1,8 +1,8 @@
package memory
import (
"joylink.club/bj-rtsts-server/ats/verify/protos/graphicData"
"joylink.club/bj-rtsts-server/ats/verify/protos/state"
"joylink.club/bj-rtsts-server/ts/protos/graphicData"
"joylink.club/bj-rtsts-server/ts/protos/state"
"joylink.club/ecs"
"joylink.club/rtsssimulation/component"
"joylink.club/rtsssimulation/entity"

View File

@ -12,12 +12,12 @@ import (
proto2 "joylink.club/rtsssimulation/repository/model/proto"
"google.golang.org/protobuf/proto"
"joylink.club/bj-rtsts-server/ats/verify/protos/graphicData"
"joylink.club/bj-rtsts-server/ats/verify/protos/state"
"joylink.club/bj-rtsts-server/db/dbquery"
"joylink.club/bj-rtsts-server/db/model"
"joylink.club/bj-rtsts-server/dto"
"joylink.club/bj-rtsts-server/sys_error"
"joylink.club/bj-rtsts-server/ts/protos/graphicData"
"joylink.club/bj-rtsts-server/ts/protos/state"
)
var (

View File

@ -4,8 +4,8 @@ import (
"fmt"
"sync"
"joylink.club/bj-rtsts-server/ats/verify/protos/graphicData"
"joylink.club/bj-rtsts-server/dto"
"joylink.club/bj-rtsts-server/ts/protos/graphicData"
"joylink.club/rtsssimulation/repository"
)

View File

@ -1,8 +1,8 @@
package memory
import (
"joylink.club/bj-rtsts-server/ats/verify/protos/graphicData"
"joylink.club/bj-rtsts-server/ats/verify/protos/state"
"joylink.club/bj-rtsts-server/ts/protos/graphicData"
"joylink.club/bj-rtsts-server/ts/protos/state"
"joylink.club/rtsssimulation/component"
"joylink.club/rtsssimulation/entity"
)

View File

@ -1,8 +1,8 @@
package memory
import (
"joylink.club/bj-rtsts-server/ats/verify/protos/graphicData"
"joylink.club/bj-rtsts-server/ats/verify/protos/state"
"joylink.club/bj-rtsts-server/ts/protos/graphicData"
"joylink.club/bj-rtsts-server/ts/protos/state"
"joylink.club/rtsssimulation/component"
"joylink.club/rtsssimulation/entity"
"joylink.club/rtsssimulation/fi"

View File

@ -1,15 +1,16 @@
package memory
import (
"joylink.club/bj-rtsts-server/ats/verify/protos/graphicData"
"joylink.club/bj-rtsts-server/ats/verify/protos/state"
"log/slog"
"joylink.club/bj-rtsts-server/dto"
"joylink.club/bj-rtsts-server/dto/request_proto"
"joylink.club/bj-rtsts-server/ts/protos/graphicData"
"joylink.club/bj-rtsts-server/ts/protos/state"
"joylink.club/ecs"
"joylink.club/rtsssimulation/component"
"joylink.club/rtsssimulation/entity"
"joylink.club/rtsssimulation/fi"
"log/slog"
)
func GetMapAllSectionState(sim *VerifySimulation, mapId int32) []*state.SectionState {

View File

@ -2,10 +2,12 @@ package memory
import (
"fmt"
"joylink.club/bj-rtsts-server/ats/verify/protos/graphicData"
"joylink.club/bj-rtsts-server/ats/verify/protos/state"
"log/slog"
"joylink.club/bj-rtsts-server/dto"
"joylink.club/bj-rtsts-server/dto/request_proto"
"joylink.club/bj-rtsts-server/ts/protos/graphicData"
"joylink.club/bj-rtsts-server/ts/protos/state"
"joylink.club/ecs"
"joylink.club/rtsssimulation/component"
"joylink.club/rtsssimulation/component/component_proto"
@ -14,7 +16,6 @@ import (
"joylink.club/rtsssimulation/fi"
"joylink.club/rtsssimulation/repository"
"joylink.club/rtsssimulation/repository/model/proto"
"log/slog"
)
func ChangeSignalState(simulation *VerifySimulation, req *dto.SignalOperationReqDto) {

View File

@ -1,8 +1,8 @@
package memory
import (
"joylink.club/bj-rtsts-server/ats/verify/protos/graphicData"
"joylink.club/bj-rtsts-server/ats/verify/protos/state"
"joylink.club/bj-rtsts-server/ts/protos/graphicData"
"joylink.club/bj-rtsts-server/ts/protos/state"
"joylink.club/rtsssimulation/component"
"joylink.club/rtsssimulation/entity"
"joylink.club/rtsssimulation/fi"

View File

@ -11,7 +11,7 @@ import (
"joylink.club/bj-rtsts-server/third_party/message"
"google.golang.org/protobuf/proto"
"joylink.club/bj-rtsts-server/ats/verify/protos/state"
"joylink.club/bj-rtsts-server/ts/protos/state"
)
// 增加列车状态

View File

@ -9,9 +9,9 @@ import (
"joylink.club/rtsssimulation/entity"
"joylink.club/rtsssimulation/fi"
"joylink.club/bj-rtsts-server/ats/verify/protos/graphicData"
"joylink.club/bj-rtsts-server/ats/verify/protos/state"
"joylink.club/bj-rtsts-server/dto/request_proto"
"joylink.club/bj-rtsts-server/ts/protos/graphicData"
"joylink.club/bj-rtsts-server/ts/protos/state"
)
// 处理道岔操作

View File

@ -14,8 +14,6 @@ import (
rtss_simulation "joylink.club/rtsssimulation"
"joylink.club/bj-rtsts-server/ats/verify/protos/graphicData"
"joylink.club/bj-rtsts-server/ats/verify/protos/state"
"joylink.club/bj-rtsts-server/config"
"joylink.club/bj-rtsts-server/dto"
"joylink.club/bj-rtsts-server/sys_error"
@ -23,6 +21,8 @@ import (
"joylink.club/bj-rtsts-server/third_party/interlock"
"joylink.club/bj-rtsts-server/third_party/message"
"joylink.club/bj-rtsts-server/third_party/semi_physical_train"
"joylink.club/bj-rtsts-server/ts/protos/graphicData"
"joylink.club/bj-rtsts-server/ts/protos/state"
"joylink.club/ecs"
"joylink.club/rtsssimulation/fi"
"joylink.club/rtsssimulation/repository"

View File

@ -1,13 +1,13 @@
package simulation
package ts
import (
"strconv"
"sync"
"joylink.club/bj-rtsts-server/ats/verify/simulation/wayside/memory"
"joylink.club/bj-rtsts-server/config"
"joylink.club/bj-rtsts-server/message_server"
"joylink.club/bj-rtsts-server/sys_error"
"joylink.club/bj-rtsts-server/ts/simulation/wayside/memory"
"joylink.club/bj-rtsts-server/dto"
)