|
|
@@ -10,14 +10,21 @@ import (
|
|
|
func NewApplication(conf application.Config) *application.App {
|
|
|
// 创建API
|
|
|
apiConfig := conf.ApiConfig
|
|
|
- apiInstance := api.New(api.WithUrlPrefix(apiConfig.UrlPrefix),
|
|
|
+ apiOptions := []api.Option{
|
|
|
+ api.WithUrlPrefix(apiConfig.UrlPrefix),
|
|
|
api.WithPort(apiConfig.Port),
|
|
|
api.WithLogSkipPaths(apiConfig.LogSkipPaths...),
|
|
|
- api.WithDumpPermissionItemsOption(&api.DumpPermissionItemsOption{
|
|
|
+ }
|
|
|
+
|
|
|
+ if conf.DumpPermissionItem != nil {
|
|
|
+ apiOptions = append(apiOptions, api.WithDumpPermissionItemsOption(&api.DumpPermissionItemsOption{
|
|
|
Namespace: conf.DumpPermissionItem.Namespace,
|
|
|
Gateway: conf.DumpPermissionItem.Gateway,
|
|
|
SaveDir: conf.DumpPermissionItem.SaveDir,
|
|
|
}))
|
|
|
+ }
|
|
|
+
|
|
|
+ apiInstance := api.New(apiOptions...)
|
|
|
|
|
|
// 创建基础设施
|
|
|
infrastructureConfig := new(infrastructure.Config)
|