public ResultData <IndexLibraryDto> LinkOrg(OrgIndexLinkDto linkDto)
        {
            if (Context.OrganizationIndices.Any(x => x.OrganizationId == linkDto.OrganizationId && x.IndexLibraryId == linkDto.IndexLibraryId))
            {
                return(new ResultData <IndexLibraryDto>(false, "已添加相同指标,不能重复添加!"));
            }

            var entity = new OrganizationIndex()
            {
                OrganizationIndexId = Guid.NewGuid(),
                OrganizationId      = linkDto.OrganizationId,
                IndexLibraryId      = linkDto.IndexLibraryId,
            };

            Context.Add(entity);
            Context.SaveChanges();

            var index = Context.IndexLibraries.FirstOrDefault(x => x.IndexLibraryId == linkDto.IndexLibraryId);

            return(new(Mapper.Map <IndexLibraryDto>(index)));
        }
Exemplo n.º 2
0
    public ExceptionlessElasticConfiguration(
        AppOptions appOptions,
        IQueue <WorkItemData> workItemQueue,
        JsonSerializerSettings serializerSettings,
        ICacheClient cacheClient,
        IMessageBus messageBus,
        IServiceProvider serviceProvider,
        ILoggerFactory loggerFactory
        ) : base(workItemQueue, cacheClient, messageBus, loggerFactory)
    {
        _appOptions         = appOptions;
        _serializerSettings = serializerSettings;

        _logger.LogInformation("All new indexes will be created with {ElasticsearchNumberOfShards} Shards and {ElasticsearchNumberOfReplicas} Replicas", _appOptions.ElasticsearchOptions.NumberOfShards, _appOptions.ElasticsearchOptions.NumberOfReplicas);
        AddIndex(Stacks        = new StackIndex(this));
        AddIndex(Events        = new EventIndex(this, serviceProvider, appOptions));
        AddIndex(Migrations    = new MigrationIndex(this, _appOptions.ElasticsearchOptions.ScopePrefix + "migrations", appOptions.ElasticsearchOptions.NumberOfReplicas));
        AddIndex(Organizations = new OrganizationIndex(this));
        AddIndex(Projects      = new ProjectIndex(this));
        AddIndex(Tokens        = new TokenIndex(this));
        AddIndex(Users         = new UserIndex(this));
        AddIndex(WebHooks      = new WebHookIndex(this));
    }
 public ProjectRepository(ElasticRepositoryContext <Project> context, OrganizationIndex index, ILoggerFactory loggerFactory = null) : base(context, index, loggerFactory)
 {
 }
Exemplo n.º 4
0
 public UserRepository(ElasticRepositoryContext <User> context, OrganizationIndex index, ILoggerFactory loggerFactory = null) : base(context, index, loggerFactory)
 {
 }
Exemplo n.º 5
0
 public ProjectRepository(ElasticRepositoryContext <Project> context, OrganizationIndex index) : base(context, index)
 {
 }
Exemplo n.º 6
0
 public OrganizationRepository(IElasticClient elasticClient, OrganizationIndex index, IValidator <Organization> validator = null, ICacheClient cacheClient = null, IMessagePublisher messagePublisher = null) : base(elasticClient, index, validator, cacheClient, messagePublisher)
 {
 }
Exemplo n.º 7
0
 public ApplicationRepository(ElasticRepositoryContext <Application> context, OrganizationIndex index, ILoggerFactory loggerFactory = null) : base(context, index, loggerFactory)
 {
 }
Exemplo n.º 8
0
 public WebHookRepository(ElasticRepositoryContext <WebHook> context, OrganizationIndex index, ILoggerFactory loggerFactory = null) : base(context, index, loggerFactory)
 {
 }
Exemplo n.º 9
0
 public ApplicationRepository(ElasticRepositoryContext <Application> context, OrganizationIndex index) : base(context, index)
 {
 }
Exemplo n.º 10
0
 public ProjectRepository(ElasticRepositoryContext <Project> context, OrganizationIndex index, ILoggerFactory loggerFactory = null) : base(context, index, loggerFactory)
 {
     DocumentsAdded.AddHandler(OnDocumentsAdded);
 }
Exemplo n.º 11
0
 public UserRepository(ElasticRepositoryContext <User> context, OrganizationIndex index) : base(context, index)
 {
 }
Exemplo n.º 12
0
 public WebHookRepository(ElasticRepositoryContext <WebHook> context, OrganizationIndex index) : base(context, index)
 {
 }
Exemplo n.º 13
0
 public TokenRepository(ElasticRepositoryContext <Token> context, OrganizationIndex index) : base(context, index)
 {
 }