adding ref

This commit is contained in:
Azmat-7860
2026-10-18 07:58:03 +05:30
parent 384751a225
commit 8a6c273983
12 changed files with 9 additions and 77 deletions
@@ -1,4 +1,4 @@
package com.realnet.io8ref.Xyz_back.Controllers; package com.realnet.io8ref.Xyz.Controllers;
import java.util.List; 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.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.realnet.Xyz_back.Entity.Xyz; import com.realnet.io8ref.Xyz.Entity.Xyz;
import com.realnet.Xyz_back.Services.XyzService; import com.realnet.io8ref.Xyz.Services.XyzService;
@RequestMapping(value = "/xyz") @RequestMapping(value = "/xyz")
@RestController @RestController
@@ -1,4 +1,4 @@
package com.realnet.io8ref.Xyz_back.Entity; package com.realnet.io8ref.Xyz.Entity;
import lombok.*; import lombok.*;
import javax.persistence.*; import javax.persistence.*;
import java.time.LocalDate; import java.time.LocalDate;
@@ -1,4 +1,4 @@
package com.realnet.io8ref.Xyz_back.Repository; package com.realnet.io8ref.Xyz.Repository;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
@@ -6,7 +6,7 @@ import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import com.realnet.io8ref.Xyz_back.Entity.Xyz; import com.realnet.io8ref.Xyz.Entity.Xyz;
@Repository @Repository
public interface XyzRepository extends JpaRepository<Xyz, Long> { public interface XyzRepository extends JpaRepository<Xyz, Long> {
@@ -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.Repository.XyzRepository;
import com.realnet.io8ref.Xyz_back.Entity.Xyz; import com.realnet.io8ref.Xyz.Entity.Xyz;
import java.util.List; import java.util.List;
import org.springframework.beans.factory.annotation.Autowired; 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);
}
}