【删除多余方法】

This commit is contained in:
weizhihong 2023-11-30 15:14:16 +08:00
parent a13f759c10
commit f2c13335c2
2 changed files with 0 additions and 22 deletions

View File

@ -4,12 +4,9 @@ import (
"flag" "flag"
"fmt" "fmt"
"log/slog" "log/slog"
"net"
"os" "os"
"strings"
"github.com/spf13/viper" "github.com/spf13/viper"
"joylink.club/bj-rtsts-server/dto"
) )
const ( const (
@ -148,23 +145,6 @@ func (c *RsspConfig) CheckAddress(srcAddr uint16, dstAddr uint16) bool {
var Config AppConfig var Config AppConfig
var SimulationId_prefix = (func() string {
ip := "127.0.0.1"
addrList, err := net.InterfaceAddrs()
if err != nil {
panic(dto.ErrorDto{Code: dto.DataOperationError, Message: err.Error()})
}
for _, address := range addrList {
if ipNet, ok := address.(*net.IPNet); ok && !ipNet.IP.IsLoopback() {
if ipNet.IP.To4() != nil {
ip = ipNet.IP.String()
}
}
}
ipArr := strings.Split(ip, ".")
return ipArr[2] + "_" + ipArr[3]
})()
// 获取配置文件名称,从运行flag参数config中获取若未提供使用默认'dev' // 获取配置文件名称,从运行flag参数config中获取若未提供使用默认'dev'
func getConfigName() string { func getConfigName() string {
configName := "" configName := ""

View File

@ -143,8 +143,6 @@ func stopThirdParty(s *memory.VerifySimulation) {
} }
func createSimulationId(projectId int32) string { func createSimulationId(projectId int32) string {
// // 当前服务器IP + 端口 + 项目
// return config.SimulationId_prefix + "_" + strconv.Itoa(config.Config.Server.Port) + "_" + strconv.Itoa(int(projectId))
// MQTT客户端id+项目 // MQTT客户端id+项目
return mqtt.GetClientId() + "_" + strconv.Itoa(int(projectId)) return mqtt.GetClientId() + "_" + strconv.Itoa(int(projectId))
} }