Преглед на файлове

1.添加App列表请求参数和bean类

master
wangwanlei преди 10 месеца
родител
ревизия
05901fa73b

+ 290
- 0
app/src/main/java/com/xhly/manageapp/bean/AppModel.java Целия файл

@@ -0,0 +1,290 @@
1
+package com.xhly.manageapp.bean;
2
+
3
+import java.io.Serializable;
4
+import java.util.List;
5
+
6
+public class AppModel implements Serializable {
7
+    private static final long serialVersionUID = 1L;
8
+
9
+    public AppModel() {
10
+    }
11
+
12
+    public AppModel(String appName, Integer appSize) {
13
+        this.appName = appName;
14
+        this.appSize = appSize;
15
+    }
16
+
17
+    public AppModel(String appName, String versionName, Integer appSize) {
18
+        this.appName = appName;
19
+        this.versionName = versionName;
20
+        this.appSize = appSize;
21
+    }
22
+
23
+    public AppModel(String appName, String versionName, Integer appSize, String appIcon) {
24
+        this.appName = appName;
25
+        this.appIcon = appIcon;
26
+        this.versionName = versionName;
27
+        this.appSize = appSize;
28
+    }
29
+
30
+    //应用表ID
31
+    private Integer appid;
32
+
33
+    //应用名称
34
+    private String appName;
35
+
36
+    //应用状态:1启用2未启用
37
+    private Integer appState;
38
+
39
+    //应用类型:1推荐应用2必装应用
40
+    private Integer appType;
41
+
42
+    //是否强制安装:0否1是
43
+    private Integer forced;
44
+
45
+    //是否应用白名单:0否1是
46
+    private Integer whited;
47
+
48
+    //是否可信任:0否1是
49
+    private Integer trusted;
50
+
51
+    //是否显示图标:0否1是
52
+    private Integer showico;
53
+
54
+    //是否加入现有策略:0否1是
55
+    private Integer strategy;
56
+
57
+    //是否允许清空缓存:0否1是
58
+    private Integer cached;
59
+
60
+    //所属应用分组ID
61
+    private Integer appgroupid;
62
+
63
+    //APK文件路径
64
+    private String apkPath;
65
+
66
+    //应用图标
67
+    private String appIcon;
68
+
69
+    //应用截图:多张图片用分号分割
70
+    private String appImg;
71
+
72
+    private String[] appImgArr;
73
+
74
+    private String appPackage;
75
+
76
+    //版本名
77
+    private String versionName;
78
+
79
+    //版本号
80
+    private Integer versionNum;
81
+
82
+    //应用大小
83
+    private Integer appSize;
84
+
85
+    //开发者
86
+    private String appDeveloper;
87
+
88
+    //唯一码
89
+    private String uniqueCode;
90
+
91
+    //应用简介
92
+    private String appAbbr;
93
+
94
+    //更新介绍
95
+    private String appRenew;
96
+
97
+    private Boolean isInstall;
98
+
99
+    public Integer getAppid() {
100
+        return appid;
101
+    }
102
+
103
+    public void setAppid(Integer appid) {
104
+        this.appid = appid;
105
+    }
106
+
107
+    public String getAppName() {
108
+        return appName;
109
+    }
110
+
111
+    public void setAppName(String appName) {
112
+        this.appName = appName;
113
+    }
114
+
115
+    public Integer getAppState() {
116
+        return appState;
117
+    }
118
+
119
+    public void setAppState(Integer appState) {
120
+        this.appState = appState;
121
+    }
122
+
123
+    public Integer getAppType() {
124
+        return appType;
125
+    }
126
+
127
+    public void setAppType(Integer appType) {
128
+        this.appType = appType;
129
+    }
130
+
131
+    public Integer getForced() {
132
+        return forced;
133
+    }
134
+
135
+    public void setForced(Integer forced) {
136
+        this.forced = forced;
137
+    }
138
+
139
+    public Integer getWhited() {
140
+        return whited;
141
+    }
142
+
143
+    public void setWhited(Integer whited) {
144
+        this.whited = whited;
145
+    }
146
+
147
+    public Integer getTrusted() {
148
+        return trusted;
149
+    }
150
+
151
+    public void setTrusted(Integer trusted) {
152
+        this.trusted = trusted;
153
+    }
154
+
155
+    public Integer getShowico() {
156
+        return showico;
157
+    }
158
+
159
+    public void setShowico(Integer showico) {
160
+        this.showico = showico;
161
+    }
162
+
163
+    public Integer getStrategy() {
164
+        return strategy;
165
+    }
166
+
167
+    public void setStrategy(Integer strategy) {
168
+        this.strategy = strategy;
169
+    }
170
+
171
+    public Integer getCached() {
172
+        return cached;
173
+    }
174
+
175
+    public void setCached(Integer cached) {
176
+        this.cached = cached;
177
+    }
178
+
179
+    public Integer getAppgroupid() {
180
+        return appgroupid;
181
+    }
182
+
183
+    public void setAppgroupid(Integer appgroupid) {
184
+        this.appgroupid = appgroupid;
185
+    }
186
+
187
+    public String getApkPath() {
188
+        return apkPath;
189
+    }
190
+
191
+    public void setApkPath(String apkPath) {
192
+        this.apkPath = apkPath;
193
+    }
194
+
195
+    public String getAppIcon() {
196
+        return appIcon;
197
+    }
198
+
199
+    public void setAppIcon(String appIcon) {
200
+        this.appIcon = appIcon;
201
+    }
202
+
203
+    public String getAppImg() {
204
+        return appImg;
205
+    }
206
+
207
+    public void setAppImg(String appImg) {
208
+        this.appImg = appImg;
209
+    }
210
+
211
+    public String getVersionName() {
212
+        return versionName;
213
+    }
214
+
215
+    public void setVersionName(String versionName) {
216
+        this.versionName = versionName;
217
+    }
218
+
219
+    public Integer getVersionNum() {
220
+        return versionNum;
221
+    }
222
+
223
+    public void setVersionNum(Integer versionNum) {
224
+        this.versionNum = versionNum;
225
+    }
226
+
227
+    public Integer getAppSize() {
228
+        return appSize;
229
+    }
230
+
231
+    public void setAppSize(Integer appSize) {
232
+        this.appSize = appSize;
233
+    }
234
+
235
+    public String getAppDeveloper() {
236
+        return appDeveloper;
237
+    }
238
+
239
+    public void setAppDeveloper(String appDeveloper) {
240
+        this.appDeveloper = appDeveloper;
241
+    }
242
+
243
+    public String getUniqueCode() {
244
+        return uniqueCode;
245
+    }
246
+
247
+    public void setUniqueCode(String uniqueCode) {
248
+        this.uniqueCode = uniqueCode;
249
+    }
250
+
251
+    public String getAppAbbr() {
252
+        return appAbbr;
253
+    }
254
+
255
+    public void setAppAbbr(String appAbbr) {
256
+        this.appAbbr = appAbbr;
257
+    }
258
+
259
+    public String getAppRenew() {
260
+        return appRenew;
261
+    }
262
+
263
+    public void setAppRenew(String appRenew) {
264
+        this.appRenew = appRenew;
265
+    }
266
+
267
+    public String getAppPackage() {
268
+        return appPackage;
269
+    }
270
+
271
+    public void setAppPackage(String appPackage) {
272
+        this.appPackage = appPackage;
273
+    }
274
+
275
+    public String[] getAppImgArr() {
276
+        return appImgArr;
277
+    }
278
+
279
+    public void setAppImgArr(String[] appImgArr) {
280
+        this.appImgArr = appImgArr;
281
+    }
282
+
283
+    public Boolean getInstall() {
284
+        return isInstall;
285
+    }
286
+
287
+    public void setInstall(Boolean install) {
288
+        isInstall = install;
289
+    }
290
+}

+ 6
- 0
app/src/main/java/com/xhly/manageapp/bean/ListAppBean.kt Целия файл

@@ -0,0 +1,6 @@
1
+package com.xhly.manageapp.bean
2
+
3
+class ListAppBean {
4
+    var appgroupid = 1
5
+    var appType = 1
6
+}

+ 5
- 0
app/src/main/java/com/xhly/manageapp/network/UriAdress.kt Целия файл

@@ -10,4 +10,9 @@ object UriAdress {
10 10
      *应用启动日志-添加
11 11
      */
12 12
     const val LOGAPPSTARTADD = "/logAppStart/add"
13
+
14
+    /**
15
+     *
16
+     */
17
+    const val LIST_APP="/app/list_app"
13 18
 }

+ 14
- 0
app/src/main/java/com/xhly/manageapp/network/app/AppService.kt Целия файл

@@ -0,0 +1,14 @@
1
+package com.xhly.manageapp.network.app
2
+
3
+import com.xhly.corelib.network.bean.ResponseData
4
+import com.xhly.manageapp.bean.AppModel
5
+import com.xhly.manageapp.bean.ListAppBean
6
+import com.xhly.manageapp.network.UriAdress
7
+import retrofit2.http.Body
8
+import retrofit2.http.POST
9
+
10
+interface AppService {
11
+    @POST(UriAdress.LIST_APP)
12
+    suspend fun postListApp(@Body listapp: ListAppBean): ResponseData<ArrayList<AppModel>>
13
+
14
+}

+ 20
- 0
app/src/main/java/com/xhly/manageapp/ui/main/viewmodel/MainViewModel.kt Целия файл

@@ -0,0 +1,20 @@
1
+package com.xhly.manageapp.ui.main.viewmodel
2
+
3
+import com.xhly.corelib.base.viewmodel.CommonBaseViewModel
4
+import com.xhly.corelib.network.RetrofitService
5
+import com.xhly.corelib.utils.LogShow
6
+import com.xhly.manageapp.bean.ListAppBean
7
+import com.xhly.manageapp.network.app.AppService
8
+
9
+class MainViewModel : CommonBaseViewModel() {
10
+    private val appService by lazy { RetrofitService.create<AppService>() }
11
+
12
+    fun getAppList() {
13
+        launchUI {
14
+            val postListApp = appService.postListApp(ListAppBean())
15
+            postListApp.obj.forEach {
16
+                LogShow("数据是" + it.appName)
17
+            }
18
+        }
19
+    }
20
+}

Loading…
Отказ
Запис