diff --git a/testmodern-back-b/authsec_springboot/backend/src/main/java/com/realnet/Builders/Services/BuilderService.java b/testmodern-back-b/authsec_springboot/backend/src/main/java/com/realnet/Builders/Services/BuilderService.java index 2ae85df..2771e77 100644 --- a/testmodern-back-b/authsec_springboot/backend/src/main/java/com/realnet/Builders/Services/BuilderService.java +++ b/testmodern-back-b/authsec_springboot/backend/src/main/java/com/realnet/Builders/Services/BuilderService.java @@ -80,6 +80,9 @@ public class BuilderService { // } // ADD OTHER SERVICE +addCustomMenu( "Test","Test", "Transcations"); + + System.out.println("dashboard and menu inserted..."); diff --git a/testmodern-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Controllers/TestController.java b/testmodern-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Controllers/TestController.java new file mode 100644 index 0000000..26d21fd --- /dev/null +++ b/testmodern-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Controllers/TestController.java @@ -0,0 +1,99 @@ +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.Test; +import com.realnet.basicp1.Services.TestService ; + + + + + + +@RequestMapping(value = "/Test") + @CrossOrigin("*") +@RestController +public class TestController { + @Autowired + private TestService Service; + +@Value("${projectPath}") + private String projectPath; + + + + + + + + @PostMapping("/Test") + public Test Savedata(@RequestBody Test data) { + Test save = Service.Savedata(data) ; + + + + + + System.out.println("data saved..." + save); + + return save; + } +@PutMapping("/Test/{id}") + public Test update(@RequestBody Test data,@PathVariable Integer id ) { + Test update = Service.update(data,id); + System.out.println("data update..." + update); + return update; + } +// get all with pagination + @GetMapping("/Test/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("/Test") + public List getdetails() { + List get = Service.getdetails(); + return get; +} +// get all without authentication + + @GetMapping("/token/Test") + public List getallwioutsec() { + List get = Service.getdetails(); + return get; +} +@GetMapping("/Test/{id}") + public Test getdetailsbyId(@PathVariable Integer id ) { + Test get = Service.getdetailsbyId(id); + return get; + } +@DeleteMapping("/Test/{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/testmodern-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Controllers/tokenFree_TestController.java b/testmodern-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Controllers/tokenFree_TestController.java new file mode 100644 index 0000000..08946c8 --- /dev/null +++ b/testmodern-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Controllers/tokenFree_TestController.java @@ -0,0 +1,99 @@ +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.Test; +import com.realnet.basicp1.Services.TestService ; + + + + + + +@RequestMapping(value = "/token/Test") + @CrossOrigin("*") +@RestController +public class tokenFree_TestController { + @Autowired + private TestService Service; + +@Value("${projectPath}") + private String projectPath; + + + + + + + + @PostMapping("/Test") + public Test Savedata(@RequestBody Test data) { + Test save = Service.Savedata(data) ; + + + + + + System.out.println("data saved..." + save); + + return save; + } +@PutMapping("/Test/{id}") + public Test update(@RequestBody Test data,@PathVariable Integer id ) { + Test update = Service.update(data,id); + System.out.println("data update..." + update); + return update; + } +// get all with pagination + @GetMapping("/Test/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("/Test") + public List getdetails() { + List get = Service.getdetails(); + return get; +} +// get all without authentication + + @GetMapping("/token/Test") + public List getallwioutsec() { + List get = Service.getdetails(); + return get; +} +@GetMapping("/Test/{id}") + public Test getdetailsbyId(@PathVariable Integer id ) { + Test get = Service.getdetailsbyId(id); + return get; + } +@DeleteMapping("/Test/{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/testmodern-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Entity/Test.java b/testmodern-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Entity/Test.java new file mode 100644 index 0000000..77ad5b4 --- /dev/null +++ b/testmodern-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Entity/Test.java @@ -0,0 +1,33 @@ +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 Test 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; + +private Boolean active; + + +} diff --git a/testmodern-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Repository/TestRepository.java b/testmodern-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Repository/TestRepository.java new file mode 100644 index 0000000..b75a742 --- /dev/null +++ b/testmodern-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Repository/TestRepository.java @@ -0,0 +1,30 @@ +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.Test; + +@Repository +public interface TestRepository extends JpaRepository { + +@Query(value = "select * from test where created_by=?1", nativeQuery = true) + List findAll(Long creayedBy); + +@Query(value = "select * from test where created_by=?1", nativeQuery = true) + Page findAll( Long creayedBy,Pageable page); +} \ No newline at end of file diff --git a/testmodern-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Services/TestService.java b/testmodern-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Services/TestService.java new file mode 100644 index 0000000..9268e43 --- /dev/null +++ b/testmodern-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Services/TestService.java @@ -0,0 +1,93 @@ +package com.realnet.basicp1.Services; +import com.realnet.basicp1.Repository.TestRepository; +import com.realnet.basicp1.Entity.Test +;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 TestService { +@Autowired +private TestRepository Repository; + @Autowired + private AppUserServiceImpl userService; +@Autowired + private RealmService realmService; + + + + + +public Test Savedata(Test data) { + + + + + + + data.setUpdatedBy(getUser().getUserId()); + data.setCreatedBy(getUser().getUserId()); + data.setAccountId(getUser().getAccount().getAccount_id()); +Test 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 Test getdetailsbyId(Integer id) { + return Repository.findById(id).get(); + } + + + public void delete_by_id(Integer id) { + Repository.deleteById(id); +} + + +public Test update(Test data,Integer id) { + Test old = Repository.findById(id).get(); +old.setName(data.getName()); + +old.setDescription(data.getDescription()); + +old.setActive (data.getActive()); + +final Test test = Repository.save(old); + data.setUpdatedBy(getUser().getUserId()); + return test;} + + + + + + + public AppUser getUser() { + AppUser user = userService.getLoggedInUser(); + return user; + + }} diff --git a/testmodern-dbb-d/authsec_mysql/mysql/wf_table/wf_table.sql b/testmodern-dbb-d/authsec_mysql/mysql/wf_table/wf_table.sql new file mode 100755 index 0000000..2c5284b --- /dev/null +++ b/testmodern-dbb-d/authsec_mysql/mysql/wf_table/wf_table.sql @@ -0,0 +1,2 @@ +CREATE TABLE dbb.Test(id BIGINT NOT NULL AUTO_INCREMENT, active VARCHAR(400), description VARCHAR(400), name VARCHAR(400), PRIMARY KEY (id)); + diff --git a/testmodern-front-f/authsec_angular_clarity_modern/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/basicp1/Test/Test.component.html b/testmodern-front-f/authsec_angular_clarity_modern/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/basicp1/Test/Test.component.html new file mode 100644 index 0000000..40f583a --- /dev/null +++ b/testmodern-front-f/authsec_angular_clarity_modern/frontend/angular-clarity-master/src/app/modules/main/BuilderComponents/basicp1/Test/Test.component.html @@ -0,0 +1,322 @@ + +
+
+
+
+

Test

+
+
+
+ + +
+
+ + +
+
+ +
+
+
+ + +
+
+
+ + + + LOADING ... + +
{{error}}
+
+ + + + + + Name + + + + + + + + + Description + + + + + + + + + Active + + + + + + + Action + + + + +{{user.name }} + + + + + + +{{user.active }} + + + + + + + +
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}}
+ + +
Active{{user.active}}
+ + +
+ +
+
+ + + + + + + + + + + + + + +