Исправлен контроллер, создана одна страница для создателя, без скрипта

This commit is contained in:
Николай 2023-03-26 18:53:00 +04:00
parent 254ddf6f54
commit ef720bbc01
7 changed files with 75 additions and 39 deletions

Binary file not shown.

View File

@ -13,36 +13,60 @@
<body> <body>
<div id="root-div"> <div id="root-div">
<header> <header>
Calculator <div>
</header> <a href="catalog.html" class="text-white">Creator</a>
<div class="content-div"> <a href="search.html" class="text-white">Manga</a>
<a href="search.html" class="text-white">Reader</a>
</div>
</header>
<div class="content">
<h1>Creator</h1>
<form id="calculator-form"> <form id="calculator-form">
<label for="first" class="form-label">num1</label> <div class="d-flex justify-content-evenly mt-3">
<input type="number" class="form-control" value="0" id="first" /> <div class="col-sm-2">
<label for="second" class="form-label">num2</label> <label for="creatorId" class="form-label">creatorId</label>
<input type="number" class="form-control" value="0" id="second" /> <input type="number" class="form-control" value="0" id="creatorId" />
<select class="form-select" id="type"> </div>
<option value="int">Integer</option> <div class="col-sm-2">
<option value="string">String</option> <label for="mangaId" class="form-label">mangaId</label>
</select> <input type="number" class="form-control" value="0" id="mangaId" />
<label for="operation" class="form-label">Operation</label> </div>
<select class="form-select" id="operation"> <div class="col-sm-2">
<option value="sum">+</option> <label for="creatorName" class="form-label">creatorName</label>
<option value="difference">-</option> <input type="text" class="form-control" value="0" id="creatorName" />
<option value="multiplication">*</option> </div>
<option value="cont">/</option> <div class="col-sm-2">
</select> <label for="password" class="form-label">password</label>
<button type="button" class="btn btn-primary" id="calculate-button">Calculate</button> <input type="text" readonly class="form-control" id="password" />
<button type="button" class="btn btn-primary" id="binary-button">Binary</button> </div>
<div>
<label for="result" class="form-label">Result</label>
<input type="text" readonly class="form-control" id="result" />
</div> </div>
<div class="ms-5 me-5">
<label for="operation" class="form-label">Operation</label>
<select class="form-select" id="operation">
<option value="getCreator">find</option>
<option value="string">dinfAll</option>
<option value="int">create</option>
<option value="string">update</option>
<option value="int">delete</option>
</select>
<button type="button" class="mt-3 btn btn-primary" id="apply-button">APPLY</button>
</div>
</form> </form>
<div class="row table-responsive">
<table class="table mt-3">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">creatorName</th>
<th scope="col">password</th>
</tr>
</thead>
<tbody id="tbody">
</tbody>
</table>
</div>
</div> </div>
<footer>
Footer
</footer>
</div> </div>
<script src="script.js"></script> <script src="script.js"></script>
</body> </body>

View File

@ -24,6 +24,16 @@
"node": ">=6" "node": ">=6"
} }
}, },
"node_modules/@popperjs/core": {
"version": "2.11.7",
"resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.7.tgz",
"integrity": "sha512-Cr4OjIkipTtcXKjAsm8agyleBuDHvxzeBoa1v543lbv1YaIwQjESsVcmjiWiPEbC1FIeHOG/Op9kdCmAmiS3Kw==",
"peer": true,
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/popperjs"
}
},
"node_modules/ansi-styles": { "node_modules/ansi-styles": {
"version": "4.3.0", "version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",

View File

@ -30,6 +30,9 @@ header {
color: white; color: white;
font-weight: 700; font-weight: 700;
} }
a {
color: white;
}
footer { footer {
padding: 1em; padding: 1em;

View File

@ -1,7 +1,6 @@
/*
package com.LabWork.app.MangaStore.controller; package com.LabWork.app.MangaStore.controller;
import com.LabWork.app.MangaStore.Dto.CreatorDto; import com.LabWork.app.MangaStore.model.Dto.CreatorDto;
import com.LabWork.app.MangaStore.service.CreatorService; import com.LabWork.app.MangaStore.service.CreatorService;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -45,4 +44,4 @@ public class CreatorController {
public CreatorDto deleteCreator(@PathVariable Long id) { public CreatorDto deleteCreator(@PathVariable Long id) {
return new CreatorDto(creatorService.deleteCreator(id)); return new CreatorDto(creatorService.deleteCreator(id));
} }
}*/ }

View File

@ -1,8 +1,8 @@
/*
package com.LabWork.app.MangaStore.controller; package com.LabWork.app.MangaStore.controller;
import com.LabWork.app.MangaStore.Dto.MangaDto;
import com.LabWork.app.MangaStore.model.Default.Creator; import com.LabWork.app.MangaStore.model.Default.Creator;
import com.LabWork.app.MangaStore.model.Dto.MangaDto;
import com.LabWork.app.MangaStore.service.MangaService; import com.LabWork.app.MangaStore.service.MangaService;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -46,4 +46,4 @@ public class MangaController {
public MangaDto deleteManga(@PathVariable Long id) { public MangaDto deleteManga(@PathVariable Long id) {
return new MangaDto(mangaService.deleteManga(id)); return new MangaDto(mangaService.deleteManga(id));
} }
}*/ }

View File

@ -1,7 +1,7 @@
/*
package com.LabWork.app.MangaStore.controller; package com.LabWork.app.MangaStore.controller;
import com.LabWork.app.MangaStore.Dto.ReaderDto;
import com.LabWork.app.MangaStore.model.Dto.ReaderDto;
import com.LabWork.app.MangaStore.service.ReaderService; import com.LabWork.app.MangaStore.service.ReaderService;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -41,15 +41,15 @@ public class ReaderController {
return new ReaderDto(readerService.updateReader(id, readerName, password)); return new ReaderDto(readerService.updateReader(id, readerName, password));
} }
@PutMapping("/{id}") @PostMapping("/{id}/manga/{manga_id}")
public ReaderDto addManga(@PathVariable Long id, public ReaderDto addManga(@PathVariable Long id,
@RequestParam("mangaId") Long mangaId) { @PathVariable Long mangaId) {
return new ReaderDto(readerService.addManga(mangaId, id)); return new ReaderDto(readerService.addManga(mangaId, id));
} }
@PutMapping("/{id}") @PutMapping("/{id}/manga/{manga_id}")
public ReaderDto removeManga(@PathVariable Long id, public ReaderDto removeManga(@PathVariable Long id,
@RequestParam("mangaId") Long mangaId) { @PathVariable Long mangaId) {
return new ReaderDto(readerService.removeManga(mangaId, id)); return new ReaderDto(readerService.removeManga(mangaId, id));
} }
@ -57,4 +57,4 @@ public class ReaderController {
public ReaderDto deleteReader(@PathVariable Long id) { public ReaderDto deleteReader(@PathVariable Long id) {
return new ReaderDto(readerService.deleteReader(id)); return new ReaderDto(readerService.deleteReader(id));
} }
}*/ }