build_app
This commit is contained in:
parent
37d75e6cf8
commit
1f8ba91da4
@ -69,6 +69,24 @@ public class BuilderService {
|
||||
executeDump(true);
|
||||
|
||||
// ADD OTHER SERVICE
|
||||
addCustomMenu( "T55", "Transcations");
|
||||
|
||||
|
||||
addCustomMenu( "Test44", "Transcations");
|
||||
|
||||
|
||||
addCustomMenu( "Test33", "Transcations");
|
||||
|
||||
|
||||
addCustomMenu( "Test1234", "Transcations");
|
||||
|
||||
|
||||
addCustomMenu( "Test22", "Transcations");
|
||||
|
||||
|
||||
addCustomMenu( "Tesrt", "Transcations");
|
||||
|
||||
|
||||
|
||||
System.out.println("dashboard and menu inserted...");
|
||||
|
||||
|
||||
@ -0,0 +1,99 @@
|
||||
package com.realnet.forma.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.forma.Entity.Tesrt;
|
||||
import com.realnet.forma.Services.TesrtService ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@RequestMapping(value = "/Tesrt")
|
||||
@CrossOrigin("*")
|
||||
@RestController
|
||||
public class TesrtController {
|
||||
@Autowired
|
||||
private TesrtService Service;
|
||||
|
||||
@Value("${projectPath}")
|
||||
private String projectPath;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@PostMapping("/Tesrt")
|
||||
public Tesrt Savedata(@RequestBody Tesrt data) {
|
||||
Tesrt save = Service.Savedata(data) ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
System.out.println("data saved..." + save);
|
||||
|
||||
return save;
|
||||
}
|
||||
@PutMapping("/Tesrt/{id}")
|
||||
public Tesrt update(@RequestBody Tesrt data,@PathVariable Integer id ) {
|
||||
Tesrt update = Service.update(data,id);
|
||||
System.out.println("data update..." + update);
|
||||
return update;
|
||||
}
|
||||
// get all with pagination
|
||||
@GetMapping("/Tesrt/getall/page")
|
||||
public Page<Tesrt> getall(@RequestParam(value = "page", required = false) Integer page,
|
||||
@RequestParam(value = "size", required = false) Integer size) {
|
||||
Pageable paging = PageRequest.of(page, size);
|
||||
Page<Tesrt> get = Service.getAllWithPagination(paging);
|
||||
|
||||
return get;
|
||||
|
||||
}
|
||||
@GetMapping("/Tesrt")
|
||||
public List<Tesrt> getdetails() {
|
||||
List<Tesrt> get = Service.getdetails();
|
||||
return get;
|
||||
}
|
||||
// get all without authentication
|
||||
|
||||
@GetMapping("/token/Tesrt")
|
||||
public List<Tesrt> getallwioutsec() {
|
||||
List<Tesrt> get = Service.getdetails();
|
||||
return get;
|
||||
}
|
||||
@GetMapping("/Tesrt/{id}")
|
||||
public Tesrt getdetailsbyId(@PathVariable Integer id ) {
|
||||
Tesrt get = Service.getdetailsbyId(id);
|
||||
return get;
|
||||
}
|
||||
@DeleteMapping("/Tesrt/{id}")
|
||||
public void delete_by_id(@PathVariable Integer id ) {
|
||||
Service.delete_by_id(id);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package com.realnet.forma.Entity;
|
||||
import lombok.*;
|
||||
import com.realnet.WhoColumn.Entity.Extension;
|
||||
import javax.persistence.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Entity
|
||||
@Data
|
||||
public class Tesrt 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;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
package com.realnet.forma.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.forma.Entity.Tesrt;
|
||||
|
||||
@Repository
|
||||
public interface TesrtRepository extends JpaRepository<Tesrt, Integer> {
|
||||
|
||||
@Query(value = "select * from tesrt where created_by=?1", nativeQuery = true)
|
||||
List<Tesrt> findAll(Long creayedBy);
|
||||
|
||||
@Query(value = "select * from tesrt where created_by=?1", nativeQuery = true)
|
||||
Page<Tesrt> findAll(Pageable page, Long creayedBy);
|
||||
}
|
||||
@ -0,0 +1,94 @@
|
||||
package com.realnet.forma.Services;
|
||||
import com.realnet.forma.Repository.TesrtRepository;
|
||||
import com.realnet.forma.Entity.Tesrt;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 TesrtService {
|
||||
@Autowired
|
||||
private TesrtRepository Repository;
|
||||
@Autowired
|
||||
private AppUserServiceImpl userService;
|
||||
@Autowired
|
||||
private RealmService realmService;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public Tesrt Savedata(Tesrt data) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
data.setUpdatedBy(getUser().getUserId());
|
||||
data.setCreatedBy(getUser().getUserId());
|
||||
data.setAccountId(getUser().getAccount().getAccount_id());
|
||||
Tesrt save = Repository.save(data);
|
||||
return save;
|
||||
}
|
||||
|
||||
|
||||
// get all with pagination
|
||||
public Page<Tesrt> getAllWithPagination(Pageable page) {
|
||||
return Repository.findAll(page, getUser().getUserId());
|
||||
}
|
||||
public List<Tesrt> getdetails() {
|
||||
List<Realm> realm = realmService.findByUserId(getUser().getUserId());
|
||||
List<Tesrt> all = Repository.findAll(getUser().getUserId());
|
||||
|
||||
return all ; }
|
||||
|
||||
|
||||
public Tesrt getdetailsbyId(Integer id) {
|
||||
return Repository.findById(id).get();
|
||||
}
|
||||
|
||||
|
||||
public void delete_by_id(Integer id) {
|
||||
Repository.deleteById(id);
|
||||
}
|
||||
|
||||
|
||||
public Tesrt update(Tesrt data,Integer id) {
|
||||
Tesrt old = Repository.findById(id).get();
|
||||
old.setName(data.getName());
|
||||
|
||||
old.setDescription(data.getDescription());
|
||||
|
||||
old.setActive (data.isActive());
|
||||
|
||||
final Tesrt test = Repository.save(old);
|
||||
data.setUpdatedBy(getUser().getUserId());
|
||||
return test;}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public AppUser getUser() {
|
||||
AppUser user = userService.getLoggedInUser();
|
||||
return user;
|
||||
|
||||
}}
|
||||
@ -0,0 +1,99 @@
|
||||
package com.realnet.rrr.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.rrr.Entity.Test44;
|
||||
import com.realnet.rrr.Services.Test44Service ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@RequestMapping(value = "/Test44")
|
||||
@CrossOrigin("*")
|
||||
@RestController
|
||||
public class Test44Controller {
|
||||
@Autowired
|
||||
private Test44Service Service;
|
||||
|
||||
@Value("${projectPath}")
|
||||
private String projectPath;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@PostMapping("/Test44")
|
||||
public Test44 Savedata(@RequestBody Test44 data) {
|
||||
Test44 save = Service.Savedata(data) ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
System.out.println("data saved..." + save);
|
||||
|
||||
return save;
|
||||
}
|
||||
@PutMapping("/Test44/{id}")
|
||||
public Test44 update(@RequestBody Test44 data,@PathVariable Integer id ) {
|
||||
Test44 update = Service.update(data,id);
|
||||
System.out.println("data update..." + update);
|
||||
return update;
|
||||
}
|
||||
// get all with pagination
|
||||
@GetMapping("/Test44/getall/page")
|
||||
public Page<Test44> getall(@RequestParam(value = "page", required = false) Integer page,
|
||||
@RequestParam(value = "size", required = false) Integer size) {
|
||||
Pageable paging = PageRequest.of(page, size);
|
||||
Page<Test44> get = Service.getAllWithPagination(paging);
|
||||
|
||||
return get;
|
||||
|
||||
}
|
||||
@GetMapping("/Test44")
|
||||
public List<Test44> getdetails() {
|
||||
List<Test44> get = Service.getdetails();
|
||||
return get;
|
||||
}
|
||||
// get all without authentication
|
||||
|
||||
@GetMapping("/token/Test44")
|
||||
public List<Test44> getallwioutsec() {
|
||||
List<Test44> get = Service.getdetails();
|
||||
return get;
|
||||
}
|
||||
@GetMapping("/Test44/{id}")
|
||||
public Test44 getdetailsbyId(@PathVariable Integer id ) {
|
||||
Test44 get = Service.getdetailsbyId(id);
|
||||
return get;
|
||||
}
|
||||
@DeleteMapping("/Test44/{id}")
|
||||
public void delete_by_id(@PathVariable Integer id ) {
|
||||
Service.delete_by_id(id);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package com.realnet.rrr.Entity;
|
||||
import lombok.*;
|
||||
import com.realnet.WhoColumn.Entity.Extension;
|
||||
import javax.persistence.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Entity
|
||||
@Data
|
||||
public class Test44 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;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
package com.realnet.rrr.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.rrr.Entity.Test44;
|
||||
|
||||
@Repository
|
||||
public interface Test44Repository extends JpaRepository<Test44, Integer> {
|
||||
|
||||
@Query(value = "select * from test44 where created_by=?1", nativeQuery = true)
|
||||
List<Test44> findAll(Long creayedBy);
|
||||
|
||||
@Query(value = "select * from test44 where created_by=?1", nativeQuery = true)
|
||||
Page<Test44> findAll(Pageable page, Long creayedBy);
|
||||
}
|
||||
@ -0,0 +1,94 @@
|
||||
package com.realnet.rrr.Services;
|
||||
import com.realnet.rrr.Repository.Test44Repository;
|
||||
import com.realnet.rrr.Entity.Test44;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 Test44Service {
|
||||
@Autowired
|
||||
private Test44Repository Repository;
|
||||
@Autowired
|
||||
private AppUserServiceImpl userService;
|
||||
@Autowired
|
||||
private RealmService realmService;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public Test44 Savedata(Test44 data) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
data.setUpdatedBy(getUser().getUserId());
|
||||
data.setCreatedBy(getUser().getUserId());
|
||||
data.setAccountId(getUser().getAccount().getAccount_id());
|
||||
Test44 save = Repository.save(data);
|
||||
return save;
|
||||
}
|
||||
|
||||
|
||||
// get all with pagination
|
||||
public Page<Test44> getAllWithPagination(Pageable page) {
|
||||
return Repository.findAll(page, getUser().getUserId());
|
||||
}
|
||||
public List<Test44> getdetails() {
|
||||
List<Realm> realm = realmService.findByUserId(getUser().getUserId());
|
||||
List<Test44> all = Repository.findAll(getUser().getUserId());
|
||||
|
||||
return all ; }
|
||||
|
||||
|
||||
public Test44 getdetailsbyId(Integer id) {
|
||||
return Repository.findById(id).get();
|
||||
}
|
||||
|
||||
|
||||
public void delete_by_id(Integer id) {
|
||||
Repository.deleteById(id);
|
||||
}
|
||||
|
||||
|
||||
public Test44 update(Test44 data,Integer id) {
|
||||
Test44 old = Repository.findById(id).get();
|
||||
old.setName(data.getName());
|
||||
|
||||
old.setDescription(data.getDescription());
|
||||
|
||||
old.setActive (data.isActive());
|
||||
|
||||
final Test44 test = Repository.save(old);
|
||||
data.setUpdatedBy(getUser().getUserId());
|
||||
return test;}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public AppUser getUser() {
|
||||
AppUser user = userService.getLoggedInUser();
|
||||
return user;
|
||||
|
||||
}}
|
||||
@ -0,0 +1,99 @@
|
||||
package com.realnet.test.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.test.Entity.T55;
|
||||
import com.realnet.test.Services.T55Service ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@RequestMapping(value = "/T55")
|
||||
@CrossOrigin("*")
|
||||
@RestController
|
||||
public class T55Controller {
|
||||
@Autowired
|
||||
private T55Service Service;
|
||||
|
||||
@Value("${projectPath}")
|
||||
private String projectPath;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@PostMapping("/T55")
|
||||
public T55 Savedata(@RequestBody T55 data) {
|
||||
T55 save = Service.Savedata(data) ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
System.out.println("data saved..." + save);
|
||||
|
||||
return save;
|
||||
}
|
||||
@PutMapping("/T55/{id}")
|
||||
public T55 update(@RequestBody T55 data,@PathVariable Integer id ) {
|
||||
T55 update = Service.update(data,id);
|
||||
System.out.println("data update..." + update);
|
||||
return update;
|
||||
}
|
||||
// get all with pagination
|
||||
@GetMapping("/T55/getall/page")
|
||||
public Page<T55> getall(@RequestParam(value = "page", required = false) Integer page,
|
||||
@RequestParam(value = "size", required = false) Integer size) {
|
||||
Pageable paging = PageRequest.of(page, size);
|
||||
Page<T55> get = Service.getAllWithPagination(paging);
|
||||
|
||||
return get;
|
||||
|
||||
}
|
||||
@GetMapping("/T55")
|
||||
public List<T55> getdetails() {
|
||||
List<T55> get = Service.getdetails();
|
||||
return get;
|
||||
}
|
||||
// get all without authentication
|
||||
|
||||
@GetMapping("/token/T55")
|
||||
public List<T55> getallwioutsec() {
|
||||
List<T55> get = Service.getdetails();
|
||||
return get;
|
||||
}
|
||||
@GetMapping("/T55/{id}")
|
||||
public T55 getdetailsbyId(@PathVariable Integer id ) {
|
||||
T55 get = Service.getdetailsbyId(id);
|
||||
return get;
|
||||
}
|
||||
@DeleteMapping("/T55/{id}")
|
||||
public void delete_by_id(@PathVariable Integer id ) {
|
||||
Service.delete_by_id(id);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,99 @@
|
||||
package com.realnet.test.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.test.Entity.Test1234;
|
||||
import com.realnet.test.Services.Test1234Service ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@RequestMapping(value = "/Test1234")
|
||||
@CrossOrigin("*")
|
||||
@RestController
|
||||
public class Test1234Controller {
|
||||
@Autowired
|
||||
private Test1234Service Service;
|
||||
|
||||
@Value("${projectPath}")
|
||||
private String projectPath;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@PostMapping("/Test1234")
|
||||
public Test1234 Savedata(@RequestBody Test1234 data) {
|
||||
Test1234 save = Service.Savedata(data) ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
System.out.println("data saved..." + save);
|
||||
|
||||
return save;
|
||||
}
|
||||
@PutMapping("/Test1234/{id}")
|
||||
public Test1234 update(@RequestBody Test1234 data,@PathVariable Integer id ) {
|
||||
Test1234 update = Service.update(data,id);
|
||||
System.out.println("data update..." + update);
|
||||
return update;
|
||||
}
|
||||
// get all with pagination
|
||||
@GetMapping("/Test1234/getall/page")
|
||||
public Page<Test1234> getall(@RequestParam(value = "page", required = false) Integer page,
|
||||
@RequestParam(value = "size", required = false) Integer size) {
|
||||
Pageable paging = PageRequest.of(page, size);
|
||||
Page<Test1234> get = Service.getAllWithPagination(paging);
|
||||
|
||||
return get;
|
||||
|
||||
}
|
||||
@GetMapping("/Test1234")
|
||||
public List<Test1234> getdetails() {
|
||||
List<Test1234> get = Service.getdetails();
|
||||
return get;
|
||||
}
|
||||
// get all without authentication
|
||||
|
||||
@GetMapping("/token/Test1234")
|
||||
public List<Test1234> getallwioutsec() {
|
||||
List<Test1234> get = Service.getdetails();
|
||||
return get;
|
||||
}
|
||||
@GetMapping("/Test1234/{id}")
|
||||
public Test1234 getdetailsbyId(@PathVariable Integer id ) {
|
||||
Test1234 get = Service.getdetailsbyId(id);
|
||||
return get;
|
||||
}
|
||||
@DeleteMapping("/Test1234/{id}")
|
||||
public void delete_by_id(@PathVariable Integer id ) {
|
||||
Service.delete_by_id(id);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,99 @@
|
||||
package com.realnet.test.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.test.Entity.Test22;
|
||||
import com.realnet.test.Services.Test22Service ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@RequestMapping(value = "/Test22")
|
||||
@CrossOrigin("*")
|
||||
@RestController
|
||||
public class Test22Controller {
|
||||
@Autowired
|
||||
private Test22Service Service;
|
||||
|
||||
@Value("${projectPath}")
|
||||
private String projectPath;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@PostMapping("/Test22")
|
||||
public Test22 Savedata(@RequestBody Test22 data) {
|
||||
Test22 save = Service.Savedata(data) ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
System.out.println("data saved..." + save);
|
||||
|
||||
return save;
|
||||
}
|
||||
@PutMapping("/Test22/{id}")
|
||||
public Test22 update(@RequestBody Test22 data,@PathVariable Integer id ) {
|
||||
Test22 update = Service.update(data,id);
|
||||
System.out.println("data update..." + update);
|
||||
return update;
|
||||
}
|
||||
// get all with pagination
|
||||
@GetMapping("/Test22/getall/page")
|
||||
public Page<Test22> getall(@RequestParam(value = "page", required = false) Integer page,
|
||||
@RequestParam(value = "size", required = false) Integer size) {
|
||||
Pageable paging = PageRequest.of(page, size);
|
||||
Page<Test22> get = Service.getAllWithPagination(paging);
|
||||
|
||||
return get;
|
||||
|
||||
}
|
||||
@GetMapping("/Test22")
|
||||
public List<Test22> getdetails() {
|
||||
List<Test22> get = Service.getdetails();
|
||||
return get;
|
||||
}
|
||||
// get all without authentication
|
||||
|
||||
@GetMapping("/token/Test22")
|
||||
public List<Test22> getallwioutsec() {
|
||||
List<Test22> get = Service.getdetails();
|
||||
return get;
|
||||
}
|
||||
@GetMapping("/Test22/{id}")
|
||||
public Test22 getdetailsbyId(@PathVariable Integer id ) {
|
||||
Test22 get = Service.getdetailsbyId(id);
|
||||
return get;
|
||||
}
|
||||
@DeleteMapping("/Test22/{id}")
|
||||
public void delete_by_id(@PathVariable Integer id ) {
|
||||
Service.delete_by_id(id);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package com.realnet.test.Entity;
|
||||
import lombok.*;
|
||||
import com.realnet.WhoColumn.Entity.Extension;
|
||||
import javax.persistence.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Entity
|
||||
@Data
|
||||
public class T55 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;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package com.realnet.test.Entity;
|
||||
import lombok.*;
|
||||
import com.realnet.WhoColumn.Entity.Extension;
|
||||
import javax.persistence.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Entity
|
||||
@Data
|
||||
public class Test1234 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;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package com.realnet.test.Entity;
|
||||
import lombok.*;
|
||||
import com.realnet.WhoColumn.Entity.Extension;
|
||||
import javax.persistence.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Entity
|
||||
@Data
|
||||
public class Test22 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;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
package com.realnet.test.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.test.Entity.T55;
|
||||
|
||||
@Repository
|
||||
public interface T55Repository extends JpaRepository<T55, Integer> {
|
||||
|
||||
@Query(value = "select * from t55 where created_by=?1", nativeQuery = true)
|
||||
List<T55> findAll(Long creayedBy);
|
||||
|
||||
@Query(value = "select * from t55 where created_by=?1", nativeQuery = true)
|
||||
Page<T55> findAll(Pageable page, Long creayedBy);
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
package com.realnet.test.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.test.Entity.Test1234;
|
||||
|
||||
@Repository
|
||||
public interface Test1234Repository extends JpaRepository<Test1234, Integer> {
|
||||
|
||||
@Query(value = "select * from test1234 where created_by=?1", nativeQuery = true)
|
||||
List<Test1234> findAll(Long creayedBy);
|
||||
|
||||
@Query(value = "select * from test1234 where created_by=?1", nativeQuery = true)
|
||||
Page<Test1234> findAll(Pageable page, Long creayedBy);
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
package com.realnet.test.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.test.Entity.Test22;
|
||||
|
||||
@Repository
|
||||
public interface Test22Repository extends JpaRepository<Test22, Integer> {
|
||||
|
||||
@Query(value = "select * from test22 where created_by=?1", nativeQuery = true)
|
||||
List<Test22> findAll(Long creayedBy);
|
||||
|
||||
@Query(value = "select * from test22 where created_by=?1", nativeQuery = true)
|
||||
Page<Test22> findAll(Pageable page, Long creayedBy);
|
||||
}
|
||||
@ -0,0 +1,94 @@
|
||||
package com.realnet.test.Services;
|
||||
import com.realnet.test.Repository.T55Repository;
|
||||
import com.realnet.test.Entity.T55;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 T55Service {
|
||||
@Autowired
|
||||
private T55Repository Repository;
|
||||
@Autowired
|
||||
private AppUserServiceImpl userService;
|
||||
@Autowired
|
||||
private RealmService realmService;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public T55 Savedata(T55 data) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
data.setUpdatedBy(getUser().getUserId());
|
||||
data.setCreatedBy(getUser().getUserId());
|
||||
data.setAccountId(getUser().getAccount().getAccount_id());
|
||||
T55 save = Repository.save(data);
|
||||
return save;
|
||||
}
|
||||
|
||||
|
||||
// get all with pagination
|
||||
public Page<T55> getAllWithPagination(Pageable page) {
|
||||
return Repository.findAll(page, getUser().getUserId());
|
||||
}
|
||||
public List<T55> getdetails() {
|
||||
List<Realm> realm = realmService.findByUserId(getUser().getUserId());
|
||||
List<T55> all = Repository.findAll(getUser().getUserId());
|
||||
|
||||
return all ; }
|
||||
|
||||
|
||||
public T55 getdetailsbyId(Integer id) {
|
||||
return Repository.findById(id).get();
|
||||
}
|
||||
|
||||
|
||||
public void delete_by_id(Integer id) {
|
||||
Repository.deleteById(id);
|
||||
}
|
||||
|
||||
|
||||
public T55 update(T55 data,Integer id) {
|
||||
T55 old = Repository.findById(id).get();
|
||||
old.setName(data.getName());
|
||||
|
||||
old.setDescription(data.getDescription());
|
||||
|
||||
old.setActive (data.isActive());
|
||||
|
||||
final T55 test = Repository.save(old);
|
||||
data.setUpdatedBy(getUser().getUserId());
|
||||
return test;}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public AppUser getUser() {
|
||||
AppUser user = userService.getLoggedInUser();
|
||||
return user;
|
||||
|
||||
}}
|
||||
@ -0,0 +1,94 @@
|
||||
package com.realnet.test.Services;
|
||||
import com.realnet.test.Repository.Test1234Repository;
|
||||
import com.realnet.test.Entity.Test1234;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 Test1234Service {
|
||||
@Autowired
|
||||
private Test1234Repository Repository;
|
||||
@Autowired
|
||||
private AppUserServiceImpl userService;
|
||||
@Autowired
|
||||
private RealmService realmService;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public Test1234 Savedata(Test1234 data) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
data.setUpdatedBy(getUser().getUserId());
|
||||
data.setCreatedBy(getUser().getUserId());
|
||||
data.setAccountId(getUser().getAccount().getAccount_id());
|
||||
Test1234 save = Repository.save(data);
|
||||
return save;
|
||||
}
|
||||
|
||||
|
||||
// get all with pagination
|
||||
public Page<Test1234> getAllWithPagination(Pageable page) {
|
||||
return Repository.findAll(page, getUser().getUserId());
|
||||
}
|
||||
public List<Test1234> getdetails() {
|
||||
List<Realm> realm = realmService.findByUserId(getUser().getUserId());
|
||||
List<Test1234> all = Repository.findAll(getUser().getUserId());
|
||||
|
||||
return all ; }
|
||||
|
||||
|
||||
public Test1234 getdetailsbyId(Integer id) {
|
||||
return Repository.findById(id).get();
|
||||
}
|
||||
|
||||
|
||||
public void delete_by_id(Integer id) {
|
||||
Repository.deleteById(id);
|
||||
}
|
||||
|
||||
|
||||
public Test1234 update(Test1234 data,Integer id) {
|
||||
Test1234 old = Repository.findById(id).get();
|
||||
old.setName(data.getName());
|
||||
|
||||
old.setDescription(data.getDescription());
|
||||
|
||||
old.setActive (data.isActive());
|
||||
|
||||
final Test1234 test = Repository.save(old);
|
||||
data.setUpdatedBy(getUser().getUserId());
|
||||
return test;}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public AppUser getUser() {
|
||||
AppUser user = userService.getLoggedInUser();
|
||||
return user;
|
||||
|
||||
}}
|
||||
@ -0,0 +1,94 @@
|
||||
package com.realnet.test.Services;
|
||||
import com.realnet.test.Repository.Test22Repository;
|
||||
import com.realnet.test.Entity.Test22;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 Test22Service {
|
||||
@Autowired
|
||||
private Test22Repository Repository;
|
||||
@Autowired
|
||||
private AppUserServiceImpl userService;
|
||||
@Autowired
|
||||
private RealmService realmService;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public Test22 Savedata(Test22 data) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
data.setUpdatedBy(getUser().getUserId());
|
||||
data.setCreatedBy(getUser().getUserId());
|
||||
data.setAccountId(getUser().getAccount().getAccount_id());
|
||||
Test22 save = Repository.save(data);
|
||||
return save;
|
||||
}
|
||||
|
||||
|
||||
// get all with pagination
|
||||
public Page<Test22> getAllWithPagination(Pageable page) {
|
||||
return Repository.findAll(page, getUser().getUserId());
|
||||
}
|
||||
public List<Test22> getdetails() {
|
||||
List<Realm> realm = realmService.findByUserId(getUser().getUserId());
|
||||
List<Test22> all = Repository.findAll(getUser().getUserId());
|
||||
|
||||
return all ; }
|
||||
|
||||
|
||||
public Test22 getdetailsbyId(Integer id) {
|
||||
return Repository.findById(id).get();
|
||||
}
|
||||
|
||||
|
||||
public void delete_by_id(Integer id) {
|
||||
Repository.deleteById(id);
|
||||
}
|
||||
|
||||
|
||||
public Test22 update(Test22 data,Integer id) {
|
||||
Test22 old = Repository.findById(id).get();
|
||||
old.setName(data.getName());
|
||||
|
||||
old.setDescription(data.getDescription());
|
||||
|
||||
old.setActive (data.isActive());
|
||||
|
||||
final Test22 test = Repository.save(old);
|
||||
data.setUpdatedBy(getUser().getUserId());
|
||||
return test;}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public AppUser getUser() {
|
||||
AppUser user = userService.getLoggedInUser();
|
||||
return user;
|
||||
|
||||
}}
|
||||
@ -0,0 +1,99 @@
|
||||
package com.realnet.ttt.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.ttt.Entity.Test33;
|
||||
import com.realnet.ttt.Services.Test33Service ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@RequestMapping(value = "/Test33")
|
||||
@CrossOrigin("*")
|
||||
@RestController
|
||||
public class Test33Controller {
|
||||
@Autowired
|
||||
private Test33Service Service;
|
||||
|
||||
@Value("${projectPath}")
|
||||
private String projectPath;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@PostMapping("/Test33")
|
||||
public Test33 Savedata(@RequestBody Test33 data) {
|
||||
Test33 save = Service.Savedata(data) ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
System.out.println("data saved..." + save);
|
||||
|
||||
return save;
|
||||
}
|
||||
@PutMapping("/Test33/{id}")
|
||||
public Test33 update(@RequestBody Test33 data,@PathVariable Integer id ) {
|
||||
Test33 update = Service.update(data,id);
|
||||
System.out.println("data update..." + update);
|
||||
return update;
|
||||
}
|
||||
// get all with pagination
|
||||
@GetMapping("/Test33/getall/page")
|
||||
public Page<Test33> getall(@RequestParam(value = "page", required = false) Integer page,
|
||||
@RequestParam(value = "size", required = false) Integer size) {
|
||||
Pageable paging = PageRequest.of(page, size);
|
||||
Page<Test33> get = Service.getAllWithPagination(paging);
|
||||
|
||||
return get;
|
||||
|
||||
}
|
||||
@GetMapping("/Test33")
|
||||
public List<Test33> getdetails() {
|
||||
List<Test33> get = Service.getdetails();
|
||||
return get;
|
||||
}
|
||||
// get all without authentication
|
||||
|
||||
@GetMapping("/token/Test33")
|
||||
public List<Test33> getallwioutsec() {
|
||||
List<Test33> get = Service.getdetails();
|
||||
return get;
|
||||
}
|
||||
@GetMapping("/Test33/{id}")
|
||||
public Test33 getdetailsbyId(@PathVariable Integer id ) {
|
||||
Test33 get = Service.getdetailsbyId(id);
|
||||
return get;
|
||||
}
|
||||
@DeleteMapping("/Test33/{id}")
|
||||
public void delete_by_id(@PathVariable Integer id ) {
|
||||
Service.delete_by_id(id);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package com.realnet.ttt.Entity;
|
||||
import lombok.*;
|
||||
import com.realnet.WhoColumn.Entity.Extension;
|
||||
import javax.persistence.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Entity
|
||||
@Data
|
||||
public class Test33 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;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
package com.realnet.ttt.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.ttt.Entity.Test33;
|
||||
|
||||
@Repository
|
||||
public interface Test33Repository extends JpaRepository<Test33, Integer> {
|
||||
|
||||
@Query(value = "select * from test33 where created_by=?1", nativeQuery = true)
|
||||
List<Test33> findAll(Long creayedBy);
|
||||
|
||||
@Query(value = "select * from test33 where created_by=?1", nativeQuery = true)
|
||||
Page<Test33> findAll(Pageable page, Long creayedBy);
|
||||
}
|
||||
@ -0,0 +1,94 @@
|
||||
package com.realnet.ttt.Services;
|
||||
import com.realnet.ttt.Repository.Test33Repository;
|
||||
import com.realnet.ttt.Entity.Test33;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 Test33Service {
|
||||
@Autowired
|
||||
private Test33Repository Repository;
|
||||
@Autowired
|
||||
private AppUserServiceImpl userService;
|
||||
@Autowired
|
||||
private RealmService realmService;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public Test33 Savedata(Test33 data) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
data.setUpdatedBy(getUser().getUserId());
|
||||
data.setCreatedBy(getUser().getUserId());
|
||||
data.setAccountId(getUser().getAccount().getAccount_id());
|
||||
Test33 save = Repository.save(data);
|
||||
return save;
|
||||
}
|
||||
|
||||
|
||||
// get all with pagination
|
||||
public Page<Test33> getAllWithPagination(Pageable page) {
|
||||
return Repository.findAll(page, getUser().getUserId());
|
||||
}
|
||||
public List<Test33> getdetails() {
|
||||
List<Realm> realm = realmService.findByUserId(getUser().getUserId());
|
||||
List<Test33> all = Repository.findAll(getUser().getUserId());
|
||||
|
||||
return all ; }
|
||||
|
||||
|
||||
public Test33 getdetailsbyId(Integer id) {
|
||||
return Repository.findById(id).get();
|
||||
}
|
||||
|
||||
|
||||
public void delete_by_id(Integer id) {
|
||||
Repository.deleteById(id);
|
||||
}
|
||||
|
||||
|
||||
public Test33 update(Test33 data,Integer id) {
|
||||
Test33 old = Repository.findById(id).get();
|
||||
old.setName(data.getName());
|
||||
|
||||
old.setDescription(data.getDescription());
|
||||
|
||||
old.setActive (data.isActive());
|
||||
|
||||
final Test33 test = Repository.save(old);
|
||||
data.setUpdatedBy(getUser().getUserId());
|
||||
return test;}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public AppUser getUser() {
|
||||
AppUser user = userService.getLoggedInUser();
|
||||
return user;
|
||||
|
||||
}}
|
||||
12
testflutter3-db-d/authsec_mysql/mysql/wf_table/wf_table.sql
Executable file
12
testflutter3-db-d/authsec_mysql/mysql/wf_table/wf_table.sql
Executable file
@ -0,0 +1,12 @@
|
||||
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.Test22(id BIGINT NOT NULL AUTO_INCREMENT, active VARCHAR(400), description VARCHAR(400), name VARCHAR(400), PRIMARY KEY (id));
|
||||
|
||||
CREATE TABLE db.Test1234(id BIGINT NOT NULL AUTO_INCREMENT, active VARCHAR(400), description VARCHAR(400), name VARCHAR(400), PRIMARY KEY (id));
|
||||
|
||||
CREATE TABLE db.Test33(id BIGINT NOT NULL AUTO_INCREMENT, active VARCHAR(400), description VARCHAR(400), name VARCHAR(400), PRIMARY KEY (id));
|
||||
|
||||
CREATE TABLE db.Test44(id BIGINT NOT NULL AUTO_INCREMENT, active VARCHAR(400), description VARCHAR(400), name VARCHAR(400), PRIMARY KEY (id));
|
||||
|
||||
CREATE TABLE db.T55(id BIGINT NOT NULL AUTO_INCREMENT, active VARCHAR(400), description VARCHAR(400), name VARCHAR(400), PRIMARY KEY (id));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user