Commit 46cca7ea authored by aray's avatar aray

initial commit

parent 69726bf2
{
"Changes": [
{
"Action": "CREATE",
"ResourceRecordSet": {
"Name": "DNS_NAME",
"Type": "CNAME",
"TTL": 60,
"ResourceRecords": [
{
"Value": "DNS_VALUE"
}
]
}
}
]
}
\ No newline at end of file
{
"Changes": [
{
"Action": "DELETE",
"ResourceRecordSet": {
"Name": "DNS_NAME",
"Type": "CNAME",
"TTL": 60,
"ResourceRecords": [
{
"Value": "DNS_VALUE"
}
]
}
}
]
}
\ No newline at end of file
FROM openjdk:8-alpine
ADD /target/playground-assessment-demo-0.0.1-SNAPSHOT.jar //
ENTRYPOINT ["java", "-jar", "/playground-assessment-demo-0.0.1-SNAPSHOT.jar"]
version: '3.3'
services:
db:
image: mysql:8.0.17
container_name: pg-mysql-db
environment:
- MYSQL_ROOT_PASSWORD=sa
- MYSQL_USER=admin
- MYSQL_PASSWORD=sa
- MYSQL_DATABASE=playground
ports:
- "3306:3306"
restart: always
demo:
image: playground-assessment-demo
container_name: playground-assessment-demo
build: .
ports:
- "1099:1099"
restart: always
depends_on:
- db
environment:
SPRING_DATASOURCE_URL: jdbc:mysql://pg-mysql-db:3306/playground?createDatabaseIfNotExist=true
SPRING_DATASOURCE_USERNAME: admin
SPRING_DATASOURCE_PASSWORD: sa
\ No newline at end of file
......@@ -10,11 +10,11 @@
</parent>
<groupId>com.altimetrik</groupId>
<artifactId>demo</artifactId>
<artifactId>playground-assessment-demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>PlaygroundCandidateDemo</name>
<description>PlaygroundCandidateDemo</description>
<name>PlaygroundAssessmentDemo</name>
<description>PlaygroundAssessmentDemo</description>
<properties>
......@@ -22,30 +22,11 @@
</properties>
<dependencies>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>1.5.20</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>3.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>3.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
......@@ -61,6 +42,13 @@
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.github.ulisesbocchio</groupId>
<artifactId>jasypt-spring-boot-starter</artifactId>
<version>3.0.3</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
......
/**
* Copyright (C) Altimetrik 2018. All rights reserved.
*
* This software is the confidential and proprietary information
* of Altimetrik. You shall not disclose such Confidential Information
* and shall use it only in accordance with the terms and conditions
* entered into with Altimetrik.
*/
package com.altimetrik.config;
import static springfox.documentation.builders.PathSelectors.regex;
import java.util.Collections;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
/**
*
* @author MMelavanki
*
*/
@Configuration
@EnableSwagger2
public class SwaggerConfig {
// Production closes swagger
private boolean enableSwagger=true;
@Bean
public Docket productApi() {
return new Docket(DocumentationType.SWAGGER_2).select().apis(RequestHandlerSelectors.basePackage("com.altimetrik.controllers")).paths(regex("/.*")).build()
.enable(enableSwagger).apiInfo(metaData());
}
private ApiInfo metaData() {
return new ApiInfo("Playground Application", "Playground API Services", "2.0",
"https://www.altimetrik.com/privacy-policy/", new Contact("Playground", "https://playground.altimetrik.com", "pg-mgr1@altimetrik.com"),
"Apache License Version 2.0", "https://www.apache.org/licenses/LICENSE-2.0", Collections.emptyList());
}
}
package com.altimetrik.controllers;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping(value = "/hello")
public class Hello {
@GetMapping(value = "/", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.ALL_VALUE)
public ResponseEntity<String> getUserDetailByGitlabEmailId() {
return new ResponseEntity<>("Wecome to Playground...", HttpStatus.OK);
}
}
package com.altimetrik;
package com.altimetrik.playground.candidate.assessment;
import com.ulisesbocchio.jasyptspringboot.annotation.EnableEncryptableProperties;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class Application {
@EnableEncryptableProperties
@Slf4j
public class PlaygroundAssessmentDemoApplication {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
SpringApplication.run(PlaygroundAssessmentDemoApplication.class, args);
log.info("PlaygroundCandidateDemo app has been started successfully ...");
}
}
package com.altimetrik.playground.candidate.assessment.controller;
public class AdminDbConsoleController {
}
# Spring properties
spring:
application:
name: PlaygroundCandidateDemo # Service registers under this name
freemarker:
enabled: false # Ignore Eureka dashboard FreeMarker templates
# HTTP Server
server:
port: 1099 # HTTP (Tomcat) port
servlet.contextPath: /
undertow:
accesslog:
enabled: true
# Logging configurations
logging:
level:
root: INFO
com.memorynotfound: DEBUG
org.springframework.web: INFO
org.springframework.security: INFO
org.hibernate.SQL: WARN
article:
fileName : validator.json
\ No newline at end of file
[
{
"id": 1,
"title": "SAMPLE APPLICATION",
"description": "It is a Sample Demo Application",
"tags": [
"JAVA",
"SPRING"
],
"vote": 1,
"createdBy": "pg-ta@altimetrik.com",
"createdDate": "01-12-2018",
"updatedBy": null,
"updatedDate": null
},
{
"id": 2,
"title": "secod APPLICATION",
"description": "It is a Sample Demo Application",
"tags": [
"JAVA",
"SPRING"
],
"vote": 2,
"createdDate": "01-12-2018",
"createdBy": "pg-ta@altimetrik.com",
"updatedDate": null,
"updatedBy": null
},
{
"id": 3,
"title": "secod APPLICATION",
"description": "It is a Sample Demo Application",
"tags": [
"JAVA",
"SPRING"
],
"vote": 0,
"createdDate": "01-12-2018",
"createdBy": "pg-ta@altimetrik.com",
"updatedDate": null,
"updatedBy": null
}
]
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment