mirror of
https://github.com/pppscn/SmsForwarder
synced 2025-08-03 01:17:41 +08:00
新增:远程查配置接口增加卡槽信息与备注 #174
This commit is contained in:
parent
42e2f03652
commit
439877c674
@ -1,20 +1,27 @@
|
|||||||
package com.idormy.sms.forwarder.entity
|
package com.idormy.sms.forwarder.entity
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName
|
||||||
import java.io.Serializable
|
import java.io.Serializable
|
||||||
|
|
||||||
//SIM卡信息
|
//SIM卡信息
|
||||||
data class SimInfo(
|
data class SimInfo(
|
||||||
//运营商信息:中国移动 中国联通 中国电信
|
//运营商信息:中国移动 中国联通 中国电信
|
||||||
|
@SerializedName("carrier_name")
|
||||||
var mCarrierName: CharSequence? = null,
|
var mCarrierName: CharSequence? = null,
|
||||||
//卡槽ID,SimSerialNumber
|
//集成电路卡识别码即SIM卡卡号
|
||||||
|
@SerializedName("icc_id")
|
||||||
var mIccId: CharSequence? = null,
|
var mIccId: CharSequence? = null,
|
||||||
//卡槽id:-1=没插入、 0=卡槽1 、1=卡槽2
|
//卡槽id:-1=没插入、 0=卡槽1 、1=卡槽2
|
||||||
|
@SerializedName("sim_slot_index")
|
||||||
var mSimSlotIndex: Int = 0,
|
var mSimSlotIndex: Int = 0,
|
||||||
//号码
|
//号码
|
||||||
|
@SerializedName("number")
|
||||||
var mNumber: CharSequence? = null,
|
var mNumber: CharSequence? = null,
|
||||||
//城市
|
//国家代码
|
||||||
|
@SerializedName("country_iso")
|
||||||
var mCountryIso: CharSequence? = null,
|
var mCountryIso: CharSequence? = null,
|
||||||
//SIM的 Subscription Id (SIM插入顺序)
|
//SIM的 Subscription Id (SIM插入顺序)
|
||||||
|
@SerializedName("subscription_id")
|
||||||
var mSubscriptionId: Int = 0,
|
var mSubscriptionId: Int = 0,
|
||||||
) : Serializable {
|
) : Serializable {
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
|
@ -1,9 +1,12 @@
|
|||||||
package com.idormy.sms.forwarder.server.controller
|
package com.idormy.sms.forwarder.server.controller
|
||||||
|
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
|
import com.idormy.sms.forwarder.App
|
||||||
import com.idormy.sms.forwarder.server.model.BaseRequest
|
import com.idormy.sms.forwarder.server.model.BaseRequest
|
||||||
import com.idormy.sms.forwarder.server.model.ConfigData
|
import com.idormy.sms.forwarder.server.model.ConfigData
|
||||||
import com.idormy.sms.forwarder.utils.HttpServerUtils
|
import com.idormy.sms.forwarder.utils.HttpServerUtils
|
||||||
|
import com.idormy.sms.forwarder.utils.PhoneUtils
|
||||||
|
import com.idormy.sms.forwarder.utils.SettingUtils
|
||||||
import com.yanzhenjie.andserver.annotation.*
|
import com.yanzhenjie.andserver.annotation.*
|
||||||
|
|
||||||
@Suppress("PrivatePropertyName")
|
@Suppress("PrivatePropertyName")
|
||||||
@ -19,6 +22,12 @@ class ConfigController {
|
|||||||
fun test(@RequestBody bean: BaseRequest<*>): ConfigData {
|
fun test(@RequestBody bean: BaseRequest<*>): ConfigData {
|
||||||
Log.d(TAG, bean.data.toString())
|
Log.d(TAG, bean.data.toString())
|
||||||
|
|
||||||
|
//获取卡槽信息
|
||||||
|
if (App.SimInfoList.isEmpty()) {
|
||||||
|
App.SimInfoList = PhoneUtils.getSimMultiInfo()
|
||||||
|
}
|
||||||
|
Log.d(TAG, App.SimInfoList.toString())
|
||||||
|
|
||||||
return ConfigData(
|
return ConfigData(
|
||||||
HttpServerUtils.enableApiClone,
|
HttpServerUtils.enableApiClone,
|
||||||
HttpServerUtils.enableApiSmsSend,
|
HttpServerUtils.enableApiSmsSend,
|
||||||
@ -26,6 +35,10 @@ class ConfigController {
|
|||||||
HttpServerUtils.enableApiCallQuery,
|
HttpServerUtils.enableApiCallQuery,
|
||||||
HttpServerUtils.enableApiContactQuery,
|
HttpServerUtils.enableApiContactQuery,
|
||||||
HttpServerUtils.enableApiBatteryQuery,
|
HttpServerUtils.enableApiBatteryQuery,
|
||||||
|
SettingUtils.extraDeviceMark.toString(),
|
||||||
|
SettingUtils.extraSim1.toString(),
|
||||||
|
SettingUtils.extraSim2.toString(),
|
||||||
|
App.SimInfoList
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.idormy.sms.forwarder.server.model
|
package com.idormy.sms.forwarder.server.model
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName
|
import com.google.gson.annotations.SerializedName
|
||||||
|
import com.idormy.sms.forwarder.entity.SimInfo
|
||||||
import java.io.Serializable
|
import java.io.Serializable
|
||||||
|
|
||||||
data class ConfigData(
|
data class ConfigData(
|
||||||
@ -16,4 +17,12 @@ data class ConfigData(
|
|||||||
var enableApiContactQuery: Boolean = false,
|
var enableApiContactQuery: Boolean = false,
|
||||||
@SerializedName("enable_api_battery_query")
|
@SerializedName("enable_api_battery_query")
|
||||||
var enableApiBatteryQuery: Boolean = false,
|
var enableApiBatteryQuery: Boolean = false,
|
||||||
|
@SerializedName("extra_device_mark")
|
||||||
|
var extraDeviceMark: String = "",
|
||||||
|
@SerializedName("extra_sim1")
|
||||||
|
var extraSim1: String = "",
|
||||||
|
@SerializedName("extra_sim2")
|
||||||
|
var extraSim2: String = "",
|
||||||
|
@SerializedName("sim_info_list")
|
||||||
|
var simInfoList: MutableMap<Int, SimInfo> = mutableMapOf(),
|
||||||
) : Serializable
|
) : Serializable
|
Loading…
x
Reference in New Issue
Block a user