feat:service mod

This commit is contained in:
2025-03-29 15:02:49 +08:00
parent d131495f4f
commit 922cfd6a02
7 changed files with 325 additions and 11 deletions

View File

@@ -59,11 +59,11 @@ func NotNil(values ...string) {
}
}
func PrintInfo(port int) {
func PrintInfo(ip string, port int) {
print.Success("[BSM - %s] Config Check Success.", vars.ServiceKey)
print.Info("[BSM - %s] Service Name: %s", vars.ServiceKey, vars.ServiceKey)
print.Info("[BSM - %s] Runtime Mode: %s", vars.ServiceKey, env.Runtime.Mode)
print.Info("[BSM - %s] Listen Addr: %s:%d", vars.ServiceKey, utils.GetLocationIP(), port)
print.Info("[BSM - %s] Listen Addr: %s:%d", vars.ServiceKey, ip, port)
}
func CheckPort(port int) int {
@@ -73,3 +73,10 @@ func CheckPort(port int) int {
}
return port
}
func CheckIP(ip string) string {
if ip == "" {
return utils.GetLocationIP()
}
return ip
}