forked from Aysenursasmaz/rentACar
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'Aysenursasmaz:main' into main
- Loading branch information
Showing
120 changed files
with
1,889 additions
and
842 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,3 +31,6 @@ build/ | |
|
||
### VS Code ### | ||
.vscode/ | ||
|
||
|
||
src\main\resources\application.properties |
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,6 +1,12 @@ | ||
# Java 19 base image | ||
FROM openjdk:19-alpine | ||
|
||
# Set the working directory | ||
WORKDIR /app | ||
|
||
# Add a volume pointing to /app | ||
VOLUME /app | ||
|
||
# Port 8080 will be exposed for the web server | ||
EXPOSE 8080 | ||
|
||
|
@@ -11,4 +17,5 @@ COPY target/pair-9-0.0.1-SNAPSHOT.jar app.jar | |
LABEL maintainer="[email protected]" | ||
|
||
# Run the JAR file | ||
ENTRYPOINT ["java","-jar","/app.jar"] | ||
#ENTRYPOINT ["java","-jar","/app.jar"] | ||
CMD ["java", "-jar", "my-java-app.jar"] |
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
23 changes: 14 additions & 9 deletions
23
pair-9/src/main/java/com/tobeto/pair9/controllers/ColorsController.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,47 +1,52 @@ | ||
package com.tobeto.pair9.controllers; | ||
|
||
import com.tobeto.pair9.core.utilities.results.DataResult; | ||
import com.tobeto.pair9.core.utilities.results.Result; | ||
import com.tobeto.pair9.core.utilities.results.BaseResponse; | ||
import com.tobeto.pair9.services.abstracts.ColorService; | ||
import com.tobeto.pair9.services.dtos.color.requests.AddColorRequest; | ||
import com.tobeto.pair9.services.dtos.color.requests.UpdateColorRequest; | ||
import com.tobeto.pair9.services.dtos.color.responses.GetListColorResponse; | ||
import jakarta.validation.Valid; | ||
import lombok.AllArgsConstructor; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.security.access.prepost.PreAuthorize; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
import java.util.List; | ||
|
||
@RestController | ||
@RequestMapping("/api/colors") | ||
@AllArgsConstructor | ||
|
||
@CrossOrigin | ||
public class ColorsController { | ||
|
||
private ColorService colorService; | ||
|
||
@GetMapping("/getAll") | ||
public DataResult<List<GetListColorResponse>> getAll(){ | ||
@PreAuthorize("hasAuthority('admin:read')") | ||
public BaseResponse<List<GetListColorResponse>> getAll(){ | ||
return colorService.getAll(); | ||
} | ||
|
||
|
||
@PostMapping("/add") | ||
@ResponseStatus(code = HttpStatus.CREATED) | ||
public Result add(@RequestBody @Valid AddColorRequest request){ | ||
@PreAuthorize("hasAuthority('admin:add')") | ||
public BaseResponse add(@RequestBody @Valid AddColorRequest request){ | ||
return colorService.add(request); | ||
} | ||
|
||
|
||
@PutMapping("/update") | ||
public Result update(@RequestBody @Valid UpdateColorRequest request){ | ||
@PreAuthorize("hasAuthority('admin:update')") | ||
public BaseResponse update(@RequestBody @Valid UpdateColorRequest request){ | ||
return colorService.update(request); | ||
} | ||
|
||
|
||
@DeleteMapping("{id}") | ||
public Result delete(@PathVariable int id){ | ||
@PreAuthorize("hasAuthority('admin:delete')") | ||
public BaseResponse delete(@PathVariable Integer id){ | ||
return colorService.delete(id); | ||
} | ||
|
||
|
||
|
||
} |
44 changes: 0 additions & 44 deletions
44
pair-9/src/main/java/com/tobeto/pair9/controllers/CorporateCustomersController.java
This file was deleted.
Oops, something went wrong.
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.