You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
632 B
Go

package base
import (
"context"
"git.noahlan.cn/n-admin/n-admin-server/rpc/core/types/core"
"git.noahlan.cn/n-admin/n-admin-server/api/internal/svc"
"net/http"
)
type InitDatabaseLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
r *http.Request
}
func NewInitDatabaseLogic(r *http.Request, ctx context.Context, svcCtx *svc.ServiceContext) *InitDatabaseLogic {
return &InitDatabaseLogic{
r: r,
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *InitDatabaseLogic) InitDatabase() error {
_, err := l.svcCtx.CoreRpc.InitDatabase(l.ctx, &core.Empty{})
if err != nil {
return err
}
return nil
}