build_app

This commit is contained in:
2026-05-21 05:07:49 +00:00
parent aac0cb6b08
commit 239f8d43cf
21 changed files with 5146 additions and 0 deletions

View File

@@ -1,3 +1,9 @@
import Basicp3 from "./components/BuilderComponents/angulardatatype/Basicp3/Basicp3";
import Basicp2 from "./components/BuilderComponents/angulardatatype/Basicp2/Basicp2";
import Basicp1 from "./components/BuilderComponents/angulardatatype/Basicp1/Basicp1";
import React from "react";
import { SystemParameterProvider } from './context/SystemParameterContext';
import {
@@ -107,6 +113,15 @@ const App = () => {
<Route path="profile" element={<Profile />} />
</Route>
{/* buildercomponents */}
<Route path="/Basicp3" element={<Basicp3 />} />
<Route path="/Basicp2" element={<Basicp2 />} />
<Route path="/Basicp1" element={<Basicp1 />} />

View File

@@ -0,0 +1,945 @@
import React, { useEffect, useState ,useRef } from "react";
import axios from "axios";
import {
Button,
Dialog,
Autocomplete,
DialogActions,
DialogContent,
DialogTitle,
Snackbar,
Alert,
Typography,
TextField,
Table,
TableBody,
Switch,
TableCell,
TableContainer,
TableHead,
TableRow,
CardMedia,
Card,
LinearProgress,
Grid,
Container,
TablePagination,
Paper,
IconButton,
InputAdornment
} from "@mui/material";
import Radio from '@mui/material/Radio';
import RadioGroup from '@mui/material/RadioGroup';
import FormControlLabel from '@mui/material/FormControlLabel';
import FormControl from '@mui/material/FormControl';
import FormLabel from '@mui/material/FormLabel';
import FormGroup from '@mui/material/FormGroup';
import Checkbox from '@mui/material/Checkbox';
import InputLabel from '@mui/material/InputLabel';
import MenuItem from '@mui/material/MenuItem';
import Select from '@mui/material/Select';
import Box from '@mui/material/Box';
import OutlinedInput from '@mui/material/OutlinedInput';
import Chip from '@mui/material/Chip';
import { makeStyles } from '@mui/styles';
import { QRCode } from "react-qrcode-logo";
import Barcode from "react-barcode";
import { ToastContainer, toast } from "react-toastify";
import "react-toastify/dist/ReactToastify.css";
import ReCAPTCHA from 'react-google-recaptcha';
import { getToken } from '../../../../utils/tokenService';import SearchIcon from '@mui/icons-material/Search';
const FILE_API_URL = `${process.env.REACT_APP_API_BASE_URL}/FileUpload/Uploadeddocs`;
const API_URL = `${process.env.REACT_APP_API_BASE_URL}/Basicp2/Basicp2`;
const token = localStorage.getItem("authToken");
// Custom styles using makeStyles
const useStyles = makeStyles((theme) => ({
tableHeader: {
backgroundColor: "#000000",
color: "#ffffff",
},
searchContainer: {
display: 'flex',
alignItems: 'center',
marginBottom: theme.spacing(2),
},
searchInput: {
marginRight: theme.spacing(2),
flex: 1,
},
tableContainer: {
marginTop: theme.spacing(2),
},
dialogContent: {
display: 'flex',
flexDirection: 'column',
gap: theme.spacing(2),
},
formControl: {
marginBottom: theme.spacing(2),
},
button: {
margin: theme.spacing(1),
},
}));
const EntityTable = () => {
const classes = useStyles();
const [data, setData] = useState([]);
const [filteredData, setFilteredData] = useState([]);
const [newEntity, setNewEntity] = useState({
about: "",
textarea2: "",
date_field: "",
date_field2: "",
datetime_field: "",
datetime_field2: "",
email_field: "",
email_field2: "",
userid_field: "",
});
const [editEntity, setEditEntity] = useState(null);
const [showEditModal, setShowEditModal] = useState(false);
const [showAddModal, setShowAddModal] = useState(false);
const [showDeleteModal, setShowDeleteModal] = useState(false);
const [deleteEntityId, setDeleteEntityId] = useState(null);
const [currentPage, setCurrentPage] = useState(0);
const [itemsPerPage] = useState(5); // Adjust this value as needed
const [searchQuery, setSearchQuery] = useState("");
const [openSnackbar, setOpenSnackbar] = useState(false);
const [snackbarMessage, setSnackbarMessage] = useState("");
const [qrText, setQrText] = useState("");
const [showQrCode, setShowQrCode] = useState(false);
const qrCodeRef = useRef();
const [barcodeText, setBarcodeText] = useState("");
const barcodeRef = useRef();
const [showBarcode, setShowBarcode] = useState(false);
const [captchaValue, setCaptchaValue] = useState(null);
const [alertMessage, setAlertMessage] = useState("");
const [showPaymentOptions, setShowPaymentOptions] = useState(false);
const [uploadProgress, setUploadProgress] = useState(0);
const [serverData, setServerData] = useState([]);
const [showValulistModal, setShowValulistModal] = useState(false);
const [snackbarSeverity, setSnackbarSeverity] = useState("success");
const handlePageChange = (event, newPage) => {
setCurrentPage(newPage);
};
useEffect(() => {
fetchData();
}, []);
useEffect(() => {
handleSearch();
}, [searchQuery, data]);
const fetchData = async () => {
try {
const token = getToken();
const response = await axios.get(API_URL, {
headers: { Authorization: `Bearer ${token}` },
});
setData(response.data);
} catch (error) {
console.error("Error fetching data:", error);
}
};
const handleDelete = async () => {
try {
const token = getToken();
await axios.delete(`${API_URL}/${deleteEntityId}`, {
headers: { Authorization: `Bearer ${token}` },
});
fetchData();
setSnackbarMessage("Successfully deleted!");
setSnackbarSeverity("success");
setOpenSnackbar(true);
setShowDeleteModal(false);
} catch (error) {
console.error("Error deleting data:", error);
setSnackbarMessage("Failed to delete!");
setSnackbarSeverity("error");
setOpenSnackbar(true);
}
};
const handleAdd = async () => {
try {
const token = getToken();
await axios.post(API_URL, newEntity, {
headers: { Authorization: `Bearer ${token}` },
});
fetchData();
setNewEntity({
about: "",
textarea2: "",
date_field: "",
date_field2: "",
datetime_field: "",
datetime_field2: "",
email_field: "",
email_field2: "",
userid_field: "",
});
setShowAddModal(false);
setSnackbarMessage("Successfully added!");
setSnackbarSeverity("success");
setOpenSnackbar(true);
} catch (error) {
console.error("Error adding data:", error);
setSnackbarMessage("Failed to add!");
setSnackbarSeverity("error");
setOpenSnackbar(true);
}
};
const handleChange = (e) => {
const { name, value } = e.target;
setNewEntity({ ...newEntity, [name]: value });
};
const handleChangeCheckbox = (e) => {
const { name, value, checked } = e.target;
setNewEntity({ ...newEntity, [value]: checked });
};
const handleChangeSelectMulti = (e) => {
const { name, value } = e.target;
setNewEntity({ ...newEntity, [name]: String(value) });
};
const handleEditChange = (e) => {
const { name, value } = e.target;
setEditEntity({ ...editEntity, [name]: value });
};
const handleEdit = (entity) => {
let requiredKeys = Object.keys(newEntity);
let newObj = {};
requiredKeys.forEach((key) => {
newObj[key] = entity[key];
});
setEditEntity(entity);
setNewEntity(newObj);
setShowEditModal(true);
};
const handleUpdate = async () => {
try {
const token = getToken();
await axios.put(`${API_URL}/${editEntity.id}`, newEntity, {
headers: { Authorization: `Bearer ${token}` },
});
fetchData();
setShowEditModal(false);
setSnackbarMessage("Successfully updated!");
setSnackbarSeverity("success");
setOpenSnackbar(true);
} catch (error) {
console.error("Error updating data:", error);
setSnackbarMessage("Failed to update!");
setSnackbarSeverity("error");
setOpenSnackbar(true);
}
};
const handleSearch = () => {
const filtered = data;
setFilteredData(filtered);
};
return (
<div className="container mt-5">
<Typography variant="h4" gutterBottom>
Entity Table
</Typography>
<div className={classes.searchContainer}>
<Button
variant="contained"
color="primary"
onClick={() => {
let emptyNewEntity = {};
Object.keys(newEntity).forEach((key) => {
emptyNewEntity[key] =
"";
});
setNewEntity(emptyNewEntity);
setShowAddModal(true);
}}
className={classes.button}
>
Add Entity
</Button>
<TextField
className={classes.searchInput}
label="Search"
variant="outlined"
size="small"
value={searchQuery}
onChange={(e) => setSearchQuery(e.target.value)}
InputProps={{
endAdornment: (
<InputAdornment position="end">
<IconButton>
<SearchIcon />
</IconButton>
</InputAdornment>
),
}}
/>
</div>
<TableContainer component={Paper} className={classes.tableContainer}>
<Table>
<TableHead>
<TableRow >
<th>about</th>
<th>textarea2</th>
<th>date_field</th>
<th>date_field2</th>
<th>datetime_field</th>
<th>datetime_field2</th>
<th>email_field</th>
<th>email_field2</th>
<th>userid_field</th>
</TableRow>
</TableHead>
<TableBody>
{filteredData.slice(currentPage * itemsPerPage, (currentPage + 1) * itemsPerPage).map((entity) => (
<TableRow key={entity.id}>
<td>{entity.about}</td>
<td>{entity.textarea2}</td>
<td>{entity.date_field}</td>
<td>{entity.date_field2}</td>
<td>{entity.datetime_field}</td>
<td>{entity.datetime_field2}</td>
<td>{entity.email_field}</td>
<td>{entity.email_field2}</td>
<td>{entity.userid_field}</td>
<TableCell>
<Button
variant="contained"
color="warning"
size="small"
className={classes.button}
onClick={() => handleEdit(entity)}
>
Update
</Button>
<Button
variant="contained"
color="error"
size="small"
className={classes.button}
onClick={() => {
setDeleteEntityId(entity.id);
setShowDeleteModal(true);
}}
>
Delete
</Button>
</TableCell>
</TableRow>
))}
</TableBody>
</Table>
</TableContainer>
<TablePagination
rowsPerPageOptions={[5, 10, 25]}
component="div"
count={filteredData.length}
rowsPerPage={itemsPerPage}
page={currentPage}
onPageChange={handlePageChange}
/>
<Dialog open={showEditModal} onClose={() => setShowEditModal(false)}>
<DialogTitle>Edit Entity</DialogTitle>
<DialogContent className={classes.dialogContent}>
<TextField
fullWidth
margin="normal"
label="about"
variant="outlined"
name="about"
value={newEntity.about}
onChange={handleChange}
multiline
rows={4}
required
/>
<TextField
fullWidth
margin="normal"
label="Textarea2"
variant="outlined"
name="textarea2"
value={newEntity.textarea2}
onChange={handleChange}
multiline
rows={4}
required
/>
<TextField
fullWidth
margin="normal"
label="Date Field"
variant="outlined"
type="date"
name="date_field"
value={newEntity.date_field}
onChange={handleChange}
InputLabelProps={{ shrink: true }}
required
/>
<TextField
fullWidth
margin="normal"
label="Date Field2"
variant="outlined"
type="date"
name="date_field2"
value={newEntity.date_field2}
onChange={handleChange}
InputLabelProps={{ shrink: true }}
required
/>
<TextField
fullWidth
margin="normal"
label="Datetime Field"
variant="outlined"
type="datetime-local"
name="datetime_field"
value={newEntity.datetime_field}
onChange={handleChange}
InputLabelProps={{ shrink: true }}
required
/>
<TextField
fullWidth
margin="normal"
label="Datetime Field2"
variant="outlined"
type="datetime-local"
name="datetime_field2"
value={newEntity.datetime_field2}
onChange={handleChange}
InputLabelProps={{ shrink: true }}
required
/>
<TextField
fullWidth
margin="normal"
label="Email Field"
variant="outlined"
name="email_field"
type="email"
value={newEntity.email_field}
onChange={handleChange}
required
/>
<TextField
fullWidth
margin="normal"
label="Email Field2"
variant="outlined"
name="email_field2"
type="email"
value={newEntity.email_field2}
onChange={handleChange}
required
/>
<TextField
label="UserId Field"
variant="outlined"
fullWidth
name="userid_field"
value={newEntity.userid_field}
onChange={handleChange}
className={classes.formControl}
/>
</DialogContent>
<DialogActions>
<Button onClick={() => setShowEditModal(false)} color="primary">
Cancel
</Button>
<Button onClick={handleUpdate} color="primary">
Update
</Button>
</DialogActions>
</Dialog>
<Dialog open={showAddModal} onClose={() => setShowAddModal(false)}>
<DialogTitle>Add Entity</DialogTitle>
<DialogContent className={classes.dialogContent}>
<TextField
fullWidth
margin="normal"
label="about"
variant="outlined"
name="about"
value={newEntity.about}
onChange={handleChange}
multiline
rows={4}
required
/>
<TextField
fullWidth
margin="normal"
label="Textarea2"
variant="outlined"
name="textarea2"
value={newEntity.textarea2}
onChange={handleChange}
multiline
rows={4}
required
/>
<TextField
fullWidth
margin="normal"
label="Date Field"
variant="outlined"
type="date"
name="date_field"
value={newEntity.date_field}
onChange={handleChange}
InputLabelProps={{ shrink: true }}
required
/>
<TextField
fullWidth
margin="normal"
label="Date Field2"
variant="outlined"
type="date"
name="date_field2"
value={newEntity.date_field2}
onChange={handleChange}
InputLabelProps={{ shrink: true }}
required
/>
<TextField
fullWidth
margin="normal"
label="Datetime Field"
variant="outlined"
type="datetime-local"
name="datetime_field"
value={newEntity.datetime_field}
onChange={handleChange}
InputLabelProps={{ shrink: true }}
required
/>
<TextField
fullWidth
margin="normal"
label="Datetime Field2"
variant="outlined"
type="datetime-local"
name="datetime_field2"
value={newEntity.datetime_field2}
onChange={handleChange}
InputLabelProps={{ shrink: true }}
required
/>
<TextField
fullWidth
margin="normal"
label="Email Field"
variant="outlined"
name="email_field"
type="email"
value={newEntity.email_field}
onChange={handleChange}
required
/>
<TextField
fullWidth
margin="normal"
label="Email Field2"
variant="outlined"
name="email_field2"
type="email"
value={newEntity.email_field2}
onChange={handleChange}
required
/>
<TextField
label="UserId Field"
variant="outlined"
fullWidth
name="userid_field"
value={newEntity.userid_field}
onChange={handleChange}
className={classes.formControl}
/>
</DialogContent>
<DialogActions>
<Button onClick={() => setShowAddModal(false)} color="primary">
Cancel
</Button>
<Button onClick={handleAdd
} color="primary">
Add
</Button>
</DialogActions>
</Dialog>
<Dialog open={showDeleteModal} onClose={() => setShowDeleteModal(false)}>
<DialogTitle>Confirm Delete</DialogTitle>
<DialogContent>
<Typography>Are you sure you want to delete this entity?</Typography>
</DialogContent>
<DialogActions>
<Button onClick={() => setShowDeleteModal(false)} color="primary">
Cancel
</Button>
<Button onClick={handleDelete} color="primary">
Delete
</Button>
</DialogActions>
</Dialog>
<Snackbar
open={openSnackbar}
autoHideDuration={6000}
onClose={() => setOpenSnackbar(false)}
>
<Alert onClose={() => setOpenSnackbar(false)} severity={snackbarSeverity}>
{snackbarMessage}
</Alert>
</Snackbar>
</div>
);
};
export default EntityTable;

View File

@@ -80,6 +80,15 @@ public class BuilderService {
// }
// ADD OTHER SERVICE
addCustomMenu( "Basicp3","Basicp3", "Transcations");
addCustomMenu( "Basicp2","Basicp2", "Transcations");
addCustomMenu( "Basicp1","Basicp1", "Transcations");
System.out.println("dashboard and menu inserted...");

View File

@@ -0,0 +1,171 @@
package com.realnet.angulardatatype.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.angulardatatype.Entity.Basicp1;
import com.realnet.angulardatatype.Services.Basicp1Service ;
@RequestMapping(value = "/Basicp1")
@CrossOrigin("*")
@RestController
public class Basicp1Controller {
@Autowired
private Basicp1Service Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Basicp1")
public Basicp1 Savedata(@RequestBody Basicp1 data) {
Basicp1 save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Basicp1/{id}")
public Basicp1 update(@RequestBody Basicp1 data,@PathVariable Integer id ) {
Basicp1 update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Basicp1/getall/page")
public Page<Basicp1> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Basicp1> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Basicp1")
public List<Basicp1> getdetails() {
List<Basicp1> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Basicp1")
public List<Basicp1> getallwioutsec() {
List<Basicp1> get = Service.getdetails();
return get;
}
@GetMapping("/Basicp1/{id}")
public Basicp1 getdetailsbyId(@PathVariable Integer id ) {
Basicp1 get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Basicp1/{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,147 @@
package com.realnet.angulardatatype.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.angulardatatype.Entity.Basicp2;
import com.realnet.angulardatatype.Services.Basicp2Service ;
@RequestMapping(value = "/Basicp2")
@CrossOrigin("*")
@RestController
public class Basicp2Controller {
@Autowired
private Basicp2Service Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Basicp2")
public Basicp2 Savedata(@RequestBody Basicp2 data) {
Basicp2 save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Basicp2/{id}")
public Basicp2 update(@RequestBody Basicp2 data,@PathVariable Integer id ) {
Basicp2 update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Basicp2/getall/page")
public Page<Basicp2> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Basicp2> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Basicp2")
public List<Basicp2> getdetails() {
List<Basicp2> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Basicp2")
public List<Basicp2> getallwioutsec() {
List<Basicp2> get = Service.getdetails();
return get;
}
@GetMapping("/Basicp2/{id}")
public Basicp2 getdetailsbyId(@PathVariable Integer id ) {
Basicp2 get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Basicp2/{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,163 @@
package com.realnet.angulardatatype.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.angulardatatype.Entity.Basicp3;
import com.realnet.angulardatatype.Services.Basicp3Service ;
@RequestMapping(value = "/Basicp3")
@CrossOrigin("*")
@RestController
public class Basicp3Controller {
@Autowired
private Basicp3Service Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Basicp3")
public Basicp3 Savedata(@RequestBody Basicp3 data) {
Basicp3 save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Basicp3/{id}")
public Basicp3 update(@RequestBody Basicp3 data,@PathVariable Integer id ) {
Basicp3 update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Basicp3/getall/page")
public Page<Basicp3> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Basicp3> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Basicp3")
public List<Basicp3> getdetails() {
List<Basicp3> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Basicp3")
public List<Basicp3> getallwioutsec() {
List<Basicp3> get = Service.getdetails();
return get;
}
@GetMapping("/Basicp3/{id}")
public Basicp3 getdetailsbyId(@PathVariable Integer id ) {
Basicp3 get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Basicp3/{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,171 @@
package com.realnet.angulardatatype.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.angulardatatype.Entity.Basicp1;
import com.realnet.angulardatatype.Services.Basicp1Service ;
@RequestMapping(value = "/token/Basicp1")
@CrossOrigin("*")
@RestController
public class tokenFree_Basicp1Controller {
@Autowired
private Basicp1Service Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Basicp1")
public Basicp1 Savedata(@RequestBody Basicp1 data) {
Basicp1 save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Basicp1/{id}")
public Basicp1 update(@RequestBody Basicp1 data,@PathVariable Integer id ) {
Basicp1 update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Basicp1/getall/page")
public Page<Basicp1> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Basicp1> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Basicp1")
public List<Basicp1> getdetails() {
List<Basicp1> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Basicp1")
public List<Basicp1> getallwioutsec() {
List<Basicp1> get = Service.getdetails();
return get;
}
@GetMapping("/Basicp1/{id}")
public Basicp1 getdetailsbyId(@PathVariable Integer id ) {
Basicp1 get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Basicp1/{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,147 @@
package com.realnet.angulardatatype.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.angulardatatype.Entity.Basicp2;
import com.realnet.angulardatatype.Services.Basicp2Service ;
@RequestMapping(value = "/token/Basicp2")
@CrossOrigin("*")
@RestController
public class tokenFree_Basicp2Controller {
@Autowired
private Basicp2Service Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Basicp2")
public Basicp2 Savedata(@RequestBody Basicp2 data) {
Basicp2 save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Basicp2/{id}")
public Basicp2 update(@RequestBody Basicp2 data,@PathVariable Integer id ) {
Basicp2 update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Basicp2/getall/page")
public Page<Basicp2> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Basicp2> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Basicp2")
public List<Basicp2> getdetails() {
List<Basicp2> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Basicp2")
public List<Basicp2> getallwioutsec() {
List<Basicp2> get = Service.getdetails();
return get;
}
@GetMapping("/Basicp2/{id}")
public Basicp2 getdetailsbyId(@PathVariable Integer id ) {
Basicp2 get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Basicp2/{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,163 @@
package com.realnet.angulardatatype.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.angulardatatype.Entity.Basicp3;
import com.realnet.angulardatatype.Services.Basicp3Service ;
@RequestMapping(value = "/token/Basicp3")
@CrossOrigin("*")
@RestController
public class tokenFree_Basicp3Controller {
@Autowired
private Basicp3Service Service;
@Value("${projectPath}")
private String projectPath;
@PostMapping("/Basicp3")
public Basicp3 Savedata(@RequestBody Basicp3 data) {
Basicp3 save = Service.Savedata(data) ;
System.out.println("data saved..." + save);
return save;
}
@PutMapping("/Basicp3/{id}")
public Basicp3 update(@RequestBody Basicp3 data,@PathVariable Integer id ) {
Basicp3 update = Service.update(data,id);
System.out.println("data update..." + update);
return update;
}
// get all with pagination
@GetMapping("/Basicp3/getall/page")
public Page<Basicp3> getall(@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "size", required = false) Integer size) {
Pageable paging = PageRequest.of(page, size);
Page<Basicp3> get = Service.getAllWithPagination(paging);
return get;
}
@GetMapping("/Basicp3")
public List<Basicp3> getdetails() {
List<Basicp3> get = Service.getdetails();
return get;
}
// get all without authentication
@GetMapping("/token/Basicp3")
public List<Basicp3> getallwioutsec() {
List<Basicp3> get = Service.getdetails();
return get;
}
@GetMapping("/Basicp3/{id}")
public Basicp3 getdetailsbyId(@PathVariable Integer id ) {
Basicp3 get = Service.getdetailsbyId(id);
return get;
}
@DeleteMapping("/Basicp3/{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,77 @@
package com.realnet.angulardatatype.Entity;
import lombok.*;
import com.realnet.WhoColumn.Entity.Extension;
import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.*;
@Entity
@Data
public class Basicp1 extends Extension {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
private String name;
private String name2;
private int number1;
private int number2;
private String phone_number;
private String phone_number2;
@Column(length = 2000)
private String paragraph_field;
@Column(length = 2000)
private String paragraph_field2;
private String password_field;
@Transient
private String confirmpassword_field;
@Column(length = 2000)
private String textarea;
@Column(length = 2000)
private String textarea_field;
@Column(length = 2000)
private String textarea_field2;
}

View File

@@ -0,0 +1,59 @@
package com.realnet.angulardatatype.Entity;
import lombok.*;
import com.realnet.WhoColumn.Entity.Extension;
import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.*;
@Entity
@Data
public class Basicp2 extends Extension {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@Column(length = 2000)
private String about;
@Column(length = 2000)
private String textarea2;
private String date_field;
private String date_field2;
private String datetime_field;
private String datetime_field2;
private String email_field;
private String email_field2;
private Long user_id;
private String user_name;
}

View File

@@ -0,0 +1,64 @@
package com.realnet.angulardatatype.Entity;
import lombok.*;
import com.realnet.WhoColumn.Entity.Extension;
import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.*;
@Entity
@Data
public class Basicp3 extends Extension {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
private Boolean toggle_switch;
private Boolean toggle_switch2;
private String url_field;
private String url_field2;
private double decimal_field;
private double decimal_field2;
private int percentage_field;
private int percentage_field2;
private String documentsequenc;
private String recaptcha;
private String recaptcha2;
}

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,183 @@
package com.realnet.angulardatatype.Services;
import com.realnet.angulardatatype.Repository.Basicp1Repository;
import com.realnet.angulardatatype.Entity.Basicp1
;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 Basicp1Service {
@Autowired
private Basicp1Repository Repository;
@Autowired
private AppUserServiceImpl userService;
@Autowired
private RealmService realmService;
public Basicp1 Savedata(Basicp1 data) {
data.setUpdatedBy(getUser().getUserId());
data.setCreatedBy(getUser().getUserId());
data.setAccountId(getUser().getAccount().getAccount_id());
Basicp1 save = Repository.save(data);
return save;
}
// get all with pagination
public Page<Basicp1> getAllWithPagination(Pageable page) {
return Repository.findAll( getUser().getUserId(),page);
}
public List<Basicp1> getdetails() {
List<Realm> realm = realmService.findByUserId(getUser().getUserId());
List<Basicp1> all = Repository.findAll(getUser().getUserId());
return all ; }
public Basicp1 getdetailsbyId(Integer id) {
return Repository.findById(id).get();
}
public void delete_by_id(Integer id) {
Repository.deleteById(id);
}
public Basicp1 update(Basicp1 data,Integer id) {
Basicp1 old = Repository.findById(id).get();
old.setName(data.getName());
old.setName2(data.getName2());
old.setNumber1(data.getNumber1());
old.setNumber2(data.getNumber2());
old.setPhone_number(data.getPhone_number());
old.setPhone_number2(data.getPhone_number2());
old.setParagraph_field(data.getParagraph_field());
old.setParagraph_field2(data.getParagraph_field2());
old.setPassword_field(data.getPassword_field());
old.setTextarea(data.getTextarea());
old.setTextarea_field(data.getTextarea_field());
old.setTextarea_field2(data.getTextarea_field2());
final Basicp1 test = Repository.save(old);
data.setUpdatedBy(getUser().getUserId());
return test;}
public AppUser getUser() {
AppUser user = userService.getLoggedInUser();
return user;
}}

View File

@@ -0,0 +1,154 @@
package com.realnet.angulardatatype.Services;
import com.realnet.angulardatatype.Repository.Basicp2Repository;
import com.realnet.angulardatatype.Entity.Basicp2
;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 Basicp2Service {
@Autowired
private Basicp2Repository Repository;
@Autowired
private AppUserServiceImpl userService;
@Autowired
private RealmService realmService;
public Basicp2 Savedata(Basicp2 data) {
data.setUser_id(getUser().getUserId());
data.setUser_name(getUser().getFullName());
data.setUpdatedBy(getUser().getUserId());
data.setCreatedBy(getUser().getUserId());
data.setAccountId(getUser().getAccount().getAccount_id());
Basicp2 save = Repository.save(data);
return save;
}
// get all with pagination
public Page<Basicp2> getAllWithPagination(Pageable page) {
return Repository.findAll( getUser().getUserId(),page);
}
public List<Basicp2> getdetails() {
List<Realm> realm = realmService.findByUserId(getUser().getUserId());
List<Basicp2> all = Repository.findAll(getUser().getUserId());
return all ; }
public Basicp2 getdetailsbyId(Integer id) {
return Repository.findById(id).get();
}
public void delete_by_id(Integer id) {
Repository.deleteById(id);
}
public Basicp2 update(Basicp2 data,Integer id) {
Basicp2 old = Repository.findById(id).get();
old.setAbout(data.getAbout());
old.setTextarea2(data.getTextarea2());
old.setDate_field(data.getDate_field());
old.setDate_field2(data.getDate_field2());
old.setDatetime_field(data.getDatetime_field());
old.setDatetime_field2(data.getDatetime_field2());
old.setEmail_field(data.getEmail_field());
old.setEmail_field2(data.getEmail_field2());
final Basicp2 test = Repository.save(old);
data.setUpdatedBy(getUser().getUserId());
return test;}
public AppUser getUser() {
AppUser user = userService.getLoggedInUser();
return user;
}}

View File

@@ -0,0 +1,174 @@
package com.realnet.angulardatatype.Services;
import com.realnet.angulardatatype.Repository.Basicp3Repository;
import com.realnet.angulardatatype.Entity.Basicp3
;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 Basicp3Service {
@Autowired
private Basicp3Repository Repository;
@Autowired
private AppUserServiceImpl userService;
@Autowired
private RealmService realmService;
@Autowired
private SequenceService documentsequencsequenceService;
public Basicp3 Savedata(Basicp3 data) {
data.setDocumentsequenc (documentsequencsequenceService.GenerateSequence("ff"));
data.setUpdatedBy(getUser().getUserId());
data.setCreatedBy(getUser().getUserId());
data.setAccountId(getUser().getAccount().getAccount_id());
Basicp3 save = Repository.save(data);
return save;
}
// get all with pagination
public Page<Basicp3> getAllWithPagination(Pageable page) {
return Repository.findAll( getUser().getUserId(),page);
}
public List<Basicp3> getdetails() {
List<Realm> realm = realmService.findByUserId(getUser().getUserId());
List<Basicp3> all = Repository.findAll(getUser().getUserId());
return all ; }
public Basicp3 getdetailsbyId(Integer id) {
return Repository.findById(id).get();
}
public void delete_by_id(Integer id) {
Repository.deleteById(id);
}
public Basicp3 update(Basicp3 data,Integer id) {
Basicp3 old = Repository.findById(id).get();
old.setToggle_switch (data.getToggle_switch());
old.setToggle_switch2 (data.getToggle_switch2());
old.setUrl_field(data.getUrl_field());
old.setUrl_field2(data.getUrl_field2());
old.setDecimal_field(data.getDecimal_field());
old.setDecimal_field2(data.getDecimal_field2());
old.setPercentage_field(data.getPercentage_field());
old.setPercentage_field2(data.getPercentage_field2());
old.setDocumentsequenc(data.getDocumentsequenc());
old.setRecaptcha(data.getRecaptcha());
old.setRecaptcha2(data.getRecaptcha2());
final Basicp3 test = Repository.save(old);
data.setUpdatedBy(getUser().getUserId());
return test;}
public AppUser getUser() {
AppUser user = userService.getLoggedInUser();
return user;
}}

View File

@@ -0,0 +1,6 @@
CREATE TABLE testtensep.Basicp1(id BIGINT NOT NULL AUTO_INCREMENT, textarea_field VARCHAR(400), paragraph_field VARCHAR(400), textarea VARCHAR(400), paragraph_field2 VARCHAR(400), phone_number2 VARCHAR(400), name VARCHAR(400), number1 int, phone_number VARCHAR(400), number2 int, name2 VARCHAR(400), password_field VARCHAR(400), textarea_field2 VARCHAR(400), PRIMARY KEY (id));
CREATE TABLE testtensep.Basicp2(id BIGINT NOT NULL AUTO_INCREMENT, datetime_field2 VARCHAR(400), about VARCHAR(400), datetime_field VARCHAR(400), userid_field VARCHAR(400), email_field2 VARCHAR(400), date_field Date, email_field VARCHAR(400), textarea2 VARCHAR(400), date_field2 Date, PRIMARY KEY (id));
CREATE TABLE testtensep.Basicp3(id BIGINT NOT NULL AUTO_INCREMENT, toggle_switch2 VARCHAR(400), decimal_field2 double, documentsequenc VARCHAR(400), toggle_switch VARCHAR(400), recaptcha VARCHAR(400), percentage_field int, percentage_field2 int, url_field VARCHAR(400), url_field2 VARCHAR(400), decimal_field double, recaptcha2 VARCHAR(400), PRIMARY KEY (id));