Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
demo-project-git-operations
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Naren Medarametla
demo-project-git-operations
Commits
a412c8b8
Commit
a412c8b8
authored
May 22, 2020
by
Kali Padhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kpadhi@nisum@.com :: EPE-001 :: PromotionEngine :: Added code for promo service
parent
a7a24f9e
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
118 additions
and
3 deletions
+118
-3
.gitignore
.gitignore
+34
-0
buildOutputCleanup.lock
.gradle/buildOutputCleanup/buildOutputCleanup.lock
+0
-0
cache.properties
.gradle/buildOutputCleanup/cache.properties
+2
-2
outputFiles.bin
.gradle/buildOutputCleanup/outputFiles.bin
+0
-0
build.gradle
build.gradle
+1
-0
Promo.java
src/main/java/com/nisum/epe/demo/model/Promo.java
+29
-0
PromoEngineController.java
...a/com/nisum/epe/demo/resources/PromoEngineController.java
+51
-0
application.properties
src/main/resources/application.properties
+1
-1
No files found.
.gitignore
0 → 100644
View file @
a412c8b8
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**
!**/src/test/**
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
.gradle
*.iws
*.iml
*.ipr
build/
gradle/
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
### VS Code ###
.vscode/
.gradle/buildOutputCleanup/buildOutputCleanup.lock
View file @
a412c8b8
No preview for this file type
.gradle/buildOutputCleanup/cache.properties
View file @
a412c8b8
#Fri May 22 1
0:17:52
IST 2020
gradle.version
=
6.
2.1
#Fri May 22 1
6:37:00
IST 2020
gradle.version
=
6.
3
.gradle/buildOutputCleanup/outputFiles.bin
deleted
100644 → 0
View file @
a7a24f9e
File deleted
build.gradle
View file @
a412c8b8
...
...
@@ -14,6 +14,7 @@ repositories {
dependencies
{
implementation
'org.springframework.boot:spring-boot-starter-data-jpa'
implementation
'org.springframework.boot:spring-boot-starter-webflux'
implementation
'org.springframework.boot:spring-boot-starter-web'
runtimeOnly
'com.h2database:h2'
testImplementation
(
'org.springframework.boot:spring-boot-starter-test'
)
{
...
...
src/main/java/com/nisum/epe/demo/model/Promo.java
0 → 100644
View file @
a412c8b8
package
com
.
nisum
.
epe
.
demo
.
model
;
public
class
Promo
{
private
String
id
;
private
String
promoDesc
;
public
Promo
(
String
id
,
String
promoDesc
)
{
this
.
id
=
id
;
this
.
promoDesc
=
promoDesc
;
}
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
String
getPromoDesc
()
{
return
promoDesc
;
}
public
void
setPromoDesc
(
String
promoDesc
)
{
this
.
promoDesc
=
promoDesc
;
}
}
src/main/java/com/nisum/epe/demo/resources/PromoEngineController.java
0 → 100644
View file @
a412c8b8
package
com
.
nisum
.
epe
.
demo
.
resources
;
import
com.nisum.epe.demo.model.Promo
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RestController
;
import
reactor.core.Disposable
;
import
reactor.core.publisher.Flux
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.stream.Collectors
;
@RestController
public
class
PromoEngineController
{
@Autowired
PromoRepository
promoRepository
;
@GetMapping
(
"/promo"
)
public
Flux
<
List
<
Promo
>>
getPromo
()
{
return
promoRepository
.
findAll
();
}
@GetMapping
(
"/promo/{promoId}"
)
public
Flux
<
List
<
Promo
>>
getPromoById
(
@PathVariable
(
"promoId"
)
String
promoId
)
{
final
Flux
<
List
<
Promo
>>
listFlux
=
promoRepository
.
findAll
();
return
Flux
.
just
(
listFlux
.
blockFirst
().
stream
().
filter
(
promo
->
promo
.
getId
().
equalsIgnoreCase
(
promoId
)).
collect
(
Collectors
.
toList
()));
}
}
@Component
class
PromoRepository
{
public
Flux
<
List
<
Promo
>>
findAll
(){
List
<
Promo
>
promos
=
Arrays
.
asList
(
new
Promo
(
"1"
,
"BXGY"
),
new
Promo
(
"2"
,
"BXGX"
),
new
Promo
(
"3"
,
"%OFF"
));
return
Flux
.
just
(
promos
);
}
}
src/main/resources/application.properties
View file @
a412c8b8
server.port
=
9090
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment