поудалял лишнее

This commit is contained in:
Николай 2023-04-21 00:06:22 +04:00
parent 0c89bb621d
commit 28e4942727
7 changed files with 0 additions and 81 deletions

View File

@ -3,7 +3,6 @@ package com.LabWork.app;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication @SpringBootApplication
public class AppApplication { public class AppApplication {
public static void main(String[] args) { public static void main(String[] args) {

View File

@ -38,19 +38,6 @@ public class MangaController {
.map(x -> new ReaderMangaDto(x)) .map(x -> new ReaderMangaDto(x))
.toList(); .toList();
} }
/*
@PostMapping
public MangaReaderDto createManga(@RequestParam("creatorId") Long creatorId,
@RequestParam("chapterCount") Integer chapterCount,
@RequestParam("mangaName") String mangaName) {
return new MangaReaderDto(mangaService.addManga(creatorId, chapterCount, mangaName), mangaService.getReader(creatorId));
}*/
/* @PutMapping("/{id}")
public MangaReaderDto updateManga(@PathVariable Long id,
@RequestParam("chapterCount") Integer chapterCount) {
return new MangaReaderDto(mangaService.updateManga(id, chapterCount), mangaService.getReader(id));
}*/
@DeleteMapping("/{id}") @DeleteMapping("/{id}")
public MangaDto deleteManga(@PathVariable Long id) { public MangaDto deleteManga(@PathVariable Long id) {

View File

@ -35,6 +35,4 @@ public class MangaMvcController {
.toList()); .toList());
return "mangaPage"; return "mangaPage";
} }
} }

View File

@ -1,13 +1,8 @@
package com.LabWork.app; package com.LabWork.app;
import org.springframework.boot.web.server.ErrorPage;
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
import org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.web.servlet.config.annotation.*; import org.springframework.web.servlet.config.annotation.*;
@Configuration @Configuration
public class WebConfiguration implements WebMvcConfigurer { public class WebConfiguration implements WebMvcConfigurer {
public static final String REST_API = "/api"; public static final String REST_API = "/api";

View File

@ -21,10 +21,6 @@
<label for="multipartFile" class="form-label">image</label> <label for="multipartFile" class="form-label">image</label>
<input type="file" id="multipartFile" th:name="multipartFile" accept="image/png, image/jpeg" class="form-control" required="true"/> <input type="file" id="multipartFile" th:name="multipartFile" accept="image/png, image/jpeg" class="form-control" required="true"/>
</div> </div>
<!-- <div class="mb-3">
<label for="image" class="form-label">image</label>
<input type="file" id="image" accept="image/png, image/jpeg" class="form-control" th:field="${mangaDto.image}" required="true"/>
</div>-->
<div class="mb-3"> <div class="mb-3">
<button type="submit" class="btn btn-primary button-fixed"> <button type="submit" class="btn btn-primary button-fixed">
<span th:if="${controller == 'creator/'}">Добавить</span> <span th:if="${controller == 'creator/'}">Добавить</span>

View File

@ -60,7 +60,6 @@
Удалить Удалить
</button> </button>
</form> </form>
</div> </div>
</div> </div>
</div> </div>
@ -68,28 +67,4 @@
</div> </div>
</div> </div>
</body> </body>
<!--<th:block layout:fragment="scripts">
<script>
let buttonAdd = document.getElementById("buttonAdd");
let selectCreatorId = document.getElementById("creatorId");
const host = "http://localhost:8080";
buttonAdd.addEventListener('click', function (event){
event.preventDefault();
create(selectCreatorId.value);
});
const create = async function (creatorId) {
const requestParams = {
method: "POST",
headers: {
"Content-Type": "application/json",
}
};
console.log(creatorId);
const response = await fetch(host + `/creatorAction?creatorId=${creatorId}`, requestParams);
return await response.json();
}
</script>
</th:block>-->
</html> </html>

View File

@ -27,9 +27,6 @@
</form> </form>
</div> </div>
</div> </div>
<div th:text="${errors}" class="margin-bottom alert-danger"></div> <div th:text="${errors}" class="margin-bottom alert-danger"></div>
<form action="#" th:action="@{/readerAction}" method="get"> <form action="#" th:action="@{/readerAction}" method="get">
<div class="col-sm-2 mb-3"> <div class="col-sm-2 mb-3">
@ -44,8 +41,6 @@
</button> </button>
</div> </div>
</form> </form>
<div class="row table-responsive text-white"> <div class="row table-responsive text-white">
<div th:each="manga: ${reader?.mangas}" class="d-flex flex-row flex-wrap flex-grow-1 align-items-center mt-3"> <div th:each="manga: ${reader?.mangas}" class="d-flex flex-row flex-wrap flex-grow-1 align-items-center mt-3">
<div class="me-3"> <div class="me-3">
@ -65,8 +60,6 @@
th:attr="onclick=|confirm('Удалить запись?') && document.getElementById('remove-${manga.id}').click()|"> th:attr="onclick=|confirm('Удалить запись?') && document.getElementById('remove-${manga.id}').click()|">
<i class="fa fa-trash" aria-hidden="true"></i> Удалить <i class="fa fa-trash" aria-hidden="true"></i> Удалить
</button> </button>
<!-- "${'/blah1/' + {object1.id} + '/blah2/' + {object2.id}}"
th:action="@{/readerAction/{readerId}/removeManga/{id}(id=${manga.id} readerId=${readerId})}"-->
<form th:action="@{'/readerAction/' + ${readerId} + '/removeManga/' + ${manga.id}}" method="post"> <form th:action="@{'/readerAction/' + ${readerId} + '/removeManga/' + ${manga.id}}" method="post">
<button th:id="'remove-' + ${manga.id}" type="submit" style="display: none"> <button th:id="'remove-' + ${manga.id}" type="submit" style="display: none">
Удалить Удалить
@ -79,28 +72,4 @@
</div> </div>
</div> </div>
</body> </body>
<!--<th:block layout:fragment="scripts">
<script>
let buttonAdd = document.getElementById("buttonAdd");
let selectReaderId = document.getElementById("readerId");
const host = "http://localhost:8080";
buttonAdd.addEventListener('click', function (event){
event.preventDefault();
create(selectReaderId.value);
});
const create = async function (readerId) {
const requestParams = {
method: "POST",
headers: {
"Content-Type": "application/json",
}
};
console.log(readerId);
const response = await fetch(host + `/readerAction?readerId=${readerId}`, requestParams);
return await response.json();
}
</script>
</th:block>-->
</html> </html>