...
- Example: Adding fields to the component schema, as well as the api. What classes to change:
- Rest API:
- controller/ComponentController.java → @RestController()
- This is where you define the api commands
- @PostMapping, @GetMapping, @DeleteMapping
- mapper/ComponentMapper.java → @Mapper
- This is only made when you have a field that has fields of its own, and you need to map it to main schema
- Service:
- This is the backend logic that the rest api commands call
- service/ComponentService.java → @Service()
- ex: create() - check no conflict, check dependencies, then create the component and save to mongodb, then return the created component id back to user
- Repository:
- This is backend logic that extends MongoRepository for functions regarding the repository like 'boolean existsByName(string name)"
- repository/ComponentRepository.java
- Schema:
- model/Component.java
- dto/ComponentDTO.java → @Schema()
- This is where you define the db document schema
- dto/newComponentDTO.java →@Schema()
- What's the difference between componentDTO and newComponentDTO?
- Exception Handling:
- exception/ComponentAlreadyExists → @ResponseStatus
- exception/ComponentNotFound→ @ResponseStatus
- Testing:
- test/....../controller/ComponentControllerTest.java
- test/....../service/ComponentServiceTest.java
Proof of concept development
Used configMap to pass in information from backend to build container. So build container can echo the build parameters passed in
- Commands:
- kubectl create configmap build-config --from-file=build-request.
properties - kubectl describe configmaps build-config