-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #57 from Blue-Bash/develop
FINISHED 1.0.0 👍
- Loading branch information
Showing
85 changed files
with
2,445 additions
and
1,616 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 0 additions & 15 deletions
15
demo/src/main/java/urlshortener/demo/config/HomeController.java
This file was deleted.
Oops, something went wrong.
23 changes: 23 additions & 0 deletions
23
demo/src/main/java/urlshortener/demo/config/LiveStatsConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package urlshortener.demo.config; | ||
|
||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.messaging.simp.config.MessageBrokerRegistry; | ||
import org.springframework.web.socket.config.annotation.AbstractWebSocketMessageBrokerConfigurer; | ||
import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker; | ||
import org.springframework.web.socket.config.annotation.StompEndpointRegistry; | ||
|
||
@Configuration | ||
@EnableWebSocketMessageBroker | ||
public class LiveStatsConfig extends AbstractWebSocketMessageBrokerConfigurer { | ||
|
||
@Override | ||
public void configureMessageBroker(MessageBrokerRegistry config) { | ||
config.enableSimpleBroker("/stats/live"); | ||
} | ||
|
||
@Override | ||
public void registerStompEndpoints(StompEndpointRegistry registry) { | ||
registry.addEndpoint("/live-stats").withSockJS(); | ||
} | ||
|
||
} |
23 changes: 0 additions & 23 deletions
23
demo/src/main/java/urlshortener/demo/config/PersistenceContext.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,10 @@ | ||
package urlshortener.demo.config; | ||
|
||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.ComponentScan; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.Import; | ||
import org.springframework.jdbc.core.JdbcTemplate; | ||
|
||
import urlshortener.demo.repository.ClickRepository; | ||
import urlshortener.demo.repository.ClickRepositoryImpl; | ||
import urlshortener.demo.repository.ShortURLRepository; | ||
import urlshortener.demo.repository.ShortURLRepositoryImpl; | ||
|
||
@Configuration | ||
@ComponentScan(basePackages = {"urlshortener.demo" }) | ||
@Import({JacksonConfiguration.class, SwaggerDocumentationConfig.class}) | ||
public class PersistenceContext { | ||
|
||
@Autowired | ||
protected JdbcTemplate jdbc; | ||
|
||
@Bean | ||
ShortURLRepository shortURLRepository() { | ||
return new ShortURLRepositoryImpl(jdbc); | ||
} | ||
|
||
@Bean | ||
ClickRepository clickRepository() { | ||
return new ClickRepositoryImpl(jdbc); | ||
} | ||
|
||
} |
35 changes: 35 additions & 0 deletions
35
demo/src/main/java/urlshortener/demo/config/RepositoryConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package urlshortener.demo.config; | ||
|
||
import io.micrometer.core.instrument.MeterRegistry; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import urlshortener.demo.domain.URIItem; | ||
import urlshortener.demo.repository.QRRepository; | ||
import urlshortener.demo.repository.URIRepository; | ||
import urlshortener.demo.repository.impl.QRRepositoryImpl; | ||
import urlshortener.demo.repository.impl.StatsRepositoryHook; | ||
import urlshortener.demo.repository.impl.URIRepositoryImpl; | ||
|
||
@Configuration | ||
public class RepositoryConfiguration { | ||
|
||
private final MeterRegistry metrics; | ||
|
||
@Autowired | ||
public RepositoryConfiguration(MeterRegistry metrics) { | ||
this.metrics = metrics; | ||
} | ||
|
||
@Bean("uriRepository") | ||
public URIRepository getURIRepository(){ | ||
StatsRepositoryHook<String, URIItem> statsHook = new StatsRepositoryHook<>(null, metrics, "uri"); | ||
return new URIRepositoryImpl(statsHook); | ||
} | ||
|
||
@Bean("qrRepository") | ||
public QRRepository getQRRepository(){ | ||
return new QRRepositoryImpl(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.