adding ref
This commit is contained in:
+3
-3
@@ -1,4 +1,4 @@
|
||||
package com.realnet.io8ref.Xyz_back.Controllers;
|
||||
package com.realnet.io8ref.Xyz.Controllers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -14,8 +14,8 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.realnet.Xyz_back.Entity.Xyz;
|
||||
import com.realnet.Xyz_back.Services.XyzService;
|
||||
import com.realnet.io8ref.Xyz.Entity.Xyz;
|
||||
import com.realnet.io8ref.Xyz.Services.XyzService;
|
||||
|
||||
@RequestMapping(value = "/xyz")
|
||||
@RestController
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.realnet.io8ref.Xyz_back.Entity;
|
||||
package com.realnet.io8ref.Xyz.Entity;
|
||||
import lombok.*;
|
||||
import javax.persistence.*;
|
||||
import java.time.LocalDate;
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
package com.realnet.io8ref.Xyz_back.Repository;
|
||||
package com.realnet.io8ref.Xyz.Repository;
|
||||
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
@@ -6,7 +6,7 @@ import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
|
||||
import com.realnet.io8ref.Xyz_back.Entity.Xyz;
|
||||
import com.realnet.io8ref.Xyz.Entity.Xyz;
|
||||
|
||||
@Repository
|
||||
public interface XyzRepository extends JpaRepository<Xyz, Long> {
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
package com.realnet.io8ref.Xyz_back.Services;
|
||||
package com.realnet.io8ref.Xyz.Services;
|
||||
|
||||
import com.realnet.io8ref.Xyz_back.Repository.XyzRepository;
|
||||
import com.realnet.io8ref.Xyz_back.Entity.Xyz;
|
||||
import com.realnet.io8ref.Xyz.Repository.XyzRepository;
|
||||
import com.realnet.io8ref.Xyz.Entity.Xyz;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -1,68 +0,0 @@
|
||||
package com.realnet.io8ref.Xyz_back.Controllers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.realnet.io8ref.Xyz_back.Entity.Xyz;
|
||||
import com.realnet.io8ref.Xyz_back.Services.XyzService;
|
||||
|
||||
@RequestMapping(value = "/xyz")
|
||||
@RestController
|
||||
public class XyzController {
|
||||
|
||||
@Autowired
|
||||
private XyzService Service;
|
||||
|
||||
// add data
|
||||
@PostMapping("/Xyz")
|
||||
public Xyz Savedata(@RequestBody Xyz data) {
|
||||
Xyz save = Service.Savedata(data);
|
||||
|
||||
return save;
|
||||
}
|
||||
|
||||
// get all
|
||||
@GetMapping("/Xyz")
|
||||
public List<Xyz> getdetails() {
|
||||
List<Xyz> get = Service.getdetails();
|
||||
|
||||
return get;
|
||||
}
|
||||
|
||||
// getby id
|
||||
@GetMapping("/Xyz/{id}")
|
||||
public Xyz getdetailsbyId(@PathVariable Long id) {
|
||||
Xyz get = Service.getdetailsbyId(id);
|
||||
|
||||
return get;
|
||||
}
|
||||
|
||||
// update by id
|
||||
@PutMapping("/Xyz/{id}")
|
||||
public Xyz update(@RequestBody Xyz data, @PathVariable Long id) {
|
||||
Xyz update = Service.update(data, id);
|
||||
|
||||
return update;
|
||||
}
|
||||
|
||||
// delete by id
|
||||
@DeleteMapping("/Xyz/{id}")
|
||||
public ResponseEntity<?> delete_by_id(@PathVariable Long id) {
|
||||
Service.delete_by_id(id);
|
||||
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user