build_app
This commit is contained in:
parent
40dd9096a5
commit
c6179cdbc4
@ -0,0 +1,120 @@
|
||||
import 'dart:typed_data';
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:http_parser/http_parser.dart';
|
||||
import '../../../../resources/api_constants.dart';
|
||||
import '../../../../data/network/base_network_service.dart';
|
||||
import '../../../../data/network/network_api_service.dart';
|
||||
|
||||
class Basicp1ApiService {
|
||||
final String baseUrl = ApiConstants.baseUrl;
|
||||
|
||||
final BaseNetworkService _helper = NetworkApiService();
|
||||
|
||||
|
||||
|
||||
Future<List<Map<String, dynamic>>> getEntities() async {
|
||||
|
||||
try {
|
||||
final response = await _helper.getGetApiResponse('$baseUrl/Basicp1/Basicp1');
|
||||
final entities = (response as List).cast<Map<String, dynamic>>();
|
||||
return entities;
|
||||
} catch (e) {
|
||||
throw Exception('Failed to get all entities: $e');
|
||||
}
|
||||
}
|
||||
Future<List<Map<String, dynamic>>> getAllWithPagination(
|
||||
int page, int size) async {
|
||||
try {
|
||||
final response =
|
||||
await _helper.getGetApiResponse('$baseUrl/Basicp1/Basicp1/getall/page?page=$page&size=$size');
|
||||
final entities =
|
||||
(response['content'] as List).cast<Map<String, dynamic>>();
|
||||
return entities;
|
||||
} catch (e) {
|
||||
throw Exception('Failed to get all without pagination: $e');
|
||||
}
|
||||
}
|
||||
Future<Map<String, dynamic>> createEntity(
|
||||
Map<String, dynamic> entity) async {
|
||||
try {
|
||||
print("in post api$entity");
|
||||
final response =
|
||||
await _helper.getPostApiResponse('$baseUrl/Basicp1/Basicp1', entity);
|
||||
|
||||
print(entity);
|
||||
|
||||
// Assuming the response is a Map<String, dynamic>
|
||||
Map<String, dynamic> responseData = response;
|
||||
|
||||
return responseData;
|
||||
} catch (e) {
|
||||
throw Exception('Failed to create entity: $e');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Future<void> updateEntity( int entityId, Map<String, dynamic> entity) async {
|
||||
try {
|
||||
await _helper.getPutApiResponse('$baseUrl/Basicp1/Basicp1/$entityId',
|
||||
entity); print(entity);
|
||||
|
||||
} catch (e) {
|
||||
throw Exception('Failed to update entity: $e');
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> deleteEntity( int entityId) async {
|
||||
try {
|
||||
await _helper.getDeleteApiResponse('$baseUrl/Basicp1/Basicp1/$entityId');
|
||||
} catch (e) {
|
||||
throw Exception('Failed to delete entity: $e');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,100 @@
|
||||
// ignore_for_file: use_build_context_synchronously
|
||||
import 'dart:convert';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../Basicp1_viewModel/Basicp1_view_model_screen.dart';
|
||||
import 'Basicp1_fields.dart';import 'package:base_project/BuilderField/shared/ui/entity_screens.dart';
|
||||
import '../../../../utils/image_constant.dart';
|
||||
import '../../../../utils/size_utils.dart';
|
||||
import '../../../../theme/app_style.dart';
|
||||
import '../../../../widgets/app_bar/appbar_image.dart';
|
||||
import '../../../../widgets/app_bar/appbar_title.dart';
|
||||
import '../../../../widgets/app_bar/custom_app_bar.dart';
|
||||
import '../../../../widgets/custom_button.dart';
|
||||
import '../../../../widgets/custom_text_form_field.dart';
|
||||
import '../../../../widgets/custom_dropdown_field.dart';
|
||||
import 'dart:math';
|
||||
import 'package:qr_flutter/qr_flutter.dart';
|
||||
import 'package:barcode_widget/barcode_widget.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
import 'package:autocomplete_textfield/autocomplete_textfield.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
import '../../../../Reuseable/reusable_date_picker_field.dart';
|
||||
import '../../../../Reuseable/reusable_date_time_picker_field.dart'
|
||||
;import 'package:multi_select_flutter/multi_select_flutter.dart';
|
||||
import 'package:just_audio/just_audio.dart';
|
||||
import 'package:video_player/video_player.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:lottie/lottie.dart';
|
||||
import '../../../../utils/toast_messages/toast_message_util.dart';
|
||||
import 'dart:io';
|
||||
import '../../../../Reuseable/reusable_text_field.dart';
|
||||
import '../../../../Reuseable/reusable_dropdown_field.dart';
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class Basicp1CreateEntityScreen extends StatefulWidget {
|
||||
const Basicp1CreateEntityScreen({super.key});
|
||||
|
||||
@override
|
||||
_Basicp1CreateEntityScreenState createState() => _Basicp1CreateEntityScreenState();
|
||||
}
|
||||
|
||||
class _Basicp1CreateEntityScreenState extends State<Basicp1CreateEntityScreen> {
|
||||
|
||||
final Map<String, dynamic> formData = {};
|
||||
final _formKey = GlobalKey<FormState>();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Consumer<Basicp1ViewModelScreen>(
|
||||
builder: (context, viewModel, child) {
|
||||
return EntityCreateScreen(
|
||||
fields: Basicp1Fields.getFields(),
|
||||
onSubmit: (data) => _handleSubmit(data),
|
||||
title: 'Basicp1',
|
||||
isLoading: viewModel.isLoading,
|
||||
errorMessage:
|
||||
viewModel.errorMessage.isNotEmpty ? viewModel.errorMessage : null,
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _handleSubmit(Map<String, dynamic> formData) async {
|
||||
final provider =
|
||||
Provider.of<Basicp1ViewModelScreen>(context, listen: false);
|
||||
final success = await provider.createEntity(formData);
|
||||
|
||||
if (success && mounted) {
|
||||
Navigator.pop(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,108 @@
|
||||
// ignore_for_file: use_build_context_synchronously
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../../../../BuilderField/shared/ui/entity_details.dart';
|
||||
import '../Basicp1_viewModel/Basicp1_view_model_screen.dart';
|
||||
import 'Basicp1_update_entity_screen.dart';
|
||||
|
||||
class Basicp1DetailsScreen extends StatefulWidget {
|
||||
final Map<String, dynamic> entity;
|
||||
|
||||
const Basicp1DetailsScreen({
|
||||
super.key,
|
||||
required this.entity,
|
||||
});
|
||||
|
||||
@override
|
||||
State<Basicp1DetailsScreen> createState() => _Basicp1DetailsScreenState();
|
||||
}
|
||||
|
||||
class _Basicp1DetailsScreenState extends State<Basicp1DetailsScreen> {
|
||||
void _navigateToUpdateScreen(Map<String, dynamic> entity) {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => ChangeNotifierProvider(
|
||||
create: (context) => Basicp1ViewModelScreen(),
|
||||
child: Basicp1UpdateEntityScreen(entity: entity),
|
||||
),
|
||||
),
|
||||
).then((_) {
|
||||
// Refresh the details screen with updated data
|
||||
setState(() {});
|
||||
});
|
||||
}
|
||||
|
||||
void _showDeleteDialog(Map<String, dynamic> entity) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
title: const Text('Confirm Deletion'),
|
||||
content: const Text('Are you sure you want to delete this Basicp1?'),
|
||||
actions: [
|
||||
TextButton(
|
||||
child: const Text('Cancel'),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
TextButton(
|
||||
child: const Text('Delete'),
|
||||
onPressed: () async {
|
||||
Navigator.of(context).pop();
|
||||
final vm =
|
||||
Provider.of<Basicp1ViewModelScreen>(context, listen: false);
|
||||
final success = await vm.deleteEntity(entity['id']);
|
||||
if (success && mounted) {
|
||||
Navigator.pop(context); // Go back to list
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Consumer<Basicp1ViewModelScreen>(
|
||||
builder: (context, viewModel, child) {
|
||||
return EntityDetails(
|
||||
entity: widget.entity,
|
||||
onEdit: (entity) => _navigateToUpdateScreen(entity),
|
||||
onDelete: (entity) => _showDeleteDialog(entity),
|
||||
title: 'Basicp1',
|
||||
displayFields: [
|
||||
{'key': 'name', 'label': 'name', 'type': 'text'},
|
||||
|
||||
{'key': 'name2', 'label': 'name2', 'type': 'text'},
|
||||
|
||||
{'key': 'number1', 'label': 'number1', 'type': 'number'},
|
||||
|
||||
{'key': 'number2', 'label': 'number2', 'type': 'number'},
|
||||
|
||||
{'key': 'phone_number', 'label': 'Phone Number', 'type': 'phone'},
|
||||
|
||||
{'key': 'phone_number2', 'label': 'Phone Number2', 'type': 'phone'},
|
||||
|
||||
{'key': 'paragraph_field', 'label': 'Paragraph Field', 'type': 'paragraph'},
|
||||
|
||||
{'key': 'paragraph_field2', 'label': 'Paragraph Field2', 'type': 'paragraph'},
|
||||
|
||||
{'key': 'password_field', 'label': 'Password Field', 'type': 'password'},
|
||||
|
||||
{'key': 'textarea', 'label': 'Textarea', 'type': 'textarea'},
|
||||
|
||||
{'key': 'textarea_field', 'label': 'Textarea Field', 'type': 'textarea'},
|
||||
|
||||
{'key': 'textarea_field2', 'label': 'Textarea Field2', 'type': 'textarea'},
|
||||
|
||||
],
|
||||
isLoading: viewModel.isLoading,
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,167 @@
|
||||
// ignore_for_file: use_build_context_synchronously
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:base_project/BuilderField/shared/ui/entity_list.dart';
|
||||
import 'Basicp1_create_entity_screen.dart';
|
||||
import 'Basicp1_update_entity_screen.dart';
|
||||
import '../Basicp1_viewModel/Basicp1_view_model_screen.dart';
|
||||
import 'Basicp1_details_screen.dart';import 'package:flutter/services.dart';
|
||||
import 'package:speech_to_text/speech_to_text.dart' as stt;
|
||||
import '../../../../theme/app_style.dart';
|
||||
import '../../../../utils/size_utils.dart';
|
||||
import '../../../../widgets/custom_icon_button.dart';
|
||||
import '../../../../utils/image_constant.dart';
|
||||
import '../../../../widgets/app_bar/appbar_image.dart';
|
||||
import '../../../../widgets/app_bar/appbar_title.dart';
|
||||
import '../../../../widgets/app_bar/custom_app_bar.dart';
|
||||
import '../../../../theme/app_decoration.dart';
|
||||
import 'package:multi_select_flutter/multi_select_flutter.dart';
|
||||
import '../../../../Reuseable/reusable_text_field.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../../../../utils/toast_messages/toast_message_util.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
|
||||
class Basicp1_entity_list_screen extends StatefulWidget {
|
||||
static const String routeName = '/entity-list';
|
||||
|
||||
@override
|
||||
_Basicp1_entity_list_screenState createState() => _Basicp1_entity_list_screenState();
|
||||
}
|
||||
|
||||
class _Basicp1_entity_list_screenState extends State<Basicp1_entity_list_screen> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_loadData();
|
||||
}
|
||||
|
||||
void _loadData() {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (mounted) {
|
||||
final vm = Provider.of<Basicp1ViewModelScreen>(context, listen: false);
|
||||
vm.getAllWithPagination(refresh: true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void _navigateToCreateScreen() {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => ChangeNotifierProvider(
|
||||
create: (context) => Basicp1ViewModelScreen(),
|
||||
child: const Basicp1CreateEntityScreen(),
|
||||
),
|
||||
),
|
||||
).then((_) {
|
||||
final vm = Provider.of<Basicp1ViewModelScreen>(context, listen: false);
|
||||
vm.refreshData();
|
||||
});
|
||||
}
|
||||
|
||||
void _navigateToUpdateScreen(Map<String, dynamic> entity) {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => ChangeNotifierProvider(
|
||||
create: (context) => Basicp1ViewModelScreen(),
|
||||
child: Basicp1UpdateEntityScreen(entity: entity),
|
||||
),
|
||||
),
|
||||
).then((_) {
|
||||
final vm = Provider.of<Basicp1ViewModelScreen>(context, listen: false);
|
||||
vm.refreshData();
|
||||
});
|
||||
}
|
||||
|
||||
void _navigateToDetailsScreen(Map<String, dynamic> entity) {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => ChangeNotifierProvider(
|
||||
create: (context) => Basicp1ViewModelScreen(),
|
||||
child: Basicp1DetailsScreen(entity: entity),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void _showDeleteDialog(Map<String, dynamic> entity) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
title: const Text('Confirm Deletion'),
|
||||
content: const Text('Are you sure you want to delete this Basicp1?'),
|
||||
actions: [
|
||||
TextButton(
|
||||
child: const Text('Cancel'),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
TextButton(
|
||||
child: const Text('Delete'),
|
||||
onPressed: () async {
|
||||
Navigator.of(context).pop();
|
||||
final vm =
|
||||
Provider.of<Basicp1ViewModelScreen>(context, listen: false);
|
||||
await vm.deleteEntity(entity['id']);
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Consumer<Basicp1ViewModelScreen>(
|
||||
builder: (context, viewModel, child) {
|
||||
return EntityList(
|
||||
entities: viewModel.filteredList,
|
||||
isLoading: viewModel.isLoading,
|
||||
errorMessage:
|
||||
viewModel.errorMessage.isNotEmpty ? viewModel.errorMessage : null,
|
||||
hasMoreData: viewModel.hasMoreData,
|
||||
searchQuery: viewModel.searchQuery,
|
||||
onSearchChanged: (query) => viewModel.searchbasicp1(query),
|
||||
onEdit: (entity) => _navigateToUpdateScreen(entity),
|
||||
onDelete: (entity) => _showDeleteDialog(entity),
|
||||
onTap: (entity) => _navigateToDetailsScreen(entity),
|
||||
onRefresh: () => viewModel.refreshData(),
|
||||
onLoadMore: () => viewModel.getAllWithPagination(),
|
||||
title: 'Basicp1',
|
||||
onAddNew: _navigateToCreateScreen,
|
||||
displayFields: [
|
||||
{'key': 'name', 'label': 'name', 'type': 'text'},
|
||||
|
||||
{'key': 'name2', 'label': 'name2', 'type': 'text'},
|
||||
|
||||
{'key': 'number1', 'label': 'number1', 'type': 'number'},
|
||||
|
||||
{'key': 'number2', 'label': 'number2', 'type': 'number'},
|
||||
|
||||
{'key': 'phone_number', 'label': 'Phone Number', 'type': 'phone'},
|
||||
|
||||
{'key': 'phone_number2', 'label': 'Phone Number2', 'type': 'phone'},
|
||||
|
||||
{'key': 'paragraph_field', 'label': 'Paragraph Field', 'type': 'paragraph'},
|
||||
|
||||
{'key': 'paragraph_field2', 'label': 'Paragraph Field2', 'type': 'paragraph'},
|
||||
|
||||
{'key': 'password_field', 'label': 'Password Field', 'type': 'password'},
|
||||
|
||||
{'key': 'textarea', 'label': 'Textarea', 'type': 'textarea'},
|
||||
|
||||
{'key': 'textarea_field', 'label': 'Textarea Field', 'type': 'textarea'},
|
||||
|
||||
{'key': 'textarea_field2', 'label': 'Textarea Field2', 'type': 'textarea'},
|
||||
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,146 @@
|
||||
import 'package:base_project/BuilderField/shared/fields/number_field.dart';
|
||||
import 'package:base_project/BuilderField/shared/fields/password_field.dart';
|
||||
import 'package:base_project/BuilderField/shared/fields/phone_field.dart';
|
||||
import 'package:base_project/BuilderField/shared/fields/custom_text_field.dart';
|
||||
|
||||
import '../../../../BuilderField/shared/fields/base_field.dart';
|
||||
|
||||
import '../../../../BuilderField/shared/fields/date_field.dart';
|
||||
import '../../../../BuilderField/shared/fields/datetime_field.dart';
|
||||
import '../../../../BuilderField/shared/fields/email_field.dart';
|
||||
import 'package:base_project/BuilderField/shared/fields/url_field.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../../../BuilderField/shared/fields/base_field.dart';
|
||||
import '../../../../BuilderField/shared/fields/custom_text_field.dart' as shared_text;
|
||||
import '../../../../BuilderField/shared/fields/captcha_field.dart';
|
||||
import '../../../../BuilderField/shared/fields/switch_field.dart';
|
||||
import '../../../../BuilderField/shared/fields/url_field.dart';
|
||||
|
||||
import '../../../../BuilderField/shared/fields/audio_upload_field.dart';
|
||||
import '../../../../BuilderField/shared/fields/checkbox_field.dart';
|
||||
import '../../../../BuilderField/shared/fields/file_upload_field.dart';
|
||||
import '../../../../BuilderField/shared/fields/image_upload_field.dart';
|
||||
import '../../../../BuilderField/shared/fields/radio_field.dart';
|
||||
import '../../../../BuilderField/shared/fields/video_upload_field.dart';
|
||||
/// Field definitions for Basicp1 entity
|
||||
/// This defines the structure and validation for Basicp1 forms
|
||||
class Basicp1Fields {
|
||||
/// Get field definitions for Basicp1 entity
|
||||
static List<BaseField> getFields() {
|
||||
return [
|
||||
// Basic Information
|
||||
CustomTextField(
|
||||
fieldKey: 'name',
|
||||
label: 'name',
|
||||
hint: 'Enter name',
|
||||
isRequired: true,
|
||||
maxLength: 50,
|
||||
),
|
||||
|
||||
CustomTextField(
|
||||
fieldKey: 'name2',
|
||||
label: 'name2',
|
||||
hint: 'Enter name2',
|
||||
isRequired: true,
|
||||
maxLength: 50,
|
||||
),
|
||||
|
||||
// Number Fields
|
||||
NumberField(
|
||||
fieldKey: 'number1',
|
||||
label: 'number1',
|
||||
hint: 'Enter number1',
|
||||
isRequired: false,
|
||||
min: 0,
|
||||
decimalPlaces: 0,
|
||||
),
|
||||
|
||||
// Number Fields
|
||||
NumberField(
|
||||
fieldKey: 'number2',
|
||||
label: 'number2',
|
||||
hint: 'Enter number2',
|
||||
isRequired: false,
|
||||
min: 0,
|
||||
decimalPlaces: 0,
|
||||
),
|
||||
|
||||
CustomTextField(
|
||||
fieldKey: 'phone_number',
|
||||
label: 'Phone Number',
|
||||
hint: 'Enter Phone Number',
|
||||
isRequired: false,
|
||||
countryCode: '+91',
|
||||
),
|
||||
|
||||
CustomTextField(
|
||||
fieldKey: 'phone_number2',
|
||||
label: 'Phone Number2',
|
||||
hint: 'Enter Phone Number2',
|
||||
isRequired: false,
|
||||
countryCode: '+91',
|
||||
),
|
||||
|
||||
CustomTextField(
|
||||
fieldKey: 'paragraph_field',
|
||||
label: 'Paragraph Field',
|
||||
hint: 'Enter Paragraph Field',
|
||||
isRequired: false,
|
||||
maxLength: 500,
|
||||
),
|
||||
|
||||
CustomTextField(
|
||||
fieldKey: 'paragraph_field2',
|
||||
label: 'Paragraph Field2',
|
||||
hint: 'Enter Paragraph Field2',
|
||||
isRequired: false,
|
||||
maxLength: 500,
|
||||
),
|
||||
|
||||
|
||||
// Password Fields (dynamic names supported via fieldKey)
|
||||
PasswordField(
|
||||
fieldKey: 'password_field',
|
||||
label: 'Password Field',
|
||||
hint: 'Enter Password Field',
|
||||
isRequired: false,
|
||||
maxLength: 50,
|
||||
groupId: 'p1',
|
||||
),
|
||||
PasswordField(
|
||||
fieldKey: 'confirm+password_field',
|
||||
label: 'Confirm Password Field',
|
||||
hint: 'Confirm Password Field',
|
||||
isRequired: false,
|
||||
maxLength: 50,
|
||||
groupId: 'p1',
|
||||
isConfirm: true,
|
||||
),
|
||||
|
||||
CustomTextField(
|
||||
fieldKey: 'textarea',
|
||||
label: 'Textarea',
|
||||
hint: 'Enter Textarea',
|
||||
isRequired: false,
|
||||
maxLength: 1000,
|
||||
),
|
||||
|
||||
CustomTextField(
|
||||
fieldKey: 'textarea_field',
|
||||
label: 'Textarea Field',
|
||||
hint: 'Enter Textarea Field',
|
||||
isRequired: false,
|
||||
maxLength: 1000,
|
||||
),
|
||||
|
||||
CustomTextField(
|
||||
fieldKey: 'textarea_field2',
|
||||
label: 'Textarea Field2',
|
||||
hint: 'Enter Textarea Field2',
|
||||
isRequired: false,
|
||||
maxLength: 1000,
|
||||
),
|
||||
|
||||
];
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,66 @@
|
||||
// ignore_for_file: use_build_context_synchronously
|
||||
import 'dart:convert';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../Basicp1_viewModel/Basicp1_view_model_screen.dart';
|
||||
import 'package:base_project/BuilderField/shared/ui/entity_screens.dart';
|
||||
import 'Basicp1_fields.dart';import '../../../../utils/image_constant.dart';
|
||||
import '../../../../utils/size_utils.dart';
|
||||
import '../../../../theme/app_style.dart';
|
||||
import '../../../../widgets/app_bar/appbar_image.dart';
|
||||
import '../../../../widgets/app_bar/appbar_title.dart';
|
||||
import '../../../../widgets/app_bar/custom_app_bar.dart';
|
||||
import 'package:barcode_widget/barcode_widget.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
import '../../../../widgets/custom_button.dart';
|
||||
import '../../../../widgets/custom_text_form_field.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:autocomplete_textfield/autocomplete_textfield.dart';
|
||||
import 'package:qr_flutter/qr_flutter.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
import 'dart:math';
|
||||
import '../../../../Reuseable/reusable_text_field.dart';
|
||||
import '../../../../Reuseable/reusable_date_picker_field.dart';
|
||||
import '../../../../Reuseable/reusable_date_time_picker_field.dart';
|
||||
import '../../../../Reuseable/reusable_dropdown_field.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
class Basicp1UpdateEntityScreen extends StatefulWidget {
|
||||
final Map<String, dynamic> entity;
|
||||
|
||||
|
||||
Basicp1UpdateEntityScreen({required this.entity});
|
||||
|
||||
@override
|
||||
_Basicp1UpdateEntityScreenState createState() => _Basicp1UpdateEntityScreenState();
|
||||
}
|
||||
|
||||
class _Basicp1UpdateEntityScreenState extends State<Basicp1UpdateEntityScreen> {
|
||||
final _formKey = GlobalKey<FormState>();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Consumer<Basicp1ViewModelScreen>(
|
||||
builder: (context, viewModel, child) {
|
||||
return EntityUpdateScreen(
|
||||
fields: Basicp1Fields.getFields(),
|
||||
initialData: widget.entity,
|
||||
onSubmit: (data) => _handleSubmit(data),
|
||||
title: 'Basicp1',
|
||||
isLoading: viewModel.isLoading,
|
||||
errorMessage:
|
||||
viewModel.errorMessage.isNotEmpty ? viewModel.errorMessage : null,
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _handleSubmit(Map<String, dynamic> formData) async {
|
||||
final provider =
|
||||
Provider.of<Basicp1ViewModelScreen>(context, listen: false);
|
||||
final success = await provider.updateEntity(widget.entity['id'], formData);
|
||||
|
||||
if (success && mounted) {
|
||||
Navigator.pop(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,96 @@
|
||||
import 'package:dio/dio.dart';
|
||||
import '../../../../data/network/base_network_service.dart';
|
||||
import '../../../../data/network/network_api_service.dart';
|
||||
import '../../../../resources/api_constants.dart';
|
||||
import 'package:base_project/data/response/api_response.dart';
|
||||
|
||||
class Basicp1RepoScreen {
|
||||
|
||||
final String baseUrl = ApiConstants.baseUrl;
|
||||
final BaseNetworkService _helper = NetworkApiService();
|
||||
final String _endpointPath = '/Basicp1/Basicp1';
|
||||
|
||||
Future<ApiResponse<List<Map<String, dynamic>>>> getEntities() async {
|
||||
try {
|
||||
final response =
|
||||
await _helper.getGetApiResponse('$baseUrl$_endpointPath');
|
||||
return ApiResponse.success(response as List<Map<String, dynamic>>);
|
||||
} catch (e) {
|
||||
return ApiResponse.error('Failed to get all entities: $e');
|
||||
}
|
||||
}
|
||||
|
||||
Future<ApiResponse<List<Map<String, dynamic>>>> getAllWithPagination(
|
||||
int page, int size) async {
|
||||
try {
|
||||
final response = await _helper.getGetApiResponse(
|
||||
'$baseUrl$_endpointPath/getall/page?page=$page&size=$size');
|
||||
|
||||
if (response is Map<String, dynamic> && response['content'] is List) {
|
||||
final List<Map<String, dynamic>> entities =
|
||||
(response['content'] as List).cast<Map<String, dynamic>>().toList();
|
||||
return ApiResponse.success(entities);
|
||||
} else {
|
||||
return ApiResponse.error('Invalid response format');
|
||||
}
|
||||
} catch (e) {
|
||||
return ApiResponse.error('Failed to get all without pagination: $e');
|
||||
}
|
||||
}
|
||||
|
||||
Future<ApiResponse<Map<String, dynamic>>> createEntity(
|
||||
Map<String, dynamic> entity) async {
|
||||
try {
|
||||
print("in post api$entity");
|
||||
final response =
|
||||
await _helper.getPostApiResponse('$baseUrl$_endpointPath', entity);
|
||||
return ApiResponse.success(response as Map<String, dynamic>);
|
||||
} catch (e) {
|
||||
return ApiResponse.error('Failed to create entity: $e');
|
||||
}
|
||||
}
|
||||
|
||||
Future<ApiResponse<Map<String, dynamic>>> updateEntity(
|
||||
int entityId, Map<String, dynamic> entity) async {
|
||||
try {
|
||||
final response = await _helper.getPutApiResponse(
|
||||
'$baseUrl$_endpointPath/$entityId', entity);
|
||||
return ApiResponse.success(response as Map<String, dynamic>);
|
||||
} catch (e) {
|
||||
return ApiResponse.error('Failed to update entity: $e');
|
||||
}
|
||||
}
|
||||
|
||||
Future<ApiResponse<void>> deleteEntity(int entityId) async {
|
||||
try {
|
||||
await _helper.getDeleteApiResponse('$baseUrl$_endpointPath/$entityId');
|
||||
return ApiResponse.success(null);
|
||||
} catch (e) {
|
||||
return ApiResponse.error('Failed to delete entity: $e');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,352 @@
|
||||
import 'package:base_project/data/response/status.dart';
|
||||
import 'dart:typed_data';
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:http_parser/http_parser.dart';
|
||||
import '../../../../utils/toast_messages/toast_message_util.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '../Basicp1_Repo/Basicp1_repo_screen.dart';
|
||||
|
||||
class Basicp1ViewModelScreen extends ChangeNotifier{
|
||||
final Basicp1RepoScreen repo = Basicp1RepoScreen();
|
||||
|
||||
|
||||
// State variables
|
||||
List<Map<String, dynamic>> _basicp1List = [];
|
||||
List<Map<String, dynamic>> _filteredList = [];
|
||||
bool _isLoading = false;
|
||||
String _errorMessage = '';
|
||||
int _currentPage = 0;
|
||||
int _pageSize = 10;
|
||||
bool _hasMoreData = true;
|
||||
String _searchQuery = '';
|
||||
|
||||
// Getters
|
||||
List<Map<String, dynamic>> get basicp1List => _basicp1List;
|
||||
List<Map<String, dynamic>> get filteredList => _filteredList;
|
||||
bool get isLoading => _isLoading;
|
||||
String get errorMessage => _errorMessage;
|
||||
bool get hasMoreData => _hasMoreData;
|
||||
String get searchQuery => _searchQuery;
|
||||
|
||||
// Set loading state
|
||||
void _setLoading(bool loading) {
|
||||
_isLoading = loading;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
// Set error message
|
||||
void _setError(String error) {
|
||||
_errorMessage = error;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
// Clear error
|
||||
void clearError() {
|
||||
_errorMessage = '';
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
// Get basicp1 list
|
||||
Future<void> getEntities() async {
|
||||
_setLoading(true);
|
||||
_setError('');
|
||||
|
||||
try {
|
||||
final response = await repo.getEntities();
|
||||
|
||||
if (response.status == Status.SUCCESS) {
|
||||
_basicp1List = response.data ?? [];
|
||||
_filteredList = List.from(_basicp1List);
|
||||
_currentPage = 0;
|
||||
_hasMoreData = true;
|
||||
} else {
|
||||
_setError(response.message ?? 'Failed to fetch basicp1 list');
|
||||
}
|
||||
} catch (e) {
|
||||
_setError('Failed to fetch basicp1 list: $e');
|
||||
} finally {
|
||||
_setLoading(false);
|
||||
}
|
||||
}
|
||||
|
||||
// Get basicp1 list with pagination
|
||||
Future<void> getAllWithPagination({bool refresh = false}) async {
|
||||
if (refresh) {
|
||||
_currentPage = 0;
|
||||
_basicp1List.clear();
|
||||
_filteredList.clear();
|
||||
_hasMoreData = true;
|
||||
}
|
||||
|
||||
if (!_hasMoreData || _isLoading) return;
|
||||
|
||||
_setLoading(true);
|
||||
_setError('');
|
||||
|
||||
try {
|
||||
final response = await repo.getAllWithPagination(_currentPage, _pageSize);
|
||||
|
||||
if (response.status == Status.SUCCESS) {
|
||||
final newItems = response.data ?? [];
|
||||
|
||||
if (refresh) {
|
||||
_basicp1List = newItems;
|
||||
} else {
|
||||
_basicp1List.addAll(newItems);
|
||||
}
|
||||
|
||||
_filteredList = List.from(_basicp1List);
|
||||
_currentPage++;
|
||||
|
||||
// Check if we have more data
|
||||
_hasMoreData = newItems.length == _pageSize;
|
||||
} else {
|
||||
_setError(response.message ?? 'Failed to fetch Basicp1 list');
|
||||
}
|
||||
} catch (e) {
|
||||
_setError('Failed to fetch basicp1 list: $e');
|
||||
} finally {
|
||||
_setLoading(false);
|
||||
}
|
||||
}
|
||||
|
||||
// Create Basicp1
|
||||
Future<bool> createEntity(Map<String, dynamic> entity) async {
|
||||
_setLoading(true);
|
||||
_setError('');
|
||||
|
||||
try {
|
||||
final response = await repo.createEntity(entity);
|
||||
|
||||
if (response.status == Status.SUCCESS) {
|
||||
ToastMessageUtil.showToast(
|
||||
message: 'basicp1 created successfully',
|
||||
toastType: ToastType.success,
|
||||
);
|
||||
|
||||
// Refresh the list
|
||||
await getEntities();
|
||||
return true;
|
||||
} else {
|
||||
_setError(response.message ?? 'Failed to create Basicp1');
|
||||
ToastMessageUtil.showToast(
|
||||
message: response.message ?? 'Failed to create Basicp1',
|
||||
toastType: ToastType.error,
|
||||
);
|
||||
return false;
|
||||
}
|
||||
} catch (e) {
|
||||
_setError('Failed to create basicp1: $e');
|
||||
ToastMessageUtil.showToast(
|
||||
message: 'Failed to create Basicp1: $e',
|
||||
toastType: ToastType.error,
|
||||
);
|
||||
return false;
|
||||
} finally {
|
||||
_setLoading(false);
|
||||
}
|
||||
}
|
||||
|
||||
// Update basicp1
|
||||
Future<bool> updateEntity(int id, Map<String, dynamic> entity) async {
|
||||
_setLoading(true);
|
||||
_setError('');
|
||||
|
||||
try {
|
||||
final response = await repo.updateEntity(id, entity);
|
||||
|
||||
if (response.status == Status.SUCCESS) {
|
||||
ToastMessageUtil.showToast(
|
||||
message: 'Basicp1 updated successfully',
|
||||
toastType: ToastType.success,
|
||||
);
|
||||
|
||||
// Update the item in the list
|
||||
final index = _basicp1List.indexWhere((item) => item['id'] == id);
|
||||
if (index != -1) {
|
||||
_basicp1List[index] = response.data!;
|
||||
_filteredList = List.from(_basicp1List);
|
||||
notifyListeners();
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
_setError(response.message ?? 'Failed to update Basicp1');
|
||||
ToastMessageUtil.showToast(
|
||||
message: response.message ?? 'Failed to update Basicp1',
|
||||
toastType: ToastType.error,
|
||||
);
|
||||
return false;
|
||||
}
|
||||
} catch (e) {
|
||||
_setError('Failed to update basicp1: $e');
|
||||
ToastMessageUtil.showToast(
|
||||
message: 'Failed to update Basicp1: $e',
|
||||
toastType: ToastType.error,
|
||||
);
|
||||
return false;
|
||||
} finally {
|
||||
_setLoading(false);
|
||||
}
|
||||
}
|
||||
|
||||
// Delete basicp1
|
||||
Future<bool> deleteEntity(int id) async {
|
||||
_setLoading(true);
|
||||
_setError('');
|
||||
|
||||
try {
|
||||
final response = await repo.deleteEntity(id);
|
||||
|
||||
if (response.status == Status.SUCCESS) {
|
||||
ToastMessageUtil.showToast(
|
||||
message: 'Basicp1 deleted successfully',
|
||||
toastType: ToastType.success,
|
||||
);
|
||||
|
||||
// Remove the item from the list
|
||||
_basicp1List.removeWhere((item) => item['id'] == id);
|
||||
_filteredList = List.from(_basicp1List);
|
||||
notifyListeners();
|
||||
return true;
|
||||
} else {
|
||||
_setError(response.message ?? 'Failed to delete Basicp1');
|
||||
ToastMessageUtil.showToast(
|
||||
message: response.message ?? 'Failed to delete Basicp1',
|
||||
toastType: ToastType.error,
|
||||
);
|
||||
return false;
|
||||
}
|
||||
} catch (e) {
|
||||
_setError('Failed to delete basicp1: $e');
|
||||
ToastMessageUtil.showToast(
|
||||
message: 'Failed to delete Basicp1: $e',
|
||||
toastType: ToastType.error,
|
||||
);
|
||||
return false;
|
||||
} finally {
|
||||
_setLoading(false);
|
||||
}
|
||||
}
|
||||
|
||||
// Search basicp1
|
||||
void searchbasicp1(String query) {
|
||||
_searchQuery = query;
|
||||
|
||||
if (query.isEmpty) {
|
||||
_filteredList = List.from(_basicp1List);
|
||||
} else {
|
||||
_filteredList = _basicp1List.where((item) {
|
||||
return
|
||||
|
||||
|
||||
(item['name']?.toString().toLowerCase().contains(query.toLowerCase()) ??false) ||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
(item['name2']?.toString().toLowerCase().contains(query.toLowerCase()) ??false) ||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
(item['number1']?.toString().toLowerCase().contains(query.toLowerCase()) ??false) ||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
(item['number2']?.toString().toLowerCase().contains(query.toLowerCase()) ??false) ||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
(item['phone_number']?.toString().toLowerCase().contains(query.toLowerCase()) ??false) ||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
(item['phone_number2']?.toString().toLowerCase().contains(query.toLowerCase()) ??false) ||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
(item['paragraph_field']?.toString().toLowerCase().contains(query.toLowerCase()) ??false) ||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
(item['paragraph_field2']?.toString().toLowerCase().contains(query.toLowerCase()) ??false) ||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
(item['password_field']?.toString().toLowerCase().contains(query.toLowerCase()) ??false) ||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
(item['textarea']?.toString().toLowerCase().contains(query.toLowerCase()) ??false) ||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
(item['textarea_field']?.toString().toLowerCase().contains(query.toLowerCase()) ??false) ||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
(item['textarea_field2']?.toString().toLowerCase().contains(query.toLowerCase()) ??false)
|
||||
|
||||
|
||||
;
|
||||
}).toList();
|
||||
}
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
// Clear search
|
||||
void clearSearch() {
|
||||
_searchQuery = '';
|
||||
_filteredList = List.from(_basicp1List);
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
// Refresh data
|
||||
Future<void> refreshData() async {
|
||||
await getAllWithPagination(refresh: true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -69,6 +69,9 @@ public class BuilderService {
|
||||
executeDump(true);
|
||||
|
||||
// ADD OTHER SERVICE
|
||||
addCustomMenu( "Basicp1","Basicp1", "Transcations");
|
||||
|
||||
|
||||
|
||||
System.out.println("dashboard and menu inserted...");
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
package com.realnet.angulardatatype.Controllers;
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.realnet.angulardatatype.Entity.District_ListFilter1;
|
||||
import com.realnet.angulardatatype.Services.District_ListFilter1Service ;
|
||||
@RequestMapping(value = "/District_ListFilter1")
|
||||
@RestController
|
||||
public class District_ListFilter1Controller {
|
||||
|
||||
@Autowired
|
||||
private District_ListFilter1Service Service;
|
||||
|
||||
@GetMapping("/District_ListFilter1")
|
||||
public List<District_ListFilter1> getlist() {
|
||||
List<District_ListFilter1> get = Service.getlistbuilder();
|
||||
return get;
|
||||
}
|
||||
@GetMapping("/District_ListFilter11/{item}")
|
||||
public List<District_ListFilter1> getlistwithparam( @PathVariable String item) {
|
||||
List<District_ListFilter1> get = Service.getlistbuilderparam( item);
|
||||
return get;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
package com.realnet.angulardatatype.Controllers;
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.realnet.angulardatatype.Entity.State_ListFilter1;
|
||||
import com.realnet.angulardatatype.Services.State_ListFilter1Service ;
|
||||
@RequestMapping(value = "/State_ListFilter1")
|
||||
@RestController
|
||||
public class State_ListFilter1Controller {
|
||||
|
||||
@Autowired
|
||||
private State_ListFilter1Service Service;
|
||||
|
||||
@GetMapping("/State_ListFilter1")
|
||||
public List<State_ListFilter1> getlist() {
|
||||
List<State_ListFilter1> get = Service.getlistbuilder();
|
||||
return get;
|
||||
}
|
||||
@GetMapping("/State_ListFilter11/{item}")
|
||||
public List<State_ListFilter1> getlistwithparam( @PathVariable String item) {
|
||||
List<State_ListFilter1> get = Service.getlistbuilderparam( item);
|
||||
return get;
|
||||
}
|
||||
}
|
||||
@ -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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
package com.realnet.angulardatatype.Controllers;
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.realnet.angulardatatype.Entity.District_ListFilter1;
|
||||
import com.realnet.angulardatatype.Services.District_ListFilter1Service ;
|
||||
@RequestMapping(value = "/token/District_ListFilter1")
|
||||
@RestController
|
||||
public class tokenFree_District_ListFilter1Controller {
|
||||
|
||||
@Autowired
|
||||
private District_ListFilter1Service Service;
|
||||
|
||||
@GetMapping("/District_ListFilter1")
|
||||
public List<District_ListFilter1> getlist() {
|
||||
List<District_ListFilter1> get = Service.getlistbuilder();
|
||||
return get;
|
||||
}
|
||||
@GetMapping("/District_ListFilter11/{item}")
|
||||
public List<District_ListFilter1> getlistwithparam( @PathVariable String item) {
|
||||
List<District_ListFilter1> get = Service.getlistbuilderparam( item);
|
||||
return get;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
package com.realnet.angulardatatype.Controllers;
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.realnet.angulardatatype.Entity.State_ListFilter1;
|
||||
import com.realnet.angulardatatype.Services.State_ListFilter1Service ;
|
||||
@RequestMapping(value = "/token/State_ListFilter1")
|
||||
@RestController
|
||||
public class tokenFree_State_ListFilter1Controller {
|
||||
|
||||
@Autowired
|
||||
private State_ListFilter1Service Service;
|
||||
|
||||
@GetMapping("/State_ListFilter1")
|
||||
public List<State_ListFilter1> getlist() {
|
||||
List<State_ListFilter1> get = Service.getlistbuilder();
|
||||
return get;
|
||||
}
|
||||
@GetMapping("/State_ListFilter11/{item}")
|
||||
public List<State_ListFilter1> getlistwithparam( @PathVariable String item) {
|
||||
List<State_ListFilter1> get = Service.getlistbuilderparam( item);
|
||||
return get;
|
||||
}
|
||||
}
|
||||
@ -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;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.realnet.angulardatatype.Entity;
|
||||
import lombok.*;
|
||||
import javax.persistence.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
|
||||
@Data
|
||||
public class District_ListFilter1 {
|
||||
|
||||
private Integer id;
|
||||
|
||||
|
||||
private String district_name;
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.realnet.angulardatatype.Entity;
|
||||
import lombok.*;
|
||||
import javax.persistence.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
|
||||
@Data
|
||||
public class State_ListFilter1 {
|
||||
|
||||
private Integer id;
|
||||
|
||||
|
||||
private String state_name;
|
||||
}
|
||||
@ -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);
|
||||
}
|
||||
@ -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;
|
||||
|
||||
}}
|
||||
@ -0,0 +1,53 @@
|
||||
package com.realnet.angulardatatype.Services;
|
||||
import java.util.*;
|
||||
import com.realnet.angulardatatype.Repository.DistrictRepository;
|
||||
import com.realnet.angulardatatype.Entity.District;
|
||||
|
||||
import com.realnet.angulardatatype.Entity.District_ListFilter1;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class District_ListFilter1Service {
|
||||
@Autowired
|
||||
private DistrictRepository Repository;
|
||||
|
||||
|
||||
|
||||
|
||||
public List<District_ListFilter1> getlistbuilder() {
|
||||
List<District> list= Repository.findAll();
|
||||
ArrayList<District_ListFilter1> l = new ArrayList<>();
|
||||
for (District data : list) {
|
||||
String State_name = data.getState_name();
|
||||
System.out.println(State_name + "\n");
|
||||
|
||||
if ("item".equals(State_name)){
|
||||
District_ListFilter1 dummy = new District_ListFilter1();
|
||||
dummy.setId(data.getId());
|
||||
dummy.setDistrict_name(data.getDistrict_name());
|
||||
l.add(dummy);
|
||||
}
|
||||
}
|
||||
return l;}
|
||||
|
||||
|
||||
|
||||
public List<District_ListFilter1> getlistbuilderparam( String item) {
|
||||
List<District> list= Repository.findAll();
|
||||
ArrayList<District_ListFilter1> l = new ArrayList<>();
|
||||
for (District data : list) {
|
||||
String State_name = data.getState_name();
|
||||
System.out.println(State_name + "\n");
|
||||
|
||||
if (item.equals(State_name)){
|
||||
District_ListFilter1 dummy = new District_ListFilter1();
|
||||
dummy.setId(data.getId());
|
||||
dummy.setDistrict_name(data.getDistrict_name());
|
||||
l.add(dummy);
|
||||
}
|
||||
}
|
||||
return l;}
|
||||
}
|
||||
@ -0,0 +1,53 @@
|
||||
package com.realnet.angulardatatype.Services;
|
||||
import java.util.*;
|
||||
import com.realnet.angulardatatype.Repository.StateRepository;
|
||||
import com.realnet.angulardatatype.Entity.State;
|
||||
|
||||
import com.realnet.angulardatatype.Entity.State_ListFilter1;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class State_ListFilter1Service {
|
||||
@Autowired
|
||||
private StateRepository Repository;
|
||||
|
||||
|
||||
|
||||
|
||||
public List<State_ListFilter1> getlistbuilder() {
|
||||
List<State> list= Repository.findAll();
|
||||
ArrayList<State_ListFilter1> l = new ArrayList<>();
|
||||
for (State data : list) {
|
||||
String Country_name = data.getCountry_name();
|
||||
System.out.println(Country_name + "\n");
|
||||
|
||||
if ("item".equals(Country_name)){
|
||||
State_ListFilter1 dummy = new State_ListFilter1();
|
||||
dummy.setId(data.getId());
|
||||
dummy.setState_name(data.getState_name());
|
||||
l.add(dummy);
|
||||
}
|
||||
}
|
||||
return l;}
|
||||
|
||||
|
||||
|
||||
public List<State_ListFilter1> getlistbuilderparam( String item) {
|
||||
List<State> list= Repository.findAll();
|
||||
ArrayList<State_ListFilter1> l = new ArrayList<>();
|
||||
for (State data : list) {
|
||||
String Country_name = data.getCountry_name();
|
||||
System.out.println(Country_name + "\n");
|
||||
|
||||
if (item.equals(Country_name)){
|
||||
State_ListFilter1 dummy = new State_ListFilter1();
|
||||
dummy.setId(data.getId());
|
||||
dummy.setState_name(data.getState_name());
|
||||
l.add(dummy);
|
||||
}
|
||||
}
|
||||
return l;}
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
package com.realnet.testdata.Controllers;
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.realnet.testdata.Entity.Country_ListFilter1;
|
||||
import com.realnet.testdata.Services.Country_ListFilter1Service ;
|
||||
@RequestMapping(value = "/Country_ListFilter1")
|
||||
@RestController
|
||||
public class Country_ListFilter1Controller {
|
||||
|
||||
@Autowired
|
||||
private Country_ListFilter1Service Service;
|
||||
|
||||
@GetMapping("/Country_ListFilter1")
|
||||
public List<Country_ListFilter1> getlist() {
|
||||
List<Country_ListFilter1> get = Service.getlistbuilder();
|
||||
return get;
|
||||
}
|
||||
@GetMapping("/Country_ListFilter11")
|
||||
public List<Country_ListFilter1> getlistwithparam( ) {
|
||||
List<Country_ListFilter1> get = Service.getlistbuilderparam( );
|
||||
return get;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
package com.realnet.testdata.Controllers;
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.realnet.testdata.Entity.Country_ListFilter1;
|
||||
import com.realnet.testdata.Services.Country_ListFilter1Service ;
|
||||
@RequestMapping(value = "/token/Country_ListFilter1")
|
||||
@RestController
|
||||
public class tokenFree_Country_ListFilter1Controller {
|
||||
|
||||
@Autowired
|
||||
private Country_ListFilter1Service Service;
|
||||
|
||||
@GetMapping("/Country_ListFilter1")
|
||||
public List<Country_ListFilter1> getlist() {
|
||||
List<Country_ListFilter1> get = Service.getlistbuilder();
|
||||
return get;
|
||||
}
|
||||
@GetMapping("/Country_ListFilter11")
|
||||
public List<Country_ListFilter1> getlistwithparam( ) {
|
||||
List<Country_ListFilter1> get = Service.getlistbuilderparam( );
|
||||
return get;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package com.realnet.testdata.Entity;
|
||||
import lombok.*;
|
||||
import javax.persistence.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
|
||||
@Data
|
||||
public class Country_ListFilter1 {
|
||||
|
||||
private Integer id;
|
||||
|
||||
|
||||
private String name;
|
||||
private String description;
|
||||
}
|
||||
@ -0,0 +1,49 @@
|
||||
package com.realnet.testdata.Services;
|
||||
import java.util.*;
|
||||
import com.realnet.testdata.Repository.CountryRepository;
|
||||
import com.realnet.testdata.Entity.Country;
|
||||
|
||||
import com.realnet.testdata.Entity.Country_ListFilter1;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class Country_ListFilter1Service {
|
||||
@Autowired
|
||||
private CountryRepository Repository;
|
||||
|
||||
|
||||
|
||||
|
||||
public List<Country_ListFilter1> getlistbuilder() {
|
||||
List<Country> list= Repository.findAll();
|
||||
ArrayList<Country_ListFilter1> l = new ArrayList<>();
|
||||
for (Country data : list) {
|
||||
{
|
||||
Country_ListFilter1 dummy = new Country_ListFilter1();
|
||||
dummy.setId(data.getId());
|
||||
dummy.setName(data.getName());
|
||||
dummy.setDescription(data.getDescription());
|
||||
l.add(dummy);
|
||||
}
|
||||
}
|
||||
return l;}
|
||||
|
||||
|
||||
|
||||
public List<Country_ListFilter1> getlistbuilderparam( ) {
|
||||
List<Country> list= Repository.findAll();
|
||||
ArrayList<Country_ListFilter1> l = new ArrayList<>();
|
||||
for (Country data : list) {
|
||||
{
|
||||
Country_ListFilter1 dummy = new Country_ListFilter1();
|
||||
dummy.setId(data.getId());
|
||||
dummy.setName(data.getName());
|
||||
dummy.setDescription(data.getDescription());
|
||||
l.add(dummy);
|
||||
}
|
||||
}
|
||||
return l;}
|
||||
}
|
||||
2
testflutter05-testninesep-d/authsec_mysql/mysql/wf_table/wf_table.sql
Executable file
2
testflutter05-testninesep-d/authsec_mysql/mysql/wf_table/wf_table.sql
Executable file
@ -0,0 +1,2 @@
|
||||
CREATE TABLE testninesep.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));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user