Skip to content

Commit

Permalink
[#8] Final commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoine Aubert committed Dec 1, 2022
1 parent dd68b75 commit 5b904ab
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,20 @@
import com.theokanning.openai.completion.CompletionRequest;
import com.theokanning.openai.completion.CompletionResult;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.view.RedirectView;

import java.time.LocalDate;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.List;

@RestController
public class MessageController {
@Autowired
private MessageRepository repository;
final private String token1 = "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";
final private String token2 = "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";

final private String token = "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";
final private String token = "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";

final private boolean debug = true;
CompletionRequest request = new CompletionRequest();
String model = "text-davinci-002";
OpenAiService service = new OpenAiService(token);
Expand Down Expand Up @@ -96,7 +89,6 @@ public RedirectView addMessageandResponse(@RequestParam final String message) {
public RedirectView deleteMessage(@RequestParam Integer id) {
// add code to delete message
for (Message message : getMessages()) {
if (debug) String.format("Liste des messages : %s", message.getMessageText());

if (message.getId() == id) {
repository.delete(message);
Expand Down
Binary file added output/Diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added output/delMSG.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added output/demoMSG.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added output/dependancy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added output/loginPage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# JAVA Chat box :

This is a university project.

### Optional thinks :
Button place with bootstrap, add a login page with login.css -> colors and new font.

***

![login](./output/loginPage.png)

![demo](./output/demoMSG.png)

![del](./output/delMSG.png)

***
# class diagram :

![dep](./output/dependancy.png)

![diag](./output/Diagram.png)


# author :
Made by : Antoine Aubert
Teacher : Maria Terzi

0 comments on commit 5b904ab

Please sign in to comment.