diff --git a/src/main/java/com/example/springdemo/controller/IndentController.java b/src/main/java/com/example/springdemo/controller/IndentController.java deleted file mode 100644 index 23481ab..0000000 --- a/src/main/java/com/example/springdemo/controller/IndentController.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.example.springdemo.controller; - -import com.example.springdemo.entities.Indent; -import com.example.springdemo.service.IndentService; -import jakarta.annotation.Resource; -import org.springframework.web.bind.annotation.*; - -@RestController -@RequestMapping("/indent") -public class IndentController { - @Resource - private IndentService indentService; - - @PostMapping("/add") - public Indent addIndent(@RequestBody Indent indent) { - return indentService.addIndent(indent); - } - - @DeleteMapping("/delete/{id}") - public void deleteIndent(@PathVariable Long id) { - indentService.deleteIndentById(id); - } - - @PutMapping("/update") - public Indent updateIndent(@RequestBody Indent indent) { - return indentService.updateIndent(indent); - } - - @GetMapping("/find") - public Iterable getIndent() { - return indentService.findAllIndents(); - } -} diff --git a/src/main/java/com/example/springdemo/service/IndentService.java b/src/main/java/com/example/springdemo/service/IndentService.java deleted file mode 100644 index 852edba..0000000 --- a/src/main/java/com/example/springdemo/service/IndentService.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.example.springdemo.service; - -import com.example.springdemo.entities.Indent; - -public interface IndentService { - Indent addIndent(Indent indent); - - void deleteIndentById(Long id); - - Indent updateIndent(Indent indent); - - Iterable findAllIndents(); -} diff --git a/src/main/java/com/example/springdemo/service/IndentServiceImpl.java b/src/main/java/com/example/springdemo/service/IndentServiceImpl.java deleted file mode 100644 index b487628..0000000 --- a/src/main/java/com/example/springdemo/service/IndentServiceImpl.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.example.springdemo.service; - -import com.example.springdemo.dao.IndentRepository; -import com.example.springdemo.entities.Indent; -import jakarta.annotation.Resource; -import org.springframework.stereotype.Service; - -@Service -public class IndentServiceImpl implements IndentService{ - @Resource - private IndentRepository indentRepository; - - @Override - public Indent addIndent(Indent indent) { - return indentRepository.save(indent); - } - - @Override - public void deleteIndentById(Long id) { - indentRepository.deleteById(id); - } - - @Override - public Indent updateIndent(Indent indent) { - return indentRepository.save(indent); - } - - @Override - public Iterable findAllIndents() { - return indentRepository.findAll(); - } -}