This repository has been archived by the owner on Oct 3, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
fulton
committed
Jan 8, 2020
1 parent
9e4fa2f
commit cc6772b
Showing
3 changed files
with
12 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,16 @@ | ||
package com.andromeda.araserver.iot | ||
|
||
import com.fasterxml.jackson.dataformat.yaml.YAMLMapper | ||
import com.fasterxml.jackson.module.kotlin.registerKotlinModule | ||
import com.google.gson.GsonBuilder | ||
import java.lang.reflect.Modifier.TRANSIENT | ||
|
||
|
||
class GetDeviceClass { | ||
fun main(url:String):String{ | ||
val gson = GsonBuilder() | ||
.excludeFieldsWithoutExposeAnnotation() | ||
.excludeFieldsWithModifiers(TRANSIENT) // STATIC|TRANSIENT in the default configuration | ||
.create() | ||
val mapper = YAMLMapper().registerKotlinModule() | ||
|
||
val mainVal = url.replace("/class/", "") | ||
return gson.toJson(TypeClassMap().main(mainVal)) | ||
return mapper.writeValueAsString(TypeClassMap().DeafaultVals(url.replace("/class/", ""))) | ||
} | ||
} |
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,3 +1,3 @@ | ||
package com.andromeda.araserver.iot | ||
|
||
data class TempModel(val temp:String, val ac:Boolean, val heat:Boolean) | ||
data class TempModel(val temp:Int, val ac:Boolean, val heat:Boolean) |
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