build_app

This commit is contained in:
2026-01-28 07:56:42 +00:00
parent e1770ab030
commit 3e8b16737d
24 changed files with 4261 additions and 0 deletions

View File

@@ -80,6 +80,12 @@ public class BuilderService {
// }
// ADD OTHER SERVICE
addCustomMenu( "Bill","Bill", "Master");
addCustomMenu( "Login","Login", "Master");
System.out.println("dashboard and menu inserted...");

View File

@@ -0,0 +1,115 @@
package com.realnet.basic.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.basic.Entity.Bill;
import com.realnet.basic.Services.BillService ;
@RequestMapping(value = "/Bill")
@CrossOrigin("*")
@RestController
public class BillController {
@Autowired
private BillService Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Bill")
public Bill Savedata(@RequestBody Bill data) {
Bill save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Bill/{id}")
public Bill update(@RequestBody Bill data,@PathVariable Integer id ) {
Bill update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Bill/getall/page")
public Page<Bill> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Bill> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Bill")
public List<Bill> getdetails() {
List<Bill> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Bill")
public List<Bill> getallwioutsec() {
List<Bill> get = Service.getdetails();
return get;
}
@GetMapping("/Bill/{id}")
public Bill getdetailsbyId(@PathVariable Integer id ) {
Bill get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Bill/{id}")
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
Service.delete_by_id(id);
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
}
}

View File

@@ -0,0 +1,115 @@
package com.realnet.basic.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.basic.Entity.Bill;
import com.realnet.basic.Services.BillService ;
@RequestMapping(value = "/token/Bill")
@CrossOrigin("*")
@RestController
public class tokenFree_BillController {
@Autowired
private BillService Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Bill")
public Bill Savedata(@RequestBody Bill data) {
Bill save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Bill/{id}")
public Bill update(@RequestBody Bill data,@PathVariable Integer id ) {
Bill update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Bill/getall/page")
public Page<Bill> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Bill> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Bill")
public List<Bill> getdetails() {
List<Bill> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Bill")
public List<Bill> getallwioutsec() {
List<Bill> get = Service.getdetails();
return get;
}
@GetMapping("/Bill/{id}")
public Bill getdetailsbyId(@PathVariable Integer id ) {
Bill get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Bill/{id}")
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
Service.delete_by_id(id);
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
}
}

View File

@@ -0,0 +1,41 @@
package com.realnet.basic.Entity;
import lombok.*;
import com.realnet.WhoColumn.Entity.Extension;
import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.*;
@Entity
@Data
public class Bill 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;
private String phoneno;
private String date;
}

View File

@@ -0,0 +1,34 @@
package com.realnet.basic.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.basic.Entity.Bill;
@Repository
public interface BillRepository extends JpaRepository<Bill, Integer> {
@Query(value = "select * from bill where created_by=?1", nativeQuery = true)
List<Bill> findAll(Long creayedBy);
@Query(value = "select * from bill where created_by=?1", nativeQuery = true)
Page<Bill> findAll( Long creayedBy,Pageable page);
}

View File

@@ -0,0 +1,113 @@
package com.realnet.basic.Services;
import com.realnet.basic.Repository.BillRepository;
import com.realnet.basic.Entity.Bill
;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 BillService {
@Autowired
private BillRepository Repository;
@Autowired
private AppUserServiceImpl userService;
@Autowired
private RealmService realmService;
public Bill Savedata(Bill data) {
data.setUpdatedBy(getUser().getUserId());
data.setCreatedBy(getUser().getUserId());
data.setAccountId(getUser().getAccount().getAccount_id());
Bill save = Repository.save(data);
return save;
}
// get all with pagination
public Page<Bill> getAllWithPagination(Pageable page) {
return Repository.findAll( getUser().getUserId(),page);
}
public List<Bill> getdetails() {
List<Realm> realm = realmService.findByUserId(getUser().getUserId());
List<Bill> all = Repository.findAll(getUser().getUserId());
return all ; }
public Bill getdetailsbyId(Integer id) {
return Repository.findById(id).get();
}
public void delete_by_id(Integer id) {
Repository.deleteById(id);
}
public Bill update(Bill data,Integer id) {
Bill old = Repository.findById(id).get();
old.setName(data.getName());
old.setDescription(data.getDescription());
old.setActive (data.getActive());
old.setPhoneno(data.getPhoneno());
old.setDate(data.getDate());
final Bill test = Repository.save(old);
data.setUpdatedBy(getUser().getUserId());
return test;}
public AppUser getUser() {
AppUser user = userService.getLoggedInUser();
return user;
}}

View File

@@ -0,0 +1,99 @@
package com.realnet.log.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.log.Entity.Login;
import com.realnet.log.Services.LoginService ;
@RequestMapping(value = "/Login")
@CrossOrigin("*")
@RestController
public class LoginController {
@Autowired
private LoginService Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Login")
public Login Savedata(@RequestBody Login data) {
Login save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Login/{id}")
public Login update(@RequestBody Login data,@PathVariable Integer id ) {
Login update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Login/getall/page")
public Page<Login> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Login> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Login")
public List<Login> getdetails() {
List<Login> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Login")
public List<Login> getallwioutsec() {
List<Login> get = Service.getdetails();
return get;
}
@GetMapping("/Login/{id}")
public Login getdetailsbyId(@PathVariable Integer id ) {
Login get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Login/{id}")
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
Service.delete_by_id(id);
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
}
}

View File

@@ -0,0 +1,99 @@
package com.realnet.log.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.log.Entity.Login;
import com.realnet.log.Services.LoginService ;
@RequestMapping(value = "/token/Login")
@CrossOrigin("*")
@RestController
public class tokenFree_LoginController {
@Autowired
private LoginService Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Login")
public Login Savedata(@RequestBody Login data) {
Login save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Login/{id}")
public Login update(@RequestBody Login data,@PathVariable Integer id ) {
Login update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Login/getall/page")
public Page<Login> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Login> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Login")
public List<Login> getdetails() {
List<Login> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Login")
public List<Login> getallwioutsec() {
List<Login> get = Service.getdetails();
return get;
}
@GetMapping("/Login/{id}")
public Login getdetailsbyId(@PathVariable Integer id ) {
Login get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Login/{id}")
public ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
Service.delete_by_id(id);
return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
}
}

View File

@@ -0,0 +1,34 @@
package com.realnet.log.Entity;
import lombok.*;
import com.realnet.WhoColumn.Entity.Extension;
import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.*;
@Entity
@Data
public class Login extends Extension {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
private String username;
private Boolean active;
private String password;
@Transient
private String confirmpassword;
}

View File

@@ -0,0 +1,30 @@
package com.realnet.log.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.log.Entity.Login;
@Repository
public interface LoginRepository extends JpaRepository<Login, Integer> {
@Query(value = "select * from login where created_by=?1", nativeQuery = true)
List<Login> findAll(Long creayedBy);
@Query(value = "select * from login where created_by=?1", nativeQuery = true)
Page<Login> findAll( Long creayedBy,Pageable page);
}

View File

@@ -0,0 +1,93 @@
package com.realnet.log.Services;
import com.realnet.log.Repository.LoginRepository;
import com.realnet.log.Entity.Login
;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 LoginService {
@Autowired
private LoginRepository Repository;
@Autowired
private AppUserServiceImpl userService;
@Autowired
private RealmService realmService;
public Login Savedata(Login data) {
data.setUpdatedBy(getUser().getUserId());
data.setCreatedBy(getUser().getUserId());
data.setAccountId(getUser().getAccount().getAccount_id());
Login save = Repository.save(data);
return save;
}
// get all with pagination
public Page<Login> getAllWithPagination(Pageable page) {
return Repository.findAll( getUser().getUserId(),page);
}
public List<Login> getdetails() {
List<Realm> realm = realmService.findByUserId(getUser().getUserId());
List<Login> all = Repository.findAll(getUser().getUserId());
return all ; }
public Login getdetailsbyId(Integer id) {
return Repository.findById(id).get();
}
public void delete_by_id(Integer id) {
Repository.deleteById(id);
}
public Login update(Login data,Integer id) {
Login old = Repository.findById(id).get();
old.setUsername(data.getUsername());
old.setActive (data.getActive());
old.setPassword(data.getPassword());
final Login test = Repository.save(old);
data.setUpdatedBy(getUser().getUserId());
return test;}
public AppUser getUser() {
AppUser user = userService.getLoggedInUser();
return user;
}}