Initial commit

This commit is contained in:
yan.y
2024-03-27 23:25:08 +08:00
commit 0884384e91
127 changed files with 9353 additions and 0 deletions
+46
View File
@@ -0,0 +1,46 @@
package web
import (
"pet-house.com/core/server/viper_server"
"pet-house.com/core/server/zap_server"
)
// init
func init() {
viper_server.Init(getViperConfig())
}
type WebBaseFunc interface {
AddWebStatic(staticAbsPath, webPrefix string, paths ...string)
AddUploadStatic(staticAbsPath, webPrefix string)
InitRouter() error
Run()
}
// WebFunc
// - GetTestClient
// - GetTestLogin
// - AddWebStatic
// - AddUploadStatic
// - Run
type WebFunc interface {
WebBaseFunc
}
// Start
func Start(wf WebFunc) {
err := wf.InitRouter()
if err != nil {
zap_server.ZAPLOG.Error(err.Error())
return
}
wf.Run()
}
// StartTest
func StartTest(wf WebFunc) {
err := wf.InitRouter()
if err != nil {
zap_server.ZAPLOG.Error(err.Error())
}
}