diff --git a/testnewstack0008-back-b/authsec_springboot/backend/src/main/java/com/realnet/Builders/Services/BuilderService.java b/testnewstack0008-back-b/authsec_springboot/backend/src/main/java/com/realnet/Builders/Services/BuilderService.java index f9801fb..d07642a 100644 --- a/testnewstack0008-back-b/authsec_springboot/backend/src/main/java/com/realnet/Builders/Services/BuilderService.java +++ b/testnewstack0008-back-b/authsec_springboot/backend/src/main/java/com/realnet/Builders/Services/BuilderService.java @@ -69,6 +69,9 @@ public class BuilderService { executeDump(true); // ADD OTHER SERVICE +addCustomMenu( "Testa","Testa", "Transcations"); + + System.out.println("dashboard and menu inserted..."); diff --git a/testnewstack0008-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Controllers/TestaController.java b/testnewstack0008-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Controllers/TestaController.java new file mode 100644 index 0000000..610e041 --- /dev/null +++ b/testnewstack0008-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Controllers/TestaController.java @@ -0,0 +1,91 @@ +package com.realnet.basicp1.Controllers; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; + import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import com.fasterxml.jackson.core.JsonProcessingException; +import org.springframework.web.bind.annotation.CrossOrigin; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.realnet.config.EmailService; +import com.realnet.users.entity1.AppUser; +import com.realnet.users.service1.AppUserServiceImpl; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.springframework.data.domain.*; +import com.realnet.fnd.response.EntityResponse; +import org.springframework.http.*; +import org.springframework.beans.factory.annotation.*; +import com.realnet.basicp1.Entity.Testa; +import com.realnet.basicp1.Services.TestaService ; + + + + +@RequestMapping(value = "/Testa") + @CrossOrigin("*") +@RestController +public class TestaController { + @Autowired + private TestaService Service; + +@Value("${projectPath}") + private String projectPath; + + + + + + @PostMapping("/Testa") + public Testa Savedata(@RequestBody Testa data) { + Testa save = Service.Savedata(data) ; + + + + System.out.println("data saved..." + save); + + return save; + } +@PutMapping("/Testa/{id}") + public Testa update(@RequestBody Testa data,@PathVariable Integer id ) { + Testa update = Service.update(data,id); + System.out.println("data update..." + update); + return update; + } +// get all with pagination + @GetMapping("/Testa/getall/page") + public Page getall(@RequestParam(value = "page", required = false) Integer page, + @RequestParam(value = "size", required = false) Integer size) { + Pageable paging = PageRequest.of(page, size); + Page get = Service.getAllWithPagination(paging); + + return get; + + } + @GetMapping("/Testa") + public List getdetails() { + List get = Service.getdetails(); + return get; +} +// get all without authentication + + @GetMapping("/token/Testa") + public List getallwioutsec() { + List get = Service.getdetails(); + return get; +} +@GetMapping("/Testa/{id}") + public Testa getdetailsbyId(@PathVariable Integer id ) { + Testa get = Service.getdetailsbyId(id); + return get; + } +@DeleteMapping("/Testa/{id}") + public ResponseEntity delete_by_id(@PathVariable Integer id ) { + Service.delete_by_id(id); + return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK); + + } + + + + + +} \ No newline at end of file diff --git a/testnewstack0008-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Controllers/tokenFree_TestaController.java b/testnewstack0008-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Controllers/tokenFree_TestaController.java new file mode 100644 index 0000000..e9681af --- /dev/null +++ b/testnewstack0008-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Controllers/tokenFree_TestaController.java @@ -0,0 +1,91 @@ +package com.realnet.basicp1.Controllers; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; + import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import com.fasterxml.jackson.core.JsonProcessingException; +import org.springframework.web.bind.annotation.CrossOrigin; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.realnet.config.EmailService; +import com.realnet.users.entity1.AppUser; +import com.realnet.users.service1.AppUserServiceImpl; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.springframework.data.domain.*; +import com.realnet.fnd.response.EntityResponse; +import org.springframework.http.*; +import org.springframework.beans.factory.annotation.*; +import com.realnet.basicp1.Entity.Testa; +import com.realnet.basicp1.Services.TestaService ; + + + + +@RequestMapping(value = "/token/Testa") + @CrossOrigin("*") +@RestController +public class tokenFree_TestaController { + @Autowired + private TestaService Service; + +@Value("${projectPath}") + private String projectPath; + + + + + + @PostMapping("/Testa") + public Testa Savedata(@RequestBody Testa data) { + Testa save = Service.Savedata(data) ; + + + + System.out.println("data saved..." + save); + + return save; + } +@PutMapping("/Testa/{id}") + public Testa update(@RequestBody Testa data,@PathVariable Integer id ) { + Testa update = Service.update(data,id); + System.out.println("data update..." + update); + return update; + } +// get all with pagination + @GetMapping("/Testa/getall/page") + public Page getall(@RequestParam(value = "page", required = false) Integer page, + @RequestParam(value = "size", required = false) Integer size) { + Pageable paging = PageRequest.of(page, size); + Page get = Service.getAllWithPagination(paging); + + return get; + + } + @GetMapping("/Testa") + public List getdetails() { + List get = Service.getdetails(); + return get; +} +// get all without authentication + + @GetMapping("/token/Testa") + public List getallwioutsec() { + List get = Service.getdetails(); + return get; +} +@GetMapping("/Testa/{id}") + public Testa getdetailsbyId(@PathVariable Integer id ) { + Testa get = Service.getdetailsbyId(id); + return get; + } +@DeleteMapping("/Testa/{id}") + public ResponseEntity delete_by_id(@PathVariable Integer id ) { + Service.delete_by_id(id); + return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK); + + } + + + + + +} \ No newline at end of file diff --git a/testnewstack0008-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Entity/Testa.java b/testnewstack0008-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Entity/Testa.java new file mode 100644 index 0000000..6479a3b --- /dev/null +++ b/testnewstack0008-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Entity/Testa.java @@ -0,0 +1,29 @@ +package com.realnet.basicp1.Entity; + import lombok.*; +import com.realnet.WhoColumn.Entity.Extension; + import javax.persistence.*; + import java.time.LocalDateTime; + import java.util.*; + + + + + @Entity + @Data + public class Testa extends Extension { + /** + * + */ + private static final long serialVersionUID = 1L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + +private String name; + +@Column(length = 2000) +private String description; + + +} diff --git a/testnewstack0008-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Repository/TestaRepository.java b/testnewstack0008-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Repository/TestaRepository.java new file mode 100644 index 0000000..bc9e0fd --- /dev/null +++ b/testnewstack0008-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Repository/TestaRepository.java @@ -0,0 +1,28 @@ +package com.realnet.basicp1.Repository; + + +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; + +import org.springframework.stereotype.Repository; +import java.util.*; + + + + + + + +import com.realnet.basicp1.Entity.Testa; + +@Repository +public interface TestaRepository extends JpaRepository { + +@Query(value = "select * from testa where created_by=?1", nativeQuery = true) + List findAll(Long creayedBy); + +@Query(value = "select * from testa where created_by=?1", nativeQuery = true) + Page findAll( Long creayedBy,Pageable page); +} \ No newline at end of file diff --git a/testnewstack0008-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Services/TestaService.java b/testnewstack0008-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Services/TestaService.java new file mode 100644 index 0000000..116447c --- /dev/null +++ b/testnewstack0008-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Services/TestaService.java @@ -0,0 +1,83 @@ +package com.realnet.basicp1.Services; +import com.realnet.basicp1.Repository.TestaRepository; +import com.realnet.basicp1.Entity.Testa +;import java.util.*; + +import org.springframework.beans.factory.annotation.Autowired; +import com.realnet.SequenceGenerator.Service.SequenceService; +import org.springframework.data.domain.Page; +import com.realnet.realm.Entity.Realm; +import com.realnet.realm.Services.RealmService; +import org.springframework.data.domain.Pageable; +import org.springframework.http.*; +import com.realnet.users.service1.AppUserServiceImpl; +import com.realnet.users.entity1.AppUser; + + + + + import org.springframework.stereotype.Service; + +@Service + public class TestaService { +@Autowired +private TestaRepository Repository; + @Autowired + private AppUserServiceImpl userService; +@Autowired + private RealmService realmService; + + + +public Testa Savedata(Testa data) { + + + + + data.setUpdatedBy(getUser().getUserId()); + data.setCreatedBy(getUser().getUserId()); + data.setAccountId(getUser().getAccount().getAccount_id()); +Testa save = Repository.save(data); + return save; + } + + +// get all with pagination + public Page getAllWithPagination(Pageable page) { + return Repository.findAll( getUser().getUserId(),page); + } +public List getdetails() { + List realm = realmService.findByUserId(getUser().getUserId()); +List all = Repository.findAll(getUser().getUserId()); + + return all ; } + + +public Testa getdetailsbyId(Integer id) { + return Repository.findById(id).get(); + } + + + public void delete_by_id(Integer id) { + Repository.deleteById(id); +} + + +public Testa update(Testa data,Integer id) { + Testa old = Repository.findById(id).get(); +old.setName(data.getName()); + +old.setDescription(data.getDescription()); + +final Testa test = Repository.save(old); + data.setUpdatedBy(getUser().getUserId()); + return test;} + + + + + public AppUser getUser() { + AppUser user = userService.getLoggedInUser(); + return user; + + }} diff --git a/testnewstack0008-ds-d/authsec_mysql/mysql/wf_table/wf_table.sql b/testnewstack0008-ds-d/authsec_mysql/mysql/wf_table/wf_table.sql new file mode 100755 index 0000000..25687c9 --- /dev/null +++ b/testnewstack0008-ds-d/authsec_mysql/mysql/wf_table/wf_table.sql @@ -0,0 +1,2 @@ +CREATE TABLE ds.Testa(id BIGINT NOT NULL AUTO_INCREMENT, description VARCHAR(400), name VARCHAR(400), PRIMARY KEY (id)); + diff --git a/testnewstack0008-front-f/authsec_angular_clarity_modern/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/basicp1/Testa/Testa.component.html b/testnewstack0008-front-f/authsec_angular_clarity_modern/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/basicp1/Testa/Testa.component.html new file mode 100644 index 0000000..e57fbd9 --- /dev/null +++ b/testnewstack0008-front-f/authsec_angular_clarity_modern/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/basicp1/Testa/Testa.component.html @@ -0,0 +1,272 @@ + +
+
+
+
+

Testa

+
+
+
+ + +
+
+ + +
+
+ +
+
+
+ + +
+
+
+ + + + LOADING ... + +
{{error}}
+
+ + + + + + Name + + + + + + + + + Description + + + + + + + Action + + + + +{{user.name }} + + + + + + + + + + + +
Who Column
+
Account ID: {{user.accountId}}
+
Created At: {{user.createdAt| date}}
+
Created By: {{user.createdBy}}
+
Updated At: {{user.updatedAt | date}}
+
Updated By: {{user.updatedBy}}
+
+
+
+ + + + + + + + + + +
+ + + + Record per page + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} + of {{pagination.totalItems}} Records + + +
+ +
+
+
+ +
Name{{user.name}}
+ + +
Description{{user.description}}
+ + +
+ +
+
+ + + + + + + + + + + + +