init: 1.0.0
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package initialize
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/perfect-panel/ppanel-server/internal/config"
|
||||
"github.com/perfect-panel/ppanel-server/internal/svc"
|
||||
"github.com/perfect-panel/ppanel-server/pkg/logger"
|
||||
"github.com/perfect-panel/ppanel-server/pkg/tool"
|
||||
)
|
||||
|
||||
func Invite(ctx *svc.ServiceContext) {
|
||||
// Initialize the system configuration
|
||||
logger.Debug("Register config initialization")
|
||||
configs, err := ctx.SystemModel.GetInviteConfig(context.Background())
|
||||
if err != nil {
|
||||
logger.Error("[Init Invite Config] Get Invite Config Error: ", logger.Field("error", err.Error()))
|
||||
return
|
||||
}
|
||||
var inviteConfig config.InviteConfig
|
||||
tool.SystemConfigSliceReflectToStruct(configs, &inviteConfig)
|
||||
ctx.Config.Invite = inviteConfig
|
||||
}
|
||||
Reference in New Issue
Block a user