diff --git a/testflutter2-back-b/authsec_springboot/backend/src/main/java/com/realnet/Builders/Services/BuilderService.java b/testflutter2-back-b/authsec_springboot/backend/src/main/java/com/realnet/Builders/Services/BuilderService.java index 552e205..fae2d53 100644 --- a/testflutter2-back-b/authsec_springboot/backend/src/main/java/com/realnet/Builders/Services/BuilderService.java +++ b/testflutter2-back-b/authsec_springboot/backend/src/main/java/com/realnet/Builders/Services/BuilderService.java @@ -69,6 +69,12 @@ public class BuilderService { executeDump(true); // ADD OTHER SERVICE +addCustomMenu( "Formb", "Transcations"); + + +addCustomMenu( "Forma", "Transcations"); + + addCustomMenu( "Tesrt", "Transcations"); diff --git a/testflutter2-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Controllers/FormaController.java b/testflutter2-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Controllers/FormaController.java new file mode 100644 index 0000000..6f844cc --- /dev/null +++ b/testflutter2-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Controllers/FormaController.java @@ -0,0 +1,163 @@ +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.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.http.ResponseEntity; +import org.springframework.data.domain.Pageable; +import org.springframework.beans.factory.annotation.*; +import com.realnet.basicp1.Entity.Forma; +import com.realnet.basicp1.Services.FormaService ; + + + + + + + + + + + + + + + + + + + + + + +@RequestMapping(value = "/Forma") + @CrossOrigin("*") +@RestController +public class FormaController { + @Autowired + private FormaService Service; + +@Value("${projectPath}") + private String projectPath; + + + + + + + + + + + + + + + + + + + + + + + + @PostMapping("/Forma") + public Forma Savedata(@RequestBody Forma data) { + Forma save = Service.Savedata(data) ; + + + + + + + + + + + + + + + + + + + + + + System.out.println("data saved..." + save); + + return save; + } +@PutMapping("/Forma/{id}") + public Forma update(@RequestBody Forma data,@PathVariable Integer id ) { + Forma update = Service.update(data,id); + System.out.println("data update..." + update); + return update; + } +// get all with pagination + @GetMapping("/Forma/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("/Forma") + public List getdetails() { + List get = Service.getdetails(); + return get; +} +// get all without authentication + + @GetMapping("/token/Forma") + public List getallwioutsec() { + List get = Service.getdetails(); + return get; +} +@GetMapping("/Forma/{id}") + public Forma getdetailsbyId(@PathVariable Integer id ) { + Forma get = Service.getdetailsbyId(id); + return get; + } +@DeleteMapping("/Forma/{id}") + public void delete_by_id(@PathVariable Integer id ) { + Service.delete_by_id(id); + + } + + + + + + + + + + + + + + + + + + + + + + + +} \ No newline at end of file diff --git a/testflutter2-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Controllers/FormbController.java b/testflutter2-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Controllers/FormbController.java new file mode 100644 index 0000000..e164be8 --- /dev/null +++ b/testflutter2-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Controllers/FormbController.java @@ -0,0 +1,115 @@ +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.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.http.ResponseEntity; +import org.springframework.data.domain.Pageable; +import org.springframework.beans.factory.annotation.*; +import com.realnet.basicp1.Entity.Formb; +import com.realnet.basicp1.Services.FormbService ; + + + + + + + + + + +@RequestMapping(value = "/Formb") + @CrossOrigin("*") +@RestController +public class FormbController { + @Autowired + private FormbService Service; + +@Value("${projectPath}") + private String projectPath; + + + + + + + + + + + + @PostMapping("/Formb") + public Formb Savedata(@RequestBody Formb data) { + Formb save = Service.Savedata(data) ; + + + + + + + + + + System.out.println("data saved..." + save); + + return save; + } +@PutMapping("/Formb/{id}") + public Formb update(@RequestBody Formb data,@PathVariable Integer id ) { + Formb update = Service.update(data,id); + System.out.println("data update..." + update); + return update; + } +// get all with pagination + @GetMapping("/Formb/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("/Formb") + public List getdetails() { + List get = Service.getdetails(); + return get; +} +// get all without authentication + + @GetMapping("/token/Formb") + public List getallwioutsec() { + List get = Service.getdetails(); + return get; +} +@GetMapping("/Formb/{id}") + public Formb getdetailsbyId(@PathVariable Integer id ) { + Formb get = Service.getdetailsbyId(id); + return get; + } +@DeleteMapping("/Formb/{id}") + public void delete_by_id(@PathVariable Integer id ) { + Service.delete_by_id(id); + + } + + + + + + + + + + + +} \ No newline at end of file diff --git a/testflutter2-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Entity/Forma.java b/testflutter2-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Entity/Forma.java new file mode 100644 index 0000000..0e8b33d --- /dev/null +++ b/testflutter2-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Entity/Forma.java @@ -0,0 +1,70 @@ +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 Forma extends Extension { + /** + * + */ + private static final long serialVersionUID = 1L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + +private String text_field; + +private int number_field; + + private String phone_number; + + +@Column(length = 2000) +private String paragraph_field; + +private String password_field; +@Transient +private String confirmpassword_field; + +@Column(length = 2000) +private String textarea; + +private String date_field; + +private String datetime_field; + +private String email_field; + +private boolean toggle_switch; + +private String url_field; + + +} diff --git a/testflutter2-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Entity/Formb.java b/testflutter2-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Entity/Formb.java new file mode 100644 index 0000000..eb54519 --- /dev/null +++ b/testflutter2-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Entity/Formb.java @@ -0,0 +1,42 @@ +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 Formb extends Extension { + /** + * + */ + private static final long serialVersionUID = 1L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + + private double decimal_field; + +private int percentage_field; + +private String recaptcha; + +private String documentgg; + + private Long user_id; + private String user_name; + + +} diff --git a/testflutter2-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Repository/FormaRepository.java b/testflutter2-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Repository/FormaRepository.java new file mode 100644 index 0000000..d9073fe --- /dev/null +++ b/testflutter2-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Repository/FormaRepository.java @@ -0,0 +1,46 @@ +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.Forma; + +@Repository +public interface FormaRepository extends JpaRepository { + +@Query(value = "select * from forma where created_by=?1", nativeQuery = true) + List findAll(Long creayedBy); + +@Query(value = "select * from forma where created_by=?1", nativeQuery = true) + Page findAll(Pageable page, Long creayedBy); +} \ No newline at end of file diff --git a/testflutter2-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Repository/FormbRepository.java b/testflutter2-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Repository/FormbRepository.java new file mode 100644 index 0000000..e3f8852 --- /dev/null +++ b/testflutter2-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Repository/FormbRepository.java @@ -0,0 +1,34 @@ +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.Formb; + +@Repository +public interface FormbRepository extends JpaRepository { + +@Query(value = "select * from formb where created_by=?1", nativeQuery = true) + List findAll(Long creayedBy); + +@Query(value = "select * from formb where created_by=?1", nativeQuery = true) + Page findAll(Pageable page, Long creayedBy); +} \ No newline at end of file diff --git a/testflutter2-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Services/FormaService.java b/testflutter2-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Services/FormaService.java new file mode 100644 index 0000000..d135cca --- /dev/null +++ b/testflutter2-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Services/FormaService.java @@ -0,0 +1,174 @@ +package com.realnet.basicp1.Services; +import com.realnet.basicp1.Repository.FormaRepository; +import com.realnet.basicp1.Entity.Forma;import java.util.List; +import java.util.ArrayList; + +import org.springframework.beans.factory.annotation.Autowired; +import com.realnet.SequenceGenerator.Service.SequenceService; +import com.realnet.Notification.Entity.NotificationService; +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.ResponseEntity; +import com.realnet.users.service1.AppUserServiceImpl; +import org.springframework.http.HttpStatus; +import com.realnet.users.entity1.AppUser; + + + + + + + + + + + + + + + + + + + + + + + import org.springframework.stereotype.Service; + +@Service + public class FormaService { +@Autowired +private FormaRepository Repository; + @Autowired + private AppUserServiceImpl userService; +@Autowired + private RealmService realmService; + + + + + + + + + + + + + + + + + + + + + +public Forma Savedata(Forma data) { + + + + + + + + + + + + + + + + + + + + + + + data.setUpdatedBy(getUser().getUserId()); + data.setCreatedBy(getUser().getUserId()); + data.setAccountId(getUser().getAccount().getAccount_id()); +Forma save = Repository.save(data); + return save; + } + + +// get all with pagination + public Page getAllWithPagination(Pageable page) { + return Repository.findAll(page, getUser().getUserId()); + } +public List getdetails() { + List realm = realmService.findByUserId(getUser().getUserId()); +List all = Repository.findAll(getUser().getUserId()); + + return all ; } + + +public Forma getdetailsbyId(Integer id) { + return Repository.findById(id).get(); + } + + + public void delete_by_id(Integer id) { + Repository.deleteById(id); +} + + +public Forma update(Forma data,Integer id) { + Forma old = Repository.findById(id).get(); +old.setText_field(data.getText_field()); + +old.setNumber_field(data.getNumber_field()); + +old.setPhone_number(data.getPhone_number()); + +old.setParagraph_field(data.getParagraph_field()); + +old.setPassword_field(data.getPassword_field()); + +old.setTextarea(data.getTextarea()); + +old.setDate_field(data.getDate_field()); + +old.setDatetime_field(data.getDatetime_field()); + +old.setEmail_field(data.getEmail_field()); + +old.setToggle_switch (data.isToggle_switch()); + +old.setUrl_field(data.getUrl_field()); + +final Forma test = Repository.save(old); + data.setUpdatedBy(getUser().getUserId()); + return test;} + + + + + + + + + + + + + + + + + + + + + + + public AppUser getUser() { + AppUser user = userService.getLoggedInUser(); + return user; + + }} diff --git a/testflutter2-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Services/FormbService.java b/testflutter2-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Services/FormbService.java new file mode 100644 index 0000000..46f715e --- /dev/null +++ b/testflutter2-back-b/authsec_springboot/backend/src/main/java/com/realnet/basicp1/Services/FormbService.java @@ -0,0 +1,116 @@ +package com.realnet.basicp1.Services; +import com.realnet.basicp1.Repository.FormbRepository; +import com.realnet.basicp1.Entity.Formb;import java.util.List; +import java.util.ArrayList; + +import org.springframework.beans.factory.annotation.Autowired; +import com.realnet.SequenceGenerator.Service.SequenceService; +import com.realnet.Notification.Entity.NotificationService; +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.ResponseEntity; +import com.realnet.users.service1.AppUserServiceImpl; +import org.springframework.http.HttpStatus; +import com.realnet.users.entity1.AppUser; + + + + + + + + + + + import org.springframework.stereotype.Service; + +@Service + public class FormbService { +@Autowired +private FormbRepository Repository; + @Autowired + private AppUserServiceImpl userService; +@Autowired + private RealmService realmService; + + + + + +@Autowired + private SequenceService documentggsequenceService; + + + +public Formb Savedata(Formb data) { + + + + + + +data.setDocumentgg (documentggsequenceService.GenerateSequence("kk")); + +data.setUser_id(getUser().getUserId()); + data.setUser_name(getUser().getFullName()); + + data.setUpdatedBy(getUser().getUserId()); + data.setCreatedBy(getUser().getUserId()); + data.setAccountId(getUser().getAccount().getAccount_id()); +Formb save = Repository.save(data); + return save; + } + + +// get all with pagination + public Page getAllWithPagination(Pageable page) { + return Repository.findAll(page, getUser().getUserId()); + } +public List getdetails() { + List realm = realmService.findByUserId(getUser().getUserId()); +List all = Repository.findAll(getUser().getUserId()); + + return all ; } + + +public Formb getdetailsbyId(Integer id) { + return Repository.findById(id).get(); + } + + + public void delete_by_id(Integer id) { + Repository.deleteById(id); +} + + +public Formb update(Formb data,Integer id) { + Formb old = Repository.findById(id).get(); +old.setDecimal_field(data.getDecimal_field()); + +old.setPercentage_field(data.getPercentage_field()); + +old.setRecaptcha(data.getRecaptcha()); + +old.setDocumentgg(data.getDocumentgg()); + + + +final Formb test = Repository.save(old); + data.setUpdatedBy(getUser().getUserId()); + return test;} + + + + + + + + + + + public AppUser getUser() { + AppUser user = userService.getLoggedInUser(); + return user; + + }} diff --git a/testflutter2-db-d/authsec_mysql/mysql/wf_table/wf_table.sql b/testflutter2-db-d/authsec_mysql/mysql/wf_table/wf_table.sql index 6357662..a6440c4 100755 --- a/testflutter2-db-d/authsec_mysql/mysql/wf_table/wf_table.sql +++ b/testflutter2-db-d/authsec_mysql/mysql/wf_table/wf_table.sql @@ -1,2 +1,4 @@ -CREATE TABLE db.Tesrt(id BIGINT NOT NULL AUTO_INCREMENT, active VARCHAR(400), description VARCHAR(400), name VARCHAR(400), PRIMARY KEY (id)); +CREATE TABLE db.Forma(id BIGINT NOT NULL AUTO_INCREMENT, paragraph_field VARCHAR(400), textarea VARCHAR(400), toggle_switch VARCHAR(400), number_field int, text_field VARCHAR(400), datetime_field VARCHAR(400), phone_number VARCHAR(400), password_field VARCHAR(400), date_field Date, email_field VARCHAR(400), url_field VARCHAR(400), PRIMARY KEY (id)); + +CREATE TABLE db.Formb(id BIGINT NOT NULL AUTO_INCREMENT, documentgg VARCHAR(400), recaptcha VARCHAR(400), percentage_field int, userid_field VARCHAR(400), decimal_field double, PRIMARY KEY (id));