This file contains hidden or 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
| import asyncio | |
| from datetime import datetime | |
| from langchain.agents import create_agent, AgentState | |
| from langchain_ollama import ChatOllama | |
| from langchain_openai import ChatOpenAI | |
| from langchain.messages import HumanMessage | |
| from langchain.tools import tool | |
| import mlflow | |
This file contains hidden or 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
| public class ArticleReadingQuryables | |
| { | |
| private readonly AppDbContext _context; | |
| public ArticleReadingQuryables(AppDbContext dBContext) | |
| { | |
| _context = dBContext; | |
| } | |
| public IQueryable<Article> Published() |
This file contains hidden or 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
| import 'package:bloc_test/bloc_test.dart'; | |
| import 'package:flutter_test/flutter_test.dart'; | |
| import 'package:mockito/annotations.dart'; | |
| import 'package:mockito/mockito.dart'; | |
| import 'package:example/repositories/account/account_repository.dart'; | |
| import 'package:example/services/device_secure_storage_service.dart'; | |
| import 'package:example/states/cubit/auth/user_authentication_cubit.dart'; | |
| import 'package:example/viewmodels/auth/authentication_data.dart'; | |
| import 'package:example/viewmodels/auth/sign_in.dart'; | |
| import 'package:example/viewmodels/profile/user_profile.dart'; |
This file contains hidden or 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
| @override | |
| Future<AuthenticationData> renewAccessToken( | |
| {required RenewAccessToken renewAccessToken, | |
| String routePath = "renew-token"}) async { | |
| try { | |
| var result = await super | |
| ._dio | |
| .post(routePath, data: renewAccessToken.toJson()) | |
| .timeout(super.timeout); | |
| if (result.statusCode == 200) { |
This file contains hidden or 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
| @override | |
| Future<bool> verifyToken( | |
| {required String accessToken, String routePath = "verify-token"}) async { | |
| try { | |
| var result = await super._dio.get(routePath, | |
| queryParameters: {"accessToken": accessToken}).timeout(super.timeout); | |
| if (result.statusCode == 200) { | |
| return true; | |
| } |
This file contains hidden or 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
| @override | |
| Future<AuthenticationData> signIn({ | |
| required SignIn signIn, | |
| String routePath = "sign-in", | |
| }) async { | |
| try { | |
| var result = await super | |
| ._dio | |
| .post(routePath, data: signIn.toJson()) | |
| .timeout(super.timeout); |
This file contains hidden or 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
| import 'dart:io'; | |
| import 'package:dio/dio.dart'; | |
| import 'package:tutorial_flutter_minimalist_authentication/constants/constants.dart'; | |
| import 'package:tutorial_flutter_minimalist_authentication/exceptions/access_token_exception.dart'; | |
| import 'package:tutorial_flutter_minimalist_authentication/exceptions/business_exception.dart'; | |
| import 'package:tutorial_flutter_minimalist_authentication/exceptions/refresh_token_exception.dart'; | |
| import 'package:tutorial_flutter_minimalist_authentication/models/api/business_error.dart'; | |
| import 'package:tutorial_flutter_minimalist_authentication/models/session/authentication_data.dart'; | |
| import 'package:tutorial_flutter_minimalist_authentication/models/account/sign_in.dart'; |
This file contains hidden or 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
| import 'dart:io'; | |
| import 'package:dio/dio.dart'; | |
| import 'package:tutorial_flutter_minimalist_authentication/constants/constants.dart'; | |
| import 'package:tutorial_flutter_minimalist_authentication/exceptions/access_token_exception.dart'; | |
| import 'package:tutorial_flutter_minimalist_authentication/exceptions/business_exception.dart'; | |
| import 'package:tutorial_flutter_minimalist_authentication/exceptions/refresh_token_exception.dart'; | |
| import 'package:tutorial_flutter_minimalist_authentication/models/api/business_error.dart'; | |
| import 'package:tutorial_flutter_minimalist_authentication/models/session/authentication_data.dart'; | |
| import 'package:tutorial_flutter_minimalist_authentication/models/account/sign_in.dart'; |
This file contains hidden or 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
| //Todo use your own URL/DNS here | |
| //This IP is my local machine service that have my backend code installed | |
| const accountAPIURL_v1 = "http://192.168.68.111:5000/api/v1/account/"; |
This file contains hidden or 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
| import 'package:tutorial_flutter_minimalist_authentication/models/session/authentication_data.dart'; | |
| import 'package:tutorial_flutter_minimalist_authentication/models/account/sign_in.dart'; | |
| import 'package:tutorial_flutter_minimalist_authentication/models/account/renew_access_token.dart'; | |
| import 'package:tutorial_flutter_minimalist_authentication/repositories/api/account_repository.dart'; | |
| class AccountApiRepository implements AccountRepository { | |
| AccountApiRepository(); | |
| @override | |
| Future<AuthenticationData> signIn({ |
NewerOlder