You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
613 B
30 lines
613 B
package core
|
|
|
|
import (
|
|
"fmt"
|
|
"time"
|
|
|
|
"shop-api/global"
|
|
"shop-api/initialize"
|
|
|
|
"go.uber.org/zap"
|
|
)
|
|
|
|
type server interface {
|
|
ListenAndServe() error
|
|
}
|
|
|
|
func RunWindowsServer() {
|
|
// 初始化redis服务
|
|
initialize.Redis()
|
|
Router := initialize.Routers()
|
|
|
|
address := fmt.Sprintf(":%d", global.MG_CONFIG.System.Addr)
|
|
s := initServer(address, Router)
|
|
// 保证文本顺序输出
|
|
// In order to ensure that the text order output can be deleted
|
|
time.Sleep(10 * time.Microsecond)
|
|
global.MG_LOG.Info("server run success on ", zap.String("address", address))
|
|
|
|
global.MG_LOG.Error(s.ListenAndServe().Error())
|
|
}
|
|
|