-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
693f5ec
commit 111f0ef
Showing
28 changed files
with
308 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import 'package:freezed_annotation/freezed_annotation.dart'; | ||
import 'package:withu_app/core/core.dart'; | ||
|
||
/// 계약 타입 | ||
@JsonEnum(valueField: 'serverKey') | ||
enum GenderType with L10nKeyProvider { | ||
man(l10nKey: 'man', serverKey: 'MAN'), | ||
|
||
woman(l10nKey: 'woman', serverKey: 'WOMAN'); | ||
|
||
@override | ||
final String l10nKey; | ||
|
||
final String serverKey; | ||
|
||
const GenderType({ | ||
required this.l10nKey, | ||
required this.serverKey, | ||
}); | ||
|
||
bool get isMan => this == GenderType.man; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export 'login/login.dart'; | ||
export 'sign_up/sign_up.dart'; |
25 changes: 25 additions & 0 deletions
25
lib/feature/account/data/data_sources/dto/sign_up/request/sign_up_request_dto.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import 'package:withu_app/core/core.dart'; | ||
import 'package:withu_app/core/types/gender_type.dart'; | ||
import 'package:freezed_annotation/freezed_annotation.dart'; | ||
|
||
part 'sign_up_request_dto.freezed.dart'; | ||
|
||
part 'sign_up_request_dto.g.dart'; | ||
|
||
part 'sign_up_request_dto.mock.dart'; | ||
|
||
@freezed | ||
class SignUpRequestDto with _$SignUpRequestDto { | ||
factory SignUpRequestDto({ | ||
required String name, | ||
required String birth, | ||
required String cellPhoneNo, | ||
required String loginId, // 이메일 | ||
required String password, | ||
required LoginType type, | ||
required GenderType gender, | ||
}) = _SignUpRequestDto; | ||
|
||
factory SignUpRequestDto.fromJson(Map<String, dynamic> json) => | ||
_$SignUpRequestDtoFromJson(json); | ||
} |
15 changes: 15 additions & 0 deletions
15
lib/feature/account/data/data_sources/dto/sign_up/request/sign_up_request_dto.mock.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
part of 'sign_up_request_dto.dart'; | ||
|
||
extension SignUpRequestDtoMock on SignUpRequestDto { | ||
static SignUpRequestDto mock() { | ||
return SignUpRequestDto( | ||
name: '홍길동', | ||
birth: '1993-06-04', | ||
cellPhoneNo: '01049212480', | ||
loginId: '[email protected]', | ||
password: '123qwe!@', | ||
type: LoginType.email, | ||
gender: GenderType.man, | ||
); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
lib/feature/account/data/data_sources/dto/sign_up/response/sign_up_response_dto.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import 'package:freezed_annotation/freezed_annotation.dart'; | ||
|
||
part 'sign_up_response_dto.freezed.dart'; | ||
|
||
part 'sign_up_response_dto.g.dart'; | ||
|
||
part 'sign_up_response_dto.mock.dart'; | ||
|
||
@freezed | ||
class SignUpResponseDto with _$SignUpResponseDto { | ||
factory SignUpResponseDto({ | ||
required bool status, | ||
required String message, | ||
String? userId, | ||
String? loginId, | ||
String? birthDate, | ||
String? sessionId, | ||
}) = _SignUpResponseDto; | ||
|
||
factory SignUpResponseDto.fromJson(Map<String, dynamic> json) => | ||
_$SignUpResponseDtoFromJson(json); | ||
} |
21 changes: 21 additions & 0 deletions
21
lib/feature/account/data/data_sources/dto/sign_up/response/sign_up_response_dto.mock.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
part of 'sign_up_response_dto.dart'; | ||
|
||
extension SignUpResponseDtoMock on SignUpResponseDto { | ||
static SignUpResponseDto successEmail() { | ||
return SignUpResponseDto( | ||
status: true, | ||
message: "가입이 완료되었습니다", | ||
userId: "1", | ||
loginId: "[email protected]", | ||
birthDate: "1993-06-04", | ||
sessionId: "test-session-id", | ||
); | ||
} | ||
|
||
static SignUpResponseDto fail() { | ||
return SignUpResponseDto( | ||
status: false, | ||
message: "회원가입에 실패하셨습니다.", | ||
); | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
lib/feature/account/data/data_sources/dto/sign_up/sign_up.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export 'request/sign_up_request_dto.dart'; | ||
export 'response/sign_up_response_dto.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export 'login/login.dart'; | ||
export 'sign_up/sign_up.dart'; |
16 changes: 16 additions & 0 deletions
16
lib/feature/account/domain/entity/sign_up/result/sign_up_result_entity.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import 'package:freezed_annotation/freezed_annotation.dart'; | ||
import 'package:withu_app/core/core.dart'; | ||
|
||
part 'sign_up_result_entity.freezed.dart'; | ||
|
||
part 'sign_up_result_entity.mock.dart'; | ||
|
||
@freezed | ||
class SignUpResultEntity with _$SignUpResultEntity { | ||
factory SignUpResultEntity({ | ||
required bool status, | ||
required String message, | ||
@Default('') String name, | ||
@Default(LoginType.none) LoginType type, | ||
}) = _SignUpResultEntity; | ||
} |
21 changes: 21 additions & 0 deletions
21
lib/feature/account/domain/entity/sign_up/result/sign_up_result_entity.mock.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
part of 'sign_up_result_entity.dart'; | ||
|
||
extension SignUpResultEntityMock on SignUpResultEntity { | ||
static SignUpResultEntity successEmail() { | ||
return SignUpResultEntity( | ||
status: true, | ||
message: '', | ||
name: '홍길동', | ||
type: LoginType.email, | ||
); | ||
} | ||
|
||
static SignUpResultEntity failure() { | ||
return SignUpResultEntity( | ||
status: false, | ||
message: '회원가입에 실패하셨습니다.', | ||
name: '', | ||
type: LoginType.none, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export 'result/sign_up_result_entity.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
lib/feature/account/domain/usecase/sign_up/sign_up_usecase.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import 'package:withu_app/feature/account/account.dart'; | ||
|
||
part 'sign_up_usecase_imple.dart'; | ||
|
||
abstract class SignUpUseCase { | ||
final AccountRepository accountRepo; | ||
|
||
SignUpUseCase({required this.accountRepo}); | ||
|
||
/// 로그인 | ||
Future<SignUpResultEntity> exec({required LoginRequestEntity entity}); | ||
} |
13 changes: 13 additions & 0 deletions
13
lib/feature/account/domain/usecase/sign_up/sign_up_usecase_imple.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
part of 'sign_up_usecase.dart'; | ||
|
||
class SignUpUseCaseImpl implements SignUpUseCase { | ||
@override | ||
final AccountRepository accountRepo; | ||
|
||
SignUpUseCaseImpl({required this.accountRepo}); | ||
|
||
@override | ||
Future<SignUpResultEntity> exec({required LoginRequestEntity entity}) async { | ||
return SignUpResultEntityMock.failure(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export 'login/login_bloc.dart'; | ||
export 'sign_up/sign_up_bloc.dart'; |
18 changes: 18 additions & 0 deletions
18
lib/feature/account/presentation/bloc/sign_up/sign_up_bloc.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import 'package:freezed_annotation/freezed_annotation.dart'; | ||
import 'package:withu_app/core/utils/bloc/base_bloc.dart'; | ||
import 'package:withu_app/feature/account/domain/usecase/sign_up/sign_up_usecase.dart'; | ||
|
||
part 'sign_up_event.dart'; | ||
|
||
part 'sign_up_state.dart'; | ||
|
||
part 'sign_up_bloc.freezed.dart'; | ||
|
||
class SignUpBloc extends BaseBloc<SignUpEvent, SignUpState> { | ||
final SignUpUseCase signUpUseCase; | ||
|
||
SignUpBloc({required this.signUpUseCase}) | ||
: super( | ||
SignUpState(status: BaseBlocStatus.initial()), | ||
); | ||
} |
2 changes: 2 additions & 0 deletions
2
lib/feature/account/presentation/bloc/sign_up/sign_up_event.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
part of 'sign_up_bloc.dart'; | ||
sealed class SignUpEvent extends BaseBlocEvent {} |
13 changes: 13 additions & 0 deletions
13
lib/feature/account/presentation/bloc/sign_up/sign_up_state.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
part of 'sign_up_bloc.dart'; | ||
|
||
|
||
@freezed | ||
class SignUpState extends BaseBlocState with _$SignUpState { | ||
factory SignUpState({ | ||
/// 상태. | ||
required BaseBlocStatus status, | ||
|
||
/// 다이얼로그 메시지 | ||
@Default('') String message, | ||
}) = _SignUpState; | ||
} |
25 changes: 25 additions & 0 deletions
25
lib/feature/account/presentation/page/sign_up/sign_up_page.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import 'package:flutter/cupertino.dart'; | ||
import 'package:flutter_bloc/flutter_bloc.dart'; | ||
import 'package:withu_app/core/core.dart'; | ||
import 'package:withu_app/feature/account/account.dart'; | ||
|
||
class SignUpPage extends StatelessWidget { | ||
const SignUpPage({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return BlocProvider<SignUpBloc>( | ||
create: (context) => getIt(), | ||
child: const SignUpPageContent(), | ||
); | ||
} | ||
} | ||
|
||
class SignUpPageContent extends StatelessWidget { | ||
const SignUpPageContent({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return const SizedBox(); | ||
} | ||
} |
Oops, something went wrong.