feat: API 연동 개선 및 라이선스 모델 확장
- 라이선스 모델 전면 개편 (상세 필드 추가, 계산 필드 구현) - API 응답 처리 개선 (HTTP 상태 코드 기반) - 장비 출고 폼 컨트롤러 추가 - 회사 지점 정보 모델 추가 - 공통 데이터 모델 구조 추가 - 전체 서비스 레이어 API 호출 방식 통일 - UI 컴포넌트 마이너 개선
This commit is contained in:
221
lib/data/models/common/api_response.freezed.dart
Normal file
221
lib/data/models/common/api_response.freezed.dart
Normal file
@@ -0,0 +1,221 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'api_response.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
ApiResponse<T> _$ApiResponseFromJson<T>(
|
||||
Map<String, dynamic> json, T Function(Object?) fromJsonT) {
|
||||
return _ApiResponse<T>.fromJson(json, fromJsonT);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$ApiResponse<T> {
|
||||
bool get success => throw _privateConstructorUsedError;
|
||||
String get message => throw _privateConstructorUsedError;
|
||||
T? get data => throw _privateConstructorUsedError;
|
||||
String? get error => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this ApiResponse to a JSON map.
|
||||
Map<String, dynamic> toJson(Object? Function(T) toJsonT) =>
|
||||
throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of ApiResponse
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$ApiResponseCopyWith<T, ApiResponse<T>> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $ApiResponseCopyWith<T, $Res> {
|
||||
factory $ApiResponseCopyWith(
|
||||
ApiResponse<T> value, $Res Function(ApiResponse<T>) then) =
|
||||
_$ApiResponseCopyWithImpl<T, $Res, ApiResponse<T>>;
|
||||
@useResult
|
||||
$Res call({bool success, String message, T? data, String? error});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$ApiResponseCopyWithImpl<T, $Res, $Val extends ApiResponse<T>>
|
||||
implements $ApiResponseCopyWith<T, $Res> {
|
||||
_$ApiResponseCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of ApiResponse
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? success = null,
|
||||
Object? message = null,
|
||||
Object? data = freezed,
|
||||
Object? error = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
success: null == success
|
||||
? _value.success
|
||||
: success // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
message: null == message
|
||||
? _value.message
|
||||
: message // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
data: freezed == data
|
||||
? _value.data
|
||||
: data // ignore: cast_nullable_to_non_nullable
|
||||
as T?,
|
||||
error: freezed == error
|
||||
? _value.error
|
||||
: error // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$ApiResponseImplCopyWith<T, $Res>
|
||||
implements $ApiResponseCopyWith<T, $Res> {
|
||||
factory _$$ApiResponseImplCopyWith(_$ApiResponseImpl<T> value,
|
||||
$Res Function(_$ApiResponseImpl<T>) then) =
|
||||
__$$ApiResponseImplCopyWithImpl<T, $Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({bool success, String message, T? data, String? error});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$ApiResponseImplCopyWithImpl<T, $Res>
|
||||
extends _$ApiResponseCopyWithImpl<T, $Res, _$ApiResponseImpl<T>>
|
||||
implements _$$ApiResponseImplCopyWith<T, $Res> {
|
||||
__$$ApiResponseImplCopyWithImpl(
|
||||
_$ApiResponseImpl<T> _value, $Res Function(_$ApiResponseImpl<T>) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of ApiResponse
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? success = null,
|
||||
Object? message = null,
|
||||
Object? data = freezed,
|
||||
Object? error = freezed,
|
||||
}) {
|
||||
return _then(_$ApiResponseImpl<T>(
|
||||
success: null == success
|
||||
? _value.success
|
||||
: success // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
message: null == message
|
||||
? _value.message
|
||||
: message // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
data: freezed == data
|
||||
? _value.data
|
||||
: data // ignore: cast_nullable_to_non_nullable
|
||||
as T?,
|
||||
error: freezed == error
|
||||
? _value.error
|
||||
: error // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable(genericArgumentFactories: true)
|
||||
class _$ApiResponseImpl<T> implements _ApiResponse<T> {
|
||||
const _$ApiResponseImpl(
|
||||
{required this.success, required this.message, this.data, this.error});
|
||||
|
||||
factory _$ApiResponseImpl.fromJson(
|
||||
Map<String, dynamic> json, T Function(Object?) fromJsonT) =>
|
||||
_$$ApiResponseImplFromJson(json, fromJsonT);
|
||||
|
||||
@override
|
||||
final bool success;
|
||||
@override
|
||||
final String message;
|
||||
@override
|
||||
final T? data;
|
||||
@override
|
||||
final String? error;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ApiResponse<$T>(success: $success, message: $message, data: $data, error: $error)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$ApiResponseImpl<T> &&
|
||||
(identical(other.success, success) || other.success == success) &&
|
||||
(identical(other.message, message) || other.message == message) &&
|
||||
const DeepCollectionEquality().equals(other.data, data) &&
|
||||
(identical(other.error, error) || other.error == error));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, success, message,
|
||||
const DeepCollectionEquality().hash(data), error);
|
||||
|
||||
/// Create a copy of ApiResponse
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$ApiResponseImplCopyWith<T, _$ApiResponseImpl<T>> get copyWith =>
|
||||
__$$ApiResponseImplCopyWithImpl<T, _$ApiResponseImpl<T>>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson(Object? Function(T) toJsonT) {
|
||||
return _$$ApiResponseImplToJson<T>(this, toJsonT);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _ApiResponse<T> implements ApiResponse<T> {
|
||||
const factory _ApiResponse(
|
||||
{required final bool success,
|
||||
required final String message,
|
||||
final T? data,
|
||||
final String? error}) = _$ApiResponseImpl<T>;
|
||||
|
||||
factory _ApiResponse.fromJson(
|
||||
Map<String, dynamic> json, T Function(Object?) fromJsonT) =
|
||||
_$ApiResponseImpl<T>.fromJson;
|
||||
|
||||
@override
|
||||
bool get success;
|
||||
@override
|
||||
String get message;
|
||||
@override
|
||||
T? get data;
|
||||
@override
|
||||
String? get error;
|
||||
|
||||
/// Create a copy of ApiResponse
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$ApiResponseImplCopyWith<T, _$ApiResponseImpl<T>> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
Reference in New Issue
Block a user