Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
promotions-service
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
0
Merge Requests
0
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
Ascend
promotions-service
Commits
f30e23dd
Commit
f30e23dd
authored
May 05, 2021
by
Sumaiyya Burney
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds endpoint skeletons
parent
f27e4b90
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
3 deletions
+46
-3
PromotionsController.java
...um/ascend/promotions/controller/PromotionsController.java
+44
-2
application.properties
src/main/resources/application.properties
+2
-1
No files found.
src/main/java/com/nisum/ascend/promotions/controller/PromotionsController.java
View file @
f30e23dd
package
com
.
nisum
.
ascend
.
promotions
.
controller
;
package
com
.
nisum
.
ascend
.
promotions
.
controller
;
import
com.nisum.ascend.promotions.dto.PromotionDto
;
import
com.nisum.ascend.promotions.model.Promotion
;
import
com.nisum.ascend.promotions.repository.PromotionRepository
;
import
com.nisum.ascend.promotions.repository.PromotionRepository
;
import
com.nisum.ascend.promotions.service.PromotionService
;
import
com.nisum.ascend.promotions.service.PromotionService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
reactor.core.publisher.Flux
;
import
reactor.core.publisher.Mono
;
import
java.util.ArrayList
;
@RestController
@RestController
@RequestMapping
(
"/api/promos"
)
@RequestMapping
(
"/api/promos"
)
...
@@ -12,4 +18,40 @@ public class PromotionsController {
...
@@ -12,4 +18,40 @@ public class PromotionsController {
@Autowired
@Autowired
PromotionService
promotionService
;
PromotionService
promotionService
;
@GetMapping
()
public
Flux
<
ResponseEntity
<
PromotionDto
>>
getAllPromotions
(
@RequestParam
(
required
=
false
)
String
itemSku
){
//TODO: get all promos OR promos by item SKU
return
null
;
}
@GetMapping
(
"/{id}"
)
public
Mono
<
ResponseEntity
<
PromotionDto
>>
getPromotionById
(
@PathVariable
String
id
){
//TODO: get promo by ID
return
null
;
}
@PostMapping
()
public
Mono
<
ResponseEntity
<
PromotionDto
>>
createPromotion
(
@RequestBody
Promotion
newPromotion
){
//TODO: create promotion
return
null
;
}
@PostMapping
(
"/bulkSearch"
)
public
Flux
<
ResponseEntity
<
PromotionDto
>>
bulkSearchPromotionsByItemSku
(){
//TODO: bulk search by list of item SKUs
return
null
;
}
@PutMapping
(
"/{promoId}"
)
public
Mono
<
ResponseEntity
<
PromotionDto
>>
updatePromotionById
(
@PathVariable
String
promoId
,
@RequestBody
Promotion
newPromotion
){
//TODO: update promotion
return
null
;
}
@DeleteMapping
(
"/{promoId}"
)
public
Mono
<
ResponseEntity
<
PromotionDto
>>
deletePromotionById
(
@PathVariable
String
promoId
){
//TODO: delete promotion
return
null
;
}
}
}
src/main/resources/application.properties
View file @
f30e23dd
server.port
=
8081
server.port
=
8081
spring.data.mongodb.uri
=
mongodb+srv://admin:${db.password}@inventory-promotions.d4nfz.mongodb.net/products-promotions-db?retryWrites=true&w=majority
spring.data.mongodb.uri
=
mongodb+srv://admin:${db.password}@inventory-promotions.d4nfz.mongodb
\
.net/${spring.data.mongodb.database}?retryWrites=true&w=majority
spring.data.mongodb.database
=
products-promotions-db
spring.data.mongodb.database
=
products-promotions-db
\ 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