Showing
5 changed files
with
62 additions
and
4 deletions
| 1 | +package com.wd.foundation.servicekit | ||
| 2 | + | ||
| 3 | +/** | ||
| 4 | + * 作者 : 张波 | ||
| 5 | + * 时间 : 2024/10/14 | ||
| 6 | + * 描述 : 应用信息获取服务接口 | ||
| 7 | + **/ | ||
| 8 | +interface IAppInfoService { | ||
| 9 | + /** | ||
| 10 | + * 获取平台标识 | ||
| 11 | + */ | ||
| 12 | + fun getPlat(): String | ||
| 13 | + | ||
| 14 | + /** | ||
| 15 | + * 获取端标识,如Android、ios | ||
| 16 | + */ | ||
| 17 | + fun getSystem(): String | ||
| 18 | + | ||
| 19 | + /** | ||
| 20 | + * 获取设备id,用于IMEI、DEVICE_ID字段等 | ||
| 21 | + */ | ||
| 22 | + fun getDeviceId(): String | ||
| 23 | + | ||
| 24 | + /** | ||
| 25 | + * 获取应用版本码,如 100 | ||
| 26 | + */ | ||
| 27 | + fun getVersionCode(): String | ||
| 28 | + | ||
| 29 | + /** | ||
| 30 | + * 获取应用版本号,如 1.0.0 | ||
| 31 | + */ | ||
| 32 | + fun getVersionName(): String | ||
| 33 | + | ||
| 34 | + /** | ||
| 35 | + * 获取应用打包版本,如 "202410141452" | ||
| 36 | + */ | ||
| 37 | + fun getBuildVersion(): String | ||
| 38 | + | ||
| 39 | + /** | ||
| 40 | + * 获取手机系统版本,取值 VERSION.RELEASE | ||
| 41 | + */ | ||
| 42 | + fun getOsVersion(): String | ||
| 43 | + | ||
| 44 | + /** | ||
| 45 | + * 获取渠道号 | ||
| 46 | + */ | ||
| 47 | + fun getChannelCode(): String | ||
| 48 | +} |
| 1 | package com.wd.foundation.servicekit.ioc | 1 | package com.wd.foundation.servicekit.ioc |
| 2 | 2 | ||
| 3 | +import com.wd.foundation.servicekit.IAppInfoService | ||
| 3 | import com.wd.foundation.servicekit.IPermissionService | 4 | import com.wd.foundation.servicekit.IPermissionService |
| 4 | import com.wd.foundation.servicekit.IStaticsService | 5 | import com.wd.foundation.servicekit.IStaticsService |
| 5 | import com.wd.foundation.servicekit.IUserService | 6 | import com.wd.foundation.servicekit.IUserService |
| @@ -21,6 +22,7 @@ import com.wd.foundation.servicekit.ioc.ServiceFactory.getOrCreateServiceEntity | @@ -21,6 +22,7 @@ import com.wd.foundation.servicekit.ioc.ServiceFactory.getOrCreateServiceEntity | ||
| 21 | val userService: IUserService by lazy(LazyThreadSafetyMode.SYNCHRONIZED) { getOrCreateServiceEntity() } | 22 | val userService: IUserService by lazy(LazyThreadSafetyMode.SYNCHRONIZED) { getOrCreateServiceEntity() } |
| 22 | val staticsService: IStaticsService by lazy(LazyThreadSafetyMode.SYNCHRONIZED) { getOrCreateServiceEntity() } | 23 | val staticsService: IStaticsService by lazy(LazyThreadSafetyMode.SYNCHRONIZED) { getOrCreateServiceEntity() } |
| 23 | val permissionService: IPermissionService by lazy(LazyThreadSafetyMode.SYNCHRONIZED) { getOrCreateServiceEntity() } | 24 | val permissionService: IPermissionService by lazy(LazyThreadSafetyMode.SYNCHRONIZED) { getOrCreateServiceEntity() } |
| 25 | +val appInfoService: IAppInfoService by lazy(LazyThreadSafetyMode.SYNCHRONIZED) { getOrCreateServiceEntity() } | ||
| 24 | 26 | ||
| 25 | /** | 27 | /** |
| 26 | * 获取服务实体 | 28 | * 获取服务实体 |
| @@ -17,6 +17,11 @@ interface ILoginService { | @@ -17,6 +17,11 @@ interface ILoginService { | ||
| 17 | fun getUserId(): String? | 17 | fun getUserId(): String? |
| 18 | 18 | ||
| 19 | /** | 19 | /** |
| 20 | + * 获取缓存用户类型 | ||
| 21 | + */ | ||
| 22 | + fun getUserType(): String? | ||
| 23 | + | ||
| 24 | + /** | ||
| 20 | * 获取缓存用户token | 25 | * 获取缓存用户token |
| 21 | */ | 26 | */ |
| 22 | fun getUserToken(): String? | 27 | fun getUserToken(): String? |
| @@ -62,7 +67,10 @@ interface ILoginService { | @@ -62,7 +67,10 @@ interface ILoginService { | ||
| 62 | * @param token 用户token | 67 | * @param token 用户token |
| 63 | * @param errorCode 错误code | 68 | * @param errorCode 错误code |
| 64 | */ | 69 | */ |
| 65 | - fun getMiguTokenByType(type: String, resultCallback: ((token: String?, errorCode: String?) -> Unit)?) | 70 | + fun getMiguTokenByType( |
| 71 | + type: String, | ||
| 72 | + resultCallback: ((token: String?, errorCode: String?) -> Unit)? | ||
| 73 | + ) | ||
| 66 | 74 | ||
| 67 | /** | 75 | /** |
| 68 | * 当前用户是否登录 | 76 | * 当前用户是否登录 |
| @@ -8,6 +8,6 @@ package com.wd.foundation.servicekit.user.login | @@ -8,6 +8,6 @@ package com.wd.foundation.servicekit.user.login | ||
| 8 | interface IProvinceService { | 8 | interface IProvinceService { |
| 9 | fun getProvinceCode(): String? | 9 | fun getProvinceCode(): String? |
| 10 | fun getCityId(): String? | 10 | fun getCityId(): String? |
| 11 | - | ||
| 12 | - fun getCarriageCode():String? | 11 | + fun getCityName(): String? |
| 12 | + fun getCarriageCode(): String? | ||
| 13 | } | 13 | } |
-
Please register or login to post a comment