поудалял лишнее
This commit is contained in:
parent
0c89bb621d
commit
28e4942727
@ -3,7 +3,6 @@ package com.LabWork.app;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
|
||||
@SpringBootApplication
|
||||
public class AppApplication {
|
||||
public static void main(String[] args) {
|
||||
|
@ -38,19 +38,6 @@ public class MangaController {
|
||||
.map(x -> new ReaderMangaDto(x))
|
||||
.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}")
|
||||
public MangaDto deleteManga(@PathVariable Long id) {
|
||||
|
@ -35,6 +35,4 @@ public class MangaMvcController {
|
||||
.toList());
|
||||
return "mangaPage";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,13 +1,8 @@
|
||||
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.http.HttpStatus;
|
||||
import org.springframework.web.servlet.config.annotation.*;
|
||||
|
||||
@Configuration
|
||||
public class WebConfiguration implements WebMvcConfigurer {
|
||||
public static final String REST_API = "/api";
|
||||
|
@ -21,10 +21,6 @@
|
||||
<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"/>
|
||||
</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">
|
||||
<button type="submit" class="btn btn-primary button-fixed">
|
||||
<span th:if="${controller == 'creator/'}">Добавить</span>
|
||||
|
@ -60,7 +60,6 @@
|
||||
Удалить
|
||||
</button>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -68,28 +67,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</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>
|
@ -27,9 +27,6 @@
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div th:text="${errors}" class="margin-bottom alert-danger"></div>
|
||||
<form action="#" th:action="@{/readerAction}" method="get">
|
||||
<div class="col-sm-2 mb-3">
|
||||
@ -44,8 +41,6 @@
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
<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 class="me-3">
|
||||
@ -65,8 +60,6 @@
|
||||
th:attr="onclick=|confirm('Удалить запись?') && document.getElementById('remove-${manga.id}').click()|">
|
||||
<i class="fa fa-trash" aria-hidden="true"></i> Удалить
|
||||
</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">
|
||||
<button th:id="'remove-' + ${manga.id}" type="submit" style="display: none">
|
||||
Удалить
|
||||
@ -79,28 +72,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</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>
|
Loading…
Reference in New Issue
Block a user