simple-call-api

This lib is a simple call APIs

Лицензия

Лицензия

Группа

Группа

com.github.mattyoliveira
Идентификатор

Идентификатор

simple-call-api
Последняя версия

Последняя версия

2.0.0
Дата

Дата

Тип

Тип

aar
Описание

Описание

simple-call-api
This lib is a simple call APIs
Ссылка на сайт

Ссылка на сайт

https://github.com/MattyOliveira/SimpleCallApi
Система контроля версий

Система контроля версий

https://github.com/MattyOliveira/SimpleCallApi

Скачать simple-call-api

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.github.mattyoliveira/simple-call-api/ -->
<dependency>
    <groupId>com.github.mattyoliveira</groupId>
    <artifactId>simple-call-api</artifactId>
    <version>2.0.0</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/com.github.mattyoliveira/simple-call-api/
implementation 'com.github.mattyoliveira:simple-call-api:2.0.0'
// https://jarcasting.com/artifacts/com.github.mattyoliveira/simple-call-api/
implementation ("com.github.mattyoliveira:simple-call-api:2.0.0")
'com.github.mattyoliveira:simple-call-api:aar:2.0.0'
<dependency org="com.github.mattyoliveira" name="simple-call-api" rev="2.0.0">
  <artifact name="simple-call-api" type="aar" />
</dependency>
@Grapes(
@Grab(group='com.github.mattyoliveira', module='simple-call-api', version='2.0.0')
)
libraryDependencies += "com.github.mattyoliveira" % "simple-call-api" % "2.0.0"
[com.github.mattyoliveira/simple-call-api "2.0.0"]

Зависимости

compile (10)

Идентификатор библиотеки Тип Версия
org.jetbrains.kotlinx : kotlinx-coroutines-core jar 1.4.2
org.jetbrains.kotlinx : kotlinx-coroutines-android jar 1.4.2
com.squareup.retrofit2 : adapter-rxjava2 jar 2.9.0
org.jetbrains.kotlin : kotlin-stdlib jar 1.4.30
androidx.core » core-ktx jar 1.3.2
androidx.appcompat » appcompat jar 1.2.0
com.google.android.material » material jar 1.3.0
com.squareup.moshi : moshi-kotlin jar 1.11.0
com.squareup.retrofit2 : converter-gson jar 2.9.0
com.squareup.retrofit2 : converter-moshi jar 2.9.0

Модули Проекта

Данный проект не имеет модулей.

SimpleCallApi

SimpleCallApi is a library to assist with API calls. The idea is that it would be as simple as possible and could help from the beginner to the most senior developer. SimpleCallApi supports Coroutines and RxJava

GitHub stars GitHub watchers GitHub followers GitHub issues GitHub version

Version

Gradle
implementation 'com.github.mattyoliveira:simple-call-api:2.0.0'
Maven
<dependency>
  <groupId>com.github.mattyoliveira</groupId>
  <artifactId>simple-call-api</artifactId>
  <version>2.0.0</version>
  <type>aar</type>
</dependency>

Example

ApiService
interface Api {
    @GET("/api")
    suspend fun getExemple(): yourType
}
NetworkConfig
createClientByService<Api>( baseUrl = "https://yourBase")
SimpleRespository
class ExempleRepository(val api: Api) {
	suspend fun getExemple() = api.getExemple()
}
SimpleUseCase
class ExempleUseCase(private val repositori: MainRepository) : SimpleUseCase<Post, None>(){
    override suspend fun run(params: None) = repositori.getExemple()
}
SimpleViewModel
class ExempleViewModel(private val useCase: ExempleUseCase) {

	fun getExemple() {
		viewModelScope.launch {
		    useCase(scope = this)
			.onStatusChange {
			    when(it) {
				AsyncStatus.DONE -> { //FinishOperation }
				AsyncStatus.RUNNING -> { //RunningOperation }
				AsyncStatus.ERROR -> { //ErrorOperation }
			    }
			}
                	.onSuccess { it //return your type }
                	.onFailure { it //return ErrorEntity  }
        	}
	}
}

Technology

SimpleCallApi uses the Retrofit2, Coroutines, RxJava2, Moshi and Gson libraries.

License

Apache License, Version 2.0

Версии библиотеки

Версия
2.0.0
1.2.3
1.2.1
1.1.1
1.0.1
1.0.0
0.0.5
0.0.3
0.0.2
0.0.1