作者 杨谦

...各种修改变更

正在显示 100 个修改的文件 包含 1218 行增加467 行删除

要显示太多修改。

为保证性能只显示 100 of 100+ 个文件。

1 <component name="ProjectCodeStyleConfiguration"> 1 <component name="ProjectCodeStyleConfiguration">
2 <code_scheme name="Project" version="173"> 2 <code_scheme name="Project" version="173">
3 <JetCodeStyleSettings> 3 <JetCodeStyleSettings>
4 - <option name="PACKAGES_TO_USE_STAR_IMPORTS">  
5 - <value>  
6 - <package name="java.util" alias="false" withSubpackages="false" />  
7 - <package name="kotlinx.android.synthetic" alias="false" withSubpackages="true" />  
8 - <package name="io.ktor" alias="false" withSubpackages="true" />  
9 - </value>  
10 - </option>  
11 - <option name="PACKAGES_IMPORT_LAYOUT">  
12 - <value>  
13 - <package name="" alias="false" withSubpackages="true" />  
14 - <package name="java" alias="false" withSubpackages="true" />  
15 - <package name="javax" alias="false" withSubpackages="true" />  
16 - <package name="kotlin" alias="false" withSubpackages="true" />  
17 - <package name="" alias="true" withSubpackages="true" />  
18 - </value>  
19 - </option>  
20 <option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" /> 4 <option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
21 </JetCodeStyleSettings> 5 </JetCodeStyleSettings>
22 <MarkdownNavigatorCodeStyleSettings> 6 <MarkdownNavigatorCodeStyleSettings>
@@ -12,6 +12,7 @@ @@ -12,6 +12,7 @@
12 <option name="modules"> 12 <option name="modules">
13 <set> 13 <set>
14 <option value="$PROJECT_DIR$" /> 14 <option value="$PROJECT_DIR$" />
  15 + <option value="$PROJECT_DIR$/Library" />
15 <option value="$PROJECT_DIR$/app" /> 16 <option value="$PROJECT_DIR$/app" />
16 </set> 17 </set>
17 </option> 18 </option>
@@ -51,5 +51,15 @@ @@ -51,5 +51,15 @@
51 <option name="name" value="maven" /> 51 <option name="name" value="maven" />
52 <option name="url" value="https://oss.sonatype.org/content/groups/public" /> 52 <option name="url" value="https://oss.sonatype.org/content/groups/public" />
53 </remote-repository> 53 </remote-repository>
  54 + <remote-repository>
  55 + <option name="id" value="maven5" />
  56 + <option name="name" value="maven5" />
  57 + <option name="url" value="https://oss.sonatype.org/content/groups/public" />
  58 + </remote-repository>
  59 + <remote-repository>
  60 + <option name="id" value="maven2" />
  61 + <option name="name" value="maven2" />
  62 + <option name="url" value="https://repo1.maven.org/maven2/" />
  63 + </remote-repository>
54 </component> 64 </component>
55 </project> 65 </project>
@@ -11,6 +11,7 @@ import java.io.File @@ -11,6 +11,7 @@ import java.io.File
11 object Constant { 11 object Constant {
12 // const val BASE_URL = "https://admin.anqixing.com" 12 // const val BASE_URL = "https://admin.anqixing.com"
13 // const val BASE_URL = "https://security.brofirst.cn" 13 // const val BASE_URL = "https://security.brofirst.cn"
  14 +// const val BASE_URL = "https://test.admin.anqixing.com"
14 const val BASE_URL = "https://test.admin.anqixing.com" 15 const val BASE_URL = "https://test.admin.anqixing.com"
15 const val USERNAME_KEY = "username" 16 const val USERNAME_KEY = "username"
16 const val USERID_KEY = "userid" 17 const val USERID_KEY = "userid"
@@ -19,6 +19,8 @@ object ConstantParamKey { @@ -19,6 +19,8 @@ object ConstantParamKey {
19 19
20 // 课程id 20 // 课程id
21 const val LESSON_ID = "lesson_id" 21 const val LESSON_ID = "lesson_id"
  22 + const val LESSON_DETAIL_ID = "lesson_detail_id"
  23 + const val LESSON_COMPLETE = "lesson_complete"
22 24
23 // lessonType 25 // lessonType
24 const val LESSON_TYPE = "lesson_type" 26 const val LESSON_TYPE = "lesson_type"
@@ -43,7 +43,7 @@ interface AllItemApi : ApiService { @@ -43,7 +43,7 @@ interface AllItemApi : ApiService {
43 @FormUrlEncoded 43 @FormUrlEncoded
44 @POST("/api/item/paper_list") 44 @POST("/api/item/paper_list")
45 fun specialPracticeList( 45 fun specialPracticeList(
46 - @Field("pos_id") pos_id: Int, // 工种ID 46 + @Field("pos_id") pos_id: String, // 工种ID
47 @Field("type") type: Int, // 47 @Field("type") type: Int, //
48 @Field("page") page: Int, 48 @Field("page") page: Int,
49 @Field("page_num") page_num: Int, 49 @Field("page_num") page_num: Int,
@@ -78,7 +78,7 @@ interface AllItemApi : ApiService { @@ -78,7 +78,7 @@ interface AllItemApi : ApiService {
78 @FormUrlEncoded 78 @FormUrlEncoded
79 @POST("/api/item/test_daily_list") 79 @POST("/api/item/test_daily_list")
80 fun dayPracticeList( 80 fun dayPracticeList(
81 - @Field("pos_id") pos_ia: Int, // 工种id 81 + @Field("pos_id") pos_ia: String, // 工种id
82 @Field("page") page: Int, // 页数 82 @Field("page") page: Int, // 页数
83 @Field("pageNum") pageNum: Int // 每页条数 83 @Field("pageNum") pageNum: Int // 每页条数
84 ): Observable<BaseResponse<CommonDataList<CommonPage<PaperDaily>>>> 84 ): Observable<BaseResponse<CommonDataList<CommonPage<PaperDaily>>>>
@@ -92,8 +92,8 @@ interface AllItemApi : ApiService { @@ -92,8 +92,8 @@ interface AllItemApi : ApiService {
92 @FormUrlEncoded 92 @FormUrlEncoded
93 @POST("/api/item/start_item") 93 @POST("/api/item/start_item")
94 fun itemStart( 94 fun itemStart(
95 - @Field("pos_id") pos_id: Int,  
96 - @Field("paper_id") paper_id: Int?, 95 + @Field("pos_id") pos_id: String,
  96 + @Field("paper_id") paper_id: String?,
97 @Field("type") type: Int 97 @Field("type") type: Int
98 ): Observable<BaseResponse<StartItemBean>> 98 ): Observable<BaseResponse<StartItemBean>>
99 99
@@ -104,7 +104,7 @@ interface AllItemApi : ApiService { @@ -104,7 +104,7 @@ interface AllItemApi : ApiService {
104 @FormUrlEncoded 104 @FormUrlEncoded
105 @POST("/api/item/item_list") 105 @POST("/api/item/item_list")
106 fun itemList( 106 fun itemList(
107 - @Field("user_item_id") user_item_id: Int 107 + @Field("user_item_id") user_item_id: String
108 ): Observable<BaseResponse<SubjectData>> 108 ): Observable<BaseResponse<SubjectData>>
109 109
110 /** 110 /**
@@ -114,7 +114,7 @@ interface AllItemApi : ApiService { @@ -114,7 +114,7 @@ interface AllItemApi : ApiService {
114 @FormUrlEncoded 114 @FormUrlEncoded
115 @POST("/api/item/get_challenge_info") 115 @POST("/api/item/get_challenge_info")
116 fun challengeInfo( 116 fun challengeInfo(
117 - @Field("user_item_id") user_item_id: Int 117 + @Field("user_item_id") user_item_id: String
118 ): Observable<BaseResponse<ChallengeInfo>> 118 ): Observable<BaseResponse<ChallengeInfo>>
119 119
120 /** 120 /**
@@ -138,7 +138,7 @@ interface AllItemApi : ApiService { @@ -138,7 +138,7 @@ interface AllItemApi : ApiService {
138 @FormUrlEncoded 138 @FormUrlEncoded
139 @POST("/api/item/user_error_detail") 139 @POST("/api/item/user_error_detail")
140 fun errorDetail( 140 fun errorDetail(
141 - @Field("id") id: Int 141 + @Field("id") id: String
142 ): Observable<BaseResponse<ErrorDetail>> 142 ): Observable<BaseResponse<ErrorDetail>>
143 143
144 /** 144 /**
@@ -149,7 +149,7 @@ interface AllItemApi : ApiService { @@ -149,7 +149,7 @@ interface AllItemApi : ApiService {
149 @FormUrlEncoded 149 @FormUrlEncoded
150 @POST("/api/item/item_sub_error") 150 @POST("/api/item/item_sub_error")
151 fun subError( 151 fun subError(
152 - @Field("error_id") error_id: Int, 152 + @Field("error_id") error_id: String,
153 @Field("answer") answer: String 153 @Field("answer") answer: String
154 ): Observable<BaseResponse<Void>> 154 ): Observable<BaseResponse<Void>>
155 155
@@ -162,7 +162,7 @@ interface AllItemApi : ApiService { @@ -162,7 +162,7 @@ interface AllItemApi : ApiService {
162 @FormUrlEncoded 162 @FormUrlEncoded
163 @POST("/api/item/item_del_error") 163 @POST("/api/item/item_del_error")
164 fun delError( 164 fun delError(
165 - @Field("item_id") item_id: Int, 165 + @Field("item_id") item_id: String,
166 @Field("type") type: Int, 166 @Field("type") type: Int,
167 @Field("item_type") item_type: Int 167 @Field("item_type") item_type: Int
168 ): Observable<BaseResponse<Void>> 168 ): Observable<BaseResponse<Void>>
@@ -190,7 +190,7 @@ interface AllItemApi : ApiService { @@ -190,7 +190,7 @@ interface AllItemApi : ApiService {
190 @FormUrlEncoded 190 @FormUrlEncoded
191 @POST("/api/item/user_item_list_detail") 191 @POST("/api/item/user_item_list_detail")
192 fun errorSubDetail( 192 fun errorSubDetail(
193 - @Field("id") id: Int 193 + @Field("id") id: String
194 ): Observable<BaseResponse<CommonList<AnswerDetail>>> 194 ): Observable<BaseResponse<CommonList<AnswerDetail>>>
195 195
196 } 196 }
@@ -20,6 +20,13 @@ import retrofit2.http.* @@ -20,6 +20,13 @@ import retrofit2.http.*
20 20
21 interface ApiService { 21 interface ApiService {
22 /** 22 /**
  23 + * 我的班级列表
  24 + */
  25 + @POST("/api/train/train_class_list")
  26 + fun getClazzList(
  27 + ): Observable<BaseResponse<CommonList<ClazzBean>>>
  28 +
  29 + /**
23 * 答题相关参数 30 * 答题相关参数
24 */ 31 */
25 @POST("/api/item/item_about") 32 @POST("/api/item/item_about")
@@ -95,7 +102,7 @@ interface ApiService { @@ -95,7 +102,7 @@ interface ApiService {
95 fun videoLessons( 102 fun videoLessons(
96 @Field("is_rec") is_rec: Int, 103 @Field("is_rec") is_rec: Int,
97 @Field("keyword") keyword: String, 104 @Field("keyword") keyword: String,
98 - @Field("pos_id") pos_id: Int, 105 + @Field("pos_id") pos_id: String,
99 @Field("page") page: Int, 106 @Field("page") page: Int,
100 @Field("page_num") page_num: Int, 107 @Field("page_num") page_num: Int,
101 ): Observable<BaseResponse<VideoLessonBean>> 108 ): Observable<BaseResponse<VideoLessonBean>>
@@ -106,7 +113,7 @@ interface ApiService { @@ -106,7 +113,7 @@ interface ApiService {
106 @FormUrlEncoded 113 @FormUrlEncoded
107 @POST("/api/lesson/lesson_detail") 114 @POST("/api/lesson/lesson_detail")
108 fun videoLessonsDetail( 115 fun videoLessonsDetail(
109 - @Field("id") id: Int, 116 + @Field("id") id: String,
110 ): Observable<BaseResponse<VideoLessonDetailBean>> 117 ): Observable<BaseResponse<VideoLessonDetailBean>>
111 118
112 119
@@ -117,7 +124,7 @@ interface ApiService { @@ -117,7 +124,7 @@ interface ApiService {
117 @POST("/api/lesson/lesson_word") 124 @POST("/api/lesson/lesson_word")
118 fun textLessons( 125 fun textLessons(
119 @Field("keyword") keyword: String, 126 @Field("keyword") keyword: String,
120 - @Field("pos_id") pos_id: Int, 127 + @Field("pos_id") pos_id: String,
121 @Field("page") page: Int, 128 @Field("page") page: Int,
122 @Field("page_num") page_num: Int, 129 @Field("page_num") page_num: Int,
123 ): Observable<BaseResponse<TextLessonBean>> 130 ): Observable<BaseResponse<TextLessonBean>>
@@ -135,7 +142,7 @@ interface ApiService { @@ -135,7 +142,7 @@ interface ApiService {
135 @FormUrlEncoded 142 @FormUrlEncoded
136 @POST("/api/lesson/lesson_word_detail") 143 @POST("/api/lesson/lesson_word_detail")
137 fun textLessonsDetail( 144 fun textLessonsDetail(
138 - @Field("id") id: Int, 145 + @Field("id") id: String,
139 ): Observable<BaseResponse<TextLessonDetailBean>> 146 ): Observable<BaseResponse<TextLessonDetailBean>>
140 147
141 /** 148 /**
@@ -158,7 +165,7 @@ interface ApiService { @@ -158,7 +165,7 @@ interface ApiService {
158 @POST("/api/item/paper_list") 165 @POST("/api/item/paper_list")
159 fun practiceList( 166 fun practiceList(
160 @Field("type") type: Int, //所属类型:1=模拟考试,2=专项练习 167 @Field("type") type: Int, //所属类型:1=模拟考试,2=专项练习
161 - @Field("pos_id") pos_id: Int, 168 + @Field("pos_id") pos_id: String,
162 @Field("page") page: Int, 169 @Field("page") page: Int,
163 @Field("page_num") page_num: Int 170 @Field("page_num") page_num: Int
164 ): Observable<BaseResponse<CommonList<PracticeBean>>> 171 ): Observable<BaseResponse<CommonList<PracticeBean>>>
@@ -259,7 +266,7 @@ interface ApiService { @@ -259,7 +266,7 @@ interface ApiService {
259 @FormUrlEncoded 266 @FormUrlEncoded
260 @POST("/api/train/train_chat_detail") 267 @POST("/api/train/train_chat_detail")
261 fun academicFeedbackDetail( 268 fun academicFeedbackDetail(
262 - @Field("train_class_id") train_class_id: Int, 269 + @Field("train_class_id") train_class_id: String,
263 ): Observable<BaseResponse<AcademicFeedbackDetailBean>> 270 ): Observable<BaseResponse<AcademicFeedbackDetailBean>>
264 271
265 /** 272 /**
@@ -269,7 +276,7 @@ interface ApiService { @@ -269,7 +276,7 @@ interface ApiService {
269 @FormUrlEncoded 276 @FormUrlEncoded
270 @POST("/api/material/material_detail") 277 @POST("/api/material/material_detail")
271 fun getDocDetail( 278 fun getDocDetail(
272 - @Field("id") id: Int 279 + @Field("id") id: String
273 ): Observable<BaseResponse<CommonDetail<MaterialDetail>>> 280 ): Observable<BaseResponse<CommonDetail<MaterialDetail>>>
274 281
275 /** 282 /**
@@ -311,8 +318,8 @@ interface ApiService { @@ -311,8 +318,8 @@ interface ApiService {
311 @FormUrlEncoded 318 @FormUrlEncoded
312 @POST("/api/item/item_sub_single") 319 @POST("/api/item/item_sub_single")
313 fun subSingle( 320 fun subSingle(
314 - @Field("user_item_id") user_item_id: Int,  
315 - @Field("item_id") item_id: Int, 321 + @Field("user_item_id") user_item_id: String,
  322 + @Field("item_id") item_id: String,
316 @Field("answer") answer: String 323 @Field("answer") answer: String
317 ): Observable<BaseResponse<SubSingle>> 324 ): Observable<BaseResponse<SubSingle>>
318 325
@@ -324,7 +331,7 @@ interface ApiService { @@ -324,7 +331,7 @@ interface ApiService {
324 @FormUrlEncoded 331 @FormUrlEncoded
325 @POST("/api/item/item_sub") 332 @POST("/api/item/item_sub")
326 fun subAnswer( 333 fun subAnswer(
327 - @Field("item_id") item_id: Int, 334 + @Field("item_id") item_id: String,
328 @Field("answer") answer: String 335 @Field("answer") answer: String
329 ): Observable<BaseResponse<SubResult>> 336 ): Observable<BaseResponse<SubResult>>
330 337
@@ -335,7 +342,7 @@ interface ApiService { @@ -335,7 +342,7 @@ interface ApiService {
335 @FormUrlEncoded 342 @FormUrlEncoded
336 @POST("/api/item/item_sub_paper") 343 @POST("/api/item/item_sub_paper")
337 fun subPaper( 344 fun subPaper(
338 - @Field("user_item_id") user_item_id: Int 345 + @Field("user_item_id") user_item_id: String
339 ): Observable<BaseResponse<SubResult>> 346 ): Observable<BaseResponse<SubResult>>
340 347
341 /** 348 /**
@@ -38,7 +38,7 @@ interface DocApi : ApiService { @@ -38,7 +38,7 @@ interface DocApi : ApiService {
38 @POST("/api/material/material_list") 38 @POST("/api/material/material_list")
39 fun getDocList( 39 fun getDocList(
40 @Field("type") type: Int, 40 @Field("type") type: Int,
41 - @Field("sort_id") sort_id: Int, 41 + @Field("sort_id") sort_id: String,
42 @Field("keyword") keyword: String, 42 @Field("keyword") keyword: String,
43 @Field("page") page: Int, 43 @Field("page") page: Int,
44 @Field("page_num") page_num: Int 44 @Field("page_num") page_num: Int
@@ -27,7 +27,6 @@ interface LessonApi : ApiService { @@ -27,7 +27,6 @@ interface LessonApi : ApiService {
27 @POST("/api/lesson/lesson_word") 27 @POST("/api/lesson/lesson_word")
28 fun lessonTxtList( 28 fun lessonTxtList(
29 @Field("keyword") keyword: String, 29 @Field("keyword") keyword: String,
30 - @Field("pos_id") pos_id: Int,  
31 @Field("page") page: Int, 30 @Field("page") page: Int,
32 @Field("page_num") page_num: Int, 31 @Field("page_num") page_num: Int,
33 ): Observable<BaseResponse<CommonDataList<CommonPage<LessonBean>>>> 32 ): Observable<BaseResponse<CommonDataList<CommonPage<LessonBean>>>>
@@ -69,8 +68,8 @@ interface LessonApi : ApiService { @@ -69,8 +68,8 @@ interface LessonApi : ApiService {
69 @FormUrlEncoded 68 @FormUrlEncoded
70 @POST("/api/lesson/lesson_detail") 69 @POST("/api/lesson/lesson_detail")
71 fun lessonVideoDetail( 70 fun lessonVideoDetail(
72 - @Field("id") id: Int  
73 - , @Field("train_class_id") train_class_id: Int 71 + @Field("id") id: String
  72 + , @Field("train_class_id") train_class_id: String
74 ): Observable<BaseResponse<LessonTrainVideoDetail>> 73 ): Observable<BaseResponse<LessonTrainVideoDetail>>
75 74
76 75
@@ -81,7 +80,7 @@ interface LessonApi : ApiService { @@ -81,7 +80,7 @@ interface LessonApi : ApiService {
81 @FormUrlEncoded 80 @FormUrlEncoded
82 @POST("/api/lesson/lesson_detail") 81 @POST("/api/lesson/lesson_detail")
83 fun lessonVideoDetail( 82 fun lessonVideoDetail(
84 - @Field("id") id: Int 83 + @Field("id") id: String
85 ): Observable<BaseResponse<LessonTrainVideoDetail>> 84 ): Observable<BaseResponse<LessonTrainVideoDetail>>
86 85
87 /** 86 /**
@@ -92,11 +91,23 @@ interface LessonApi : ApiService { @@ -92,11 +91,23 @@ interface LessonApi : ApiService {
92 @FormUrlEncoded 91 @FormUrlEncoded
93 @POST("/api/lesson/lesson_class_detail") 92 @POST("/api/lesson/lesson_class_detail")
94 fun videoDetail( 93 fun videoDetail(
95 - @Field("id") id: Int 94 + @Field("id") id: String
96 // , @Field("train_class_id") train_class_id: Int 95 // , @Field("train_class_id") train_class_id: Int
97 ): Observable<BaseResponse<CommonDetail<LessonClassDetail>>> 96 ): Observable<BaseResponse<CommonDetail<LessonClassDetail>>>
98 97
99 /** 98 /**
  99 + * 视频详情
  100 + * @param id 视频id
  101 + * @param train_class_id 培训计划课程id
  102 + */
  103 + @FormUrlEncoded
  104 + @POST("/api/lesson/lesson_class_detail")
  105 + fun videoDetail(
  106 + @Field("id") id: String
  107 + , @Field("train_class_id") train_class_id: String
  108 + ): Observable<BaseResponse<CommonDetail<LessonClassDetail>>>
  109 +
  110 + /**
100 * 资料库列表 111 * 资料库列表
101 * @param keyword 搜索关键词 112 * @param keyword 搜索关键词
102 * @param page 页数 113 * @param page 页数
@@ -106,7 +117,6 @@ interface LessonApi : ApiService { @@ -106,7 +117,6 @@ interface LessonApi : ApiService {
106 @POST("/api/material/material_list") 117 @POST("/api/material/material_list")
107 fun searchDocList( 118 fun searchDocList(
108 @Field("keyword") keyword: String, 119 @Field("keyword") keyword: String,
109 - @Field("sort_id") sort_id: Int,  
110 @Field("page") page: Int, 120 @Field("page") page: Int,
111 @Field("page_num") page_num: Int 121 @Field("page_num") page_num: Int
112 ): Observable<BaseResponse<MaterialPage>> 122 ): Observable<BaseResponse<MaterialPage>>
@@ -123,7 +133,7 @@ interface LessonApi : ApiService { @@ -123,7 +133,7 @@ interface LessonApi : ApiService {
123 @POST("/api/lesson/lesson") 133 @POST("/api/lesson/lesson")
124 fun searchVideoList( 134 fun searchVideoList(
125 @Field("keyword") keyword: String, // 搜索关键词 135 @Field("keyword") keyword: String, // 搜索关键词
126 - @Field("pos_id") pos_id: String, // 工种id 136 +// @Field("pos_id") pos_id: String, // 工种id
127 @Field("page") page: Int, 137 @Field("page") page: Int,
128 @Field("page_num") page_num: Int, 138 @Field("page_num") page_num: Int,
129 ): Observable<BaseResponse<VideoLessonBean>> 139 ): Observable<BaseResponse<VideoLessonBean>>
@@ -166,7 +176,7 @@ interface LessonApi : ApiService { @@ -166,7 +176,7 @@ interface LessonApi : ApiService {
166 @FormUrlEncoded 176 @FormUrlEncoded
167 @POST("/api/lesson/lesson_live_detail") 177 @POST("/api/lesson/lesson_live_detail")
168 fun lessonLiveDetail( 178 fun lessonLiveDetail(
169 - @Field("id") id: Int 179 + @Field("id") id: String
170 ): Observable<BaseResponse<CommonDetail<LessonLive>>> 180 ): Observable<BaseResponse<CommonDetail<LessonLive>>>
171 181
172 /** 182 /**
@@ -177,8 +187,8 @@ interface LessonApi : ApiService { @@ -177,8 +187,8 @@ interface LessonApi : ApiService {
177 @FormUrlEncoded 187 @FormUrlEncoded
178 @POST("/api/lesson/lesson_offline") 188 @POST("/api/lesson/lesson_offline")
179 fun lessonOffList( 189 fun lessonOffList(
180 - @Field("id") id: Int,  
181 - @Field("train_class_id") train_class_id: Int 190 + @Field("id") id: String,
  191 + @Field("train_class_id") train_class_id: String
182 ): Observable<BaseResponse<LessonOffline>> 192 ): Observable<BaseResponse<LessonOffline>>
183 193
184 /** 194 /**
@@ -188,7 +198,7 @@ interface LessonApi : ApiService { @@ -188,7 +198,7 @@ interface LessonApi : ApiService {
188 @FormUrlEncoded 198 @FormUrlEncoded
189 @POST("/api/lesson/lesson_offline_detail") 199 @POST("/api/lesson/lesson_offline_detail")
190 fun lessonOffDetail( 200 fun lessonOffDetail(
191 - @Field("id") id: Int 201 + @Field("id") id: String
192 ): Observable<BaseResponse<CommonDetail<LessonOfflineDetail>>> 202 ): Observable<BaseResponse<CommonDetail<LessonOfflineDetail>>>
193 203
194 /** 204 /**
@@ -16,6 +16,7 @@ import retrofit2.http.POST @@ -16,6 +16,7 @@ import retrofit2.http.POST
16 * PS: Not easy to write code, please indicate. 16 * PS: Not easy to write code, please indicate.
17 */ 17 */
18 interface TrainApi : ApiService { 18 interface TrainApi : ApiService {
  19 +
19 /** 20 /**
20 * 我的任务(课程) 21 * 我的任务(课程)
21 * @param type 状态0=全部1=已完成2=未完成 22 * @param type 状态0=全部1=已完成2=未完成
@@ -26,6 +27,7 @@ interface TrainApi : ApiService { @@ -26,6 +27,7 @@ interface TrainApi : ApiService {
26 @POST("/api/train/train_lesson_list") 27 @POST("/api/train/train_lesson_list")
27 fun getTrainLessonList( 28 fun getTrainLessonList(
28 @Field("type") type: Int, 29 @Field("type") type: Int,
  30 + @Field("train_class_id") train_class_id: Int,
29 @Field("page") page: Int, 31 @Field("page") page: Int,
30 @Field("page_num") page_num: Int 32 @Field("page_num") page_num: Int
31 ): Observable<BaseResponse<LessonList>> 33 ): Observable<BaseResponse<LessonList>>
@@ -40,6 +42,7 @@ interface TrainApi : ApiService { @@ -40,6 +42,7 @@ interface TrainApi : ApiService {
40 @POST("/api/train/train_practise_list") 42 @POST("/api/train/train_practise_list")
41 fun getTrainPractiseList( 43 fun getTrainPractiseList(
42 @Field("type") type: Int, 44 @Field("type") type: Int,
  45 + @Field("train_class_id") train_class_id: Int,
43 @Field("page") page: Int, 46 @Field("page") page: Int,
44 @Field("page_num") page_num: Int 47 @Field("page_num") page_num: Int
45 ): Observable<BaseResponse<CommonList<PractiseBean>>> 48 ): Observable<BaseResponse<CommonList<PractiseBean>>>
@@ -54,6 +57,7 @@ interface TrainApi : ApiService { @@ -54,6 +57,7 @@ interface TrainApi : ApiService {
54 @POST("/api/train/train_exam_list") 57 @POST("/api/train/train_exam_list")
55 fun getTrainExamList( 58 fun getTrainExamList(
56 @Field("type") type: Int, 59 @Field("type") type: Int,
  60 + @Field("train_class_id") train_class_id: Int,
57 @Field("page") page: Int, 61 @Field("page") page: Int,
58 @Field("page_num") page_num: Int 62 @Field("page_num") page_num: Int
59 ): Observable<BaseResponse<CommonList<ExamBean>>> 63 ): Observable<BaseResponse<CommonList<ExamBean>>>
@@ -65,7 +69,7 @@ interface TrainApi : ApiService { @@ -65,7 +69,7 @@ interface TrainApi : ApiService {
65 @FormUrlEncoded 69 @FormUrlEncoded
66 @POST("/api/train/train_exam_detail") 70 @POST("/api/train/train_exam_detail")
67 fun getTrainExamDetail( 71 fun getTrainExamDetail(
68 - @Field("train_exam_id") train_exam_id: Int 72 + @Field("train_exam_id") train_exam_id: String
69 ): Observable<BaseResponse<CommonDetail<ExamDetail>>> 73 ): Observable<BaseResponse<CommonDetail<ExamDetail>>>
70 74
71 /** 75 /**
@@ -75,7 +79,7 @@ interface TrainApi : ApiService { @@ -75,7 +79,7 @@ interface TrainApi : ApiService {
75 @FormUrlEncoded 79 @FormUrlEncoded
76 @POST("/api/train/start_practise") 80 @POST("/api/train/start_practise")
77 fun startPractise( 81 fun startPractise(
78 - @Field("train_practise_id") train_practise_id: Int 82 + @Field("train_practise_id") train_practise_id: String
79 ): Observable<BaseResponse<SubjectData>> 83 ): Observable<BaseResponse<SubjectData>>
80 84
81 /** 85 /**
@@ -95,7 +99,7 @@ interface TrainApi : ApiService { @@ -95,7 +99,7 @@ interface TrainApi : ApiService {
95 @FormUrlEncoded 99 @FormUrlEncoded
96 @POST("/api/train/start_exam_exp") 100 @POST("/api/train/start_exam_exp")
97 fun startExamExp( 101 fun startExamExp(
98 - @Field("train_exam_id") train_exam_id: Int 102 + @Field("train_exam_id") train_exam_id: String
99 ): Observable<BaseResponse<SubjectData>> 103 ): Observable<BaseResponse<SubjectData>>
100 104
101 /** 105 /**
@@ -117,7 +121,7 @@ interface TrainApi : ApiService { @@ -117,7 +121,7 @@ interface TrainApi : ApiService {
117 @FormUrlEncoded 121 @FormUrlEncoded
118 @POST("/api/train/train_chat_detail") 122 @POST("/api/train/train_chat_detail")
119 fun trainChatDetail( 123 fun trainChatDetail(
120 - @Field("train_class_id") train_class_id: Int 124 + @Field("train_class_id") train_class_id: String
121 ): Observable<BaseResponse<TrainDetail>> 125 ): Observable<BaseResponse<TrainDetail>>
122 126
123 /** 127 /**
@@ -127,7 +131,7 @@ interface TrainApi : ApiService { @@ -127,7 +131,7 @@ interface TrainApi : ApiService {
127 @FormUrlEncoded 131 @FormUrlEncoded
128 @POST("/api/train/train_chat_read") 132 @POST("/api/train/train_chat_read")
129 fun trainChatRead( 133 fun trainChatRead(
130 - @Field("train_class_id") train_class_id: Int 134 + @Field("train_class_id") train_class_id: String
131 ): Observable<BaseResponse<Void>> 135 ): Observable<BaseResponse<Void>>
132 136
133 /** 137 /**
@@ -205,7 +205,7 @@ interface UserApi : ApiService { @@ -205,7 +205,7 @@ interface UserApi : ApiService {
205 @FormUrlEncoded 205 @FormUrlEncoded
206 @POST("/api/user/my_cert_detail") 206 @POST("/api/user/my_cert_detail")
207 fun certDetail( 207 fun certDetail(
208 - @Field("id") id: Int 208 + @Field("id") id: String
209 ): Observable<BaseResponse<CommonDetail<UserCertDetail>>> 209 ): Observable<BaseResponse<CommonDetail<UserCertDetail>>>
210 210
211 /** 211 /**
@@ -237,8 +237,8 @@ interface UserApi : ApiService { @@ -237,8 +237,8 @@ interface UserApi : ApiService {
237 @FormUrlEncoded 237 @FormUrlEncoded
238 @POST("/api/user/my_cert_add") 238 @POST("/api/user/my_cert_add")
239 fun certAdd( 239 fun certAdd(
240 - @Field("id") id: Int?,  
241 - @Field("cert_id") cert_id: Int, 240 + @Field("id") id: String?,
  241 + @Field("cert_id") cert_id: String,
242 @Field("image") image: String, 242 @Field("image") image: String,
243 @Field("start_time") start_time: String, 243 @Field("start_time") start_time: String,
244 @Field("end_time") end_time: String? 244 @Field("end_time") end_time: String?
@@ -279,7 +279,7 @@ interface UserApi : ApiService { @@ -279,7 +279,7 @@ interface UserApi : ApiService {
279 fun msgDetail( 279 fun msgDetail(
280 @Field("page") page: Int, 280 @Field("page") page: Int,
281 @Field("page_num") page_num: Int, 281 @Field("page_num") page_num: Int,
282 - @Field("teacher_id") teacherId: Int, 282 + @Field("teacher_id") teacherId: String,
283 ): Observable<BaseResponse<CommonDetail<CommonPage<ChatDetailBean>>>> 283 ): Observable<BaseResponse<CommonDetail<CommonPage<ChatDetailBean>>>>
284 284
285 /** 285 /**
@@ -290,7 +290,7 @@ interface UserApi : ApiService { @@ -290,7 +290,7 @@ interface UserApi : ApiService {
290 @FormUrlEncoded 290 @FormUrlEncoded
291 @POST("/api/teachermessage/return_msg") 291 @POST("/api/teachermessage/return_msg")
292 fun sendMsg( 292 fun sendMsg(
293 - @Field("teacher_id") teacherId: Int, 293 + @Field("teacher_id") teacherId: String,
294 @Field("content") content: String, 294 @Field("content") content: String,
295 ): Observable<BaseResponse<Any>> 295 ): Observable<BaseResponse<Any>>
296 296
@@ -302,7 +302,7 @@ interface UserApi : ApiService { @@ -302,7 +302,7 @@ interface UserApi : ApiService {
302 @FormUrlEncoded 302 @FormUrlEncoded
303 @POST("/api/user/my_cert_del") 303 @POST("/api/user/my_cert_del")
304 fun certDel( 304 fun certDel(
305 - @Field("id") id: Int 305 + @Field("id") id: String
306 ): Observable<BaseResponse<Void>> 306 ): Observable<BaseResponse<Void>>
307 307
308 308
@@ -4,10 +4,17 @@ import androidx.lifecycle.MutableLiveData @@ -4,10 +4,17 @@ import androidx.lifecycle.MutableLiveData
4 import com.br_technology.securitytrain_master.base.common.State 4 import com.br_technology.securitytrain_master.base.common.State
5 import com.br_technology.securitytrain_master.base.network.response.BaseResponse 5 import com.br_technology.securitytrain_master.base.network.response.BaseResponse
6 import com.br_technology.securitytrain_master.base.network.response.CommonList 6 import com.br_technology.securitytrain_master.base.network.response.CommonList
7 -import com.br_technology.securitytrain_master.base.repository.ApiRepository  
8 import com.br_technology.securitytrain_master.ui.bean.RegisterCompany 7 import com.br_technology.securitytrain_master.ui.bean.RegisterCompany
9 import com.br_technology.securitytrain_master.ui.bean.SearchLog 8 import com.br_technology.securitytrain_master.ui.bean.SearchLog
  9 +import com.br_technology.securitytrain_master.ui.bean.UploadFileData
10 import com.br_technology.securitytrain_master.ui.bean.UserRule 10 import com.br_technology.securitytrain_master.ui.bean.UserRule
  11 +import com.wjx.android.wanandroidmvvm.base.observer.BaseObserver
  12 +import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
  13 +import io.reactivex.rxjava3.schedulers.Schedulers
  14 +import okhttp3.MediaType
  15 +import okhttp3.MultipartBody
  16 +import okhttp3.RequestBody
  17 +import java.io.File
11 18
12 /** 19 /**
13 * Author by YSir 20 * Author by YSir
@@ -15,7 +22,7 @@ import com.br_technology.securitytrain_master.ui.bean.UserRule @@ -15,7 +22,7 @@ import com.br_technology.securitytrain_master.ui.bean.UserRule
15 * description 22 * description
16 * PS: Not easy to write code, please indicate. 23 * PS: Not easy to write code, please indicate.
17 */ 24 */
18 -class CommonRepository(loadState: MutableLiveData<State>) : ApiRepository(loadState) { 25 +class CommonRepository(val loadState: MutableLiveData<State>) : ApiRepository(loadState) {
19 //注册企业 26 //注册企业
20 fun registerCompany( 27 fun registerCompany(
21 type: Int, 28 type: Int,
@@ -78,4 +85,36 @@ class CommonRepository(loadState: MutableLiveData<State>) : ApiRepository(loadSt @@ -78,4 +85,36 @@ class CommonRepository(loadState: MutableLiveData<State>) : ApiRepository(loadSt
78 commonService.requestInit(type, lng, lat), liveData 85 commonService.requestInit(type, lng, lat), liveData
79 ) 86 )
80 } 87 }
  88 +
  89 + fun uploadFile(
  90 + path: String,
  91 + liveData: MutableLiveData<BaseResponse<UploadFileData>>
  92 + ) {
  93 + val file = File(path)
  94 + if (file.exists()) {
  95 + MultipartBody.Part.createFormData(
  96 + "file", file.name, RequestBody.create(MediaType.parse("multipart/form-data"), file)
  97 + )
  98 + apiService.uploadFile(
  99 + MultipartBody.Part.createFormData(
  100 + "file",
  101 + file.name,
  102 + RequestBody.create(MediaType.parse("multipart/form-data"), file)
  103 + )
  104 + )
  105 + .subscribeOn(Schedulers.io())
  106 + .observeOn(AndroidSchedulers.mainThread())
  107 + .subscribe(
  108 + BaseObserver(
  109 + liveData,
  110 + loadState,
  111 + this
  112 + )
  113 + )
  114 + }
  115 + }
  116 +
  117 + fun checkFace(url: String, liveData: MutableLiveData<BaseResponse<Void>>) {
  118 + addRequest(apiService.checkFace(url), liveData)
  119 + }
81 } 120 }
@@ -27,7 +27,7 @@ class DocRepository(loadState: MutableLiveData<State>) : ApiRepository(loadState @@ -27,7 +27,7 @@ class DocRepository(loadState: MutableLiveData<State>) : ApiRepository(loadState
27 //资料库列表 27 //资料库列表
28 fun getDocList( 28 fun getDocList(
29 type: Int, 29 type: Int,
30 - sort_id: Int, 30 + sort_id: String,
31 keyword: String, 31 keyword: String,
32 page: Int, 32 page: Int,
33 page_num: Int, 33 page_num: Int,
@@ -38,7 +38,7 @@ class DocRepository(loadState: MutableLiveData<State>) : ApiRepository(loadState @@ -38,7 +38,7 @@ class DocRepository(loadState: MutableLiveData<State>) : ApiRepository(loadState
38 38
39 //资料库详情 39 //资料库详情
40 fun getDocDetail( 40 fun getDocDetail(
41 - id: Int, 41 + id: String,
42 liveData: MutableLiveData<BaseResponse<CommonDetail<MaterialDetail>>> 42 liveData: MutableLiveData<BaseResponse<CommonDetail<MaterialDetail>>>
43 ) { 43 ) {
44 addRequest(docService.getDocDetail(id), liveData) 44 addRequest(docService.getDocDetail(id), liveData)
@@ -7,7 +7,10 @@ import com.br_technology.securitytrain_master.base.network.response.CommonDataLi @@ -7,7 +7,10 @@ import com.br_technology.securitytrain_master.base.network.response.CommonDataLi
7 import com.br_technology.securitytrain_master.base.network.response.CommonList 7 import com.br_technology.securitytrain_master.base.network.response.CommonList
8 import com.br_technology.securitytrain_master.base.network.response.CommonPage 8 import com.br_technology.securitytrain_master.base.network.response.CommonPage
9 import com.br_technology.securitytrain_master.ui.bean.* 9 import com.br_technology.securitytrain_master.ui.bean.*
10 -import com.br_technology.securitytrain_master.ui.view.bank.bean.* 10 +import com.br_technology.securitytrain_master.ui.view.bank.bean.PracticeBean
  11 +import com.br_technology.securitytrain_master.ui.view.bank.bean.StartItemBean
  12 +import com.br_technology.securitytrain_master.ui.view.bank.bean.SubjectData
  13 +import com.br_technology.securitytrain_master.ui.view.bank.bean.TestSubject
11 14
12 /** 15 /**
13 * Author by YSir 16 * Author by YSir
@@ -34,7 +37,7 @@ class ItemRepository(loadState: MutableLiveData<State>) : ApiRepository(loadStat @@ -34,7 +37,7 @@ class ItemRepository(loadState: MutableLiveData<State>) : ApiRepository(loadStat
34 37
35 //专项练习列表 38 //专项练习列表
36 fun specialPracticeList( 39 fun specialPracticeList(
37 - pos_id: Int, // 工种ID 40 + pos_id: String, // 工种ID
38 type: Int, // 41 type: Int, //
39 page: Int, 42 page: Int,
40 page_num: Int, 43 page_num: Int,
@@ -61,7 +64,7 @@ class ItemRepository(loadState: MutableLiveData<State>) : ApiRepository(loadStat @@ -61,7 +64,7 @@ class ItemRepository(loadState: MutableLiveData<State>) : ApiRepository(loadStat
61 64
62 //每日一练获取列表 65 //每日一练获取列表
63 fun dayPracticeList( 66 fun dayPracticeList(
64 - pos_id: Int, 67 + pos_id: String,
65 page: Int, 68 page: Int,
66 pageNum: Int, 69 pageNum: Int,
67 liveData: MutableLiveData<BaseResponse<CommonDataList<CommonPage<PaperDaily>>>> 70 liveData: MutableLiveData<BaseResponse<CommonDataList<CommonPage<PaperDaily>>>>
@@ -71,8 +74,8 @@ class ItemRepository(loadState: MutableLiveData<State>) : ApiRepository(loadStat @@ -71,8 +74,8 @@ class ItemRepository(loadState: MutableLiveData<State>) : ApiRepository(loadStat
71 74
72 //开始答题 75 //开始答题
73 fun itemStart( 76 fun itemStart(
74 - pos_id: Int,  
75 - paper_id: Int?, 77 + pos_id: String,
  78 + paper_id: String?,
76 type: Int, 79 type: Int,
77 liveData: MutableLiveData<BaseResponse<StartItemBean>> 80 liveData: MutableLiveData<BaseResponse<StartItemBean>>
78 ) { 81 ) {
@@ -80,19 +83,19 @@ class ItemRepository(loadState: MutableLiveData<State>) : ApiRepository(loadStat @@ -80,19 +83,19 @@ class ItemRepository(loadState: MutableLiveData<State>) : ApiRepository(loadStat
80 } 83 }
81 84
82 //题目列表 85 //题目列表
83 - fun itemList(pos_id: Int, liveData: MutableLiveData<BaseResponse<SubjectData>>) { 86 + fun itemList(pos_id: String, liveData: MutableLiveData<BaseResponse<SubjectData>>) {
84 addRequest(itemService.itemList(pos_id), liveData) 87 addRequest(itemService.itemList(pos_id), liveData)
85 } 88 }
86 89
87 //获取挑战答题弹板信息 90 //获取挑战答题弹板信息
88 - fun challengeInfo(user_item_id: Int, liveData: MutableLiveData<BaseResponse<ChallengeInfo>>) { 91 + fun challengeInfo(user_item_id: String, liveData: MutableLiveData<BaseResponse<ChallengeInfo>>) {
89 addRequest(itemService.challengeInfo(user_item_id), liveData) 92 addRequest(itemService.challengeInfo(user_item_id), liveData)
90 } 93 }
91 94
92 //提交答题(某一题) 95 //提交答题(某一题)
93 fun subSingle( 96 fun subSingle(
94 - user_item_id: Int,  
95 - item_id: Int, 97 + user_item_id: String,
  98 + item_id: String,
96 answer: String, 99 answer: String,
97 liveData: MutableLiveData<BaseResponse<SubSingle>> 100 liveData: MutableLiveData<BaseResponse<SubSingle>>
98 ) { 101 ) {
@@ -101,7 +104,7 @@ class ItemRepository(loadState: MutableLiveData<State>) : ApiRepository(loadStat @@ -101,7 +104,7 @@ class ItemRepository(loadState: MutableLiveData<State>) : ApiRepository(loadStat
101 104
102 //subAnswer 105 //subAnswer
103 fun subAnswer( 106 fun subAnswer(
104 - item_id: Int, 107 + item_id: String,
105 answer: String, 108 answer: String,
106 liveData: MutableLiveData<BaseResponse<SubResult>> 109 liveData: MutableLiveData<BaseResponse<SubResult>>
107 ) { 110 ) {
@@ -109,19 +112,19 @@ class ItemRepository(loadState: MutableLiveData<State>) : ApiRepository(loadStat @@ -109,19 +112,19 @@ class ItemRepository(loadState: MutableLiveData<State>) : ApiRepository(loadStat
109 } 112 }
110 113
111 //交卷 114 //交卷
112 - fun subPaper(user_item_id: Int, liveData: MutableLiveData<BaseResponse<SubResult>>) { 115 + fun subPaper(user_item_id: String, liveData: MutableLiveData<BaseResponse<SubResult>>) {
113 addRequest(itemService.subPaper(user_item_id), liveData) 116 addRequest(itemService.subPaper(user_item_id), liveData)
114 } 117 }
115 118
116 119
117 //错题详情 120 //错题详情
118 - fun errorDetail(id: Int, liveData: MutableLiveData<BaseResponse<ErrorDetail>>) { 121 + fun errorDetail(id: String, liveData: MutableLiveData<BaseResponse<ErrorDetail>>) {
119 addRequest(itemService.errorDetail(id), liveData) 122 addRequest(itemService.errorDetail(id), liveData)
120 } 123 }
121 124
122 //提交错题 125 //提交错题
123 fun subError( 126 fun subError(
124 - error_id: Int, 127 + error_id: String,
125 answer: String, 128 answer: String,
126 liveData: MutableLiveData<BaseResponse<Void>> 129 liveData: MutableLiveData<BaseResponse<Void>>
127 ) { 130 ) {
@@ -140,7 +143,7 @@ class ItemRepository(loadState: MutableLiveData<State>) : ApiRepository(loadStat @@ -140,7 +143,7 @@ class ItemRepository(loadState: MutableLiveData<State>) : ApiRepository(loadStat
140 143
141 //答题记录详情 144 //答题记录详情
142 fun errorSubDetail( 145 fun errorSubDetail(
143 - id: Int, 146 + id: String,
144 liveData: MutableLiveData<BaseResponse<CommonList<AnswerDetail>>> 147 liveData: MutableLiveData<BaseResponse<CommonList<AnswerDetail>>>
145 ) { 148 ) {
146 addRequest(itemService.errorSubDetail(id), liveData) 149 addRequest(itemService.errorSubDetail(id), liveData)
@@ -34,15 +34,14 @@ class LessonRepository(val loadState: MutableLiveData<State>) : ApiRepository(lo @@ -34,15 +34,14 @@ class LessonRepository(val loadState: MutableLiveData<State>) : ApiRepository(lo
34 34
35 fun lessonTxtList( 35 fun lessonTxtList(
36 keyword: String, 36 keyword: String,
37 - pos_id: Int,  
38 page: Int, page_num: Int, 37 page: Int, page_num: Int,
39 liveData: MutableLiveData<BaseResponse<CommonDataList<CommonPage<LessonBean>>>> 38 liveData: MutableLiveData<BaseResponse<CommonDataList<CommonPage<LessonBean>>>>
40 ) { 39 ) {
41 - addRequest(lessonService.lessonTxtList(keyword, pos_id, page, page_num), liveData) 40 + addRequest(lessonService.lessonTxtList(keyword, page, page_num), liveData)
42 } 41 }
43 42
44 fun materialDetail( 43 fun materialDetail(
45 - id: Int, 44 + id: String,
46 liveData: MutableLiveData<BaseResponse<CommonDetail<MaterialDetail>>> 45 liveData: MutableLiveData<BaseResponse<CommonDetail<MaterialDetail>>>
47 ) { 46 ) {
48 addRequest(lessonService.getDocDetail(id), liveData) 47 addRequest(lessonService.getDocDetail(id), liveData)
@@ -67,29 +66,37 @@ class LessonRepository(val loadState: MutableLiveData<State>) : ApiRepository(lo @@ -67,29 +66,37 @@ class LessonRepository(val loadState: MutableLiveData<State>) : ApiRepository(lo
67 } 66 }
68 67
69 fun lessonVideoDetail( 68 fun lessonVideoDetail(
70 - id: Int,  
71 - trainClassId: Int, 69 + id: String,
  70 + trainClassId: String,
72 liveData: MutableLiveData<BaseResponse<LessonTrainVideoDetail>> 71 liveData: MutableLiveData<BaseResponse<LessonTrainVideoDetail>>
73 ) { 72 ) {
74 - addRequest(lessonService.lessonVideoDetail(id,trainClassId), liveData) 73 + addRequest(lessonService.lessonVideoDetail(id, trainClassId), liveData)
75 } 74 }
76 75
77 fun lessonVideoDetail( 76 fun lessonVideoDetail(
78 - id: Int, 77 + id: String,
79 liveData: MutableLiveData<BaseResponse<LessonTrainVideoDetail>> 78 liveData: MutableLiveData<BaseResponse<LessonTrainVideoDetail>>
80 ) { 79 ) {
81 addRequest(lessonService.lessonVideoDetail(id), liveData) 80 addRequest(lessonService.lessonVideoDetail(id), liveData)
82 } 81 }
83 82
84 fun videoDetail( 83 fun videoDetail(
85 - id: Int, 84 + id: String,
86 liveData: MutableLiveData<BaseResponse<CommonDetail<LessonClassDetail>>> 85 liveData: MutableLiveData<BaseResponse<CommonDetail<LessonClassDetail>>>
87 ) { 86 ) {
88 addRequest(lessonService.videoDetail(id), liveData) 87 addRequest(lessonService.videoDetail(id), liveData)
89 } 88 }
90 89
  90 + fun videoDetail(
  91 + id: String,
  92 + train_class_id: String,
  93 + liveData: MutableLiveData<BaseResponse<CommonDetail<LessonClassDetail>>>
  94 + ) {
  95 + addRequest(lessonService.videoDetail(id,train_class_id), liveData)
  96 + }
  97 +
91 fun lessonLiveList( 98 fun lessonLiveList(
92 - keyword: String?=null, 99 + keyword: String? = null,
93 type: Int, 100 type: Int,
94 page: Int, 101 page: Int,
95 page_num: Int, 102 page_num: Int,
@@ -109,49 +116,46 @@ class LessonRepository(val loadState: MutableLiveData<State>) : ApiRepository(lo @@ -109,49 +116,46 @@ class LessonRepository(val loadState: MutableLiveData<State>) : ApiRepository(lo
109 116
110 fun searchVideoList( 117 fun searchVideoList(
111 keyword: String, 118 keyword: String,
112 - pos_id: String,  
113 page: Int, 119 page: Int,
114 page_num: Int, 120 page_num: Int,
115 liveData: MutableLiveData<BaseResponse<VideoLessonBean>> 121 liveData: MutableLiveData<BaseResponse<VideoLessonBean>>
116 ) { 122 ) {
117 - addRequest(lessonService.searchVideoList(keyword, pos_id, page, page_num), liveData) 123 + addRequest(lessonService.searchVideoList(keyword, page, page_num), liveData)
118 } 124 }
119 125
120 fun searchTxtList( 126 fun searchTxtList(
121 keyword: String, 127 keyword: String,
122 - pos_id: Int,  
123 page: Int, page_num: Int, 128 page: Int, page_num: Int,
124 liveData: MutableLiveData<BaseResponse<CommonDataList<CommonPage<LessonBean>>>> 129 liveData: MutableLiveData<BaseResponse<CommonDataList<CommonPage<LessonBean>>>>
125 ) { 130 ) {
126 - addRequest(lessonService.lessonTxtList(keyword, pos_id, page, page_num), liveData) 131 + addRequest(lessonService.lessonTxtList(keyword, page, page_num), liveData)
127 } 132 }
128 133
129 fun searchMaterialList( 134 fun searchMaterialList(
130 keyword: String, 135 keyword: String,
131 - pos_id: Int,  
132 page: Int, page_num: Int, 136 page: Int, page_num: Int,
133 liveData: MutableLiveData<BaseResponse<MaterialPage>> 137 liveData: MutableLiveData<BaseResponse<MaterialPage>>
134 ) { 138 ) {
135 - addRequest(lessonService.searchDocList(keyword, pos_id, page, page_num), liveData) 139 + addRequest(lessonService.searchDocList(keyword, page, page_num), liveData)
136 } 140 }
137 141
138 fun lessonLiveDetail( 142 fun lessonLiveDetail(
139 - id: Int, 143 + id: String,
140 liveData: MutableLiveData<BaseResponse<CommonDetail<LessonLive>>> 144 liveData: MutableLiveData<BaseResponse<CommonDetail<LessonLive>>>
141 ) { 145 ) {
142 addRequest(lessonService.lessonLiveDetail(id), liveData) 146 addRequest(lessonService.lessonLiveDetail(id), liveData)
143 } 147 }
144 148
145 fun lessonOffList( 149 fun lessonOffList(
146 - id: Int,  
147 - train_class_id: Int, 150 + id: String,
  151 + train_class_id: String,
148 liveData: MutableLiveData<BaseResponse<LessonOffline>> 152 liveData: MutableLiveData<BaseResponse<LessonOffline>>
149 ) { 153 ) {
150 addRequest(lessonService.lessonOffList(id, train_class_id), liveData) 154 addRequest(lessonService.lessonOffList(id, train_class_id), liveData)
151 } 155 }
152 156
153 fun lessonOffDetail( 157 fun lessonOffDetail(
154 - id: Int, 158 + id: String,
155 liveData: MutableLiveData<BaseResponse<CommonDetail<LessonOfflineDetail>>> 159 liveData: MutableLiveData<BaseResponse<CommonDetail<LessonOfflineDetail>>>
156 ) { 160 ) {
157 addRequest(lessonService.lessonOffDetail(id), liveData) 161 addRequest(lessonService.lessonOffDetail(id), liveData)
@@ -206,7 +210,7 @@ class LessonRepository(val loadState: MutableLiveData<State>) : ApiRepository(lo @@ -206,7 +210,7 @@ class LessonRepository(val loadState: MutableLiveData<State>) : ApiRepository(lo
206 } 210 }
207 211
208 fun txtLessonDetail( 212 fun txtLessonDetail(
209 - id: Int, 213 + id: String,
210 liveData: MutableLiveData<BaseResponse<TextLessonDetailBean>> 214 liveData: MutableLiveData<BaseResponse<TextLessonDetailBean>>
211 ) { 215 ) {
212 addRequest(lessonService.textLessonsDetail(id), liveData) 216 addRequest(lessonService.textLessonsDetail(id), liveData)
@@ -5,6 +5,7 @@ import com.br_technology.securitytrain_master.base.common.State @@ -5,6 +5,7 @@ import com.br_technology.securitytrain_master.base.common.State
5 import com.br_technology.securitytrain_master.base.network.response.* 5 import com.br_technology.securitytrain_master.base.network.response.*
6 import com.br_technology.securitytrain_master.ui.bean.* 6 import com.br_technology.securitytrain_master.ui.bean.*
7 import com.br_technology.securitytrain_master.ui.view.bank.bean.SubjectData 7 import com.br_technology.securitytrain_master.ui.view.bank.bean.SubjectData
  8 +import com.br_technology.securitytrain_master.util.current_class_id
8 import com.wjx.android.wanandroidmvvm.base.observer.BaseObserver 9 import com.wjx.android.wanandroidmvvm.base.observer.BaseObserver
9 import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers 10 import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
10 import io.reactivex.rxjava3.schedulers.Schedulers 11 import io.reactivex.rxjava3.schedulers.Schedulers
@@ -21,12 +22,24 @@ import java.io.File @@ -21,12 +22,24 @@ import java.io.File
21 */ 22 */
22 class TrainRepository(val loadState: MutableLiveData<State>) : ApiRepository(loadState) { 23 class TrainRepository(val loadState: MutableLiveData<State>) : ApiRepository(loadState) {
23 24
  25 + fun getClazzList(
  26 + liveData: MutableLiveData<BaseResponse<CommonList<ClazzBean>>>
  27 + ) {
  28 + addRequest(
  29 + trainService.getClazzList(),
  30 + liveData
  31 + )
  32 + }
  33 +
24 fun getTrainLessonList( 34 fun getTrainLessonList(
25 type: Int, 35 type: Int,
26 page: Int, 36 page: Int,
27 page_num: Int, liveData: MutableLiveData<BaseResponse<LessonList>> 37 page_num: Int, liveData: MutableLiveData<BaseResponse<LessonList>>
28 ) { 38 ) {
29 - addRequest(trainService.getTrainLessonList(type, page, page_num), liveData) 39 + addRequest(
  40 + trainService.getTrainLessonList(type, current_class_id.toInt(), page, page_num),
  41 + liveData
  42 + )
30 } 43 }
31 44
32 fun getTrainPractiseList( 45 fun getTrainPractiseList(
@@ -34,7 +47,10 @@ class TrainRepository(val loadState: MutableLiveData<State>) : ApiRepository(loa @@ -34,7 +47,10 @@ class TrainRepository(val loadState: MutableLiveData<State>) : ApiRepository(loa
34 page: Int, 47 page: Int,
35 page_num: Int, liveData: MutableLiveData<BaseResponse<CommonList<PractiseBean>>> 48 page_num: Int, liveData: MutableLiveData<BaseResponse<CommonList<PractiseBean>>>
36 ) { 49 ) {
37 - addRequest(trainService.getTrainPractiseList(type, page, page_num), liveData) 50 + addRequest(
  51 + trainService.getTrainPractiseList(type, current_class_id.toInt(), page, page_num),
  52 + liveData
  53 + )
38 } 54 }
39 55
40 fun getTrainExamList( 56 fun getTrainExamList(
@@ -42,24 +58,24 @@ class TrainRepository(val loadState: MutableLiveData<State>) : ApiRepository(loa @@ -42,24 +58,24 @@ class TrainRepository(val loadState: MutableLiveData<State>) : ApiRepository(loa
42 page: Int, 58 page: Int,
43 page_num: Int, liveData: MutableLiveData<BaseResponse<CommonList<ExamBean>>> 59 page_num: Int, liveData: MutableLiveData<BaseResponse<CommonList<ExamBean>>>
44 ) { 60 ) {
45 - addRequest(trainService.getTrainExamList(type, page, page_num), liveData) 61 + addRequest(trainService.getTrainExamList(type, current_class_id.toInt(), page, page_num), liveData)
46 } 62 }
47 63
48 fun getTrainExamDetail( 64 fun getTrainExamDetail(
49 - train_exam_id: Int, liveData: MutableLiveData<BaseResponse<CommonDetail<ExamDetail>>> 65 + train_exam_id: String, liveData: MutableLiveData<BaseResponse<CommonDetail<ExamDetail>>>
50 ) { 66 ) {
51 addRequest(trainService.getTrainExamDetail(train_exam_id), liveData) 67 addRequest(trainService.getTrainExamDetail(train_exam_id), liveData)
52 } 68 }
53 69
54 fun startPractise( 70 fun startPractise(
55 - train_practise_id: Int, 71 + train_practise_id: String,
56 liveData: MutableLiveData<BaseResponse<SubjectData>> 72 liveData: MutableLiveData<BaseResponse<SubjectData>>
57 ) { 73 ) {
58 addRequest(trainService.startPractise(train_practise_id), liveData) 74 addRequest(trainService.startPractise(train_practise_id), liveData)
59 } 75 }
60 76
61 fun startExamExp( 77 fun startExamExp(
62 - train_exam_id: Int, 78 + train_exam_id: String,
63 liveData: MutableLiveData<BaseResponse<SubjectData>> 79 liveData: MutableLiveData<BaseResponse<SubjectData>>
64 ) { 80 ) {
65 addRequest(trainService.startExamExp(train_exam_id), liveData) 81 addRequest(trainService.startExamExp(train_exam_id), liveData)
@@ -73,13 +89,13 @@ class TrainRepository(val loadState: MutableLiveData<State>) : ApiRepository(loa @@ -73,13 +89,13 @@ class TrainRepository(val loadState: MutableLiveData<State>) : ApiRepository(loa
73 } 89 }
74 90
75 fun trainChatDetail( 91 fun trainChatDetail(
76 - train_class_id: Int, 92 + train_class_id: String,
77 liveData: MutableLiveData<BaseResponse<TrainDetail>> 93 liveData: MutableLiveData<BaseResponse<TrainDetail>>
78 ) { 94 ) {
79 addRequest(trainService.trainChatDetail(train_class_id), liveData) 95 addRequest(trainService.trainChatDetail(train_class_id), liveData)
80 } 96 }
81 97
82 - fun trainChatRead(train_class_id: Int, liveData: MutableLiveData<BaseResponse<Void>>) { 98 + fun trainChatRead(train_class_id: String, liveData: MutableLiveData<BaseResponse<Void>>) {
83 addRequest(trainService.trainChatRead(train_class_id), liveData) 99 addRequest(trainService.trainChatRead(train_class_id), liveData)
84 } 100 }
85 101
@@ -93,8 +109,8 @@ class TrainRepository(val loadState: MutableLiveData<State>) : ApiRepository(loa @@ -93,8 +109,8 @@ class TrainRepository(val loadState: MutableLiveData<State>) : ApiRepository(loa
93 109
94 //提交答题(某一题) 110 //提交答题(某一题)
95 fun subSingle( 111 fun subSingle(
96 - user_item_id: Int,  
97 - item_id: Int, 112 + user_item_id: String,
  113 + item_id: String,
98 answer: String, 114 answer: String,
99 liveData: MutableLiveData<BaseResponse<SubSingle>> 115 liveData: MutableLiveData<BaseResponse<SubSingle>>
100 ) { 116 ) {
@@ -103,7 +119,7 @@ class TrainRepository(val loadState: MutableLiveData<State>) : ApiRepository(loa @@ -103,7 +119,7 @@ class TrainRepository(val loadState: MutableLiveData<State>) : ApiRepository(loa
103 119
104 //subAnswer 120 //subAnswer
105 fun subAnswer( 121 fun subAnswer(
106 - item_id: Int, 122 + item_id: String,
107 answer: String, 123 answer: String,
108 liveData: MutableLiveData<BaseResponse<SubResult>> 124 liveData: MutableLiveData<BaseResponse<SubResult>>
109 ) { 125 ) {
@@ -111,7 +127,7 @@ class TrainRepository(val loadState: MutableLiveData<State>) : ApiRepository(loa @@ -111,7 +127,7 @@ class TrainRepository(val loadState: MutableLiveData<State>) : ApiRepository(loa
111 } 127 }
112 128
113 //交卷 129 //交卷
114 - fun subPaper(user_item_id: Int, liveData: MutableLiveData<BaseResponse<SubResult>>) { 130 + fun subPaper(user_item_id: String, liveData: MutableLiveData<BaseResponse<SubResult>>) {
115 addRequest(itemService.subPaper(user_item_id), liveData) 131 addRequest(itemService.subPaper(user_item_id), liveData)
116 } 132 }
117 133
@@ -119,7 +119,7 @@ class UserRepository(val loadState: MutableLiveData<State>) : ApiRepository(load @@ -119,7 +119,7 @@ class UserRepository(val loadState: MutableLiveData<State>) : ApiRepository(load
119 } 119 }
120 120
121 fun certDetail( 121 fun certDetail(
122 - id: Int, liveData: MutableLiveData<BaseResponse<CommonDetail<UserCertDetail>>> 122 + id: String, liveData: MutableLiveData<BaseResponse<CommonDetail<UserCertDetail>>>
123 ) { 123 ) {
124 addRequest(userService.certDetail(id), liveData) 124 addRequest(userService.certDetail(id), liveData)
125 } 125 }
@@ -136,8 +136,8 @@ class UserRepository(val loadState: MutableLiveData<State>) : ApiRepository(load @@ -136,8 +136,8 @@ class UserRepository(val loadState: MutableLiveData<State>) : ApiRepository(load
136 } 136 }
137 137
138 fun certAdd( 138 fun certAdd(
139 - id: Int?,  
140 - cert_id: Int, 139 + id: String?,
  140 + cert_id: String,
141 image: String, 141 image: String,
142 start_time: String, 142 start_time: String,
143 end_time: String?, 143 end_time: String?,
@@ -154,7 +154,7 @@ class UserRepository(val loadState: MutableLiveData<State>) : ApiRepository(load @@ -154,7 +154,7 @@ class UserRepository(val loadState: MutableLiveData<State>) : ApiRepository(load
154 } 154 }
155 155
156 fun certDel( 156 fun certDel(
157 - id: Int, liveData: MutableLiveData<BaseResponse<Void>> 157 + id: String, liveData: MutableLiveData<BaseResponse<Void>>
158 ) { 158 ) {
159 addRequest(userService.certDel(id), liveData) 159 addRequest(userService.certDel(id), liveData)
160 } 160 }
@@ -9,8 +9,6 @@ import androidx.appcompat.widget.Toolbar @@ -9,8 +9,6 @@ import androidx.appcompat.widget.Toolbar
9 import androidx.lifecycle.Observer 9 import androidx.lifecycle.Observer
10 import androidx.lifecycle.ViewModelProvider 10 import androidx.lifecycle.ViewModelProvider
11 import androidx.viewbinding.ViewBinding 11 import androidx.viewbinding.ViewBinding
12 -import com.br_technology.securitytrain_master.util.sp_job_id  
13 -import com.br_technology.securitytrain_master.util.token  
14 import com.br_technology.securitytrain_master.R 12 import com.br_technology.securitytrain_master.R
15 import com.br_technology.securitytrain_master.base.common.CommonUtil 13 import com.br_technology.securitytrain_master.base.common.CommonUtil
16 import com.br_technology.securitytrain_master.base.common.State 14 import com.br_technology.securitytrain_master.base.common.State
@@ -20,6 +18,9 @@ import com.br_technology.securitytrain_master.base.common.callback.LoadingCallBa @@ -20,6 +18,9 @@ import com.br_technology.securitytrain_master.base.common.callback.LoadingCallBa
20 import com.br_technology.securitytrain_master.base.view.BaseViewModel 18 import com.br_technology.securitytrain_master.base.view.BaseViewModel
21 import com.br_technology.securitytrain_master.expand.statusBarHeight 19 import com.br_technology.securitytrain_master.expand.statusBarHeight
22 import com.br_technology.securitytrain_master.ui.view.login.activity.AccountLoginActivity 20 import com.br_technology.securitytrain_master.ui.view.login.activity.AccountLoginActivity
  21 +import com.br_technology.securitytrain_master.util.is_set_face
  22 +import com.br_technology.securitytrain_master.util.sp_job_id
  23 +import com.br_technology.securitytrain_master.util.token
23 import com.kingja.loadsir.callback.SuccessCallback 24 import com.kingja.loadsir.callback.SuccessCallback
24 25
25 /** 26 /**
@@ -39,6 +40,14 @@ abstract class BaseLifeCycleActivity<VM : BaseViewModel<*>, VB : ViewBinding>(pr @@ -39,6 +40,14 @@ abstract class BaseLifeCycleActivity<VM : BaseViewModel<*>, VB : ViewBinding>(pr
39 return binding.root 40 return binding.root
40 } 41 }
41 42
  43 + fun toastSetFace() {
  44 + Toast.makeText(this, "您当前还未设置人脸识别的照片,请前去设置", Toast.LENGTH_SHORT).show()
  45 + }
  46 +
  47 + fun hasSetFace(): Boolean {
  48 + return is_set_face;
  49 + }
  50 +
42 override fun initView() { 51 override fun initView() {
43 val statusBar: Toolbar? = binding.root.findViewById(R.id.status_bar) 52 val statusBar: Toolbar? = binding.root.findViewById(R.id.status_bar)
44 statusBar?.post { 53 statusBar?.post {
@@ -103,7 +112,7 @@ abstract class BaseLifeCycleActivity<VM : BaseViewModel<*>, VB : ViewBinding>(pr @@ -103,7 +112,7 @@ abstract class BaseLifeCycleActivity<VM : BaseViewModel<*>, VB : ViewBinding>(pr
103 112
104 private fun toLogin() { 113 private fun toLogin() {
105 token = "" 114 token = ""
106 - sp_job_id = 0 115 + sp_job_id = ""
107 startActivity(AccountLoginActivity::class.java) 116 startActivity(AccountLoginActivity::class.java)
108 } 117 }
109 118
@@ -12,8 +12,6 @@ import android.widget.Toast @@ -12,8 +12,6 @@ import android.widget.Toast
12 import androidx.lifecycle.Observer 12 import androidx.lifecycle.Observer
13 import androidx.lifecycle.ViewModelProvider 13 import androidx.lifecycle.ViewModelProvider
14 import androidx.viewbinding.ViewBinding 14 import androidx.viewbinding.ViewBinding
15 -import com.br_technology.securitytrain_master.util.sp_job_id  
16 -import com.br_technology.securitytrain_master.util.token  
17 import com.br_technology.securitytrain_master.base.common.CommonUtil 15 import com.br_technology.securitytrain_master.base.common.CommonUtil
18 import com.br_technology.securitytrain_master.base.common.State 16 import com.br_technology.securitytrain_master.base.common.State
19 import com.br_technology.securitytrain_master.base.common.StateType 17 import com.br_technology.securitytrain_master.base.common.StateType
@@ -21,6 +19,8 @@ import com.br_technology.securitytrain_master.base.common.callback.EmptyCallBack @@ -21,6 +19,8 @@ import com.br_technology.securitytrain_master.base.common.callback.EmptyCallBack
21 import com.br_technology.securitytrain_master.base.common.callback.LoadingCallBack 19 import com.br_technology.securitytrain_master.base.common.callback.LoadingCallBack
22 import com.br_technology.securitytrain_master.base.view.BaseViewModel 20 import com.br_technology.securitytrain_master.base.view.BaseViewModel
23 import com.br_technology.securitytrain_master.ui.view.login.activity.AccountLoginActivity 21 import com.br_technology.securitytrain_master.ui.view.login.activity.AccountLoginActivity
  22 +import com.br_technology.securitytrain_master.util.sp_job_id
  23 +import com.br_technology.securitytrain_master.util.token
24 import com.kingja.loadsir.callback.SuccessCallback 24 import com.kingja.loadsir.callback.SuccessCallback
25 25
26 /** 26 /**
@@ -112,7 +112,7 @@ abstract class BaseLifeCycleFragment<VM : BaseViewModel<*>, VB : ViewBinding>( @@ -112,7 +112,7 @@ abstract class BaseLifeCycleFragment<VM : BaseViewModel<*>, VB : ViewBinding>(
112 112
113 private fun toLogin() { 113 private fun toLogin() {
114 token = "" 114 token = ""
115 - sp_job_id = 0 115 + sp_job_id = ""
116 startActivity(AccountLoginActivity::class.java) 116 startActivity(AccountLoginActivity::class.java)
117 } 117 }
118 118
1 package com.br_technology.securitytrain_master.expand 1 package com.br_technology.securitytrain_master.expand
2 2
3 import android.content.Context 3 import android.content.Context
  4 +import android.graphics.Canvas
  5 +import android.graphics.Paint
4 import android.graphics.Point 6 import android.graphics.Point
5 import android.graphics.Rect 7 import android.graphics.Rect
6 import android.text.Spannable 8 import android.text.Spannable
@@ -10,7 +12,11 @@ import android.view.View @@ -10,7 +12,11 @@ import android.view.View
10 import android.view.WindowManager 12 import android.view.WindowManager
11 import android.view.inputmethod.InputMethodManager 13 import android.view.inputmethod.InputMethodManager
12 import android.widget.TextView 14 import android.widget.TextView
  15 +import androidx.core.content.ContextCompat
  16 +import androidx.core.view.marginLeft
  17 +import androidx.core.view.marginRight
13 import androidx.recyclerview.widget.RecyclerView 18 import androidx.recyclerview.widget.RecyclerView
  19 +import com.br_technology.securitytrain_master.R
14 20
15 21
16 /** 22 /**
@@ -98,6 +104,44 @@ fun RecyclerView.addItemDecoration2(spanCount: Int, spacing: Int, top: Int) { @@ -98,6 +104,44 @@ fun RecyclerView.addItemDecoration2(spanCount: Int, spacing: Int, top: Int) {
98 }) 104 })
99 } 105 }
100 106
  107 +fun RecyclerView.addItemDecorationVertical() {
  108 + this.addItemDecoration(object : RecyclerView.ItemDecoration() {
  109 + var paint: Paint? = null
  110 +
  111 + override fun getItemOffsets(
  112 + outRect: Rect,
  113 + view: View,
  114 + parent: RecyclerView,
  115 + state: RecyclerView.State
  116 + ) {
  117 + super.getItemOffsets(outRect, view, parent, state)
  118 + //这里是关键,需要根据你有几列来判断
  119 + outRect.top = 0
  120 + outRect.left = 0
  121 + outRect.right = 0
  122 + outRect.bottom = 2
  123 + }
  124 +
  125 + override fun onDraw(c: Canvas, parent: RecyclerView, state: RecyclerView.State) {
  126 + super.onDraw(c, parent, state)
  127 + if (paint == null) {
  128 + paint = Paint().apply {
  129 + color = ContextCompat.getColor(context, R.color.color_eb)
  130 + }
  131 + }
  132 + val childCount = parent.childCount
  133 + for (i in 0 until childCount) {
  134 + val view = parent.getChildAt(i)
  135 + val dividerTop = view.bottom.toFloat()
  136 + val dividerLeft = paddingLeft + marginLeft.toFloat()
  137 + val dividerRight = parent.width - paddingRight - marginRight.toFloat()
  138 + val dividerBottom = view.bottom + 2.toFloat()
  139 + c.drawRect(dividerLeft, dividerTop, dividerRight, dividerBottom, paint!!)
  140 + }
  141 + }
  142 + })
  143 +}
  144 +
101 fun RecyclerView.addItemDecorationCustom(spacing: Int) { 145 fun RecyclerView.addItemDecorationCustom(spacing: Int) {
102 this.addItemDecoration(object : RecyclerView.ItemDecoration() { 146 this.addItemDecoration(object : RecyclerView.ItemDecoration() {
103 override fun getItemOffsets( 147 override fun getItemOffsets(
@@ -17,7 +17,7 @@ open class FileBean( @@ -17,7 +17,7 @@ open class FileBean(
17 ) 17 )
18 18
19 open class Teacher( 19 open class Teacher(
20 - var id: Int, 20 + var id: String,
21 var name: String,//"测试讲师2", // 讲师名称 21 var name: String,//"测试讲师2", // 讲师名称
22 var avatar: String//"http://security.cn/assets/img/avatar.png" // 讲师头像 22 var avatar: String//"http://security.cn/assets/img/avatar.png" // 讲师头像
23 ) : Serializable 23 ) : Serializable
@@ -34,11 +34,11 @@ open class UserRule( @@ -34,11 +34,11 @@ open class UserRule(
34 34
35 //历史搜索记录 35 //历史搜索记录
36 open class SearchLog( 36 open class SearchLog(
37 - var id: Int, 37 + var id: String,
38 var keyword: String 38 var keyword: String
39 ) 39 )
40 40
41 // 做题答案 41 // 做题答案
42 -open class Answer(var id: Int, var answer: String) 42 +open class Answer(var id: String, var answer: String)
43 43
44 44
@@ -7,14 +7,14 @@ package com.br_technology.securitytrain_master.ui.bean @@ -7,14 +7,14 @@ package com.br_technology.securitytrain_master.ui.bean
7 * PS: Not easy to write code, please indicate. 7 * PS: Not easy to write code, please indicate.
8 */ 8 */
9 open class HomeBanner( 9 open class HomeBanner(
10 - var id: Int, 10 + var id: String,
11 var title: String, // 标题 11 var title: String, // 标题
12 var image: String,//"/uploads/20210914/d19a69b89974e3876ca6c61ff32e2f79.jpg", // 图片地址 12 var image: String,//"/uploads/20210914/d19a69b89974e3876ca6c61ff32e2f79.jpg", // 图片地址
13 var href: String//"https://www.baidu.com" // 跳转链接 13 var href: String//"https://www.baidu.com" // 跳转链接
14 ) 14 )
15 15
16 open class HomeNotice( 16 open class HomeNotice(
17 - var id: Int, 17 + var id: String,
18 var type: String, // 发布来源:1=平台,2=企业,3=培训师 18 var type: String, // 发布来源:1=平台,2=企业,3=培训师
19 var title: String,//"测试通知", // 标题 19 var title: String,//"测试通知", // 标题
20 var des: String,//"1234213", // 描述 20 var des: String,//"1234213", // 描述
@@ -25,9 +25,9 @@ open class HomeNotice( @@ -25,9 +25,9 @@ open class HomeNotice(
25 ) 25 )
26 26
27 open class HomeMaterialRec( 27 open class HomeMaterialRec(
28 - var id: Int,  
29 - var company_id: Int,  
30 - var material_sort_id: Int, 28 + var id: String,
  29 + var company_id: String,
  30 + var material_sort_id: String,
31 var name: String, // 名称 31 var name: String, // 名称
32 var des: String, // 描述 32 var des: String, // 描述
33 var image: String,//"/uploads/20210914/d19a69b89974e3876ca6c61ff32e2f79.jpg", // 图片 33 var image: String,//"/uploads/20210914/d19a69b89974e3876ca6c61ff32e2f79.jpg", // 图片
@@ -2,7 +2,6 @@ package com.br_technology.securitytrain_master.ui.bean @@ -2,7 +2,6 @@ package com.br_technology.securitytrain_master.ui.bean
2 2
3 import com.br_technology.securitytrain_master.ui.view.bank.bean.OptionArr 3 import com.br_technology.securitytrain_master.ui.view.bank.bean.OptionArr
4 import com.br_technology.securitytrain_master.ui.view.bank.bean.PracticeBean 4 import com.br_technology.securitytrain_master.ui.view.bank.bean.PracticeBean
5 -import com.br_technology.securitytrain_master.base.network.response.CommonDetail  
6 import com.br_technology.securitytrain_master.ui.view.bank.bean.TestSubject 5 import com.br_technology.securitytrain_master.ui.view.bank.bean.TestSubject
7 6
8 /** 7 /**
@@ -22,15 +21,15 @@ open class ChallengeRule( @@ -22,15 +21,15 @@ open class ChallengeRule(
22 ) 21 )
23 22
24 open class WorkerClassify( 23 open class WorkerClassify(
25 - var id: Int, 24 + var id: String,
26 var name: String, // 职位名称 25 var name: String, // 职位名称
27 var is_choose: Int, // 是否为当前登录用户工种0=否1=是 26 var is_choose: Int, // 是否为当前登录用户工种0=否1=是
28 ) 27 )
29 28
30 open class PaperListDetail( 29 open class PaperListDetail(
31 - var id: Int,  
32 - var company_id: Int,  
33 - var item_sort_id: Int, 30 + var id: String,
  31 + var company_id: String,
  32 + var item_sort_id: String,
34 var pos_id: String, 33 var pos_id: String,
35 var name: String, 34 var name: String,
36 var score: Int, 35 var score: Int,
@@ -49,9 +48,9 @@ open class PaperListDetail( @@ -49,9 +48,9 @@ open class PaperListDetail(
49 ) 48 )
50 49
51 open class PaperDaily( 50 open class PaperDaily(
52 - var id: Int,  
53 - var company_id: Int,  
54 - var pos_id: Int, 51 + var id: String,
  52 + var company_id: String,
  53 + var pos_id: String,
55 var type: String, 54 var type: String,
56 var title: String, 55 var title: String,
57 var count: Int, 56 var count: Int,
@@ -85,7 +84,7 @@ open class SubResult( @@ -85,7 +84,7 @@ open class SubResult(
85 84
86 //错题列表 85 //错题列表
87 open class ErrorListItem( 86 open class ErrorListItem(
88 - var id: Int, 87 + var id: String,
89 var title: String, // 错题标题 88 var title: String, // 错题标题
90 var item_type: String, // 类型1=每日一练2=挑战答题3=专项练习4=模拟考试 89 var item_type: String, // 类型1=每日一练2=挑战答题3=专项练习4=模拟考试
91 var type: String, // 类型1=单选2=多选3=判断 90 var type: String, // 类型1=单选2=多选3=判断
@@ -99,9 +98,9 @@ open class ErrorDetail( @@ -99,9 +98,9 @@ open class ErrorDetail(
99 ) 98 )
100 99
101 open class ErrorDetailData( 100 open class ErrorDetailData(
102 - var id: Int,  
103 - var item_sort_id: Int,  
104 - var company_id: Int, 101 + var id: String,
  102 + var item_sort_id: String,
  103 + var company_id: String,
105 var pos_ids: String, 104 var pos_ids: String,
106 var title: String, 105 var title: String,
107 var type: String, 106 var type: String,
@@ -117,9 +116,9 @@ open class ErrorDetailData( @@ -117,9 +116,9 @@ open class ErrorDetailData(
117 116
118 //答题记录 117 //答题记录
119 open class AnswerRecord( 118 open class AnswerRecord(
120 - var id: Int, 119 + var id: String,
121 var type: String, // 题目类型:1=单选,2=多选,3=判断 120 var type: String, // 题目类型:1=单选,2=多选,3=判断
122 - var pos_id: Int, 121 + var pos_id: String,
123 var title: String, // 标题 122 var title: String, // 标题
124 var count: Int, 123 var count: Int,
125 var correct: Int, 124 var correct: Int,
@@ -131,7 +130,7 @@ open class AnswerRecord( @@ -131,7 +130,7 @@ open class AnswerRecord(
131 //答题记录详情 130 //答题记录详情
132 open class AnswerDetail( 131 open class AnswerDetail(
133 val type: String, 132 val type: String,
134 - val item_id: Int, 133 + val item_id: String,
135 val answer: String, 134 val answer: String,
136 val is_correct: String, 135 val is_correct: String,
137 val item: TestSubject, 136 val item: TestSubject,
@@ -9,7 +9,7 @@ import java.io.Serializable @@ -9,7 +9,7 @@ import java.io.Serializable
9 * PS: Not easy to write code, please indicate. 9 * PS: Not easy to write code, please indicate.
10 */ 10 */
11 open class LessonWord( 11 open class LessonWord(
12 - var id: Int, 12 + var id: String,
13 var name: String, // 课程名称 13 var name: String, // 课程名称
14 var des: String, // 描述 14 var des: String, // 描述
15 var image: String, // 图片 15 var image: String, // 图片
@@ -19,7 +19,7 @@ open class LessonWord( @@ -19,7 +19,7 @@ open class LessonWord(
19 open class LessonTrainVideoDetail(var detail: LessonVideoDetail, var class_list: List<LessonClazz>) 19 open class LessonTrainVideoDetail(var detail: LessonVideoDetail, var class_list: List<LessonClazz>)
20 20
21 open class LessonWordDetail( 21 open class LessonWordDetail(
22 - var id: Int, 22 + var id: String,
23 var name: String, // 课程名称 23 var name: String, // 课程名称
24 var des: String, // 描述 24 var des: String, // 描述
25 var intro: Int, // 简介信息 25 var intro: Int, // 简介信息
@@ -32,7 +32,7 @@ open class LessonWordDetail( @@ -32,7 +32,7 @@ open class LessonWordDetail(
32 ) 32 )
33 33
34 open class LessonVideo( 34 open class LessonVideo(
35 - var id: Int, 35 + var id: String,
36 var name: String, // 课程名称 36 var name: String, // 课程名称
37 var des: String, // 描述 37 var des: String, // 描述
38 var image: String, // 图片 38 var image: String, // 图片
@@ -42,14 +42,14 @@ open class LessonVideo( @@ -42,14 +42,14 @@ open class LessonVideo(
42 ) 42 )
43 43
44 open class LessonClazz( 44 open class LessonClazz(
45 - var id: Int, 45 + var id: String,
46 var name: String, 46 var name: String,
47 var lesson_id: String, 47 var lesson_id: String,
48 var lessonclassdetail: List<LessonClassDetail> 48 var lessonclassdetail: List<LessonClassDetail>
49 ) : Serializable 49 ) : Serializable
50 50
51 open class LessonClassDetail( 51 open class LessonClassDetail(
52 - var id: Int, 52 + var id: String,
53 var is_complete: Int, 53 var is_complete: Int,
54 var name: String, 54 var name: String,
55 var lesson_id: String, 55 var lesson_id: String,
@@ -60,7 +60,7 @@ open class LessonClassDetail( @@ -60,7 +60,7 @@ open class LessonClassDetail(
60 ) : Serializable 60 ) : Serializable
61 61
62 open class LessonLive( 62 open class LessonLive(
63 - var id: Int, 63 + var id: String,
64 var company_id: String, 64 var company_id: String,
65 var name: String, // 课程名称 65 var name: String, // 课程名称
66 var image: String,//"http://security.cn/assets/img/qrcode.png", // 图片 66 var image: String,//"http://security.cn/assets/img/qrcode.png", // 图片
@@ -74,12 +74,12 @@ open class LessonLive( @@ -74,12 +74,12 @@ open class LessonLive(
74 74
75 data class LessonLiveBean( 75 data class LessonLiveBean(
76 val average_study: String, 76 val average_study: String,
77 - val company_id: Int, 77 + val company_id: String,
78 val create_time: Int, 78 val create_time: Int,
79 val create_time_text: String, 79 val create_time_text: String,
80 val delete_time: Any, 80 val delete_time: Any,
81 val delete_time_text: String, 81 val delete_time_text: String,
82 - val id: Int, 82 + val id: String,
83 val lesson_id: String, 83 val lesson_id: String,
84 val lessonlive: LessonLiveEntity, 84 val lessonlive: LessonLiveEntity,
85 val name: String, 85 val name: String,
@@ -103,7 +103,7 @@ data class LessonLiveEntity( @@ -103,7 +103,7 @@ data class LessonLiveEntity(
103 val delete_time: Any, 103 val delete_time: Any,
104 val delete_time_text: String, 104 val delete_time_text: String,
105 val end_time: String, 105 val end_time: String,
106 - val id: Int, 106 + val id: String,
107 val image: String, 107 val image: String,
108 val is_open: String, 108 val is_open: String,
109 val is_open_text: String, 109 val is_open_text: String,
@@ -133,7 +133,7 @@ data class TrainclassBean( @@ -133,7 +133,7 @@ data class TrainclassBean(
133 val des: String, 133 val des: String,
134 val end_time: Int, 134 val end_time: Int,
135 val end_time_text: String, 135 val end_time_text: String,
136 - val id: Int, 136 + val id: String,
137 val is_exam: String, 137 val is_exam: String,
138 val is_exam_text: String, 138 val is_exam_text: String,
139 val is_parctise: String, 139 val is_parctise: String,
@@ -169,7 +169,7 @@ data class Teachers( @@ -169,7 +169,7 @@ data class Teachers(
169 val create_time_text: String, 169 val create_time_text: String,
170 val delete_time_text: String, 170 val delete_time_text: String,
171 val gender_text: String, 171 val gender_text: String,
172 - val id: Int, 172 + val id: String,
173 val name: String, 173 val name: String,
174 val update_time_text: String 174 val update_time_text: String
175 ) 175 )
@@ -192,7 +192,7 @@ open class TrainClass( @@ -192,7 +192,7 @@ open class TrainClass(
192 ) : Serializable 192 ) : Serializable
193 193
194 open class LessonOfflineItem( 194 open class LessonOfflineItem(
195 - var id: Int, 195 + var id: String,
196 var type: String, 196 var type: String,
197 var company_id: Int, 197 var company_id: Int,
198 var name: String, 198 var name: String,
@@ -210,8 +210,8 @@ open class LessonOfflineItem( @@ -210,8 +210,8 @@ open class LessonOfflineItem(
210 ) : Serializable 210 ) : Serializable
211 211
212 open class LessonOfflineClazz( 212 open class LessonOfflineClazz(
213 - var id: Int,  
214 - var lesson_id: Int, 213 + var id: String,
  214 + var lesson_id: String,
215 var name: String, 215 var name: String,
216 var start_time: String, 216 var start_time: String,
217 var end_time: String, 217 var end_time: String,
@@ -220,7 +220,7 @@ open class LessonOfflineClazz( @@ -220,7 +220,7 @@ open class LessonOfflineClazz(
220 ) : Serializable 220 ) : Serializable
221 221
222 open class LessonOfflineDetail( 222 open class LessonOfflineDetail(
223 - var id: Int, 223 + var id: String,
224 var image: String, // 课程名称 224 var image: String, // 课程名称
225 var name: String, // 课程名称 225 var name: String, // 课程名称
226 var content: String, 226 var content: String,
@@ -13,9 +13,9 @@ import com.br_technology.securitytrain_master.ui.view.home.bean.RecommendBean @@ -13,9 +13,9 @@ import com.br_technology.securitytrain_master.ui.view.home.bean.RecommendBean
13 * 资料库分类 13 * 资料库分类
14 */ 14 */
15 open class MaterialClassify( 15 open class MaterialClassify(
16 - var id: Int,  
17 - var company_id: Int,  
18 - var pid: Int, 16 + var id: String,
  17 + var company_id: String,
  18 + var pid: String,
19 var type: Int, 19 var type: Int,
20 var name: String, 20 var name: String,
21 var weigh: Int, 21 var weigh: Int,
@@ -31,9 +31,9 @@ open class MaterialPage( @@ -31,9 +31,9 @@ open class MaterialPage(
31 * 资料库分类子分类 31 * 资料库分类子分类
32 */ 32 */
33 open class MaterialChild( 33 open class MaterialChild(
34 - var id: Int,  
35 - var company_id: Int,  
36 - var pid: Int, 34 + var id: String,
  35 + var company_id: String,
  36 + var pid: String,
37 var type: Int, 37 var type: Int,
38 var name: String, 38 var name: String,
39 var weigh: Int, 39 var weigh: Int,
@@ -45,9 +45,9 @@ open class MaterialChild( @@ -45,9 +45,9 @@ open class MaterialChild(
45 * 资料库分类子次级分类 45 * 资料库分类子次级分类
46 */ 46 */
47 open class MaterialChildSecond( 47 open class MaterialChildSecond(
48 - var id: Int,  
49 - var company_id: Int,  
50 - var pid: Int, 48 + var id: String,
  49 + var company_id: String,
  50 + var pid: String,
51 var type: Int, 51 var type: Int,
52 var name: String, 52 var name: String,
53 var weigh: Int, 53 var weigh: Int,
@@ -58,8 +58,8 @@ open class MaterialChildSecond( @@ -58,8 +58,8 @@ open class MaterialChildSecond(
58 * 资料库列表item 58 * 资料库列表item
59 */ 59 */
60 open class MaterialListItem( 60 open class MaterialListItem(
61 - var id: Int,  
62 - var company_id: Int, 61 + var id: String,
  62 + var company_id: String,
63 var material_sort_id: Int, 63 var material_sort_id: Int,
64 var name: String, // 名称 64 var name: String, // 名称
65 var des: String, // 描述 65 var des: String, // 描述
@@ -78,7 +78,7 @@ open class MaterialListItem( @@ -78,7 +78,7 @@ open class MaterialListItem(
78 * 资料库详情 78 * 资料库详情
79 */ 79 */
80 open class MaterialDetail( 80 open class MaterialDetail(
81 - var id: Int, 81 + var id: String,
82 var pid: Int, 82 var pid: Int,
83 var company_id: Int, 83 var company_id: Int,
84 var material_sort_id: Int, 84 var material_sort_id: Int,
@@ -7,9 +7,9 @@ package com.br_technology.securitytrain_master.ui.bean @@ -7,9 +7,9 @@ package com.br_technology.securitytrain_master.ui.bean
7 * PS: Not easy to write code, please indicate. 7 * PS: Not easy to write code, please indicate.
8 */ 8 */
9 open class UserInfo( 9 open class UserInfo(
10 - var id: Int,  
11 - var department_id: Int,  
12 - var pos_id: Int, 10 + var id: String,
  11 + var department_id: String,
  12 + var pos_id: String,
13 var username: String, 13 var username: String,
14 var nickname: String, // 昵称 14 var nickname: String, // 昵称
15 var mobile: String, // 手机号 15 var mobile: String, // 手机号
@@ -30,7 +30,7 @@ open class ContactBean( @@ -30,7 +30,7 @@ open class ContactBean(
30 ) 30 )
31 31
32 open class FavoriteData( 32 open class FavoriteData(
33 - var id: Int, 33 + var id: String,
34 var object_id: String, 34 var object_id: String,
35 var user_id: Int, 35 var user_id: Int,
36 var title: String, 36 var title: String,
@@ -40,9 +40,9 @@ open class FavoriteData( @@ -40,9 +40,9 @@ open class FavoriteData(
40 ) 40 )
41 41
42 open class UserCert( 42 open class UserCert(
43 - var id: Int,  
44 - var credentials_id: Int,  
45 - var user_id: Int, 43 + var id: String,
  44 + var credentials_id: String,
  45 + var user_id: String,
46 var credentials_name: String, // 证件名称 46 var credentials_name: String, // 证件名称
47 var name: String, // 姓名 47 var name: String, // 姓名
48 var identity: String, // 身份证号 48 var identity: String, // 身份证号
@@ -57,13 +57,13 @@ open class UserCert( @@ -57,13 +57,13 @@ open class UserCert(
57 ) 57 )
58 58
59 open class UserCertData( 59 open class UserCertData(
60 - var id: Int, 60 + var id: String,
61 var name: String // 证书名称 61 var name: String // 证书名称
62 ) 62 )
63 63
64 open class CertType( 64 open class CertType(
65 - val id:Int,  
66 - val company_id:Int, 65 + val id:String,
  66 + val company_id:String,
67 val name:String,// 证件名称 67 val name:String,// 证件名称
68 val valid:Int,// 有效期 68 val valid:Int,// 有效期
69 val weigh:Int, 69 val weigh:Int,
@@ -73,8 +73,8 @@ open class CertType( @@ -73,8 +73,8 @@ open class CertType(
73 ) 73 )
74 74
75 open class UserCertDetail( 75 open class UserCertDetail(
76 - var id: Int,  
77 - var credentials_id: Int, 76 + var id: String,
  77 + var credentials_id: String,
78 var user_id: Int, 78 var user_id: Int,
79 var credentials_name: String, // 证件名称 79 var credentials_name: String, // 证件名称
80 var name: String, // 姓名 80 var name: String, // 姓名
@@ -95,7 +95,7 @@ open class CertEndTime( @@ -95,7 +95,7 @@ open class CertEndTime(
95 ) 95 )
96 96
97 open class CertLog( 97 open class CertLog(
98 - var id: Int, 98 + var id: String,
99 var start_time: String, // 生效时间 99 var start_time: String, // 生效时间
100 var before_start_time: Long, 100 var before_start_time: Long,
101 var end_time: String, // 截止时间 101 var end_time: String, // 截止时间
@@ -103,7 +103,7 @@ open class CertLog( @@ -103,7 +103,7 @@ open class CertLog(
103 ) 103 )
104 104
105 open class ScoreLog( 105 open class ScoreLog(
106 - var id: Int, 106 + var id: String,
107 var createtime: String, 107 var createtime: String,
108 var score: Int, // 获得积分 108 var score: Int, // 获得积分
109 var type: String, // 获取方式:类型:1=每日一练,2=挑战答题,3=专项练习,4=培训计划考试.5=培训计划练习,6=模拟考试[未完待续……],7=班级任务 109 var type: String, // 获取方式:类型:1=每日一练,2=挑战答题,3=专项练习,4=培训计划考试.5=培训计划练习,6=模拟考试[未完待续……],7=班级任务
@@ -13,8 +13,8 @@ open class NoticeUnread( @@ -13,8 +13,8 @@ open class NoticeUnread(
13 13
14 //消息列表 14 //消息列表
15 open class NoticeItem( 15 open class NoticeItem(
16 - var id: Int,  
17 - var user_id: Int, 16 + var id: String,
  17 + var user_id: String,
18 var msg_sort: String, 18 var msg_sort: String,
19 var type: String, // 类型:1=站内信,2=短信提醒 19 var type: String, // 类型:1=站内信,2=短信提醒
20 var content: String, // 消息内容 20 var content: String, // 消息内容
@@ -24,8 +24,8 @@ open class NoticeItem( @@ -24,8 +24,8 @@ open class NoticeItem(
24 24
25 //消息详情 25 //消息详情
26 open class NoticeDetail( 26 open class NoticeDetail(
27 - var id: Int,  
28 - var user_id: Int, 27 + var id: String,
  28 + var user_id: String,
29 var msg_sort: String, 29 var msg_sort: String,
30 var type: String, // 类型:1=站内信,2=短信提醒 30 var type: String, // 类型:1=站内信,2=短信提醒
31 var content: String, // 消息内容 31 var content: String, // 消息内容
@@ -7,10 +7,10 @@ package com.br_technology.securitytrain_master.ui.view.bank.bean @@ -7,10 +7,10 @@ package com.br_technology.securitytrain_master.ui.view.bank.bean
7 * PS: Not easy to write code, please indicate. 7 * PS: Not easy to write code, please indicate.
8 */ 8 */
9 open class TestSubject( 9 open class TestSubject(
10 - var id: Int,  
11 - var company_id: Int,  
12 - var paper_id: Int,  
13 - var item_id: Int, 10 + var id: String,
  11 + var company_id: String,
  12 + var paper_id: String,
  13 + var item_id: String,
14 var title: String, 14 var title: String,
15 var options: String, 15 var options: String,
16 var type: String, 16 var type: String,
@@ -34,7 +34,7 @@ open class OptionArr( @@ -34,7 +34,7 @@ open class OptionArr(
34 * 考试开始(练习)(考试)(模拟考试) 34 * 考试开始(练习)(考试)(模拟考试)
35 */ 35 */
36 open class SubjectData( 36 open class SubjectData(
37 - var user_item_id: Int, // 答题id 37 + var user_item_id: String, // 答题id
38 var over_second: Int, // 答题剩余时间 38 var over_second: Int, // 答题剩余时间
39 var list: List<UserSubject>, 39 var list: List<UserSubject>,
40 var remark: String 40 var remark: String
@@ -42,7 +42,7 @@ open class SubjectData( @@ -42,7 +42,7 @@ open class SubjectData(
42 42
43 //专项答题 43 //专项答题
44 open class SubjectSpecial( 44 open class SubjectSpecial(
45 - user_item_id: Int, // 答题id 45 + user_item_id: String, // 答题id
46 over_second: Int, // 答题剩余时间 46 over_second: Int, // 答题剩余时间
47 list: List<UserSubject>, 47 list: List<UserSubject>,
48 remark: String, 48 remark: String,
@@ -55,7 +55,7 @@ open class SubjectSpecial( @@ -55,7 +55,7 @@ open class SubjectSpecial(
55 ) 55 )
56 56
57 open class UserSubject( 57 open class UserSubject(
58 - var id: Int, 58 + var id: String,
59 var title: String, // 职位名称 59 var title: String, // 职位名称
60 var type: String, // 类型1=单选2=多选3=判断 60 var type: String, // 类型1=单选2=多选3=判断
61 var difficulty: String, // 难度1=简单2=适中3=困难 61 var difficulty: String, // 难度1=简单2=适中3=困难
@@ -17,9 +17,18 @@ open class LessonList( @@ -17,9 +17,18 @@ open class LessonList(
17 var list: List<LessonBean> 17 var list: List<LessonBean>
18 ) 18 )
19 19
  20 +/**
  21 + * 班级信息
  22 + */
  23 +open class ClazzBean(
  24 + var id: String,
  25 + var name: String,
  26 + var status: String
  27 +)
  28 +
20 open class LessonBean( 29 open class LessonBean(
21 - var id: Int, // 课程id  
22 - var class_id: Int, // 视频/班级课程id,对应课程进度的class_id 30 + var id: String, // 课程id
  31 + var class_id: String, // 视频/班级课程id,对应课程进度的class_id
23 // var class_name: String, // 班级名称 32 // var class_name: String, // 班级名称
24 var train_class_id: Int, // 班级课程id 33 var train_class_id: Int, // 班级课程id
25 var train_id: Int, // 培训计划id 34 var train_id: Int, // 培训计划id
@@ -44,11 +53,11 @@ open class LessonBean( @@ -44,11 +53,11 @@ open class LessonBean(
44 * 我的任务(练习) 53 * 我的任务(练习)
45 */ 54 */
46 open class PractiseBean( 55 open class PractiseBean(
47 - var id: Int,  
48 - var company_id: Int,  
49 - var train_id: Int,  
50 - var train_class_id: Int,  
51 - var paper_id: Int, 56 + var id: String,
  57 + var company_id: String,
  58 + var train_id: String,
  59 + var train_class_id: String,
  60 + var paper_id: String,
52 var times: Int, 61 var times: Int,
53 var score: Int, 62 var score: Int,
54 var pass: Int, 63 var pass: Int,
@@ -66,11 +75,11 @@ open class PractiseBean( @@ -66,11 +75,11 @@ open class PractiseBean(
66 * 我的任务(考试) 75 * 我的任务(考试)
67 */ 76 */
68 open class ExamBean( 77 open class ExamBean(
69 - var id: Int,  
70 - var company_id: Int, 78 + var id: String,
  79 + var company_id: String,
71 var train_id: Int, 80 var train_id: Int,
72 - var train_class_id: Int,  
73 - var paper_id: Int, 81 + var train_class_id: String,
  82 + var paper_id: String,
74 var times: Int, 83 var times: Int,
75 var score: Int, 84 var score: Int,
76 var pass: Int, 85 var pass: Int,
@@ -93,7 +102,7 @@ open class ExamBean( @@ -93,7 +102,7 @@ open class ExamBean(
93 * 考试详情 102 * 考试详情
94 */ 103 */
95 open class ExamDetail( 104 open class ExamDetail(
96 - var id: Int, 105 + var id: String,
97 var name: String, //测试", // 考试名称 106 var name: String, //测试", // 考试名称
98 var times: String, // 考试时间(分钟) 107 var times: String, // 考试时间(分钟)
99 var count: Int, // 考试题数 108 var count: Int, // 考试题数
@@ -105,7 +114,7 @@ open class ExamDetail( @@ -105,7 +114,7 @@ open class ExamDetail(
105 * 学情反馈item 114 * 学情反馈item
106 */ 115 */
107 open class TrainChatItem( 116 open class TrainChatItem(
108 - var id: Int, // 班级id 117 + var id: String, // 班级id
109 var name: Int, // 班级名称 118 var name: Int, // 班级名称
110 var image: String, //http://security.cn/assets/img/avatar.png", // 图片 119 var image: String, //http://security.cn/assets/img/avatar.png", // 图片
111 var class_hours: Int, // 已学课时 120 var class_hours: Int, // 已学课时
@@ -117,7 +126,7 @@ open class TrainChatItem( @@ -117,7 +126,7 @@ open class TrainChatItem(
117 * 学情反馈详情 126 * 学情反馈详情
118 */ 127 */
119 open class TrainDetail( 128 open class TrainDetail(
120 - var id: Int, // 班级id 129 + var id: String, // 班级id
121 var name: Int, // 班级名称 130 var name: Int, // 班级名称
122 var image: String, //http://security.cn/assets/img/avatar.png", // 图片 131 var image: String, //http://security.cn/assets/img/avatar.png", // 图片
123 var class_hours: Int, // 已学课时 132 var class_hours: Int, // 已学课时
@@ -136,14 +145,14 @@ open class TrainReport( @@ -136,14 +145,14 @@ open class TrainReport(
136 ) 145 )
137 146
138 open class TrainReportUser( 147 open class TrainReportUser(
139 - var id: Int, 148 + var id: String,
140 var nickname: String, // 姓名 149 var nickname: String, // 姓名
141 var mobile: String,//手机号", // 手机号 150 var mobile: String,//手机号", // 手机号
142 var gender: Int, // 性别1=男2=女 151 var gender: Int, // 性别1=男2=女
143 var avatar: String,//"https://security.brofirst.cn/uploads/20211030/e777a39142bf8ab8dd3e02b6eb9f9d9f.jpg", // 头像 152 var avatar: String,//"https://security.brofirst.cn/uploads/20211030/e777a39142bf8ab8dd3e02b6eb9f9d9f.jpg", // 头像
144 var score: Int, // 积分 153 var score: Int, // 积分
145 var identity: String, // 身份证号 154 var identity: String, // 身份证号
146 - var user_id: Int, 155 + var user_id: String,
147 var createtime: String, // 建档日期 156 var createtime: String, // 建档日期
148 var class_hours_count: Int, // 培训总学时 157 var class_hours_count: Int, // 培训总学时
149 var item_count: Int, // 练习题量 158 var item_count: Int, // 练习题量
@@ -157,9 +166,9 @@ open class TrainReportUser( @@ -157,9 +166,9 @@ open class TrainReportUser(
157 ) 166 )
158 167
159 open class TrainStudyTrain( 168 open class TrainStudyTrain(
160 - var id: Int,  
161 - var company_id: Int,  
162 - var pid: Int, 169 + var id: String,
  170 + var company_id: String,
  171 + var pid: String,
163 var train_sort_id: String, 172 var train_sort_id: String,
164 var name: String, // 培训名称 173 var name: String, // 培训名称
165 var depart_ids: String, 174 var depart_ids: String,
@@ -171,18 +180,18 @@ open class TrainStudyTrain( @@ -171,18 +180,18 @@ open class TrainStudyTrain(
171 var status: String, 180 var status: String,
172 var trainsort: TrainStudySort, 181 var trainsort: TrainStudySort,
173 var update_time_text: String, 182 var update_time_text: String,
174 - var trainclass:TrainClass 183 + var trainclass: TrainClass
175 ) 184 )
176 185
177 open class TrainStudySort( 186 open class TrainStudySort(
178 - var id: Int,  
179 - var company_id: Int, 187 + var id: String,
  188 + var company_id: String,
180 var name: String, // 培训类型 189 var name: String, // 培训类型
181 var weigh: Int 190 var weigh: Int
182 ) 191 )
183 192
184 open class TrainReportStudy( 193 open class TrainReportStudy(
185 - var id: Int, 194 + var id: String,
186 var distance: String, 195 var distance: String,
187 var status: String, // 结业状态0=未结业1=已结业 196 var status: String, // 结业状态0=未结业1=已结业
188 var view_len: String, 197 var view_len: String,
@@ -193,7 +202,7 @@ open class TrainReportStudy( @@ -193,7 +202,7 @@ open class TrainReportStudy(
193 ) 202 )
194 203
195 open class TrainReportClass( 204 open class TrainReportClass(
196 - var id: Int, 205 + var id: String,
197 var name: String, // 培训班级名称 206 var name: String, // 培训班级名称
198 var sort_id: String, 207 var sort_id: String,
199 var students: Int, 208 var students: Int,
@@ -205,7 +214,7 @@ open class TrainReportClass( @@ -205,7 +214,7 @@ open class TrainReportClass(
205 ) 214 )
206 215
207 open class TrainReportExam( 216 open class TrainReportExam(
208 - var id: Int, 217 + var id: String,
209 var title: String, 218 var title: String,
210 var count: Int, 219 var count: Int,
211 var correct: Int, 220 var correct: Int,
@@ -218,7 +227,7 @@ open class TrainReportExam( @@ -218,7 +227,7 @@ open class TrainReportExam(
218 ) 227 )
219 228
220 open class TrainReportExamMsg( 229 open class TrainReportExamMsg(
221 - var id: Int, 230 + var id: String,
222 var name: String, // 考试名称 231 var name: String, // 考试名称
223 var times: Int, 232 var times: Int,
224 var start_time: Int, 233 var start_time: Int,
@@ -12,7 +12,7 @@ import java.util.List; @@ -12,7 +12,7 @@ import java.util.List;
12 * PS: Not easy to write code, please indicate. 12 * PS: Not easy to write code, please indicate.
13 */ 13 */
14 public class LessonVideoDetail implements Serializable { 14 public class LessonVideoDetail implements Serializable {
15 - private int id; 15 + private String id;
16 private String type; 16 private String type;
17 private String pos_ids; 17 private String pos_ids;
18 private String train_class_id; 18 private String train_class_id;
@@ -85,11 +85,11 @@ public class LessonVideoDetail implements Serializable { @@ -85,11 +85,11 @@ public class LessonVideoDetail implements Serializable {
85 this.pos_ids = pos_ids; 85 this.pos_ids = pos_ids;
86 } 86 }
87 87
88 - public int getId() { 88 + public String getId() {
89 return id; 89 return id;
90 } 90 }
91 91
92 - public void setId(int id) { 92 + public void setId(String id) {
93 this.id = id; 93 this.id = id;
94 } 94 }
95 95
@@ -141,7 +141,7 @@ open class TrainCourseDetailItemChild(var type: Int, var pos: Int) : MultiItemEn @@ -141,7 +141,7 @@ open class TrainCourseDetailItemChild(var type: Int, var pos: Int) : MultiItemEn
141 get() = type 141 get() = type
142 } 142 }
143 143
144 -open class SearchEvent(var search: String) 144 +open class SearchEvent(var search: String, var index: Int)
145 145
146 open class SearchBean(var type: Int) : MultiItemEntity { 146 open class SearchBean(var type: Int) : MultiItemEntity {
147 var txtData: LessonBean? = null 147 var txtData: LessonBean? = null
1 package com.br_technology.securitytrain_master.ui.view.bank.activity 1 package com.br_technology.securitytrain_master.ui.view.bank.activity
2 2
3 import android.app.Activity 3 import android.app.Activity
4 -import android.content.ClipData  
5 import android.content.Intent 4 import android.content.Intent
6 import android.view.View 5 import android.view.View
7 import androidx.activity.result.contract.ActivityResultContracts 6 import androidx.activity.result.contract.ActivityResultContracts
@@ -9,8 +8,6 @@ import androidx.core.content.ContextCompat @@ -9,8 +8,6 @@ import androidx.core.content.ContextCompat
9 import com.br_technology.securitytrain_master.R 8 import com.br_technology.securitytrain_master.R
10 import com.br_technology.securitytrain_master.databinding.ActivityAnswerRecordDetailsBinding 9 import com.br_technology.securitytrain_master.databinding.ActivityAnswerRecordDetailsBinding
11 import com.br_technology.securitytrain_master.ui.view.bank.adapter.AnswerRecordDetailsAdapter 10 import com.br_technology.securitytrain_master.ui.view.bank.adapter.AnswerRecordDetailsAdapter
12 -import com.br_technology.securitytrain_master.ui.view.bank.bean.OptionArr  
13 -import com.br_technology.securitytrain_master.ui.view.bank.bean.TestSubject  
14 import com.br_technology.securitytrain_master.ui.view.bank.viewmodel.PracticeViewModel 11 import com.br_technology.securitytrain_master.ui.view.bank.viewmodel.PracticeViewModel
15 import com.br_technology.securitytrain_master.view.listener.ToolBarClickListener 12 import com.br_technology.securitytrain_master.view.listener.ToolBarClickListener
16 import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity 13 import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity
@@ -60,8 +57,8 @@ class AnswerRecordDetailsActivity : @@ -60,8 +57,8 @@ class AnswerRecordDetailsActivity :
60 57
61 override fun initData() { 58 override fun initData() {
62 super.initData() 59 super.initData()
63 - val id = intent.getIntExtra("id", 0)  
64 - mViewModel.errorSubDetail(id) 60 + val id = intent.getStringExtra("id")
  61 + mViewModel.errorSubDetail(id?:"")
65 binding.apply { 62 binding.apply {
66 toolBar.setRightText("答题卡") 63 toolBar.setRightText("答题卡")
67 toolBar.setRightTextDrawable( 64 toolBar.setRightTextDrawable(
@@ -26,7 +26,7 @@ class ChallengeActivity : @@ -26,7 +26,7 @@ class ChallengeActivity :
26 26
27 27
28 private val mPagerAdapter = PracticePaperAdapter(false) 28 private val mPagerAdapter = PracticePaperAdapter(false)
29 - private var userItemId = 0 29 + private var userItemId = ""
30 private val titleDialog by lazy { 30 private val titleDialog by lazy {
31 DialogTitle(this) 31 DialogTitle(this)
32 } 32 }
@@ -64,6 +64,10 @@ class ChallengeActivity : @@ -64,6 +64,10 @@ class ChallengeActivity :
64 }) 64 })
65 // 下一题 65 // 下一题
66 next.setOnClickListener { 66 next.setOnClickListener {
  67 + if (mPagerAdapter.getCount() <= 0) {
  68 + ToastUtils.s(baseContext, "暂无数据")
  69 + return@setOnClickListener
  70 + }
67 next.isClickable = false 71 next.isClickable = false
68 val answer = mPagerAdapter.getAnswer()[practicePager.currentItem] 72 val answer = mPagerAdapter.getAnswer()[practicePager.currentItem]
69 if (answer.answer.isEmpty()) { 73 if (answer.answer.isEmpty()) {
@@ -104,7 +108,7 @@ class ChallengeActivity : @@ -104,7 +108,7 @@ class ChallengeActivity :
104 override fun initDataObserver() { 108 override fun initDataObserver() {
105 mViewModel.itemStartData.observe(this) { 109 mViewModel.itemStartData.observe(this) {
106 if (it.code == 1) { 110 if (it.code == 1) {
107 - userItemId = it.data.user_item_id.toInt() 111 + userItemId = it.data.user_item_id
108 mPagerAdapter.addList(it.data.list) 112 mPagerAdapter.addList(it.data.list)
109 binding.practicePager.adapter = mPagerAdapter 113 binding.practicePager.adapter = mPagerAdapter
110 } else { 114 } else {
@@ -26,7 +26,7 @@ class ExamDetailActivity : @@ -26,7 +26,7 @@ class ExamDetailActivity :
26 BaseLifeCycleActivity<PracticeViewModel, ActivityPracticeBinding>(ActivityPracticeBinding::inflate) { 26 BaseLifeCycleActivity<PracticeViewModel, ActivityPracticeBinding>(ActivityPracticeBinding::inflate) {
27 27
28 private val mPagerAdapter = PracticePaperAdapter() 28 private val mPagerAdapter = PracticePaperAdapter()
29 - private var userItemId = 0 29 + private var userItemId = ""
30 private var overSecond = 0 30 private var overSecond = 0
31 private var isFinish = false 31 private var isFinish = false
32 private var countDownTimer: CountDownTimer? = null 32 private var countDownTimer: CountDownTimer? = null
@@ -62,7 +62,7 @@ class ExamDetailActivity : @@ -62,7 +62,7 @@ class ExamDetailActivity :
62 62
63 override fun initData() { 63 override fun initData() {
64 super.initData() 64 super.initData()
65 - val paperId = intent.getIntExtra("paper_id", 0) 65 + val paperId = intent.getStringExtra("paper_id")
66 val type = intent.getIntExtra("type", 0) 66 val type = intent.getIntExtra("type", 0)
67 67
68 mViewModel.itemStart(paperId, type) 68 mViewModel.itemStart(paperId, type)
@@ -157,7 +157,7 @@ class ExamDetailActivity : @@ -157,7 +157,7 @@ class ExamDetailActivity :
157 override fun initDataObserver() { 157 override fun initDataObserver() {
158 mViewModel.itemStartData.observe(this) { 158 mViewModel.itemStartData.observe(this) {
159 // 试卷id 159 // 试卷id
160 - userItemId = it.data.user_item_id.toInt() 160 + userItemId = it.data.user_item_id
161 // 倒计时 秒 161 // 倒计时 秒
162 overSecond = it.data.over_second 162 overSecond = it.data.over_second
163 mPagerAdapter.addList(it.data.list) 163 mPagerAdapter.addList(it.data.list)
@@ -30,17 +30,21 @@ class MockExamActivity : @@ -30,17 +30,21 @@ class MockExamActivity :
30 smartRefresh.autoRefresh() 30 smartRefresh.autoRefresh()
31 // 刷新回调函数 31 // 刷新回调函数
32 smartRefresh.setOnRefreshListener { 32 smartRefresh.setOnRefreshListener {
33 - refresh() 33 + refresh()
34 } 34 }
35 // 加载回调函数 35 // 加载回调函数
36 smartRefresh.setOnLoadMoreListener { 36 smartRefresh.setOnLoadMoreListener {
37 - loadMore() 37 + loadMore()
38 } 38 }
39 // 适配器item点击函数 39 // 适配器item点击函数
40 mockExamAdapter.setOnItemClickListener { _, _, position -> 40 mockExamAdapter.setOnItemClickListener { _, _, position ->
41 - val id = mockExamAdapter.data[position].id  
42 - mViewModel.specialPracticeDetail(id.toString())  
43 - 41 + val data = mockExamAdapter.data[position]
  42 + if (data.count > 0) {
  43 + val id = data.id
  44 + mViewModel.specialPracticeDetail(id.toString())
  45 + } else {
  46 + toast("该模拟考试暂无题目")
  47 + }
44 } 48 }
45 // 设置列表适配器 49 // 设置列表适配器
46 recycler.adapter = mockExamAdapter 50 recycler.adapter = mockExamAdapter
@@ -48,14 +52,14 @@ class MockExamActivity : @@ -48,14 +52,14 @@ class MockExamActivity :
48 } 52 }
49 } 53 }
50 54
51 - private fun refresh(){ 55 + private fun refresh() {
52 // 初始化页码为1 56 // 初始化页码为1
53 page = 1 57 page = 1
54 // 请求接口 58 // 请求接口
55 mViewModel.specialPracticeList(page) 59 mViewModel.specialPracticeList(page)
56 } 60 }
57 61
58 - private fun loadMore(){ 62 + private fun loadMore() {
59 // 页码自动加1 63 // 页码自动加1
60 ++page 64 ++page
61 // 请求接口 65 // 请求接口
1 package com.br_technology.securitytrain_master.ui.view.bank.activity 1 package com.br_technology.securitytrain_master.ui.view.bank.activity
2 2
3 import android.app.Activity 3 import android.app.Activity
  4 +import android.content.Intent
4 import android.view.View 5 import android.view.View
5 import androidx.activity.result.contract.ActivityResultContracts 6 import androidx.activity.result.contract.ActivityResultContracts
  7 +import androidx.core.content.ContextCompat
  8 +import com.br_technology.securitytrain_master.R
6 import com.br_technology.securitytrain_master.base.common.ConstantType 9 import com.br_technology.securitytrain_master.base.common.ConstantType
7 import com.br_technology.securitytrain_master.databinding.ActivityPracticeBinding 10 import com.br_technology.securitytrain_master.databinding.ActivityPracticeBinding
8 import com.br_technology.securitytrain_master.ui.view.bank.adapter.PracticePaperAdapter 11 import com.br_technology.securitytrain_master.ui.view.bank.adapter.PracticePaperAdapter
@@ -10,6 +13,7 @@ import com.br_technology.securitytrain_master.ui.view.bank.viewmodel.PracticeVie @@ -10,6 +13,7 @@ import com.br_technology.securitytrain_master.ui.view.bank.viewmodel.PracticeVie
10 import com.br_technology.securitytrain_master.view.DialogDetermine 13 import com.br_technology.securitytrain_master.view.DialogDetermine
11 import com.br_technology.securitytrain_master.view.DialogTitle 14 import com.br_technology.securitytrain_master.view.DialogTitle
12 import com.br_technology.securitytrain_master.view.listener.DialogListener 15 import com.br_technology.securitytrain_master.view.listener.DialogListener
  16 +import com.br_technology.securitytrain_master.view.listener.ToolBarClickListener
13 import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity 17 import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity
14 18
15 /** 19 /**
@@ -21,7 +25,7 @@ class PracticeActivity : @@ -21,7 +25,7 @@ class PracticeActivity :
21 BaseLifeCycleActivity<PracticeViewModel, ActivityPracticeBinding>(ActivityPracticeBinding::inflate) { 25 BaseLifeCycleActivity<PracticeViewModel, ActivityPracticeBinding>(ActivityPracticeBinding::inflate) {
22 26
23 // 请求id 27 // 请求id
24 - private var contentId = 0 28 + private var contentId = ""
25 private val mPagerAdapter = PracticePaperAdapter() 29 private val mPagerAdapter = PracticePaperAdapter()
26 private var userItemId: String = "" 30 private var userItemId: String = ""
27 private val startForResult = 31 private val startForResult =
@@ -59,7 +63,7 @@ class PracticeActivity : @@ -59,7 +63,7 @@ class PracticeActivity :
59 63
60 override fun initData() { 64 override fun initData() {
61 super.initData() 65 super.initData()
62 - contentId = intent.getIntExtra("contentId", 0) 66 + contentId = intent.getStringExtra("contentId") ?: ""
63 val contentType = intent.getIntExtra("contentType", 0) 67 val contentType = intent.getIntExtra("contentType", 0)
64 binding.toolBar.setTitle(ConstantType.getTestType(contentType)) 68 binding.toolBar.setTitle(ConstantType.getTestType(contentType))
65 mViewModel.itemStart(contentId, contentType) 69 mViewModel.itemStart(contentId, contentType)
@@ -79,6 +83,9 @@ class PracticeActivity : @@ -79,6 +83,9 @@ class PracticeActivity :
79 } 83 }
80 // 下一题 84 // 下一题
81 next.setOnClickListener { 85 next.setOnClickListener {
  86 + if (mPagerAdapter.getCount() <= 0) {
  87 + return@setOnClickListener
  88 + }
82 val index = practicePager.currentItem 89 val index = practicePager.currentItem
83 if (index < mPagerAdapter.itemCount - 1) { 90 if (index < mPagerAdapter.itemCount - 1) {
84 practicePager.currentItem = index + 1 91 practicePager.currentItem = index + 1
@@ -104,7 +111,7 @@ class PracticeActivity : @@ -104,7 +111,7 @@ class PracticeActivity :
104 return@setOnClickListener 111 return@setOnClickListener
105 } 112 }
106 // 答完题提交答案到服务器 113 // 答完题提交答案到服务器
107 - mViewModel.submitAnswer(userItemId.toInt(), mPagerAdapter.getAnswer()) 114 + mViewModel.submitAnswer(userItemId, mPagerAdapter.getAnswer())
108 } 115 }
109 } 116 }
110 // 标题弹窗 117 // 标题弹窗
@@ -134,6 +141,23 @@ class PracticeActivity : @@ -134,6 +141,23 @@ class PracticeActivity :
134 }) 141 })
135 142
136 mViewModel.subAnswer.observe(this) { 143 mViewModel.subAnswer.observe(this) {
  144 + binding.toolBar.setRightText("答题卡")
  145 + binding.toolBar.setRightTextDrawable(
  146 + ContextCompat.getDrawable(
  147 + baseContext,
  148 + R.mipmap.answer_sheet
  149 + )
  150 + )
  151 + // 答题卡点击事件
  152 + binding.toolBar.addRightListener(object : ToolBarClickListener {
  153 + override fun onClick(view: View) {
  154 + val intent = Intent(this@PracticeActivity, AnswerSheetActivity::class.java)
  155 + .putStringArrayListExtra("resultData", mPagerAdapter.getArrayList())
  156 + .putExtra("showCorrect", mPagerAdapter.showCorrect)
  157 + .putExtra("title", binding.toolBar.getTitle())
  158 + startForResult.launch(intent)
  159 + }
  160 + })
137 binding.finishJob.isClickable = true 161 binding.finishJob.isClickable = true
138 if (!titleDialog.isShowing) { 162 if (!titleDialog.isShowing) {
139 // 点击外部不取消 163 // 点击外部不取消
@@ -41,6 +41,10 @@ class PracticeListActivity : BaseLifeCycleActivity<PracticeViewModel, ActivityPr @@ -41,6 +41,10 @@ class PracticeListActivity : BaseLifeCycleActivity<PracticeViewModel, ActivityPr
41 ToastUtils.s(baseContext, "该试题已完成") 41 ToastUtils.s(baseContext, "该试题已完成")
42 return@setOnItemClickListener 42 return@setOnItemClickListener
43 } 43 }
  44 + if (listAdapter.data[position].count <= 0) {
  45 + toast("该练习暂无题目")
  46 + return@setOnItemClickListener
  47 + }
44 val id = listAdapter.data[position].id 48 val id = listAdapter.data[position].id
45 startActivity( 49 startActivity(
46 Intent( 50 Intent(
@@ -26,7 +26,7 @@ class QuestionsActivity : @@ -26,7 +26,7 @@ class QuestionsActivity :
26 BaseLifeCycleActivity<PracticeViewModel, ActivityPracticeBinding>(ActivityPracticeBinding::inflate) { 26 BaseLifeCycleActivity<PracticeViewModel, ActivityPracticeBinding>(ActivityPracticeBinding::inflate) {
27 27
28 private val mPagerAdapter = PracticePaperAdapter() 28 private val mPagerAdapter = PracticePaperAdapter()
29 - private var userItemId = 0 29 + private var userItemId = ""
30 private var isFinish = false 30 private var isFinish = false
31 private val titleDialog by lazy { 31 private val titleDialog by lazy {
32 DialogTitle(this) 32 DialogTitle(this)
@@ -60,7 +60,7 @@ class QuestionsActivity : @@ -60,7 +60,7 @@ class QuestionsActivity :
60 60
61 override fun initData() { 61 override fun initData() {
62 super.initData() 62 super.initData()
63 - val paperId = intent.getIntExtra("paper_id", 0) 63 + val paperId = intent.getStringExtra("paper_id")
64 val type = intent.getIntExtra("type", 0) 64 val type = intent.getIntExtra("type", 0)
65 65
66 mViewModel.itemStart(paperId, type) 66 mViewModel.itemStart(paperId, type)
@@ -154,7 +154,7 @@ class QuestionsActivity : @@ -154,7 +154,7 @@ class QuestionsActivity :
154 override fun initDataObserver() { 154 override fun initDataObserver() {
155 mViewModel.itemStartData.observe(this) { 155 mViewModel.itemStartData.observe(this) {
156 if (it.code == 1) { 156 if (it.code == 1) {
157 - userItemId = it.data.user_item_id.toInt() 157 + userItemId = it.data.user_item_id
158 mPagerAdapter.addList(it.data.list) 158 mPagerAdapter.addList(it.data.list)
159 binding.practicePager.adapter = mPagerAdapter 159 binding.practicePager.adapter = mPagerAdapter
160 } else { 160 } else {
@@ -17,7 +17,7 @@ class WrongQuestionsActivity : @@ -17,7 +17,7 @@ class WrongQuestionsActivity :
17 BaseLifeCycleActivity<PracticeViewModel, ActivityWrongQuestionsBinding>( 17 BaseLifeCycleActivity<PracticeViewModel, ActivityWrongQuestionsBinding>(
18 ActivityWrongQuestionsBinding::inflate 18 ActivityWrongQuestionsBinding::inflate
19 ) { 19 ) {
20 - private var itemId: Int = 0 20 + private var itemId: String = ""
21 private var type by Delegates.notNull<Int>() 21 private var type by Delegates.notNull<Int>()
22 private val adapter by lazy { 22 private val adapter by lazy {
23 PracticePaperAdapter() 23 PracticePaperAdapter()
@@ -25,7 +25,7 @@ class WrongQuestionsActivity : @@ -25,7 +25,7 @@ class WrongQuestionsActivity :
25 25
26 override fun initDataObserver() { 26 override fun initDataObserver() {
27 mViewModel.errorDetail.observe(this) { 27 mViewModel.errorDetail.observe(this) {
28 - itemId = it.data.error_id.toInt() 28 + itemId = it.data.error_id
29 adapter.addData(it.data.detail) 29 adapter.addData(it.data.detail)
30 } 30 }
31 mViewModel.subErrorLiveData.observe(this) { 31 mViewModel.subErrorLiveData.observe(this) {
@@ -37,10 +37,10 @@ class WrongQuestionsActivity : @@ -37,10 +37,10 @@ class WrongQuestionsActivity :
37 37
38 override fun initData() { 38 override fun initData() {
39 super.initData() 39 super.initData()
40 - val id = intent.getIntExtra("id", 0) 40 + val id = intent.getStringExtra("id")
41 type = intent.getIntExtra("type", 1) 41 type = intent.getIntExtra("type", 1)
42 MyErrorQuestionFragment.map[type] = true 42 MyErrorQuestionFragment.map[type] = true
43 - mViewModel.errorDetail(id) 43 + mViewModel.errorDetail(id?:"")
44 binding.apply { 44 binding.apply {
45 errorPager.isUserInputEnabled = false 45 errorPager.isUserInputEnabled = false
46 errorPager.adapter = adapter 46 errorPager.adapter = adapter
1 package com.br_technology.securitytrain_master.ui.view.bank.fragment 1 package com.br_technology.securitytrain_master.ui.view.bank.fragment
2 2
3 import android.content.Intent 3 import android.content.Intent
  4 +import android.widget.Toast
4 import androidx.recyclerview.widget.LinearLayoutManager 5 import androidx.recyclerview.widget.LinearLayoutManager
5 import com.br_technology.securitytrain_master.R 6 import com.br_technology.securitytrain_master.R
6 import com.br_technology.securitytrain_master.base.common.ConstantType 7 import com.br_technology.securitytrain_master.base.common.ConstantType
@@ -36,7 +37,9 @@ class BankFragment : @@ -36,7 +37,9 @@ class BankFragment :
36 DialogStar(requireActivity()) 37 DialogStar(requireActivity())
37 } 38 }
38 39
39 - private var posId: Int = if (sp_job_id_select == 0) { 40 + private var hasMore = true
  41 +
  42 + private var posId: String = if (sp_job_id_select == "") {
40 sp_job_id 43 sp_job_id
41 } else { 44 } else {
42 sp_job_id_select 45 sp_job_id_select
@@ -70,11 +73,11 @@ class BankFragment : @@ -70,11 +73,11 @@ class BankFragment :
70 } 73 }
71 change.setOnClickListener { 74 change.setOnClickListener {
72 if (it.isPressed) { 75 if (it.isPressed) {
73 - refresh() 76 + change()
74 } 77 }
75 } 78 }
76 refreshLayout.setOnLoadMoreListener { 79 refreshLayout.setOnLoadMoreListener {
77 - initLoadMore() 80 +// initLoadMore()
78 } 81 }
79 // 模拟考试 82 // 模拟考试
80 mockExam.setOnClickListener { 83 mockExam.setOnClickListener {
@@ -101,14 +104,21 @@ class BankFragment : @@ -101,14 +104,21 @@ class BankFragment :
101 practice.layoutManager = LinearLayoutManager(activity) 104 practice.layoutManager = LinearLayoutManager(activity)
102 105
103 practiceAdapter?.setOnItemClickListener { _, _, position -> 106 practiceAdapter?.setOnItemClickListener { _, _, position ->
104 - activity?.startActivity(  
105 - Intent(  
106 - activity,  
107 - QuestionsActivity::class.java  
108 - )  
109 - .putExtra("paper_id", practiceAdapter?.data?.get(position)?.id)  
110 - .putExtra("type", ConstantType.TEST_TYPE_PRACTICE)  
111 - ) 107 + val data = practiceAdapter?.data?.get(position)
  108 + data?.let {
  109 + if (it.count > 0) {
  110 + activity?.startActivity(
  111 + Intent(
  112 + activity,
  113 + QuestionsActivity::class.java
  114 + )
  115 + .putExtra("paper_id", "${practiceAdapter?.data?.get(position)?.id}")
  116 + .putExtra("type", ConstantType.TEST_TYPE_PRACTICE)
  117 + )
  118 + } else {
  119 + Toast.makeText(activity, "该试卷暂无题目", Toast.LENGTH_SHORT).show()
  120 + }
  121 + }
112 } 122 }
113 123
114 initLoadMore() 124 initLoadMore()
@@ -117,6 +127,7 @@ class BankFragment : @@ -117,6 +127,7 @@ class BankFragment :
117 // 挑战答题弹框 127 // 挑战答题弹框
118 dialogStarDialog.setListener(object : DialogListener { 128 dialogStarDialog.setListener(object : DialogListener {
119 override fun determine() { 129 override fun determine() {
  130 + // 挑战答题,跳转前先获取判断是否具有题目
120 startActivity(ChallengeActivity::class.java) 131 startActivity(ChallengeActivity::class.java)
121 dialogStarDialog.dismiss() 132 dialogStarDialog.dismiss()
122 } 133 }
@@ -125,17 +136,38 @@ class BankFragment : @@ -125,17 +136,38 @@ class BankFragment :
125 136
126 private fun refresh() { 137 private fun refresh() {
127 page = 1 138 page = 1
128 - mViewModel.practiceList(page, 20, posId) 139 + mViewModel.practiceList(page, 6, posId)
  140 + binding.refreshLayout.setEnableRefresh(false)
  141 + binding.refreshLayout.setEnableLoadMore(false)
  142 + }
  143 +
  144 + private fun change() {
  145 + if (hasMore) {
  146 + page++
  147 + } else {
  148 + page = 1;
  149 + }
  150 + mViewModel.practiceList(page, 6, posId)
129 binding.refreshLayout.setEnableRefresh(false) 151 binding.refreshLayout.setEnableRefresh(false)
130 binding.refreshLayout.setEnableLoadMore(false) 152 binding.refreshLayout.setEnableLoadMore(false)
131 } 153 }
132 154
133 private fun initLoadMore() { 155 private fun initLoadMore() {
134 - page++  
135 - mViewModel.practiceList(page, 20, posId) 156 + val needReset =
  157 + practiceAdapter != null
  158 + && practiceAdapter?.data?.isNotEmpty() == true
  159 + && practiceAdapter?.data?.size?.rem(
  160 + 6
  161 + ) != 0
  162 + if (!needReset) {
  163 + page = 1
  164 + } else {
  165 + page++
  166 + }
  167 + mViewModel.practiceList(page, 6, posId)
136 binding.refreshLayout.setEnableRefresh(false) 168 binding.refreshLayout.setEnableRefresh(false)
137 binding.refreshLayout.setEnableLoadMore(false) 169 binding.refreshLayout.setEnableLoadMore(false)
138 - practiceAdapter?.loadMoreModule?.isAutoLoadMore = true 170 + practiceAdapter?.loadMoreModule?.isAutoLoadMore = false
139 practiceAdapter?.loadMoreModule?.isEnableLoadMoreIfNotFullPage = false 171 practiceAdapter?.loadMoreModule?.isEnableLoadMoreIfNotFullPage = false
140 } 172 }
141 173
@@ -154,12 +186,9 @@ class BankFragment : @@ -154,12 +186,9 @@ class BankFragment :
154 mViewModel.mPracticeBean.observe(this, { 186 mViewModel.mPracticeBean.observe(this, {
155 binding.refreshLayout.finishLoadMore() 187 binding.refreshLayout.finishLoadMore()
156 binding.refreshLayout.finishRefresh() 188 binding.refreshLayout.finishRefresh()
157 - binding.refreshLayout.setEnableLoadMore(it.data.list.size == 20)  
158 - if (page == 1) {  
159 - practiceAdapter?.setList(it.data.list)  
160 - } else {  
161 - practiceAdapter?.addData(it.data.list)  
162 - } 189 + binding.refreshLayout.setEnableLoadMore(false)
  190 + hasMore = (!(it.data.list.size < 6))
  191 + practiceAdapter?.setList(it.data.list)
163 }) 192 })
164 } 193 }
165 } 194 }
@@ -6,11 +6,16 @@ import com.br_technology.securitytrain_master.base.network.response.BaseResponse @@ -6,11 +6,16 @@ import com.br_technology.securitytrain_master.base.network.response.BaseResponse
6 import com.br_technology.securitytrain_master.base.network.response.CommonList 6 import com.br_technology.securitytrain_master.base.network.response.CommonList
7 import com.br_technology.securitytrain_master.base.repository.ApiRepository 7 import com.br_technology.securitytrain_master.base.repository.ApiRepository
8 import com.br_technology.securitytrain_master.ui.bean.AnswerAbout 8 import com.br_technology.securitytrain_master.ui.bean.AnswerAbout
  9 +import com.br_technology.securitytrain_master.ui.bean.UploadFileData
9 import com.br_technology.securitytrain_master.ui.view.bank.bean.PracticeBean 10 import com.br_technology.securitytrain_master.ui.view.bank.bean.PracticeBean
10 import com.br_technology.securitytrain_master.ui.view.home.bean.WorkTypeBean 11 import com.br_technology.securitytrain_master.ui.view.home.bean.WorkTypeBean
11 import com.wjx.android.wanandroidmvvm.base.observer.BaseObserver 12 import com.wjx.android.wanandroidmvvm.base.observer.BaseObserver
12 import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers 13 import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
13 import io.reactivex.rxjava3.schedulers.Schedulers 14 import io.reactivex.rxjava3.schedulers.Schedulers
  15 +import okhttp3.MediaType
  16 +import okhttp3.MultipartBody
  17 +import okhttp3.RequestBody
  18 +import java.io.File
14 19
15 /** 20 /**
16 * createTime:2021/7/27 15:49 21 * createTime:2021/7/27 15:49
@@ -40,7 +45,7 @@ class BankRepository(val loadState: MutableLiveData<State>): ApiRepository(loadS @@ -40,7 +45,7 @@ class BankRepository(val loadState: MutableLiveData<State>): ApiRepository(loadS
40 } 45 }
41 46
42 fun practiceList( 47 fun practiceList(
43 - pos_id : Int, 48 + pos_id : String,
44 page : Int, 49 page : Int,
45 page_num : Int, 50 page_num : Int,
46 liveData: MutableLiveData<BaseResponse<CommonList<PracticeBean>>> 51 liveData: MutableLiveData<BaseResponse<CommonList<PracticeBean>>>
@@ -55,6 +60,37 @@ class BankRepository(val loadState: MutableLiveData<State>): ApiRepository(loadS @@ -55,6 +60,37 @@ class BankRepository(val loadState: MutableLiveData<State>): ApiRepository(loadS
55 this 60 this
56 ) 61 )
57 ) 62 )
  63 + }
  64 +
  65 + fun uploadFile(
  66 + path: String,
  67 + liveData: MutableLiveData<BaseResponse<UploadFileData>>
  68 + ) {
  69 + val file = File(path)
  70 + if (file.exists()) {
  71 + MultipartBody.Part.createFormData(
  72 + "file", file.name, RequestBody.create(MediaType.parse("multipart/form-data"), file)
  73 + )
  74 + apiService.uploadFile(
  75 + MultipartBody.Part.createFormData(
  76 + "file",
  77 + file.name,
  78 + RequestBody.create(MediaType.parse("multipart/form-data"), file)
  79 + )
  80 + )
  81 + .subscribeOn(Schedulers.io())
  82 + .observeOn(AndroidSchedulers.mainThread())
  83 + .subscribe(
  84 + BaseObserver(
  85 + liveData,
  86 + loadState,
  87 + this
  88 + )
  89 + )
  90 + }
  91 + }
58 92
  93 + fun checkFace(url: String, liveData: MutableLiveData<BaseResponse<Void>>) {
  94 + addRequest(apiService.checkFace(url), liveData)
59 } 95 }
60 } 96 }
@@ -6,6 +6,7 @@ import com.br_technology.securitytrain_master.base.network.response.BaseResponse @@ -6,6 +6,7 @@ import com.br_technology.securitytrain_master.base.network.response.BaseResponse
6 import com.br_technology.securitytrain_master.base.network.response.CommonList 6 import com.br_technology.securitytrain_master.base.network.response.CommonList
7 import com.br_technology.securitytrain_master.base.view.BaseViewModel 7 import com.br_technology.securitytrain_master.base.view.BaseViewModel
8 import com.br_technology.securitytrain_master.ui.bean.AnswerAbout 8 import com.br_technology.securitytrain_master.ui.bean.AnswerAbout
  9 +import com.br_technology.securitytrain_master.ui.bean.UploadFileData
9 import com.br_technology.securitytrain_master.ui.view.bank.bean.PracticeBean 10 import com.br_technology.securitytrain_master.ui.view.bank.bean.PracticeBean
10 import com.br_technology.securitytrain_master.ui.view.bank.repository.BankRepository 11 import com.br_technology.securitytrain_master.ui.view.bank.repository.BankRepository
11 import com.br_technology.securitytrain_master.ui.view.home.bean.WorkTypeBean 12 import com.br_technology.securitytrain_master.ui.view.home.bean.WorkTypeBean
@@ -19,6 +20,9 @@ class BankViewModel : BaseViewModel<BankRepository>() { @@ -19,6 +20,9 @@ class BankViewModel : BaseViewModel<BankRepository>() {
19 var mWorkTypeBean: MutableLiveData<BaseResponse<WorkTypeBean>> = MutableLiveData() 20 var mWorkTypeBean: MutableLiveData<BaseResponse<WorkTypeBean>> = MutableLiveData()
20 var mAnswerAbout: MutableLiveData<BaseResponse<AnswerAbout>> = MutableLiveData() 21 var mAnswerAbout: MutableLiveData<BaseResponse<AnswerAbout>> = MutableLiveData()
21 22
  23 + var mFaceFile = MutableLiveData<BaseResponse<UploadFileData>>()
  24 + var mFaceCheck = MutableLiveData<BaseResponse<Void>>()
  25 +
22 fun beanData(): LiveData<BaseResponse<WorkTypeBean>> { 26 fun beanData(): LiveData<BaseResponse<WorkTypeBean>> {
23 return mWorkTypeBean 27 return mWorkTypeBean
24 } 28 }
@@ -36,8 +40,16 @@ class BankViewModel : BaseViewModel<BankRepository>() { @@ -36,8 +40,16 @@ class BankViewModel : BaseViewModel<BankRepository>() {
36 fun practiceList( 40 fun practiceList(
37 page: Int, 41 page: Int,
38 page_num: Int, 42 page_num: Int,
39 - pos_id: Int 43 + pos_id: String
40 ) { 44 ) {
41 mRepository.practiceList(pos_id, page, page_num, mPracticeBean) 45 mRepository.practiceList(pos_id, page, page_num, mPracticeBean)
42 } 46 }
  47 +
  48 + fun uploadFace(filePath: String) {
  49 + mRepository.uploadFile(filePath, mFaceFile)
  50 + }
  51 +
  52 + fun checkFace(url: String) {
  53 + mRepository.checkFace(url, mFaceCheck)
  54 + }
43 } 55 }
@@ -2,13 +2,16 @@ package com.br_technology.securitytrain_master.ui.view.bank.viewmodel @@ -2,13 +2,16 @@ package com.br_technology.securitytrain_master.ui.view.bank.viewmodel
2 2
3 import androidx.lifecycle.MutableLiveData 3 import androidx.lifecycle.MutableLiveData
4 import com.alibaba.fastjson.JSON 4 import com.alibaba.fastjson.JSON
  5 +import com.br_technology.securitytrain_master.base.network.response.BaseResponse
  6 +import com.br_technology.securitytrain_master.base.network.response.CommonDataList
  7 +import com.br_technology.securitytrain_master.base.network.response.CommonList
  8 +import com.br_technology.securitytrain_master.base.network.response.CommonPage
5 import com.br_technology.securitytrain_master.base.repository.ItemRepository 9 import com.br_technology.securitytrain_master.base.repository.ItemRepository
6 -import com.br_technology.securitytrain_master.base.network.response.*  
7 import com.br_technology.securitytrain_master.base.view.BaseViewModel 10 import com.br_technology.securitytrain_master.base.view.BaseViewModel
8 import com.br_technology.securitytrain_master.ui.bean.* 11 import com.br_technology.securitytrain_master.ui.bean.*
9 import com.br_technology.securitytrain_master.ui.view.bank.bean.OptionArr 12 import com.br_technology.securitytrain_master.ui.view.bank.bean.OptionArr
10 -import com.br_technology.securitytrain_master.ui.view.bank.bean.TestSubject  
11 import com.br_technology.securitytrain_master.ui.view.bank.bean.StartItemBean 13 import com.br_technology.securitytrain_master.ui.view.bank.bean.StartItemBean
  14 +import com.br_technology.securitytrain_master.ui.view.bank.bean.TestSubject
12 import com.br_technology.securitytrain_master.util.sp_job_id 15 import com.br_technology.securitytrain_master.util.sp_job_id
13 16
14 /** 17 /**
@@ -60,7 +63,7 @@ class PracticeViewModel : BaseViewModel<ItemRepository>() { @@ -60,7 +63,7 @@ class PracticeViewModel : BaseViewModel<ItemRepository>() {
60 pagerListData.value = dataList 63 pagerListData.value = dataList
61 } 64 }
62 65
63 - fun submitAnswer(itemId: Int, list: ArrayList<Answer>) { 66 + fun submitAnswer(itemId: String, list: ArrayList<Answer>) {
64 val jsonArray = JSON.toJSONString(list) 67 val jsonArray = JSON.toJSONString(list)
65 mRepository.subAnswer(itemId, jsonArray, subAnswer) 68 mRepository.subAnswer(itemId, jsonArray, subAnswer)
66 } 69 }
@@ -68,27 +71,27 @@ class PracticeViewModel : BaseViewModel<ItemRepository>() { @@ -68,27 +71,27 @@ class PracticeViewModel : BaseViewModel<ItemRepository>() {
68 /** 71 /**
69 * 提交错题 72 * 提交错题
70 */ 73 */
71 - fun subError(itemId: Int, answer: String) { 74 + fun subError(itemId: String, answer: String) {
72 mRepository.subError(itemId, answer, subErrorLiveData) 75 mRepository.subError(itemId, answer, subErrorLiveData)
73 } 76 }
74 77
75 // 开始答题 78 // 开始答题
76 fun itemStart( 79 fun itemStart(
77 - paper_id: Int?, 80 + paper_id: String?,
78 type: Int, 81 type: Int,
79 ) { 82 ) {
80 mRepository.itemStart(sp_job_id, paper_id, type, itemStartData) 83 mRepository.itemStart(sp_job_id, paper_id, type, itemStartData)
81 } 84 }
82 85
83 //获取挑战答题弹板信息 86 //获取挑战答题弹板信息
84 - fun challengeInfo(user_item_id: Int) { 87 + fun challengeInfo(user_item_id: String) {
85 mRepository.challengeInfo(user_item_id, challengeInfoLiveData) 88 mRepository.challengeInfo(user_item_id, challengeInfoLiveData)
86 } 89 }
87 90
88 // 提交某一题 91 // 提交某一题
89 fun subSingle( 92 fun subSingle(
90 - user_item_id: Int,  
91 - item_id: Int, 93 + user_item_id: String,
  94 + item_id: String,
92 answer: String, 95 answer: String,
93 ) { 96 ) {
94 mRepository.subSingle(user_item_id, item_id, answer, subSingleData) 97 mRepository.subSingle(user_item_id, item_id, answer, subSingleData)
@@ -96,7 +99,7 @@ class PracticeViewModel : BaseViewModel<ItemRepository>() { @@ -96,7 +99,7 @@ class PracticeViewModel : BaseViewModel<ItemRepository>() {
96 99
97 100
98 // 提交答卷 101 // 提交答卷
99 - fun subFinish(user_item_id: Int) { 102 + fun subFinish(user_item_id: String) {
100 mRepository.subPaper(user_item_id, subFinish) 103 mRepository.subPaper(user_item_id, subFinish)
101 } 104 }
102 105
@@ -109,14 +112,14 @@ class PracticeViewModel : BaseViewModel<ItemRepository>() { @@ -109,14 +112,14 @@ class PracticeViewModel : BaseViewModel<ItemRepository>() {
109 112
110 113
111 fun errorSubDetail( 114 fun errorSubDetail(
112 - id: Int 115 + id: String
113 ) { 116 ) {
114 mRepository.errorSubDetail(id, errorSubDetailLiveData) 117 mRepository.errorSubDetail(id, errorSubDetailLiveData)
115 } 118 }
116 119
117 120
118 fun errorDetail( 121 fun errorDetail(
119 - id: Int 122 + id: String
120 ) { 123 ) {
121 mRepository.errorDetail(id, errorDetail) 124 mRepository.errorDetail(id, errorDetail)
122 } 125 }
@@ -46,9 +46,14 @@ class DatabaseActivity : @@ -46,9 +46,14 @@ class DatabaseActivity :
46 } 46 }
47 mViewModel.sortSecond.value?.let { second -> popData?.addList(list!!, second, popChild!!) } 47 mViewModel.sortSecond.value?.let { second -> popData?.addList(list!!, second, popChild!!) }
48 popData?.iClickChild = object : DatabaseListPop.IClickChild { 48 popData?.iClickChild = object : DatabaseListPop.IClickChild {
49 - override fun child(child: MaterialChild, data: MaterialChildSecond) { 49 + override fun child(child: MaterialChild, data: MaterialChildSecond?) {
50 mViewModel.popChild.value = child 50 mViewModel.popChild.value = child
51 - mViewModel.sortSecond.value = data 51 + if (child.child == null || child.child?.isEmpty() == true) {
  52 + mViewModel.sortChild.value = child
  53 + mViewModel.sortSecond.value = null
  54 + } else {
  55 + mViewModel.sortSecond.value = data
  56 + }
52 } 57 }
53 } 58 }
54 popData?.showAsDropDown(binding.type) 59 popData?.showAsDropDown(binding.type)
@@ -122,7 +127,12 @@ class DatabaseActivity : @@ -122,7 +127,12 @@ class DatabaseActivity :
122 }) 127 })
123 128
124 type.setOnClickListener { 129 type.setOnClickListener {
125 - showPopData() 130 + val classify = mViewModel.selectClassify.value
  131 + if (classify?.child == null || classify.child.isEmpty()) {
  132 +
  133 + } else {
  134 + showPopData()
  135 + }
126 } 136 }
127 } 137 }
128 } 138 }
@@ -152,6 +162,7 @@ class DatabaseActivity : @@ -152,6 +162,7 @@ class DatabaseActivity :
152 mClassifyAdapter?.addListener(object : OnItemClickListener<MaterialClassify> { 162 mClassifyAdapter?.addListener(object : OnItemClickListener<MaterialClassify> {
153 override fun onClick(position: Int, data: MaterialClassify) { 163 override fun onClick(position: Int, data: MaterialClassify) {
154 val list = data.child 164 val list = data.child
  165 + val id = data.id
155 mClassifyAdapter?.let { classifyAdapter -> 166 mClassifyAdapter?.let { classifyAdapter ->
156 val oldIndex = classifyAdapter.index; 167 val oldIndex = classifyAdapter.index;
157 if (oldIndex != position) { 168 if (oldIndex != position) {
@@ -162,12 +173,17 @@ class DatabaseActivity : @@ -162,12 +173,17 @@ class DatabaseActivity :
162 classifyAdapter.notifyItemChanged(position) 173 classifyAdapter.notifyItemChanged(position)
163 } 174 }
164 } 175 }
165 - if (list.isNotEmpty()) {  
166 - mViewModel.selectClassify.value = data  
167 - } else {  
168 - mViewModel.classifyDataList.value = BaseResponse(  
169 - MaterialPage(CommonPage(0, "10", 1, 1, listOf()))  
170 - ) 176 + mViewModel.selectClassify.value = data
  177 + if (list.isNullOrEmpty()) {
  178 + binding.type.text = "全部"
  179 + if (id.isNotEmpty()) {
  180 + page = 1
  181 + mViewModel.getDataList(page)
  182 + } else {
  183 + mViewModel.classifyDataList.value = BaseResponse(
  184 + MaterialPage(CommonPage(0, "10", 1, 1, listOf()))
  185 + )
  186 + }
171 } 187 }
172 } 188 }
173 }) 189 })
@@ -182,16 +198,25 @@ class DatabaseActivity : @@ -182,16 +198,25 @@ class DatabaseActivity :
182 if (list.isNotEmpty()) { 198 if (list.isNotEmpty()) {
183 mViewModel.sortChild.value = list[0] 199 mViewModel.sortChild.value = list[0]
184 mViewModel.popChild.value = list[0] 200 mViewModel.popChild.value = list[0]
  201 + } else {
  202 + binding.type.text = "全部"
185 } 203 }
186 }) 204 })
187 mViewModel.sortSecond.observe(this, { 205 mViewModel.sortSecond.observe(this, {
188 - mViewModel.getDataList(page)  
189 - binding.type.text = it.name 206 + if (it != null) {
  207 + page = 1
  208 + mViewModel.getDataList(page)
  209 + binding.type.text = it.name
  210 + }
190 }) 211 })
191 mViewModel.sortChild.observe(this, { 212 mViewModel.sortChild.observe(this, {
192 val child = it.child 213 val child = it.child
193 if (child != null && child.isNotEmpty()) { 214 if (child != null && child.isNotEmpty()) {
194 mViewModel.sortSecond.value = child[0] 215 mViewModel.sortSecond.value = child[0]
  216 + } else {
  217 + mViewModel.sortSecond.value = null
  218 + page = 1
  219 + mViewModel.getDataList(page)
195 } 220 }
196 }) 221 })
197 mViewModel.classifyDataList.observe(this, { 222 mViewModel.classifyDataList.observe(this, {
@@ -220,7 +245,7 @@ class DatabaseActivity : @@ -220,7 +245,7 @@ class DatabaseActivity :
220 override fun onClick(position: Int, data: RecommendBean.ListBean) { 245 override fun onClick(position: Int, data: RecommendBean.ListBean) {
221 startActivity( 246 startActivity(
222 Intent(this@DatabaseActivity, DatabaseDetailActivity::class.java) 247 Intent(this@DatabaseActivity, DatabaseDetailActivity::class.java)
223 - .putExtra(DOC_ID, data.id) 248 + .putExtra(DOC_ID, "${data.id}")
224 ) 249 )
225 } 250 }
226 }) 251 })
@@ -87,7 +87,7 @@ class DatabaseDetailActivity : @@ -87,7 +87,7 @@ class DatabaseDetailActivity :
87 87
88 override fun initData() { 88 override fun initData() {
89 super.initData() 89 super.initData()
90 - mViewModel.materialDetail(intent.getIntExtra(DOC_ID, 0)) 90 + mViewModel.materialDetail(intent.getStringExtra(DOC_ID)?:"")
91 } 91 }
92 92
93 override fun onBackPressed() { 93 override fun onBackPressed() {
1 package com.br_technology.securitytrain_master.ui.view.home.activity 1 package com.br_technology.securitytrain_master.ui.view.home.activity
2 2
  3 +import android.Manifest
  4 +import android.app.Activity
  5 +import android.content.Intent
3 import android.os.Bundle 6 import android.os.Bundle
  7 +import android.text.TextUtils
4 import android.view.View 8 import android.view.View
5 import androidx.core.content.ContextCompat 9 import androidx.core.content.ContextCompat
6 import androidx.fragment.app.FragmentPagerAdapter 10 import androidx.fragment.app.FragmentPagerAdapter
7 import com.br_technology.securitytrain_master.R 11 import com.br_technology.securitytrain_master.R
8 import com.br_technology.securitytrain_master.base.view.BasePagerAdapter 12 import com.br_technology.securitytrain_master.base.view.BasePagerAdapter
9 import com.br_technology.securitytrain_master.databinding.ActivityLiveCourseBinding 13 import com.br_technology.securitytrain_master.databinding.ActivityLiveCourseBinding
  14 +import com.br_technology.securitytrain_master.ext.initPermissions
10 import com.br_technology.securitytrain_master.ui.view.bank.viewmodel.BankViewModel 15 import com.br_technology.securitytrain_master.ui.view.bank.viewmodel.BankViewModel
  16 +import com.br_technology.securitytrain_master.ui.view.home.event.CheckLiveFace
11 import com.br_technology.securitytrain_master.ui.view.home.event.GetWorkTypeEvent 17 import com.br_technology.securitytrain_master.ui.view.home.event.GetWorkTypeEvent
12 import com.br_technology.securitytrain_master.ui.view.home.fragment.OnLiveCourseFragment 18 import com.br_technology.securitytrain_master.ui.view.home.fragment.OnLiveCourseFragment
13 -import com.br_technology.securitytrain_master.util.TYPE_All  
14 -import com.br_technology.securitytrain_master.util.TYPE_LIVE  
15 -import com.br_technology.securitytrain_master.util.sp_job_name 19 +import com.br_technology.securitytrain_master.util.*
16 import com.br_technology.securitytrain_master.view.ClassifyPop 20 import com.br_technology.securitytrain_master.view.ClassifyPop
  21 +import com.br_technology.securitytrain_master.view.DialogCheckIDCard
  22 +import com.br_technology.securitytrain_master.view.DialogTrainLoading
17 import com.br_technology.securitytrain_master.view.listener.ToolBarClickListener 23 import com.br_technology.securitytrain_master.view.listener.ToolBarClickListener
18 import com.google.android.material.tabs.TabLayout 24 import com.google.android.material.tabs.TabLayout
19 import com.gyf.immersionbar.ImmersionBar 25 import com.gyf.immersionbar.ImmersionBar
20 import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity 26 import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity
21 import org.greenrobot.eventbus.EventBus 27 import org.greenrobot.eventbus.EventBus
22 import org.greenrobot.eventbus.Subscribe 28 import org.greenrobot.eventbus.Subscribe
  29 +import java.io.File
23 30
24 /** 31 /**
25 * Time: 7/31/2021 10:43 32 * Time: 7/31/2021 10:43
26 * Author: Captain 33 * Author: Captain
27 - * Description: 初见时你很迷人 34 + * Description: 初见时你很迷人lessonLiveList()
28 */ 35 */
29 class LiveCourseActivity 36 class LiveCourseActivity
30 : 37 :
@@ -34,6 +41,49 @@ class LiveCourseActivity @@ -34,6 +41,49 @@ class LiveCourseActivity
34 ClassifyPop(this, TYPE_All) 41 ClassifyPop(this, TYPE_All)
35 } 42 }
36 43
  44 + private var isCheckFace: Boolean = false
  45 + private var dialogId: DialogCheckIDCard? = null
  46 + private var permissionCount = 0
  47 + private var fileUploadTemp: File? = null
  48 + private val faceUtil = FaceUtil()
  49 + private var dialogLoading: DialogTrainLoading? = null
  50 +
  51 + fun hasCheckFace(): Boolean {
  52 + return isCheckFace || company_is_check
  53 + }
  54 +
  55 + private fun dialogLoading() {
  56 + if (dialogLoading == null) {
  57 + dialogLoading = DialogTrainLoading(this)
  58 + }
  59 + dialogLoading!!.show()
  60 + }
  61 +
  62 + private fun dismissLoading() {
  63 + if (dialogLoading != null && dialogLoading!!.isShowing) {
  64 + dialogLoading!!.dismiss()
  65 + }
  66 + }
  67 +
  68 + override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
  69 + super.onActivityResult(requestCode, resultCode, data)
  70 + if (requestCode == FaceUtil.FRONT_CAPTURE_CODE) {
  71 + if (resultCode == Activity.RESULT_OK) {
  72 + permissionCount = 0
  73 + fileUploadTemp?.let {
  74 + faceUtil.compressFile(this, fileUploadTemp!!, object : FaceUtil.ICompress {
  75 + override fun compress(file: File) {
  76 + dialogLoading()
  77 + mViewModel.uploadFace(file.path)
  78 + }
  79 + })
  80 + }
  81 + } else {
  82 + dismissLoading()
  83 + }
  84 + }
  85 + }
  86 +
37 override fun initView() { 87 override fun initView() {
38 super.initView() 88 super.initView()
39 ImmersionBar.with(this@LiveCourseActivity).statusBarDarkFont(true).init(); 89 ImmersionBar.with(this@LiveCourseActivity).statusBarDarkFont(true).init();
@@ -49,6 +99,38 @@ class LiveCourseActivity @@ -49,6 +99,38 @@ class LiveCourseActivity
49 EventBus.getDefault().unregister(this) 99 EventBus.getDefault().unregister(this)
50 } 100 }
51 101
  102 + private fun showDialogId() {
  103 + if (dialogId == null) {
  104 + dialogId = DialogCheckIDCard(this)
  105 + dialogId!!.setListener({
  106 + dialogId!!.dismiss()
  107 + finish()
  108 + }, {
  109 + initPermissions(
  110 + Manifest.permission.CAMERA,
  111 + Manifest.permission.WRITE_EXTERNAL_STORAGE,
  112 + onGranted = {
  113 + if (permissionCount == 0) {
  114 + permissionCount++
  115 + if (CameraUtil.isSupportFrontCamera()) {
  116 + faceUtil.startCaptureFace(this, object : FaceUtil.ICapture {
  117 + override fun capture(file: File) {
  118 + fileUploadTemp = file
  119 + }
  120 + })
  121 + }
  122 + }
  123 + },
  124 + onDenied = {
  125 + dialogId!!.dismiss()
  126 + }, onDeniedNever = {
  127 + dialogId!!.dismiss()
  128 + })
  129 + })
  130 + }
  131 + dialogId!!.show()
  132 + }
  133 +
52 override fun initDataObserver() { 134 override fun initDataObserver() {
53 //岗位 135 //岗位
54 mViewModel.mWorkTypeBean.observe(this, { 136 mViewModel.mWorkTypeBean.observe(this, {
@@ -57,6 +139,35 @@ class LiveCourseActivity @@ -57,6 +139,35 @@ class LiveCourseActivity
57 classifyPop.showAsDropDown(binding.toolBar) 139 classifyPop.showAsDropDown(binding.toolBar)
58 } 140 }
59 }) 141 })
  142 + mViewModel.mFaceFile.observe(this, {
  143 + it.let {
  144 + if (!TextUtils.isEmpty(it.data.fullurl)) {
  145 + mViewModel.checkFace(it.data.fullurl)
  146 + } else {
  147 + showTip(it.msg)
  148 + if (dialogLoading != null) {
  149 + dialogLoading!!.dismiss()
  150 + }
  151 + }
  152 + }
  153 + })
  154 +
  155 + mViewModel.mFaceCheck.observe(this, {
  156 + if (dialogLoading != null) {
  157 + dialogLoading!!.dismiss()
  158 + }
  159 + it.let {
  160 + if (it.code == 1) {
  161 + if (dialogId != null) {
  162 + dialogId!!.dismiss()
  163 + }
  164 + isCheckFace = true
  165 + } else {
  166 + finish()
  167 + showTip(it.msg)
  168 + }
  169 + }
  170 + })
60 } 171 }
61 172
62 override fun initData() { 173 override fun initData() {
@@ -115,4 +226,9 @@ class LiveCourseActivity @@ -115,4 +226,9 @@ class LiveCourseActivity
115 binding.toolBar.setRightText(data.name) 226 binding.toolBar.setRightText(data.name)
116 } 227 }
117 } 228 }
  229 +
  230 + @Subscribe
  231 + fun eventCheck(data: CheckLiveFace) {
  232 + showDialogId()
  233 + }
118 } 234 }
@@ -36,7 +36,7 @@ class OnlineActivity : @@ -36,7 +36,7 @@ class OnlineActivity :
36 private val classifyPop by lazy { 36 private val classifyPop by lazy {
37 ClassifyPop(this, TYPE_All) 37 ClassifyPop(this, TYPE_All)
38 } 38 }
39 - private var posId: Int = sp_job_id_select 39 + private var posId: String = sp_job_id_select
40 var videoCourseAdapter: VideoCourseAdapter? = null 40 var videoCourseAdapter: VideoCourseAdapter? = null
41 override fun onCreate(savedInstanceState: Bundle?) { 41 override fun onCreate(savedInstanceState: Bundle?) {
42 super.onCreate(savedInstanceState) 42 super.onCreate(savedInstanceState)
1 package com.br_technology.securitytrain_master.ui.view.home.activity 1 package com.br_technology.securitytrain_master.ui.view.home.activity
2 2
  3 +import android.Manifest
  4 +import android.app.Activity
  5 +import android.content.Intent
3 import android.os.Bundle 6 import android.os.Bundle
  7 +import android.text.TextUtils
4 import android.view.View 8 import android.view.View
5 import androidx.fragment.app.FragmentPagerAdapter 9 import androidx.fragment.app.FragmentPagerAdapter
6 import com.br_technology.securitytrain_master.base.view.BasePagerAdapter 10 import com.br_technology.securitytrain_master.base.view.BasePagerAdapter
7 import com.br_technology.securitytrain_master.databinding.ActivitySearchBinding 11 import com.br_technology.securitytrain_master.databinding.ActivitySearchBinding
  12 +import com.br_technology.securitytrain_master.ext.initPermissions
8 import com.br_technology.securitytrain_master.ui.bean.SearchEvent 13 import com.br_technology.securitytrain_master.ui.bean.SearchEvent
9 import com.br_technology.securitytrain_master.ui.bean.SearchLog 14 import com.br_technology.securitytrain_master.ui.bean.SearchLog
10 import com.br_technology.securitytrain_master.ui.view.home.adapter.HistoryAdapter 15 import com.br_technology.securitytrain_master.ui.view.home.adapter.HistoryAdapter
  16 +import com.br_technology.securitytrain_master.ui.view.home.event.CheckSearchFace
11 import com.br_technology.securitytrain_master.ui.view.home.fragment.ResultFragment 17 import com.br_technology.securitytrain_master.ui.view.home.fragment.ResultFragment
12 import com.br_technology.securitytrain_master.ui.view.home.viewmodel.SearchViewModel 18 import com.br_technology.securitytrain_master.ui.view.home.viewmodel.SearchViewModel
  19 +import com.br_technology.securitytrain_master.util.CameraUtil
  20 +import com.br_technology.securitytrain_master.util.FaceUtil
  21 +import com.br_technology.securitytrain_master.util.company_is_check
  22 +import com.br_technology.securitytrain_master.view.DialogCheckIDCard
13 import com.br_technology.securitytrain_master.view.DialogSureCancel 23 import com.br_technology.securitytrain_master.view.DialogSureCancel
  24 +import com.br_technology.securitytrain_master.view.DialogTrainLoading
14 import com.br_technology.securitytrain_master.view.listener.DialogListener 25 import com.br_technology.securitytrain_master.view.listener.DialogListener
15 import com.br_technology.securitytrain_master.view.listener.OnItemClickListener 26 import com.br_technology.securitytrain_master.view.listener.OnItemClickListener
16 import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity 27 import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity
17 import org.greenrobot.eventbus.EventBus 28 import org.greenrobot.eventbus.EventBus
  29 +import org.greenrobot.eventbus.Subscribe
  30 +import java.io.File
18 31
19 /** 32 /**
20 * createTime:2021/7/28 11:13 33 * createTime:2021/7/28 11:13
@@ -23,6 +36,81 @@ import org.greenrobot.eventbus.EventBus @@ -23,6 +36,81 @@ import org.greenrobot.eventbus.EventBus
23 */ 36 */
24 class SearchActivity : 37 class SearchActivity :
25 BaseLifeCycleActivity<SearchViewModel, ActivitySearchBinding>(ActivitySearchBinding::inflate) { 38 BaseLifeCycleActivity<SearchViewModel, ActivitySearchBinding>(ActivitySearchBinding::inflate) {
  39 + private var isCheckFace: Boolean = false
  40 + private var dialogId: DialogCheckIDCard? = null
  41 + private var permissionCount = 0
  42 + private var fileUploadTemp: File? = null
  43 + private val faceUtil = FaceUtil()
  44 + private var dialogLoading: DialogTrainLoading? = null
  45 +
  46 + fun hasCheckFace(): Boolean {
  47 + return isCheckFace || company_is_check
  48 + }
  49 +
  50 + private fun dialogLoading() {
  51 + if (dialogLoading == null) {
  52 + dialogLoading = DialogTrainLoading(this)
  53 + }
  54 + dialogLoading!!.show()
  55 + }
  56 +
  57 + private fun dismissLoading() {
  58 + if (dialogLoading != null && dialogLoading!!.isShowing) {
  59 + dialogLoading!!.dismiss()
  60 + }
  61 + }
  62 +
  63 + override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
  64 + super.onActivityResult(requestCode, resultCode, data)
  65 + if (requestCode == FaceUtil.FRONT_CAPTURE_CODE) {
  66 + if (resultCode == Activity.RESULT_OK) {
  67 + permissionCount = 0
  68 + fileUploadTemp?.let {
  69 + faceUtil.compressFile(this, fileUploadTemp!!, object : FaceUtil.ICompress {
  70 + override fun compress(file: File) {
  71 + dialogLoading()
  72 + mViewModel.uploadFace(file.path)
  73 + }
  74 + })
  75 + }
  76 + } else {
  77 + dismissLoading()
  78 + }
  79 + }
  80 + }
  81 +
  82 + private fun showDialogId() {
  83 + if (dialogId == null) {
  84 + dialogId = DialogCheckIDCard(this)
  85 + dialogId!!.setListener({
  86 + dialogId!!.dismiss()
  87 + finish()
  88 + }, {
  89 + initPermissions(
  90 + Manifest.permission.CAMERA,
  91 + Manifest.permission.WRITE_EXTERNAL_STORAGE,
  92 + onGranted = {
  93 + if (permissionCount == 0) {
  94 + permissionCount++
  95 + if (CameraUtil.isSupportFrontCamera()) {
  96 + faceUtil.startCaptureFace(this, object : FaceUtil.ICapture {
  97 + override fun capture(file: File) {
  98 + fileUploadTemp = file
  99 + }
  100 + })
  101 + }
  102 + }
  103 + },
  104 + onDenied = {
  105 + dialogId!!.dismiss()
  106 + }, onDeniedNever = {
  107 + dialogId!!.dismiss()
  108 + })
  109 + })
  110 + }
  111 + dialogId!!.show()
  112 + }
  113 +
26 override fun onCreate(savedInstanceState: Bundle?) { 114 override fun onCreate(savedInstanceState: Bundle?) {
27 super.onCreate(savedInstanceState) 115 super.onCreate(savedInstanceState)
28 binding.apply { 116 binding.apply {
@@ -49,7 +137,8 @@ class SearchActivity : @@ -49,7 +137,8 @@ class SearchActivity :
49 search.setOnClickListener { 137 search.setOnClickListener {
50 // 点击搜索时隐藏历史记录 138 // 点击搜索时隐藏历史记录
51 showData(true) 139 showData(true)
52 - EventBus.getDefault().post(SearchEvent(searchEdit.text.toString())) 140 + EventBus.getDefault()
  141 + .post(SearchEvent(searchEdit.text.toString(), viewPager.currentItem))
53 } 142 }
54 143
55 searchEdit.setOnClickListener { 144 searchEdit.setOnClickListener {
@@ -75,6 +164,12 @@ class SearchActivity : @@ -75,6 +164,12 @@ class SearchActivity :
75 viewPager.offscreenPageLimit = 3 164 viewPager.offscreenPageLimit = 3
76 tabLayout.setupWithViewPager(viewPager) 165 tabLayout.setupWithViewPager(viewPager)
77 } 166 }
  167 + EventBus.getDefault().register(this)
  168 + }
  169 +
  170 + override fun onDestroy() {
  171 + super.onDestroy()
  172 + EventBus.getDefault().unregister(this)
78 } 173 }
79 174
80 override fun onResume() { 175 override fun onResume() {
@@ -103,15 +198,55 @@ class SearchActivity : @@ -103,15 +198,55 @@ class SearchActivity :
103 historyAdapter.addList(it.data.list) 198 historyAdapter.addList(it.data.list)
104 historyAdapter.addListener(object : OnItemClickListener<SearchLog> { 199 historyAdapter.addListener(object : OnItemClickListener<SearchLog> {
105 override fun onClick(position: Int, data: SearchLog) { 200 override fun onClick(position: Int, data: SearchLog) {
106 - EventBus.getDefault().post(SearchEvent(data.keyword)) 201 + binding.searchEdit.setText(data.keyword)
  202 + EventBus.getDefault()
  203 + .post(SearchEvent(data.keyword, binding.viewPager.currentItem))
107 showData(true) 204 showData(true)
108 } 205 }
109 }) 206 })
110 }) 207 })
111 mViewModel.clearData.observe(this, { 208 mViewModel.clearData.observe(this, {
112 mViewModel.searchLog() 209 mViewModel.searchLog()
113 - EventBus.getDefault().post(SearchEvent(""))  
114 - showData(true) 210 +// EventBus.getDefault().post(SearchEvent("", binding.viewPager.currentItem))
  211 +// showData(true)
115 }) 212 })
  213 + mViewModel.mFaceFile.observe(this, {
  214 + it.let {
  215 + if (!TextUtils.isEmpty(it.data.fullurl)) {
  216 + mViewModel.checkFace(it.data.fullurl)
  217 + } else {
  218 + showTip(it.msg)
  219 + if (dialogLoading != null) {
  220 + dialogLoading!!.dismiss()
  221 + }
  222 + }
  223 + }
  224 + })
  225 +
  226 + mViewModel.mFaceCheck.observe(this, {
  227 + if (dialogLoading != null) {
  228 + dialogLoading!!.dismiss()
  229 + }
  230 + it.let {
  231 + if (it.code == 1) {
  232 + if (dialogId != null) {
  233 + dialogId!!.dismiss()
  234 + }
  235 + isCheckFace = true
  236 + } else {
  237 + finish()
  238 + showTip(it.msg)
  239 + }
  240 + }
  241 + })
  242 + }
  243 +
  244 + fun getCurrentIndex(): SearchEvent {
  245 + return SearchEvent(binding.searchEdit.text.toString(), binding.viewPager.currentItem)
  246 + }
  247 +
  248 + @Subscribe
  249 + public fun searchFace(data: CheckSearchFace) {
  250 + showDialogId()
116 } 251 }
117 } 252 }
@@ -34,7 +34,7 @@ class TextCourseActivity : @@ -34,7 +34,7 @@ class TextCourseActivity :
34 private val classifyPop by lazy { 34 private val classifyPop by lazy {
35 ClassifyPop(this, TYPE_All) 35 ClassifyPop(this, TYPE_All)
36 } 36 }
37 - private var posId: Int = sp_job_id_select 37 + private var posId: String = sp_job_id_select
38 38
39 private fun loadData() { 39 private fun loadData() {
40 mViewModel.textLessons("", page, posId) 40 mViewModel.textLessons("", page, posId)
@@ -21,6 +21,7 @@ import com.br_technology.securitytrain_master.ui.view.home.fragment.OnlineDetail @@ -21,6 +21,7 @@ import com.br_technology.securitytrain_master.ui.view.home.fragment.OnlineDetail
21 import com.br_technology.securitytrain_master.ui.view.home.viewmodel.CourseDetailViewModel 21 import com.br_technology.securitytrain_master.ui.view.home.viewmodel.CourseDetailViewModel
22 import com.br_technology.securitytrain_master.util.CameraUtil 22 import com.br_technology.securitytrain_master.util.CameraUtil
23 import com.br_technology.securitytrain_master.util.FaceUtil 23 import com.br_technology.securitytrain_master.util.FaceUtil
  24 +import com.br_technology.securitytrain_master.util.company_is_check
24 import com.br_technology.securitytrain_master.view.DialogCheckIDCard 25 import com.br_technology.securitytrain_master.view.DialogCheckIDCard
25 import com.br_technology.securitytrain_master.view.DialogTrainLoading 26 import com.br_technology.securitytrain_master.view.DialogTrainLoading
26 import com.bumptech.glide.Glide 27 import com.bumptech.glide.Glide
@@ -28,7 +29,7 @@ import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity @@ -28,7 +29,7 @@ import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity
28 import java.io.File 29 import java.io.File
29 30
30 31
31 -/** 32 +/**AllItemApi.itemStart
32 * Time: 7/30/2021 13:56 33 * Time: 7/30/2021 13:56
33 * Author: Captain 34 * Author: Captain
34 * Description: 初见时你很迷人 35 * Description: 初见时你很迷人
@@ -41,7 +42,7 @@ class CourseDetailActivity @@ -41,7 +42,7 @@ class CourseDetailActivity
41 private var courseBean: CourseParam? = null 42 private var courseBean: CourseParam? = null
42 private var courseLesson: VideoLessonBean.ListBean.DataBean? = null 43 private var courseLesson: VideoLessonBean.ListBean.DataBean? = null
43 private var mWorkBean: WorkTypeBean? = null 44 private var mWorkBean: WorkTypeBean? = null
44 - private var mapWork = mutableMapOf<Int, WorkTypeBean.ListBean>() 45 + private var mapWork = mutableMapOf<String, WorkTypeBean.ListBean>()
45 46
46 private var dialogId: DialogCheckIDCard? = null 47 private var dialogId: DialogCheckIDCard? = null
47 private var permissionCount = 0 48 private var permissionCount = 0
@@ -166,6 +167,7 @@ class CourseDetailActivity @@ -166,6 +167,7 @@ class CourseDetailActivity
166 searchResultAdapter?.addTitle(titles) 167 searchResultAdapter?.addTitle(titles)
167 viewPager.adapter = searchResultAdapter 168 viewPager.adapter = searchResultAdapter
168 tabLayout.setupWithViewPager(viewPager) 169 tabLayout.setupWithViewPager(viewPager)
  170 + viewPager.currentItem = 1
169 } 171 }
170 }) 172 })
171 173
@@ -256,7 +258,7 @@ class CourseDetailActivity @@ -256,7 +258,7 @@ class CourseDetailActivity
256 private fun setPosName(posIds: String): String { 258 private fun setPosName(posIds: String): String {
257 val str = StringBuilder("适用于:") 259 val str = StringBuilder("适用于:")
258 for (data in posIds.split(",")) { 260 for (data in posIds.split(",")) {
259 - str.append(mapWork[data.toInt()]?.name).append(",") 261 + str.append(mapWork[data]?.name).append(",")
260 } 262 }
261 return str.toString().substring(0, str.toString().length - 1) 263 return str.toString().substring(0, str.toString().length - 1)
262 } 264 }
@@ -283,29 +285,33 @@ class CourseDetailActivity @@ -283,29 +285,33 @@ class CourseDetailActivity
283 when (it.type) { 285 when (it.type) {
284 TYPE_COURSE_DETAIL_ITEM_VIDEO -> { 286 TYPE_COURSE_DETAIL_ITEM_VIDEO -> {
285 mViewModel.videoLessonsDetail( 287 mViewModel.videoLessonsDetail(
286 - it.mLessonId.toInt(),  
287 - it.mTrainClassId.toInt() 288 + it.mLessonId,
  289 + it.mTrainClassId
288 ) 290 )
289 } 291 }
290 TYPE_COURSE_DETAIL_ITEM_NORMAL -> { 292 TYPE_COURSE_DETAIL_ITEM_NORMAL -> {
291 if (courseBean?.isTrainClass == true) { 293 if (courseBean?.isTrainClass == true) {
292 mViewModel.videoLessonsDetail( 294 mViewModel.videoLessonsDetail(
293 - it.mLessonId.toInt(),  
294 - it.mTrainClassId.toInt() 295 + it.mLessonId,
  296 + it.mTrainClassId
295 ) 297 )
296 } else { 298 } else {
297 - mViewModel.videoLessonNormal(it.mLessonId.toInt()) 299 + mViewModel.videoLessonNormal(it.mLessonId)
298 } 300 }
299 } 301 }
300 TYPE_COURSE_DETAIL_ITEM_LIVE -> { 302 TYPE_COURSE_DETAIL_ITEM_LIVE -> {
301 - mViewModel.liveLessonDetail(it.mLessonId.toInt()) 303 + mViewModel.liveLessonDetail(it.mLessonId)
302 } 304 }
303 TYPE_COURSE_DETAIL_ITEM_OFF -> { 305 TYPE_COURSE_DETAIL_ITEM_OFF -> {
304 - mViewModel.offLessonDetail(it.mLessonId.toInt()) 306 + mViewModel.offLessonDetail(it.mLessonId)
305 } 307 }
306 } 308 }
307 - if (it.type != TYPE_COURSE_DETAIL_ITEM_OFF && !it.isFinished) {  
308 - showDialogId() 309 + if (!company_is_check && it.type != TYPE_COURSE_DETAIL_ITEM_OFF && !it.isFinished) {
  310 + if (hasSetFace()) {
  311 + showDialogId()
  312 + } else {
  313 + toastSetFace()
  314 + }
309 } 315 }
310 } 316 }
311 }) 317 })
@@ -37,7 +37,7 @@ class CoursePractiseActivity : @@ -37,7 +37,7 @@ class CoursePractiseActivity :
37 private var courseBean: CourseParam? = null 37 private var courseBean: CourseParam? = null
38 38
39 private val mPagerAdapter = CourseTestPaperAdapter() 39 private val mPagerAdapter = CourseTestPaperAdapter()
40 - private var userItemId = 0 40 + private var userItemId = ""
41 private var isFinish = false 41 private var isFinish = false
42 private val titleDialog by lazy { 42 private val titleDialog by lazy {
43 DialogTitle(this) 43 DialogTitle(this)
@@ -75,9 +75,9 @@ class CoursePractiseActivity : @@ -75,9 +75,9 @@ class CoursePractiseActivity :
75 val isExam = intent.getBooleanExtra("isExam", false) 75 val isExam = intent.getBooleanExtra("isExam", false)
76 courseBean?.let { 76 courseBean?.let {
77 if (isExam) { 77 if (isExam) {
78 - mViewModel.startExam(it.mTrainClassId.toInt()) 78 + mViewModel.startExam(it.mTrainClassId)
79 } else { 79 } else {
80 - mViewModel.startPractise(it.mTrainClassId.toInt()) 80 + mViewModel.startPractise(it.mTrainClassId)
81 } 81 }
82 } 82 }
83 binding.apply { 83 binding.apply {
@@ -40,9 +40,9 @@ class TextDetailActivity : @@ -40,9 +40,9 @@ class TextDetailActivity :
40 courseBean = intent.getParcelableExtra(COURSE_BEAN) 40 courseBean = intent.getParcelableExtra(COURSE_BEAN)
41 courseBean?.let { course -> 41 courseBean?.let { course ->
42 if (course.isTrainClass) { 42 if (course.isTrainClass) {
43 - mViewModel.textLessonsDetail(course.mLessonId.toInt()) 43 + mViewModel.textLessonsDetail(course.mLessonId)
44 } else { 44 } else {
45 - mViewModel.materialDetail(course.mLessonId.toInt()) 45 + mViewModel.materialDetail(course.mLessonId)
46 } 46 }
47 binding.start.setOnClickListener { 47 binding.start.setOnClickListener {
48 if (course.isTrainClass) { 48 if (course.isTrainClass) {
@@ -24,20 +24,6 @@ class VideoDetailActivity : BaseLifeCycleActivity<VideoDetailViewModel, Activity @@ -24,20 +24,6 @@ class VideoDetailActivity : BaseLifeCycleActivity<VideoDetailViewModel, Activity
24 var courseBean: CourseParam? = null 24 var courseBean: CourseParam? = null
25 25
26 override fun initDataObserver() { 26 override fun initDataObserver() {
27 - mViewModel.mVideoLesson.observe(this, {  
28 - val url = it.data.detail.clazz[0].lessonclassdetail[0].video_url  
29 - val bool = it.data.detail.clazz[0].lessonclassdetail[0].is_complete == 1  
30 - binding.videoPlayer.apply {  
31 - initVideoBuilderMode(  
32 - "it.data.detail.image",  
33 - url,  
34 - this@VideoDetailActivity,  
35 - true,  
36 - lifecycle  
37 - )  
38 - setCantTouch(bool)  
39 - }  
40 - })  
41 } 27 }
42 28
43 override fun initView() { 29 override fun initView() {
@@ -58,10 +44,24 @@ class VideoDetailActivity : BaseLifeCycleActivity<VideoDetailViewModel, Activity @@ -58,10 +44,24 @@ class VideoDetailActivity : BaseLifeCycleActivity<VideoDetailViewModel, Activity
58 44
59 override fun initData() { 45 override fun initData() {
60 super.initData() 46 super.initData()
61 - val id = intent.getIntExtra(ConstantParamKey.LESSON_ID, 0) 47 + val id = intent.getStringExtra(ConstantParamKey.LESSON_ID)?:""
  48 + val detailId = intent.getStringExtra(ConstantParamKey.LESSON_DETAIL_ID)?:""
  49 + val url = intent.getStringExtra(ConstantParamKey.COURSE_LESSON)?:""
  50 + val bool = intent.getBooleanExtra(ConstantParamKey.LESSON_COMPLETE,false)
62 courseBean = intent.getParcelableExtra(ConstantParamKey.COURSE_BEAN) 51 courseBean = intent.getParcelableExtra(ConstantParamKey.COURSE_BEAN)
63 - mViewModel.videoLessonsDetail(id) 52 + courseBean?.mClassId = detailId
64 mViewModel.courseParam.value = courseBean 53 mViewModel.courseParam.value = courseBean
  54 +// mViewModel.videoDetail(detailId)
  55 + binding.videoPlayer.apply {
  56 + initVideoBuilderMode(
  57 + "it.data.detail.image",
  58 + url,
  59 + this@VideoDetailActivity,
  60 + true,
  61 + lifecycle
  62 + )
  63 + setCantTouch(bool)
  64 + }
65 } 65 }
66 66
67 fun timeGet(str: String): String { 67 fun timeGet(str: String): String {
@@ -79,5 +79,4 @@ class VideoDetailActivity : BaseLifeCycleActivity<VideoDetailViewModel, Activity @@ -79,5 +79,4 @@ class VideoDetailActivity : BaseLifeCycleActivity<VideoDetailViewModel, Activity
79 } 79 }
80 super.onBackPressed() 80 super.onBackPressed()
81 } 81 }
82 -  
83 } 82 }
@@ -5,6 +5,7 @@ import android.view.View @@ -5,6 +5,7 @@ import android.view.View
5 import android.widget.ImageView 5 import android.widget.ImageView
6 import android.widget.TextView 6 import android.widget.TextView
7 import com.br_technology.securitytrain_master.R 7 import com.br_technology.securitytrain_master.R
  8 +import com.br_technology.securitytrain_master.expand.TranslateUnit
8 import com.br_technology.securitytrain_master.expand.glideRound 9 import com.br_technology.securitytrain_master.expand.glideRound
9 import com.br_technology.securitytrain_master.ui.bean.LessonBean 10 import com.br_technology.securitytrain_master.ui.bean.LessonBean
10 import com.br_technology.securitytrain_master.ui.bean.LessonLive 11 import com.br_technology.securitytrain_master.ui.bean.LessonLive
@@ -43,6 +44,18 @@ class SearchAdapter : BaseMultiItemQuickAdapter<SearchBean, BaseViewHolder>() { @@ -43,6 +44,18 @@ class SearchAdapter : BaseMultiItemQuickAdapter<SearchBean, BaseViewHolder>() {
43 mClickItem = iClickItem 44 mClickItem = iClickItem
44 } 45 }
45 46
  47 + override fun onItemViewHolderCreated(viewHolder: BaseViewHolder, viewType: Int) {
  48 + super.onItemViewHolderCreated(viewHolder, viewType)
  49 + if (viewType == 0) {
  50 + val width =
  51 + (viewHolder.itemView.resources.displayMetrics.widthPixels - TranslateUnit.dp2px(
  52 + viewHolder.itemView.context,
  53 + 32f
  54 + ) - 15) / 2
  55 + viewHolder.getView<ImageView>(R.id.video_pic).layoutParams.width = width
  56 + }
  57 + }
  58 +
46 override fun convert(holder: BaseViewHolder, item: SearchBean) { 59 override fun convert(holder: BaseViewHolder, item: SearchBean) {
47 when (item.type) { 60 when (item.type) {
48 0 -> { 61 0 -> {
@@ -34,7 +34,7 @@ class VideoCourseListSecondProvider : BaseNodeProvider() { @@ -34,7 +34,7 @@ class VideoCourseListSecondProvider : BaseNodeProvider() {
34 context.startActivity( 34 context.startActivity(
35 Intent(context, VideoDetailActivity::class.java) 35 Intent(context, VideoDetailActivity::class.java)
36 .putExtra(ConstantParamKey.LESSON_ID, lessonDetailBean.lesson_id) 36 .putExtra(ConstantParamKey.LESSON_ID, lessonDetailBean.lesson_id)
37 - .putExtra("train_class_id", lessonDetailBean.lesson_id) 37 + .putExtra("train_class_id", "${lessonDetailBean.lesson_id}")
38 ) 38 )
39 } 39 }
40 } 40 }
@@ -19,9 +19,9 @@ public class WorkTypeBean { @@ -19,9 +19,9 @@ public class WorkTypeBean {
19 } 19 }
20 20
21 public static class ListBean { 21 public static class ListBean {
22 - private Integer id;  
23 - private Integer company_id;  
24 - private Integer department_id; 22 + private String id;
  23 + private String company_id;
  24 + private String department_id;
25 private String name; 25 private String name;
26 private Integer weigh; 26 private Integer weigh;
27 private Integer create_time; 27 private Integer create_time;
@@ -29,27 +29,27 @@ public class WorkTypeBean { @@ -29,27 +29,27 @@ public class WorkTypeBean {
29 private Object delete_time; 29 private Object delete_time;
30 private Integer is_choose; 30 private Integer is_choose;
31 31
32 - public Integer getId() { 32 + public String getId() {
33 return id; 33 return id;
34 } 34 }
35 35
36 - public void setId(Integer id) { 36 + public void setId(String id) {
37 this.id = id; 37 this.id = id;
38 } 38 }
39 39
40 - public Integer getCompany_id() { 40 + public String getCompany_id() {
41 return company_id; 41 return company_id;
42 } 42 }
43 43
44 - public void setCompany_id(Integer company_id) { 44 + public void setCompany_id(String company_id) {
45 this.company_id = company_id; 45 this.company_id = company_id;
46 } 46 }
47 47
48 - public Integer getDepartment_id() { 48 + public String getDepartment_id() {
49 return department_id; 49 return department_id;
50 } 50 }
51 51
52 - public void setDepartment_id(Integer department_id) { 52 + public void setDepartment_id(String department_id) {
53 this.department_id = department_id; 53 this.department_id = department_id;
54 } 54 }
55 55
@@ -5,12 +5,23 @@ package com.br_technology.securitytrain_master.ui.view.home.event @@ -5,12 +5,23 @@ package com.br_technology.securitytrain_master.ui.view.home.event
5 * Author: Captain 5 * Author: Captain
6 * Description: 初见时你很迷人 6 * Description: 初见时你很迷人
7 */ 7 */
8 -class GetWorkTypeEvent(var id: Int, var name: String, var type: Int) 8 +// 职位选择
  9 +class GetWorkTypeEvent(var id: String, var name: String, var type: Int)
9 10
  11 +// 课程页面状态选择
10 class StatusTypeEvent(var id: Int, var name: String) 12 class StatusTypeEvent(var id: Int, var name: String)
11 13
12 -class TransType(var id: Int) 14 +// 班级选择
  15 +class ClazzChangeEvent(var id: String)
13 16
14 -class CheckFace() 17 +// 直播课程类型切换
  18 +class TransType(var id: String)
15 19
  20 +// 直播页面人脸检测
  21 +class CheckLiveFace()
  22 +
  23 +// 搜索页面人脸检测
  24 +class CheckSearchFace()
  25 +
  26 +// 视频波安防页面进度刷新
16 class VideoClassChange(var lessonId: String, var isFinish: Boolean) 27 class VideoClassChange(var lessonId: String, var isFinish: Boolean)
@@ -4,6 +4,8 @@ import android.content.Intent @@ -4,6 +4,8 @@ import android.content.Intent
4 import com.br_technology.securitytrain_master.base.common.ConstantParamKey 4 import com.br_technology.securitytrain_master.base.common.ConstantParamKey
5 import com.br_technology.securitytrain_master.base.common.ConstantParamKey.COMMON_URL 5 import com.br_technology.securitytrain_master.base.common.ConstantParamKey.COMMON_URL
6 import com.br_technology.securitytrain_master.base.common.ConstantParamKey.COURSE_BEAN 6 import com.br_technology.securitytrain_master.base.common.ConstantParamKey.COURSE_BEAN
  7 +import com.br_technology.securitytrain_master.base.common.ConstantParamKey.LESSON_COMPLETE
  8 +import com.br_technology.securitytrain_master.base.common.ConstantParamKey.LESSON_DETAIL_ID
7 import com.br_technology.securitytrain_master.base.common.ConstantParamKey.LESSON_ID 9 import com.br_technology.securitytrain_master.base.common.ConstantParamKey.LESSON_ID
8 import com.br_technology.securitytrain_master.databinding.FragmentCourseListBinding 10 import com.br_technology.securitytrain_master.databinding.FragmentCourseListBinding
9 import com.br_technology.securitytrain_master.ui.bean.TrainCourseData 11 import com.br_technology.securitytrain_master.ui.bean.TrainCourseData
@@ -53,7 +55,7 @@ class CourseListFragment(var courseData: TrainCourseData, var tranClassId: Strin @@ -53,7 +55,7 @@ class CourseListFragment(var courseData: TrainCourseData, var tranClassId: Strin
53 courseData.lessonBean?.apply { 55 courseData.lessonBean?.apply {
54 for ((index, p) in class_list.withIndex()) { 56 for ((index, p) in class_list.withIndex()) {
55 if (p.lesson_id == search.lessonId) { 57 if (p.lesson_id == search.lessonId) {
56 - if (p.lessonclassdetail.isNotEmpty()){ 58 + if (p.lessonclassdetail.isNotEmpty()) {
57 p.lessonclassdetail[0].is_complete = 1 59 p.lessonclassdetail[0].is_complete = 1
58 } 60 }
59 adapter.notifyItemChanged(index) 61 adapter.notifyItemChanged(index)
@@ -110,7 +112,12 @@ class CourseListFragment(var courseData: TrainCourseData, var tranClassId: Strin @@ -110,7 +112,12 @@ class CourseListFragment(var courseData: TrainCourseData, var tranClassId: Strin
110 startActivity( 112 startActivity(
111 Intent(activity, VideoDetailActivity::class.java) 113 Intent(activity, VideoDetailActivity::class.java)
112 .putExtra(COMMON_URL, item.lessonVideoChild?.video_url) 114 .putExtra(COMMON_URL, item.lessonVideoChild?.video_url)
113 - .putExtra(LESSON_ID, item.lessonVideoChild?.lesson_id?.toInt()) 115 + .putExtra(LESSON_ID, item.lessonVideoChild?.lesson_id)
  116 + .putExtra(LESSON_DETAIL_ID, item.lessonVideoChild?.id)
  117 + .putExtra(
  118 + LESSON_COMPLETE,
  119 + item.lessonVideoChild?.is_complete == 1
  120 + )
114 .putExtra(COURSE_BEAN, param) 121 .putExtra(COURSE_BEAN, param)
115 ) 122 )
116 } 123 }
@@ -121,8 +128,13 @@ class CourseListFragment(var courseData: TrainCourseData, var tranClassId: Strin @@ -121,8 +128,13 @@ class CourseListFragment(var courseData: TrainCourseData, var tranClassId: Strin
121 .putExtra(COMMON_URL, item.lessonVideoNormalChild?.video_url) 128 .putExtra(COMMON_URL, item.lessonVideoNormalChild?.video_url)
122 .putExtra( 129 .putExtra(
123 LESSON_ID, 130 LESSON_ID,
124 - item.lessonVideoNormalChild?.lesson_id?.toInt() 131 + item.lessonVideoNormalChild?.lesson_id
  132 + )
  133 + .putExtra(
  134 + LESSON_COMPLETE,
  135 + item.lessonVideoChild?.is_complete == 1
125 ) 136 )
  137 + .putExtra(LESSON_DETAIL_ID, item.lessonVideoChild?.id)
126 .putExtra( 138 .putExtra(
127 COURSE_BEAN, 139 COURSE_BEAN,
128 (activity as CourseDetailActivity).getCourseBean() 140 (activity as CourseDetailActivity).getCourseBean()
@@ -226,7 +226,7 @@ class HomeFragment : @@ -226,7 +226,7 @@ class HomeFragment :
226 override fun onClick(position: Int, data: RecommendBean.ListBean) { 226 override fun onClick(position: Int, data: RecommendBean.ListBean) {
227 startActivity( 227 startActivity(
228 Intent(requireContext(), DatabaseDetailActivity::class.java) 228 Intent(requireContext(), DatabaseDetailActivity::class.java)
229 - .putExtra(DOC_ID, data.id) 229 + .putExtra(DOC_ID, data.id.toString())
230 ) 230 )
231 } 231 }
232 }) 232 })
@@ -7,11 +7,14 @@ import com.br_technology.securitytrain_master.R @@ -7,11 +7,14 @@ import com.br_technology.securitytrain_master.R
7 import com.br_technology.securitytrain_master.databinding.FragmentOnliveCourseBinding 7 import com.br_technology.securitytrain_master.databinding.FragmentOnliveCourseBinding
8 import com.br_technology.securitytrain_master.expand.addItemDecoration2 8 import com.br_technology.securitytrain_master.expand.addItemDecoration2
9 import com.br_technology.securitytrain_master.ui.bean.LessonLiveBean 9 import com.br_technology.securitytrain_master.ui.bean.LessonLiveBean
  10 +import com.br_technology.securitytrain_master.ui.view.home.activity.LiveCourseActivity
10 import com.br_technology.securitytrain_master.ui.view.home.adapter.LiveAdapter 11 import com.br_technology.securitytrain_master.ui.view.home.adapter.LiveAdapter
  12 +import com.br_technology.securitytrain_master.ui.view.home.event.CheckLiveFace
11 import com.br_technology.securitytrain_master.ui.view.home.event.TransType 13 import com.br_technology.securitytrain_master.ui.view.home.event.TransType
12 import com.br_technology.securitytrain_master.ui.view.home.viewmodel.OnLiveCourseFragmentViewModel 14 import com.br_technology.securitytrain_master.ui.view.home.viewmodel.OnLiveCourseFragmentViewModel
13 import com.br_technology.securitytrain_master.ui.view.mine.activity.LiveWebActivity 15 import com.br_technology.securitytrain_master.ui.view.mine.activity.LiveWebActivity
14 import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleFragment 16 import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleFragment
  17 +import org.greenrobot.eventbus.EventBus
15 import org.greenrobot.eventbus.Subscribe 18 import org.greenrobot.eventbus.Subscribe
16 19
17 /** 20 /**
@@ -84,6 +87,15 @@ class OnLiveCourseFragment @@ -84,6 +87,15 @@ class OnLiveCourseFragment
84 url = adapter.data.get(position).lessonlive.playback_url 87 url = adapter.data.get(position).lessonlive.playback_url
85 } 88 }
86 if (status == "1") { 89 if (status == "1") {
  90 + if (!(activity as LiveCourseActivity).hasCheckFace()) {
  91 + if (!(activity as LiveCourseActivity).hasSetFace()) {
  92 + (activity as LiveCourseActivity).toastSetFace()
  93 + return@setOnItemClickListener
  94 + } else {
  95 + EventBus.getDefault().post(CheckLiveFace())
  96 + return@setOnItemClickListener
  97 + }
  98 + }
87 url = adapter.data.get(position).playerUrl 99 url = adapter.data.get(position).playerUrl
88 } 100 }
89 val title = adapter.data[position].name 101 val title = adapter.data[position].name
@@ -95,7 +107,6 @@ class OnLiveCourseFragment @@ -95,7 +107,6 @@ class OnLiveCourseFragment
95 } 107 }
96 } 108 }
97 109
98 -  
99 override fun onResume() { 110 override fun onResume() {
100 super.onResume() 111 super.onResume()
101 if (map[type] == true) { 112 if (map[type] == true) {
@@ -7,14 +7,17 @@ import androidx.recyclerview.widget.GridLayoutManager @@ -7,14 +7,17 @@ import androidx.recyclerview.widget.GridLayoutManager
7 import androidx.recyclerview.widget.LinearLayoutManager 7 import androidx.recyclerview.widget.LinearLayoutManager
8 import com.br_technology.securitytrain_master.base.common.ConstantParamKey 8 import com.br_technology.securitytrain_master.base.common.ConstantParamKey
9 import com.br_technology.securitytrain_master.databinding.FragmentResultBinding 9 import com.br_technology.securitytrain_master.databinding.FragmentResultBinding
  10 +import com.br_technology.securitytrain_master.expand.addItemDecoration2
10 import com.br_technology.securitytrain_master.expand.addItemDecorationCustom 11 import com.br_technology.securitytrain_master.expand.addItemDecorationCustom
11 import com.br_technology.securitytrain_master.ui.bean.* 12 import com.br_technology.securitytrain_master.ui.bean.*
12 import com.br_technology.securitytrain_master.ui.view.home.activity.DatabaseDetailActivity 13 import com.br_technology.securitytrain_master.ui.view.home.activity.DatabaseDetailActivity
  14 +import com.br_technology.securitytrain_master.ui.view.home.activity.SearchActivity
13 import com.br_technology.securitytrain_master.ui.view.home.activity.course.CourseDetailActivity 15 import com.br_technology.securitytrain_master.ui.view.home.activity.course.CourseDetailActivity
14 import com.br_technology.securitytrain_master.ui.view.home.activity.course.TextDetailActivity 16 import com.br_technology.securitytrain_master.ui.view.home.activity.course.TextDetailActivity
15 import com.br_technology.securitytrain_master.ui.view.home.adapter.SearchAdapter 17 import com.br_technology.securitytrain_master.ui.view.home.adapter.SearchAdapter
16 import com.br_technology.securitytrain_master.ui.view.home.bean.RecommendBean 18 import com.br_technology.securitytrain_master.ui.view.home.bean.RecommendBean
17 import com.br_technology.securitytrain_master.ui.view.home.bean.VideoLessonBean 19 import com.br_technology.securitytrain_master.ui.view.home.bean.VideoLessonBean
  20 +import com.br_technology.securitytrain_master.ui.view.home.event.CheckSearchFace
18 import com.br_technology.securitytrain_master.ui.view.home.viewmodel.ResultViewModel 21 import com.br_technology.securitytrain_master.ui.view.home.viewmodel.ResultViewModel
19 import com.br_technology.securitytrain_master.ui.view.mine.activity.LiveWebActivity 22 import com.br_technology.securitytrain_master.ui.view.mine.activity.LiveWebActivity
20 import com.br_technology.securitytrain_master.util.TranslateUnit 23 import com.br_technology.securitytrain_master.util.TranslateUnit
@@ -43,6 +46,7 @@ class ResultFragment(val type: Int) : @@ -43,6 +46,7 @@ class ResultFragment(val type: Int) :
43 } 46 }
44 ResultViewModel.ResultType.TYPE_ONE -> { 47 ResultViewModel.ResultType.TYPE_ONE -> {
45 str = "暂无直播课程" 48 str = "暂无直播课程"
  49 + binding.result.setPadding(0, 0, 0, 0)
46 } 50 }
47 ResultViewModel.ResultType.TYPE_TWO -> { 51 ResultViewModel.ResultType.TYPE_TWO -> {
48 str = "暂无文本课程" 52 str = "暂无文本课程"
@@ -55,8 +59,13 @@ class ResultFragment(val type: Int) : @@ -55,8 +59,13 @@ class ResultFragment(val type: Int) :
55 binding.apply { 59 binding.apply {
56 when (type) { 60 when (type) {
57 0 -> { 61 0 -> {
58 - result.addItemDecorationCustom(TranslateUnit.dp2px(context, 16f))  
59 - result.layoutManager = GridLayoutManager(requireActivity(), 2) 62 + result.addItemDecoration2(
  63 + 2,
  64 + 15,
  65 + 15
  66 + )
  67 + val gridLayoutManager = GridLayoutManager(requireActivity(), 2)
  68 + result.layoutManager = gridLayoutManager
60 } 69 }
61 else -> { 70 else -> {
62 result.addItemDecorationCustom(TranslateUnit.dp2px(context, 16f)) 71 result.addItemDecorationCustom(TranslateUnit.dp2px(context, 16f))
@@ -64,12 +73,17 @@ class ResultFragment(val type: Int) : @@ -64,12 +73,17 @@ class ResultFragment(val type: Int) :
64 } 73 }
65 } 74 }
66 } 75 }
  76 + binding.smartRefresh.setOnRefreshListener {
  77 + search((activity as SearchActivity).getCurrentIndex())
  78 + }
67 } 79 }
68 80
69 var searchAdapter: SearchAdapter? = null 81 var searchAdapter: SearchAdapter? = null
70 82
71 override fun initData() { 83 override fun initData() {
72 super.initData() 84 super.initData()
  85 + val searchEvent = (activity as SearchActivity).getCurrentIndex()
  86 + keywords = searchEvent.search
73 refresh() 87 refresh()
74 } 88 }
75 89
@@ -115,7 +129,6 @@ class ResultFragment(val type: Int) : @@ -115,7 +129,6 @@ class ResultFragment(val type: Int) :
115 } else { 129 } else {
116 View.VISIBLE 130 View.VISIBLE
117 } 131 }
118 -  
119 } 132 }
120 133
121 private fun transData(data: List<Any>): List<SearchBean> { 134 private fun transData(data: List<Any>): List<SearchBean> {
@@ -162,7 +175,9 @@ class ResultFragment(val type: Int) : @@ -162,7 +175,9 @@ class ResultFragment(val type: Int) :
162 @Subscribe 175 @Subscribe
163 fun search(search: SearchEvent) { 176 fun search(search: SearchEvent) {
164 keywords = search.search 177 keywords = search.search
165 - refresh() 178 + if (search.index == type) {
  179 + refresh()
  180 + }
166 } 181 }
167 182
168 override fun clickItem(item: SearchBean) { 183 override fun clickItem(item: SearchBean) {
@@ -181,12 +196,33 @@ class ResultFragment(val type: Int) : @@ -181,12 +196,33 @@ class ResultFragment(val type: Int) :
181 ) 196 )
182 } 197 }
183 ResultViewModel.ResultType.TYPE_ONE -> { 198 ResultViewModel.ResultType.TYPE_ONE -> {
184 - 199 + val status = item.liveData?.live_status ?: "3"
  200 + if (status == "3") {
  201 + showTip("还未开播")
  202 + return
  203 + }
  204 + var url = ""
  205 + if (status == "2") {
  206 + url = item.liveData?.webrtc_url ?: ""
  207 + }
  208 + if (status == "1") {
  209 + if (!(activity as SearchActivity).hasCheckFace()) {
  210 + if ((activity as SearchActivity).hasSetFace()) {
  211 + EventBus.getDefault().post(CheckSearchFace())
  212 + return
  213 + } else {
  214 + (activity as SearchActivity).toastSetFace()
  215 + return
  216 + }
  217 + }
  218 + url = item.liveData?.webrtc_url ?: ""
  219 + }
  220 + val title = item.liveData?.name
185 //todo 直播未写 221 //todo 直播未写
186 // val title = item.videoData 222 // val title = item.videoData
187 val intent = Intent(requireActivity(), LiveWebActivity::class.java) 223 val intent = Intent(requireActivity(), LiveWebActivity::class.java)
188 -// intent.putExtra("url", url)  
189 -// intent.putExtra("title", title) 224 + intent.putExtra("url", url)
  225 + intent.putExtra("title", title)
190 startActivity(intent) 226 startActivity(intent)
191 } 227 }
192 ResultViewModel.ResultType.TYPE_TWO -> { 228 ResultViewModel.ResultType.TYPE_TWO -> {
@@ -211,5 +247,4 @@ class ResultFragment(val type: Int) : @@ -211,5 +247,4 @@ class ResultFragment(val type: Int) :
211 } 247 }
212 } 248 }
213 } 249 }
214 -  
215 } 250 }
@@ -2,10 +2,10 @@ package com.br_technology.securitytrain_master.ui.view.home.repository @@ -2,10 +2,10 @@ package com.br_technology.securitytrain_master.ui.view.home.repository
2 2
3 import androidx.lifecycle.MutableLiveData 3 import androidx.lifecycle.MutableLiveData
4 import com.br_technology.securitytrain_master.base.common.State 4 import com.br_technology.securitytrain_master.base.common.State
  5 +import com.br_technology.securitytrain_master.base.network.response.BaseResponse
5 import com.br_technology.securitytrain_master.base.repository.ApiRepository 6 import com.br_technology.securitytrain_master.base.repository.ApiRepository
6 import com.br_technology.securitytrain_master.ui.view.home.bean.VideoLessonDetailBean 7 import com.br_technology.securitytrain_master.ui.view.home.bean.VideoLessonDetailBean
7 import com.wjx.android.wanandroidmvvm.base.observer.BaseObserver 8 import com.wjx.android.wanandroidmvvm.base.observer.BaseObserver
8 -import com.br_technology.securitytrain_master.base.network.response.BaseResponse  
9 import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers 9 import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
10 import io.reactivex.rxjava3.schedulers.Schedulers 10 import io.reactivex.rxjava3.schedulers.Schedulers
11 11
@@ -16,7 +16,7 @@ import io.reactivex.rxjava3.schedulers.Schedulers @@ -16,7 +16,7 @@ import io.reactivex.rxjava3.schedulers.Schedulers
16 */ 16 */
17 class OnlineDetailRepository (val loadState: MutableLiveData<State>): ApiRepository(loadState) { 17 class OnlineDetailRepository (val loadState: MutableLiveData<State>): ApiRepository(loadState) {
18 fun videoLessonsDetail( 18 fun videoLessonsDetail(
19 - id: Int, 19 + id: String,
20 liveData: MutableLiveData<BaseResponse<VideoLessonDetailBean>> 20 liveData: MutableLiveData<BaseResponse<VideoLessonDetailBean>>
21 ) { 21 ) {
22 apiService.videoLessonsDetail(id) 22 apiService.videoLessonsDetail(id)
@@ -2,11 +2,11 @@ package com.br_technology.securitytrain_master.ui.view.home.repository @@ -2,11 +2,11 @@ package com.br_technology.securitytrain_master.ui.view.home.repository
2 2
3 import androidx.lifecycle.MutableLiveData 3 import androidx.lifecycle.MutableLiveData
4 import com.br_technology.securitytrain_master.base.common.State 4 import com.br_technology.securitytrain_master.base.common.State
  5 +import com.br_technology.securitytrain_master.base.network.response.BaseResponse
5 import com.br_technology.securitytrain_master.base.repository.ApiRepository 6 import com.br_technology.securitytrain_master.base.repository.ApiRepository
6 import com.br_technology.securitytrain_master.ui.view.home.bean.VideoLessonBean 7 import com.br_technology.securitytrain_master.ui.view.home.bean.VideoLessonBean
7 import com.br_technology.securitytrain_master.ui.view.home.bean.WorkTypeBean 8 import com.br_technology.securitytrain_master.ui.view.home.bean.WorkTypeBean
8 import com.wjx.android.wanandroidmvvm.base.observer.BaseObserver 9 import com.wjx.android.wanandroidmvvm.base.observer.BaseObserver
9 -import com.br_technology.securitytrain_master.base.network.response.BaseResponse  
10 import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers 10 import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
11 import io.reactivex.rxjava3.schedulers.Schedulers 11 import io.reactivex.rxjava3.schedulers.Schedulers
12 12
@@ -19,7 +19,7 @@ class OnlineRepository(val loadState: MutableLiveData<State>): ApiRepository(loa @@ -19,7 +19,7 @@ class OnlineRepository(val loadState: MutableLiveData<State>): ApiRepository(loa
19 fun videoLessons( 19 fun videoLessons(
20 is_rec: Int, 20 is_rec: Int,
21 keyword: String, 21 keyword: String,
22 - pos_id: Int, 22 + pos_id: String,
23 page: Int, 23 page: Int,
24 page_num: Int, 24 page_num: Int,
25 liveData: MutableLiveData<BaseResponse<VideoLessonBean>> 25 liveData: MutableLiveData<BaseResponse<VideoLessonBean>>
@@ -2,11 +2,11 @@ package com.br_technology.securitytrain_master.ui.view.home.repository @@ -2,11 +2,11 @@ package com.br_technology.securitytrain_master.ui.view.home.repository
2 2
3 import androidx.lifecycle.MutableLiveData 3 import androidx.lifecycle.MutableLiveData
4 import com.br_technology.securitytrain_master.base.common.State 4 import com.br_technology.securitytrain_master.base.common.State
  5 +import com.br_technology.securitytrain_master.base.network.response.BaseResponse
5 import com.br_technology.securitytrain_master.base.repository.ApiRepository 6 import com.br_technology.securitytrain_master.base.repository.ApiRepository
6 import com.br_technology.securitytrain_master.ui.view.home.bean.TextLessonBean 7 import com.br_technology.securitytrain_master.ui.view.home.bean.TextLessonBean
7 import com.br_technology.securitytrain_master.ui.view.home.bean.WorkTypeBean 8 import com.br_technology.securitytrain_master.ui.view.home.bean.WorkTypeBean
8 import com.wjx.android.wanandroidmvvm.base.observer.BaseObserver 9 import com.wjx.android.wanandroidmvvm.base.observer.BaseObserver
9 -import com.br_technology.securitytrain_master.base.network.response.BaseResponse  
10 import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers 10 import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
11 import io.reactivex.rxjava3.schedulers.Schedulers 11 import io.reactivex.rxjava3.schedulers.Schedulers
12 12
@@ -18,7 +18,7 @@ import io.reactivex.rxjava3.schedulers.Schedulers @@ -18,7 +18,7 @@ import io.reactivex.rxjava3.schedulers.Schedulers
18 class TextCourseRepository(val loadState: MutableLiveData<State>): ApiRepository(loadState) { 18 class TextCourseRepository(val loadState: MutableLiveData<State>): ApiRepository(loadState) {
19 fun textLessons( 19 fun textLessons(
20 keyword: String, 20 keyword: String,
21 - pos_id: Int, 21 + pos_id: String,
22 page: Int, 22 page: Int,
23 page_num: Int, 23 page_num: Int,
24 liveData: MutableLiveData<BaseResponse<TextLessonBean>> 24 liveData: MutableLiveData<BaseResponse<TextLessonBean>>
@@ -24,21 +24,21 @@ class CourseDetailViewModel : BaseViewModel<LessonRepository>() { @@ -24,21 +24,21 @@ class CourseDetailViewModel : BaseViewModel<LessonRepository>() {
24 var mFaceCheck = MutableLiveData<BaseResponse<Void>>() 24 var mFaceCheck = MutableLiveData<BaseResponse<Void>>()
25 25
26 fun videoLessonsDetail( 26 fun videoLessonsDetail(
27 - id: Int,  
28 - trainClassId: Int 27 + id: String,
  28 + trainClassId: String
29 ) { 29 ) {
30 - mRepository.lessonVideoDetail(id,trainClassId, mVideoLesson) 30 + mRepository.lessonVideoDetail(id, trainClassId, mVideoLesson)
31 } 31 }
32 32
33 - fun videoLessonNormal(id: Int) { 33 + fun videoLessonNormal(id: String) {
34 mRepository.videoDetail(id, mVideoLessonNormal) 34 mRepository.videoDetail(id, mVideoLessonNormal)
35 } 35 }
36 36
37 - fun liveLessonDetail(id: Int) { 37 + fun liveLessonDetail(id: String) {
38 mRepository.lessonLiveDetail(id, mLiveLesson) 38 mRepository.lessonLiveDetail(id, mLiveLesson)
39 } 39 }
40 40
41 - fun offLessonDetail(id: Int) { 41 + fun offLessonDetail(id: String) {
42 mRepository.lessonOffDetail(id, mLessonOff) 42 mRepository.lessonOffDetail(id, mLessonOff)
43 } 43 }
44 44
@@ -35,29 +35,29 @@ class CoursePracticeViewModel : BaseViewModel<TrainRepository>() { @@ -35,29 +35,29 @@ class CoursePracticeViewModel : BaseViewModel<TrainRepository>() {
35 35
36 // 开始练习 36 // 开始练习
37 fun startPractise( 37 fun startPractise(
38 - train_practise_id: Int, 38 + train_practise_id: String,
39 ) { 39 ) {
40 mRepository.startPractise(train_practise_id, exam) 40 mRepository.startPractise(train_practise_id, exam)
41 } 41 }
42 42
43 // 开始答题 43 // 开始答题
44 fun startExam( 44 fun startExam(
45 - train_practise_id: Int, 45 + train_practise_id: String,
46 ) { 46 ) {
47 mRepository.startExamExp(train_practise_id, exam) 47 mRepository.startExamExp(train_practise_id, exam)
48 } 48 }
49 49
50 // 提交某一题 50 // 提交某一题
51 fun subSingle( 51 fun subSingle(
52 - user_item_id: Int,  
53 - item_id: Int, 52 + user_item_id: String,
  53 + item_id: String,
54 answer: String, 54 answer: String,
55 ) { 55 ) {
56 mRepository.subSingle(user_item_id, item_id, answer, subSingleData) 56 mRepository.subSingle(user_item_id, item_id, answer, subSingleData)
57 } 57 }
58 58
59 // 提交答卷 59 // 提交答卷
60 - fun subFinish(user_item_id: Int) { 60 + fun subFinish(user_item_id: String) {
61 mRepository.subPaper(user_item_id, subFinish) 61 mRepository.subPaper(user_item_id, subFinish)
62 } 62 }
63 } 63 }
@@ -16,7 +16,7 @@ class DatabaseDetailViewModel : BaseViewModel<LessonRepository>() { @@ -16,7 +16,7 @@ class DatabaseDetailViewModel : BaseViewModel<LessonRepository>() {
16 var mDetailMaterialNormal = MutableLiveData<BaseResponse<CommonDetail<MaterialDetail>>>() 16 var mDetailMaterialNormal = MutableLiveData<BaseResponse<CommonDetail<MaterialDetail>>>()
17 var collectResponse = MutableLiveData<BaseResponse<Void>>() 17 var collectResponse = MutableLiveData<BaseResponse<Void>>()
18 18
19 - fun materialDetail(id: Int) { 19 + fun materialDetail(id: String) {
20 mRepository.materialDetail(id, mDetailMaterialNormal) 20 mRepository.materialDetail(id, mDetailMaterialNormal)
21 } 21 }
22 22
@@ -19,7 +19,7 @@ class OnlineViewModel : BaseViewModel<OnlineRepository>() { @@ -19,7 +19,7 @@ class OnlineViewModel : BaseViewModel<OnlineRepository>() {
19 is_rec: Int, 19 is_rec: Int,
20 keyword: String, 20 keyword: String,
21 page: Int, 21 page: Int,
22 - pos_id: Int 22 + pos_id: String
23 ) { 23 ) {
24 mRepository.videoLessons(is_rec, keyword, pos_id, page, 10, mVideoLessonBean) 24 mRepository.videoLessons(is_rec, keyword, pos_id, page, 10, mVideoLessonBean)
25 } 25 }
@@ -10,7 +10,6 @@ import com.br_technology.securitytrain_master.ui.bean.LessonBean @@ -10,7 +10,6 @@ import com.br_technology.securitytrain_master.ui.bean.LessonBean
10 import com.br_technology.securitytrain_master.ui.bean.LessonLive 10 import com.br_technology.securitytrain_master.ui.bean.LessonLive
11 import com.br_technology.securitytrain_master.ui.bean.MaterialPage 11 import com.br_technology.securitytrain_master.ui.bean.MaterialPage
12 import com.br_technology.securitytrain_master.ui.view.home.bean.VideoLessonBean 12 import com.br_technology.securitytrain_master.ui.view.home.bean.VideoLessonBean
13 -import com.br_technology.securitytrain_master.util.sp_job_id  
14 13
15 /** 14 /**
16 * createTime:2021/7/27 15:48 15 * createTime:2021/7/27 15:48
@@ -55,7 +54,7 @@ class ResultViewModel : BaseViewModel<LessonRepository>() { @@ -55,7 +54,7 @@ class ResultViewModel : BaseViewModel<LessonRepository>() {
55 keyword: String, 54 keyword: String,
56 page: Int 55 page: Int
57 ) { 56 ) {
58 - mRepository.searchVideoList(keyword, sp_job_id.toString(), page, 10, videoData) 57 + mRepository.searchVideoList(keyword, page, 10, videoData)
59 } 58 }
60 59
61 fun searchLiveList( 60 fun searchLiveList(
@@ -69,13 +68,13 @@ class ResultViewModel : BaseViewModel<LessonRepository>() { @@ -69,13 +68,13 @@ class ResultViewModel : BaseViewModel<LessonRepository>() {
69 keyword: String, 68 keyword: String,
70 page: Int 69 page: Int
71 ) { 70 ) {
72 - mRepository.searchTxtList(keyword, sp_job_id, page, 10, txtData) 71 + mRepository.searchTxtList(keyword, page, 10, txtData)
73 } 72 }
74 73
75 fun searchMaterialList( 74 fun searchMaterialList(
76 keyword: String, 75 keyword: String,
77 page: Int 76 page: Int
78 ) { 77 ) {
79 - mRepository.searchMaterialList(keyword, sp_job_id, page, 10, materialData) 78 + mRepository.searchMaterialList(keyword, page, 10, materialData)
80 } 79 }
81 } 80 }
@@ -6,6 +6,7 @@ import com.br_technology.securitytrain_master.base.network.response.CommonList @@ -6,6 +6,7 @@ import com.br_technology.securitytrain_master.base.network.response.CommonList
6 import com.br_technology.securitytrain_master.base.repository.CommonRepository 6 import com.br_technology.securitytrain_master.base.repository.CommonRepository
7 import com.br_technology.securitytrain_master.base.view.BaseViewModel 7 import com.br_technology.securitytrain_master.base.view.BaseViewModel
8 import com.br_technology.securitytrain_master.ui.bean.SearchLog 8 import com.br_technology.securitytrain_master.ui.bean.SearchLog
  9 +import com.br_technology.securitytrain_master.ui.bean.UploadFileData
9 10
10 /** 11 /**
11 * createTime:2021/7/27 15:48 12 * createTime:2021/7/27 15:48
@@ -17,6 +18,9 @@ class SearchViewModel : BaseViewModel<CommonRepository>() { @@ -17,6 +18,9 @@ class SearchViewModel : BaseViewModel<CommonRepository>() {
17 val liveData = MutableLiveData<BaseResponse<CommonList<SearchLog>>>() 18 val liveData = MutableLiveData<BaseResponse<CommonList<SearchLog>>>()
18 val clearData = MutableLiveData<BaseResponse<CommonList<SearchLog>>>() 19 val clearData = MutableLiveData<BaseResponse<CommonList<SearchLog>>>()
19 20
  21 + var mFaceFile = MutableLiveData<BaseResponse<UploadFileData>>()
  22 + var mFaceCheck = MutableLiveData<BaseResponse<Void>>()
  23 +
20 fun searchLog() { 24 fun searchLog() {
21 mRepository.searchLog(liveData) 25 mRepository.searchLog(liveData)
22 } 26 }
@@ -24,4 +28,12 @@ class SearchViewModel : BaseViewModel<CommonRepository>() { @@ -24,4 +28,12 @@ class SearchViewModel : BaseViewModel<CommonRepository>() {
24 fun clearLog() { 28 fun clearLog() {
25 mRepository.searchLogClear(clearData) 29 mRepository.searchLogClear(clearData)
26 } 30 }
  31 +
  32 + fun uploadFace(filePath: String) {
  33 + mRepository.uploadFile(filePath, mFaceFile)
  34 + }
  35 +
  36 + fun checkFace(url: String) {
  37 + mRepository.checkFace(url, mFaceCheck)
  38 + }
27 } 39 }
@@ -18,7 +18,7 @@ class TextCourseViewModel : BaseViewModel<TextCourseRepository>() { @@ -18,7 +18,7 @@ class TextCourseViewModel : BaseViewModel<TextCourseRepository>() {
18 fun textLessons( 18 fun textLessons(
19 keyword: String, 19 keyword: String,
20 page: Int, 20 page: Int,
21 - pos_id: Int 21 + pos_id: String
22 ) { 22 ) {
23 mRepository.textLessons(keyword, pos_id, page, 10, mTextLessonBean) 23 mRepository.textLessons(keyword, pos_id, page, 10, mTextLessonBean)
24 } 24 }
@@ -29,12 +29,12 @@ class TextDetailViewModel : BaseViewModel<LessonRepository>() { @@ -29,12 +29,12 @@ class TextDetailViewModel : BaseViewModel<LessonRepository>() {
29 var favoriteResponse = MutableLiveData<BaseResponse<Void>>() 29 var favoriteResponse = MutableLiveData<BaseResponse<Void>>()
30 30
31 fun textLessonsDetail( 31 fun textLessonsDetail(
32 - id: Int 32 + id: String
33 ) { 33 ) {
34 mRepository.txtLessonDetail(id, mTextLessonDetailBean) 34 mRepository.txtLessonDetail(id, mTextLessonDetailBean)
35 } 35 }
36 36
37 - fun materialDetail(id: Int) { 37 + fun materialDetail(id: String) {
38 mRepository.materialDetail(id, mDetailMaterialNormal) 38 mRepository.materialDetail(id, mDetailMaterialNormal)
39 } 39 }
40 40
@@ -2,10 +2,11 @@ package com.br_technology.securitytrain_master.ui.view.home.viewmodel @@ -2,10 +2,11 @@ package com.br_technology.securitytrain_master.ui.view.home.viewmodel
2 2
3 import androidx.lifecycle.MutableLiveData 3 import androidx.lifecycle.MutableLiveData
4 import com.br_technology.securitytrain_master.base.network.response.BaseResponse 4 import com.br_technology.securitytrain_master.base.network.response.BaseResponse
  5 +import com.br_technology.securitytrain_master.base.network.response.CommonDetail
5 import com.br_technology.securitytrain_master.base.repository.LessonRepository 6 import com.br_technology.securitytrain_master.base.repository.LessonRepository
6 import com.br_technology.securitytrain_master.base.view.BaseViewModel 7 import com.br_technology.securitytrain_master.base.view.BaseViewModel
7 import com.br_technology.securitytrain_master.ui.bean.CourseParam 8 import com.br_technology.securitytrain_master.ui.bean.CourseParam
8 -import com.br_technology.securitytrain_master.ui.bean.LessonTrainVideoDetail 9 +import com.br_technology.securitytrain_master.ui.bean.LessonClassDetail
9 10
10 /** 11 /**
11 * Time: 12/8/2021 15:46 12 * Time: 12/8/2021 15:46
@@ -18,7 +19,9 @@ class VideoDetailViewModel : BaseViewModel<LessonRepository>() { @@ -18,7 +19,9 @@ class VideoDetailViewModel : BaseViewModel<LessonRepository>() {
18 19
19 val record = MutableLiveData<BaseResponse<Void>>() 20 val record = MutableLiveData<BaseResponse<Void>>()
20 21
21 - val mVideoLesson = MutableLiveData<BaseResponse<LessonTrainVideoDetail>>() 22 +// val mVideoLesson = MutableLiveData<BaseResponse<LessonTrainVideoDetail>>()
  23 +
  24 + val mVideoLessonDetail = MutableLiveData<BaseResponse<CommonDetail<LessonClassDetail>>>()
22 25
23 fun record( 26 fun record(
24 view_len: String 27 view_len: String
@@ -40,9 +43,17 @@ class VideoDetailViewModel : BaseViewModel<LessonRepository>() { @@ -40,9 +43,17 @@ class VideoDetailViewModel : BaseViewModel<LessonRepository>() {
40 } 43 }
41 } 44 }
42 45
43 - fun videoLessonsDetail(  
44 - id: Int  
45 - ) {  
46 - mRepository.lessonVideoDetail(id, mVideoLesson) 46 +// fun videoLessonsDetail(
  47 +// id: String
  48 +// ) {
  49 +// mRepository.lessonVideoDetail(id, mVideoLesson)
  50 +// }
  51 +
  52 + fun videoDetail(id: String) {
  53 + mRepository.videoDetail(id, mVideoLessonDetail)
  54 + }
  55 +
  56 + fun videoDetail(id: String, classId: String) {
  57 + mRepository.videoDetail(id, classId, mVideoLessonDetail)
47 } 58 }
48 } 59 }
@@ -20,7 +20,7 @@ public class LoginBean { @@ -20,7 +20,7 @@ public class LoginBean {
20 private Integer id; 20 private Integer id;
21 private Integer company_id; 21 private Integer company_id;
22 private Integer department_id; 22 private Integer department_id;
23 - private Integer pos_id; 23 + private String pos_id;
24 private String username; 24 private String username;
25 private String nickname; 25 private String nickname;
26 private String mobile; 26 private String mobile;
@@ -59,11 +59,11 @@ public class LoginBean { @@ -59,11 +59,11 @@ public class LoginBean {
59 this.department_id = department_id; 59 this.department_id = department_id;
60 } 60 }
61 61
62 - public Integer getPos_id() { 62 + public String getPos_id() {
63 return pos_id; 63 return pos_id;
64 } 64 }
65 65
66 - public void setPos_id(Integer pos_id) { 66 + public void setPos_id(String pos_id) {
67 this.pos_id = pos_id; 67 this.pos_id = pos_id;
68 } 68 }
69 69
@@ -8,6 +8,8 @@ import com.br_technology.securitytrain_master.ui.view.bank.fragment.BankFragment @@ -8,6 +8,8 @@ import com.br_technology.securitytrain_master.ui.view.bank.fragment.BankFragment
8 import com.br_technology.securitytrain_master.ui.view.home.fragment.HomeFragment 8 import com.br_technology.securitytrain_master.ui.view.home.fragment.HomeFragment
9 import com.br_technology.securitytrain_master.ui.view.main.viewmodel.MainViewModel 9 import com.br_technology.securitytrain_master.ui.view.main.viewmodel.MainViewModel
10 import com.br_technology.securitytrain_master.ui.view.mine.fragment.MineFragment 10 import com.br_technology.securitytrain_master.ui.view.mine.fragment.MineFragment
  11 +import com.br_technology.securitytrain_master.util.company_is_check
  12 +import com.br_technology.securitytrain_master.util.is_set_face
11 import com.gyf.immersionbar.ImmersionBar 13 import com.gyf.immersionbar.ImmersionBar
12 import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity 14 import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity
13 15
@@ -49,6 +51,10 @@ class MainActivity : @@ -49,6 +51,10 @@ class MainActivity :
49 } 51 }
50 52
51 override fun initDataObserver() { 53 override fun initDataObserver() {
  54 + mViewModel.mMineInfoBean.observe(this, {
  55 + company_is_check = it.data.info.company_check_face.equals("0") // 0为关闭人脸检测
  56 + is_set_face = it.data.info.is_check_face.equals("1")
  57 + })
52 } 58 }
53 59
54 } 60 }
@@ -2,7 +2,12 @@ package com.br_technology.securitytrain_master.ui.view.main.repository @@ -2,7 +2,12 @@ package com.br_technology.securitytrain_master.ui.view.main.repository
2 2
3 import androidx.lifecycle.MutableLiveData 3 import androidx.lifecycle.MutableLiveData
4 import com.br_technology.securitytrain_master.base.common.State 4 import com.br_technology.securitytrain_master.base.common.State
  5 +import com.br_technology.securitytrain_master.base.network.response.BaseResponse
5 import com.br_technology.securitytrain_master.base.repository.ApiRepository 6 import com.br_technology.securitytrain_master.base.repository.ApiRepository
  7 +import com.br_technology.securitytrain_master.ui.view.mine.bean.MineInfoBean
  8 +import com.wjx.android.wanandroidmvvm.base.observer.BaseObserver
  9 +import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
  10 +import io.reactivex.rxjava3.schedulers.Schedulers
6 11
7 /** 12 /**
8 * createTime:2021/7/27 14:51 13 * createTime:2021/7/27 14:51
@@ -10,4 +15,19 @@ import com.br_technology.securitytrain_master.base.repository.ApiRepository @@ -10,4 +15,19 @@ import com.br_technology.securitytrain_master.base.repository.ApiRepository
10 * des: 15 * des:
11 */ 16 */
12 class MainRepository(val loadState: MutableLiveData<State>): ApiRepository(loadState) { 17 class MainRepository(val loadState: MutableLiveData<State>): ApiRepository(loadState) {
  18 + fun getMineInfo(
  19 + liveData: MutableLiveData<BaseResponse<MineInfoBean>>
  20 + ) {
  21 + apiService.getMineInfo()
  22 + .subscribeOn(Schedulers.io())
  23 + .observeOn(AndroidSchedulers.mainThread())
  24 + .subscribe(
  25 + BaseObserver(
  26 + liveData,
  27 + loadState,
  28 + this
  29 + )
  30 + )
  31 +
  32 + }
13 } 33 }
@@ -2,11 +2,13 @@ package com.br_technology.securitytrain_master.ui.view.main.viewmodel @@ -2,11 +2,13 @@ package com.br_technology.securitytrain_master.ui.view.main.viewmodel
2 2
3 import androidx.fragment.app.Fragment 3 import androidx.fragment.app.Fragment
4 import androidx.lifecycle.MutableLiveData 4 import androidx.lifecycle.MutableLiveData
  5 +import com.br_technology.securitytrain_master.base.network.response.BaseResponse
5 import com.br_technology.securitytrain_master.base.view.BaseViewModel 6 import com.br_technology.securitytrain_master.base.view.BaseViewModel
6 import com.br_technology.securitytrain_master.ui.view.bank.fragment.BankFragment 7 import com.br_technology.securitytrain_master.ui.view.bank.fragment.BankFragment
7 import com.br_technology.securitytrain_master.ui.view.home.fragment.HomeFragment 8 import com.br_technology.securitytrain_master.ui.view.home.fragment.HomeFragment
8 import com.br_technology.securitytrain_master.ui.view.login.bean.LoginBean 9 import com.br_technology.securitytrain_master.ui.view.login.bean.LoginBean
9 import com.br_technology.securitytrain_master.ui.view.main.repository.MainRepository 10 import com.br_technology.securitytrain_master.ui.view.main.repository.MainRepository
  11 +import com.br_technology.securitytrain_master.ui.view.mine.bean.MineInfoBean
10 import com.br_technology.securitytrain_master.ui.view.mine.fragment.MineFragment 12 import com.br_technology.securitytrain_master.ui.view.mine.fragment.MineFragment
11 13
12 /** 14 /**
@@ -15,15 +17,21 @@ import com.br_technology.securitytrain_master.ui.view.mine.fragment.MineFragment @@ -15,15 +17,21 @@ import com.br_technology.securitytrain_master.ui.view.mine.fragment.MineFragment
15 * des: 17 * des:
16 */ 18 */
17 class MainViewModel : BaseViewModel<MainRepository>() { 19 class MainViewModel : BaseViewModel<MainRepository>() {
  20 + var mMineInfoBean: MutableLiveData<BaseResponse<MineInfoBean>> = MutableLiveData()
  21 +
  22 + fun getMineInfo() {
  23 + mRepository.getMineInfo(mMineInfoBean)
  24 + }
  25 +
18 val liveData: MutableLiveData<List<Fragment>> by lazy { 26 val liveData: MutableLiveData<List<Fragment>> by lazy {
19 MutableLiveData() 27 MutableLiveData()
20 } 28 }
  29 +
21 val pos_id_get: MutableLiveData<LoginBean> = MutableLiveData() 30 val pos_id_get: MutableLiveData<LoginBean> = MutableLiveData()
22 31
23 init { 32 init {
24 val list = listOf(HomeFragment(), BankFragment(), MineFragment()) 33 val list = listOf(HomeFragment(), BankFragment(), MineFragment())
25 liveData.postValue(list as List<Fragment>?) 34 liveData.postValue(list as List<Fragment>?)
  35 + getMineInfo()
26 } 36 }
27 -  
28 -  
29 } 37 }
@@ -70,7 +70,7 @@ class AcademicFeedbackActivity : @@ -70,7 +70,7 @@ class AcademicFeedbackActivity :
70 iChat = object : AcademicFeedbackAdapter.IChat { 70 iChat = object : AcademicFeedbackAdapter.IChat {
71 override fun chat(teacherId: String) { 71 override fun chat(teacherId: String) {
72 val intent = Intent(baseContext, ChatActivity::class.java) 72 val intent = Intent(baseContext, ChatActivity::class.java)
73 - intent.putExtra("id", teacherId.toInt()) 73 + intent.putExtra("id", teacherId)
74 startActivity(intent) 74 startActivity(intent)
75 } 75 }
76 } 76 }
@@ -33,7 +33,7 @@ class ChatActivity : @@ -33,7 +33,7 @@ class ChatActivity :
33 ChatAdapter() 33 ChatAdapter()
34 } 34 }
35 private var page = 1 35 private var page = 1
36 - private var teacherId = -1 36 + private var teacherId = ""
37 37
38 override fun initDataObserver() { 38 override fun initDataObserver() {
39 mViewModel.detailLiveData.observe(this) { 39 mViewModel.detailLiveData.observe(this) {
@@ -69,7 +69,7 @@ class ChatActivity : @@ -69,7 +69,7 @@ class ChatActivity :
69 .init() 69 .init()
70 70
71 // 教师id 71 // 教师id
72 - teacherId = intent.getIntExtra("id", -1) 72 + teacherId = intent.getStringExtra("id")?:""
73 // 请求网络 73 // 请求网络
74 mViewModel.msgDetail(page, teacherId) 74 mViewModel.msgDetail(page, teacherId)
75 binding.apply { 75 binding.apply {
@@ -56,7 +56,7 @@ class ChatRecordActivity : @@ -56,7 +56,7 @@ class ChatRecordActivity :
56 chatRecordAdapter.setOnItemClickListener { _, _, position -> 56 chatRecordAdapter.setOnItemClickListener { _, _, position ->
57 val id = chatRecordAdapter.data[position].teacher_id 57 val id = chatRecordAdapter.data[position].teacher_id
58 val intent = Intent(baseContext,ChatActivity::class.java) 58 val intent = Intent(baseContext,ChatActivity::class.java)
59 - intent.putExtra("id",id) 59 + intent.putExtra("id",id.toString())
60 startActivity(intent) 60 startActivity(intent)
61 } 61 }
62 } 62 }
@@ -15,12 +15,15 @@ import com.br_technology.securitytrain_master.base.view.BasePagerAdapter @@ -15,12 +15,15 @@ import com.br_technology.securitytrain_master.base.view.BasePagerAdapter
15 import com.br_technology.securitytrain_master.databinding.ActivityClassDutyBinding 15 import com.br_technology.securitytrain_master.databinding.ActivityClassDutyBinding
16 import com.br_technology.securitytrain_master.ext.initPermissions 16 import com.br_technology.securitytrain_master.ext.initPermissions
17 import com.br_technology.securitytrain_master.ui.view.home.adapter.StatusName 17 import com.br_technology.securitytrain_master.ui.view.home.adapter.StatusName
  18 +import com.br_technology.securitytrain_master.ui.view.home.event.ClazzChangeEvent
18 import com.br_technology.securitytrain_master.ui.view.home.event.StatusTypeEvent 19 import com.br_technology.securitytrain_master.ui.view.home.event.StatusTypeEvent
19 import com.br_technology.securitytrain_master.ui.view.mine.fragment.ClassDutyCourseFragment 20 import com.br_technology.securitytrain_master.ui.view.mine.fragment.ClassDutyCourseFragment
20 import com.br_technology.securitytrain_master.ui.view.mine.viewmodel.ClassDutyViewModel 21 import com.br_technology.securitytrain_master.ui.view.mine.viewmodel.ClassDutyViewModel
21 import com.br_technology.securitytrain_master.util.CameraUtil 22 import com.br_technology.securitytrain_master.util.CameraUtil
22 import com.br_technology.securitytrain_master.util.FaceUtil 23 import com.br_technology.securitytrain_master.util.FaceUtil
  24 +import com.br_technology.securitytrain_master.util.company_is_check
23 import com.br_technology.securitytrain_master.view.DialogCheckIDCard 25 import com.br_technology.securitytrain_master.view.DialogCheckIDCard
  26 +import com.br_technology.securitytrain_master.view.DialogClassList
24 import com.br_technology.securitytrain_master.view.DialogTrainLoading 27 import com.br_technology.securitytrain_master.view.DialogTrainLoading
25 import com.br_technology.securitytrain_master.view.StatusPop 28 import com.br_technology.securitytrain_master.view.StatusPop
26 import com.br_technology.securitytrain_master.view.listener.ToolBarClickListener 29 import com.br_technology.securitytrain_master.view.listener.ToolBarClickListener
@@ -43,6 +46,7 @@ class ClassDutyActivity : @@ -43,6 +46,7 @@ class ClassDutyActivity :
43 private val faceUtil = FaceUtil() 46 private val faceUtil = FaceUtil()
44 private var dialogLoading: DialogTrainLoading? = null 47 private var dialogLoading: DialogTrainLoading? = null
45 private var isChecked = false 48 private var isChecked = false
  49 + private var dialogClassList: DialogClassList? = null
46 50
47 fun showDialogId() { 51 fun showDialogId() {
48 if (dialogId == null) { 52 if (dialogId == null) {
@@ -64,13 +68,23 @@ class ClassDutyActivity : @@ -64,13 +68,23 @@ class ClassDutyActivity :
64 } 68 }
65 }, 69 },
66 onDenied = { 70 onDenied = {
67 - }, onDeniedNever = { 71 + dialogId!!.dismiss()
  72 + },
  73 + onDeniedNever = {
  74 + dialogId!!.dismiss()
68 }) 75 })
69 }) 76 })
70 } 77 }
71 dialogId!!.show() 78 dialogId!!.show()
72 } 79 }
73 80
  81 + @Subscribe
  82 + fun selectClazz(clazzId: ClazzChangeEvent) {
  83 + if (dialogClassList != null) {
  84 + dialogClassList?.dismiss()
  85 + }
  86 + }
  87 +
74 private fun dialogLoading() { 88 private fun dialogLoading() {
75 if (dialogLoading == null) { 89 if (dialogLoading == null) {
76 dialogLoading = DialogTrainLoading(this) 90 dialogLoading = DialogTrainLoading(this)
@@ -103,6 +117,7 @@ class ClassDutyActivity : @@ -103,6 +117,7 @@ class ClassDutyActivity :
103 override fun onCreate(savedInstanceState: Bundle?) { 117 override fun onCreate(savedInstanceState: Bundle?) {
104 super.onCreate(savedInstanceState) 118 super.onCreate(savedInstanceState)
105 EventBus.getDefault().register(this) 119 EventBus.getDefault().register(this)
  120 + mViewModel.getClazzList()
106 } 121 }
107 122
108 override fun onDestroy() { 123 override fun onDestroy() {
@@ -116,6 +131,12 @@ class ClassDutyActivity : @@ -116,6 +131,12 @@ class ClassDutyActivity :
116 } 131 }
117 132
118 override fun initDataObserver() { 133 override fun initDataObserver() {
  134 + mViewModel.mClazzList.observe(this, {
  135 + runOnUiThread {
  136 + dialogClassList = DialogClassList(this@ClassDutyActivity, it.data.list)
  137 + dialogClassList?.show()
  138 + }
  139 + })
119 mViewModel.mFaceFile.observe(this, { 140 mViewModel.mFaceFile.observe(this, {
120 it.let { 141 it.let {
121 if (!TextUtils.isEmpty(it.data.fullurl)) { 142 if (!TextUtils.isEmpty(it.data.fullurl)) {
@@ -186,6 +207,6 @@ class ClassDutyActivity : @@ -186,6 +207,6 @@ class ClassDutyActivity :
186 } 207 }
187 208
188 fun isChecked(): Boolean { 209 fun isChecked(): Boolean {
189 - return isChecked 210 + return isChecked || company_is_check
190 } 211 }
191 } 212 }
@@ -36,8 +36,8 @@ class CredentialsUpLoadActivity : @@ -36,8 +36,8 @@ class CredentialsUpLoadActivity :
36 36
37 private var path: String = "" 37 private var path: String = ""
38 private var dateTime: String = "" 38 private var dateTime: String = ""
39 - private var typeId: Int = 0  
40 - private var id: Int? = 0 39 + private var typeId: String = ""
  40 + private var id: String = ""
41 private var endTime: String? = "" 41 private var endTime: String? = ""
42 private val certTypeAdapter: CertTypeAdapter by lazy { 42 private val certTypeAdapter: CertTypeAdapter by lazy {
43 CertTypeAdapter() 43 CertTypeAdapter()
@@ -90,11 +90,6 @@ class CredentialsUpLoadActivity : @@ -90,11 +90,6 @@ class CredentialsUpLoadActivity :
90 binding.certTypeTv.text = user.cert.name 90 binding.certTypeTv.text = user.cert.name
91 } 91 }
92 92
93 - id = if (id == 0) {  
94 - null  
95 - } else {  
96 - id  
97 - }  
98 endTime = if (endTime?.isEmpty() == true) { 93 endTime = if (endTime?.isEmpty() == true) {
99 null 94 null
100 } else { 95 } else {
@@ -110,7 +105,7 @@ class CredentialsUpLoadActivity : @@ -110,7 +105,7 @@ class CredentialsUpLoadActivity :
110 tvUpload.isClickable = true 105 tvUpload.isClickable = true
111 return@setOnClickListener 106 return@setOnClickListener
112 } 107 }
113 - if (typeId == 0) { 108 + if (typeId == "") {
114 tvUpload.isClickable = true 109 tvUpload.isClickable = true
115 showTip("请选择证件类型") 110 showTip("请选择证件类型")
116 return@setOnClickListener 111 return@setOnClickListener
@@ -46,7 +46,7 @@ class MyCredentialsDetailActivity : @@ -46,7 +46,7 @@ class MyCredentialsDetailActivity :
46 46
47 override fun onResume() { 47 override fun onResume() {
48 super.onResume() 48 super.onResume()
49 - val id = intent.getIntExtra("id", -1)  
50 - mViewModel.certDetail(id) 49 + val id = intent.getStringExtra("id")
  50 + mViewModel.certDetail(id?:"")
51 } 51 }
52 } 52 }
@@ -34,7 +34,7 @@ class QuestionRecordActivity : @@ -34,7 +34,7 @@ class QuestionRecordActivity :
34 SpecialExercisesFragment.newInstance(5), 34 SpecialExercisesFragment.newInstance(5),
35 SpecialExercisesFragment.newInstance(6) 35 SpecialExercisesFragment.newInstance(6)
36 ) 36 )
37 - val titles = listOf("专项练习", "培训计划考试", "培训计划联系", "模拟考试") 37 + val titles = listOf("专项练习", "培训计划考试", "培训计划练习", "模拟考试")
38 searchResultAdapter.addData(list.toMutableList()) 38 searchResultAdapter.addData(list.toMutableList())
39 searchResultAdapter.addTitle(titles) 39 searchResultAdapter.addTitle(titles)
40 viewPager.adapter = searchResultAdapter 40 viewPager.adapter = searchResultAdapter
@@ -69,7 +69,7 @@ public class AcademicFeedbackBean { @@ -69,7 +69,7 @@ public class AcademicFeedbackBean {
69 private Integer id; 69 private Integer id;
70 private Integer company_id; 70 private Integer company_id;
71 private Integer train_id; 71 private Integer train_id;
72 - private Integer train_class_id; 72 + private String train_class_id;
73 private Integer user_id; 73 private Integer user_id;
74 private Integer teacher_id; 74 private Integer teacher_id;
75 private Integer class_hours; 75 private Integer class_hours;
@@ -114,11 +114,11 @@ public class AcademicFeedbackBean { @@ -114,11 +114,11 @@ public class AcademicFeedbackBean {
114 this.train_id = train_id; 114 this.train_id = train_id;
115 } 115 }
116 116
117 - public Integer getTrain_class_id() { 117 + public String getTrain_class_id() {
118 return train_class_id; 118 return train_class_id;
119 } 119 }
120 120
121 - public void setTrain_class_id(Integer train_class_id) { 121 + public void setTrain_class_id(String train_class_id) {
122 this.train_class_id = train_class_id; 122 this.train_class_id = train_class_id;
123 } 123 }
124 124
@@ -9,7 +9,7 @@ import com.chad.library.adapter.base.entity.MultiItemEntity @@ -9,7 +9,7 @@ import com.chad.library.adapter.base.entity.MultiItemEntity
9 * updateInfo: 9 * updateInfo:
10 */ 10 */
11 data class ChatRecordBean( 11 data class ChatRecordBean(
12 - val id: Int, 12 + val id: String,
13 val is_read: String, 13 val is_read: String,
14 val last_content: String, 14 val last_content: String,
15 val teacher: Teacher, 15 val teacher: Teacher,
@@ -30,14 +30,14 @@ data class ChatDetailBean( @@ -30,14 +30,14 @@ data class ChatDetailBean(
30 val content: String, 30 val content: String,
31 val create_time: String, 31 val create_time: String,
32 val delete_time: String, 32 val delete_time: String,
33 - val from_id: Int, 33 + val from_id: String,
34 val from_id_type: String, 34 val from_id_type: String,
35 val from_id_type_text: String, 35 val from_id_type_text: String,
36 - val id: Int, 36 + val id: String,
37 val is_read: String, 37 val is_read: String,
38 val is_read_text: String, 38 val is_read_text: String,
39 val is_show_time: Int, 39 val is_show_time: Int,
40 - val msg_id: Int,  
41 - val to_id: Int, 40 + val msg_id: String,
  41 + val to_id: String,
42 val update_time: String, override var itemType: Int 42 val update_time: String, override var itemType: Int
43 ) : MultiItemEntity 43 ) : MultiItemEntity
@@ -5,6 +5,7 @@ import android.content.Intent @@ -5,6 +5,7 @@ import android.content.Intent
5 import android.os.Bundle 5 import android.os.Bundle
6 import android.view.View 6 import android.view.View
7 import android.view.ViewGroup 7 import android.view.ViewGroup
  8 +import android.widget.Toast
8 import com.br_technology.securitytrain_master.base.common.ConstantParamKey 9 import com.br_technology.securitytrain_master.base.common.ConstantParamKey
9 import com.br_technology.securitytrain_master.base.common.ConstantType 10 import com.br_technology.securitytrain_master.base.common.ConstantType
10 import com.br_technology.securitytrain_master.databinding.FragmentClassDutyCourseBinding 11 import com.br_technology.securitytrain_master.databinding.FragmentClassDutyCourseBinding
@@ -13,6 +14,7 @@ import com.br_technology.securitytrain_master.ui.bean.* @@ -13,6 +14,7 @@ import com.br_technology.securitytrain_master.ui.bean.*
13 import com.br_technology.securitytrain_master.ui.view.home.activity.course.CourseDetailActivity 14 import com.br_technology.securitytrain_master.ui.view.home.activity.course.CourseDetailActivity
14 import com.br_technology.securitytrain_master.ui.view.home.activity.course.CoursePractiseActivity 15 import com.br_technology.securitytrain_master.ui.view.home.activity.course.CoursePractiseActivity
15 import com.br_technology.securitytrain_master.ui.view.home.activity.course.TextDetailActivity 16 import com.br_technology.securitytrain_master.ui.view.home.activity.course.TextDetailActivity
  17 +import com.br_technology.securitytrain_master.ui.view.home.event.ClazzChangeEvent
16 import com.br_technology.securitytrain_master.ui.view.home.event.StatusTypeEvent 18 import com.br_technology.securitytrain_master.ui.view.home.event.StatusTypeEvent
17 import com.br_technology.securitytrain_master.ui.view.mine.activity.ClassDutyActivity 19 import com.br_technology.securitytrain_master.ui.view.mine.activity.ClassDutyActivity
18 import com.br_technology.securitytrain_master.ui.view.mine.activity.LiveWebActivity 20 import com.br_technology.securitytrain_master.ui.view.mine.activity.LiveWebActivity
@@ -20,6 +22,7 @@ import com.br_technology.securitytrain_master.ui.view.mine.adapter.CourseAdapter @@ -20,6 +22,7 @@ import com.br_technology.securitytrain_master.ui.view.mine.adapter.CourseAdapter
20 import com.br_technology.securitytrain_master.ui.view.mine.adapter.TrainTestAdapter 22 import com.br_technology.securitytrain_master.ui.view.mine.adapter.TrainTestAdapter
21 import com.br_technology.securitytrain_master.ui.view.mine.viewmodel.ClassDutyCourseViewModel 23 import com.br_technology.securitytrain_master.ui.view.mine.viewmodel.ClassDutyCourseViewModel
22 import com.br_technology.securitytrain_master.util.TranslateUnit 24 import com.br_technology.securitytrain_master.util.TranslateUnit
  25 +import com.br_technology.securitytrain_master.util.current_class_id
23 import com.br_technology.securitytrain_master.view.DialogMention 26 import com.br_technology.securitytrain_master.view.DialogMention
24 import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleFragment 27 import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleFragment
25 import org.greenrobot.eventbus.EventBus 28 import org.greenrobot.eventbus.EventBus
@@ -65,6 +68,11 @@ class ClassDutyCourseFragment(val type: Int) : @@ -65,6 +68,11 @@ class ClassDutyCourseFragment(val type: Int) :
65 refreshData() 68 refreshData()
66 } 69 }
67 70
  71 + @Subscribe
  72 + fun selectClazz(clazzId: ClazzChangeEvent) {
  73 + refreshData()
  74 + }
  75 +
68 private fun boolData(boolean: Boolean) { 76 private fun boolData(boolean: Boolean) {
69 if (boolean) { 77 if (boolean) {
70 binding.layData.visibility = View.VISIBLE 78 binding.layData.visibility = View.VISIBLE
@@ -180,11 +188,17 @@ class ClassDutyCourseFragment(val type: Int) : @@ -180,11 +188,17 @@ class ClassDutyCourseFragment(val type: Int) :
180 } 188 }
181 189
182 private fun refreshData() { 190 private fun refreshData() {
  191 + if (current_class_id == "") {
  192 + return
  193 + }
183 page = 1 194 page = 1
184 getData() 195 getData()
185 } 196 }
186 197
187 private fun loadMore() { 198 private fun loadMore() {
  199 + if (current_class_id == "") {
  200 + return
  201 + }
188 page++ 202 page++
189 getData() 203 getData()
190 } 204 }
@@ -252,8 +266,12 @@ class ClassDutyCourseFragment(val type: Int) : @@ -252,8 +266,12 @@ class ClassDutyCourseFragment(val type: Int) :
252 if (activity is ClassDutyActivity) { 266 if (activity is ClassDutyActivity) {
253 val classDutyActivity = activity as ClassDutyActivity 267 val classDutyActivity = activity as ClassDutyActivity
254 if (!classDutyActivity.isChecked()) { 268 if (!classDutyActivity.isChecked()) {
255 - classDutyActivity.showDialogId()  
256 - return 269 + if (classDutyActivity.hasSetFace()) {
  270 + classDutyActivity.showDialogId()
  271 + return
  272 + } else {
  273 + classDutyActivity.toastSetFace()
  274 + }
257 } 275 }
258 } 276 }
259 try { 277 try {
@@ -279,6 +297,14 @@ class ClassDutyCourseFragment(val type: Int) : @@ -279,6 +297,14 @@ class ClassDutyCourseFragment(val type: Int) :
279 } 297 }
280 298
281 fun startNext(item: TrainTestData) { 299 fun startNext(item: TrainTestData) {
  300 + if (item.isTest && item.exam?.count!! <= 0) {
  301 + Toast.makeText(activity, "该考试暂无题目", Toast.LENGTH_SHORT).show()
  302 + return
  303 + }
  304 + if (item.isTest && item.practice?.count!! <= 0) {
  305 + Toast.makeText(activity, "该练习暂无题目", Toast.LENGTH_SHORT).show()
  306 + return
  307 + }
282 this@ClassDutyCourseFragment.startActivity( 308 this@ClassDutyCourseFragment.startActivity(
283 Intent( 309 Intent(
284 requireActivity(), 310 requireActivity(),
@@ -303,6 +329,10 @@ class ClassDutyCourseFragment(val type: Int) : @@ -303,6 +329,10 @@ class ClassDutyCourseFragment(val type: Int) :
303 url = response.playback_url 329 url = response.playback_url
304 } 330 }
305 if (status == "1") { 331 if (status == "1") {
  332 + if (!(activity as ClassDutyActivity).isChecked()) {
  333 + (activity as ClassDutyActivity).showDialogId()
  334 + return
  335 + }
306 url = response.playerUrl 336 url = response.playerUrl
307 } 337 }
308 val title = response.name 338 val title = response.name
@@ -63,7 +63,7 @@ class DatabaseFragment : @@ -63,7 +63,7 @@ class DatabaseFragment :
63 override fun onClick(position: Int, data: FavoriteData) { 63 override fun onClick(position: Int, data: FavoriteData) {
64 this@DatabaseFragment.startActivity( 64 this@DatabaseFragment.startActivity(
65 Intent(requireActivity(), DatabaseDetailActivity::class.java) 65 Intent(requireActivity(), DatabaseDetailActivity::class.java)
66 - .putExtra(ConstantParamKey.DOC_ID, data.object_id.toInt()) 66 + .putExtra(ConstantParamKey.DOC_ID, data.object_id)
67 ) 67 )
68 } 68 }
69 }) 69 })
@@ -7,6 +7,8 @@ import com.br_technology.securitytrain_master.databinding.FragmentMineBinding @@ -7,6 +7,8 @@ import com.br_technology.securitytrain_master.databinding.FragmentMineBinding
7 import com.br_technology.securitytrain_master.ui.view.home.viewmodel.MineViewModel 7 import com.br_technology.securitytrain_master.ui.view.home.viewmodel.MineViewModel
8 import com.br_technology.securitytrain_master.ui.view.login.activity.AccountLoginActivity 8 import com.br_technology.securitytrain_master.ui.view.login.activity.AccountLoginActivity
9 import com.br_technology.securitytrain_master.ui.view.mine.activity.* 9 import com.br_technology.securitytrain_master.ui.view.mine.activity.*
  10 +import com.br_technology.securitytrain_master.util.company_is_check
  11 +import com.br_technology.securitytrain_master.util.is_set_face
10 import com.br_technology.securitytrain_master.util.token 12 import com.br_technology.securitytrain_master.util.token
11 import com.br_technology.securitytrain_master.view.DialogSureCancel 13 import com.br_technology.securitytrain_master.view.DialogSureCancel
12 import com.br_technology.securitytrain_master.view.listener.DialogListener 14 import com.br_technology.securitytrain_master.view.listener.DialogListener
@@ -36,6 +38,8 @@ class MineFragment @@ -36,6 +38,8 @@ class MineFragment
36 .placeholder(R.mipmap.placeholder_head).into(binding.ivIcon) 38 .placeholder(R.mipmap.placeholder_head).into(binding.ivIcon)
37 identity = it.data.info.identity 39 identity = it.data.info.identity
38 binding.departmentName.text = it.data.info.department_name.plus(" - ").plus(it.data.info.pos_name) 40 binding.departmentName.text = it.data.info.department_name.plus(" - ").plus(it.data.info.pos_name)
  41 + company_is_check = it.data.info.company_check_face.equals("0") // 0为关闭人脸检测
  42 + is_set_face = it.data.info.is_check_face.equals("1");
39 }) 43 })
40 44
41 mViewModel.mCommonBean.observe(this,{ 45 mViewModel.mCommonBean.observe(this,{
@@ -2,11 +2,9 @@ package com.br_technology.securitytrain_master.ui.view.mine.fragment @@ -2,11 +2,9 @@ package com.br_technology.securitytrain_master.ui.view.mine.fragment
2 2
3 import android.content.Intent 3 import android.content.Intent
4 import android.os.Bundle 4 import android.os.Bundle
5 -import com.br_technology.securitytrain_master.R  
6 import com.br_technology.securitytrain_master.databinding.FragmentMyErrorQuestionBinding 5 import com.br_technology.securitytrain_master.databinding.FragmentMyErrorQuestionBinding
7 import com.br_technology.securitytrain_master.ui.bean.ErrorListItem 6 import com.br_technology.securitytrain_master.ui.bean.ErrorListItem
8 import com.br_technology.securitytrain_master.ui.view.bank.activity.WrongQuestionsActivity 7 import com.br_technology.securitytrain_master.ui.view.bank.activity.WrongQuestionsActivity
9 -import com.br_technology.securitytrain_master.ui.view.home.pojo.VideoCourse  
10 import com.br_technology.securitytrain_master.ui.view.mine.adapter.MyErrorQuestionAdapter 8 import com.br_technology.securitytrain_master.ui.view.mine.adapter.MyErrorQuestionAdapter
11 import com.br_technology.securitytrain_master.ui.view.mine.viewmodel.MyErrorQuestionFragmentViewModel 9 import com.br_technology.securitytrain_master.ui.view.mine.viewmodel.MyErrorQuestionFragmentViewModel
12 import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleFragment 10 import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleFragment
@@ -66,7 +64,7 @@ class MyErrorQuestionFragment : @@ -66,7 +64,7 @@ class MyErrorQuestionFragment :
66 questionAdapter.setOnItemChildClickListener { adapter, view, position -> 64 questionAdapter.setOnItemChildClickListener { adapter, view, position ->
67 val errorListItem = adapter.data.get(position) as ErrorListItem 65 val errorListItem = adapter.data.get(position) as ErrorListItem
68 mViewModel.delError( 66 mViewModel.delError(
69 - errorListItem.item_id.toInt(), 67 + errorListItem.item_id,
70 type, 68 type,
71 errorListItem.item_type.toInt() 69 errorListItem.item_type.toInt()
72 ) 70 )
@@ -2,11 +2,11 @@ package com.br_technology.securitytrain_master.ui.view.mine.repository @@ -2,11 +2,11 @@ package com.br_technology.securitytrain_master.ui.view.mine.repository
2 2
3 import androidx.lifecycle.MutableLiveData 3 import androidx.lifecycle.MutableLiveData
4 import com.br_technology.securitytrain_master.base.common.State 4 import com.br_technology.securitytrain_master.base.common.State
  5 +import com.br_technology.securitytrain_master.base.network.response.BaseResponse
5 import com.br_technology.securitytrain_master.base.repository.ApiRepository 6 import com.br_technology.securitytrain_master.base.repository.ApiRepository
6 import com.br_technology.securitytrain_master.ui.view.mine.bean.AcademicFeedbackBean 7 import com.br_technology.securitytrain_master.ui.view.mine.bean.AcademicFeedbackBean
7 import com.br_technology.securitytrain_master.ui.view.mine.bean.AcademicFeedbackDetailBean 8 import com.br_technology.securitytrain_master.ui.view.mine.bean.AcademicFeedbackDetailBean
8 import com.wjx.android.wanandroidmvvm.base.observer.BaseObserver 9 import com.wjx.android.wanandroidmvvm.base.observer.BaseObserver
9 -import com.br_technology.securitytrain_master.base.network.response.BaseResponse  
10 import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers 10 import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
11 import io.reactivex.rxjava3.schedulers.Schedulers 11 import io.reactivex.rxjava3.schedulers.Schedulers
12 12
@@ -35,7 +35,7 @@ class AcademicFeedbackRepository(val loadState: MutableLiveData<State>) : ApiRep @@ -35,7 +35,7 @@ class AcademicFeedbackRepository(val loadState: MutableLiveData<State>) : ApiRep
35 } 35 }
36 36
37 fun academicFeedbackDetail( 37 fun academicFeedbackDetail(
38 - train_class_id: Int, 38 + train_class_id: String,
39 liveData: MutableLiveData<BaseResponse<AcademicFeedbackDetailBean>> 39 liveData: MutableLiveData<BaseResponse<AcademicFeedbackDetailBean>>
40 ) { 40 ) {
41 apiService.academicFeedbackDetail(train_class_id) 41 apiService.academicFeedbackDetail(train_class_id)
@@ -2,11 +2,9 @@ package com.br_technology.securitytrain_master.ui.view.mine.repository @@ -2,11 +2,9 @@ package com.br_technology.securitytrain_master.ui.view.mine.repository
2 2
3 import androidx.lifecycle.MutableLiveData 3 import androidx.lifecycle.MutableLiveData
4 import com.br_technology.securitytrain_master.base.common.State 4 import com.br_technology.securitytrain_master.base.common.State
5 -import com.br_technology.securitytrain_master.base.network.response.BaseResponse  
6 -import com.br_technology.securitytrain_master.base.network.response.CommonDataList  
7 -import com.br_technology.securitytrain_master.base.network.response.CommonDetail  
8 -import com.br_technology.securitytrain_master.base.network.response.CommonPage 5 +import com.br_technology.securitytrain_master.base.network.response.*
9 import com.br_technology.securitytrain_master.base.repository.ApiRepository 6 import com.br_technology.securitytrain_master.base.repository.ApiRepository
  7 +import com.br_technology.securitytrain_master.ui.bean.ClazzBean
10 import com.br_technology.securitytrain_master.ui.view.mine.bean.ChatDetailBean 8 import com.br_technology.securitytrain_master.ui.view.mine.bean.ChatDetailBean
11 import com.br_technology.securitytrain_master.ui.view.mine.bean.ChatRecordBean 9 import com.br_technology.securitytrain_master.ui.view.mine.bean.ChatRecordBean
12 10
@@ -18,6 +16,14 @@ import com.br_technology.securitytrain_master.ui.view.mine.bean.ChatRecordBean @@ -18,6 +16,14 @@ import com.br_technology.securitytrain_master.ui.view.mine.bean.ChatRecordBean
18 */ 16 */
19 class ChatRepository(val loadState: MutableLiveData<State>) : ApiRepository(loadState) { 17 class ChatRepository(val loadState: MutableLiveData<State>) : ApiRepository(loadState) {
20 18
  19 + fun getClazzList(
  20 + liveData: MutableLiveData<BaseResponse<CommonList<ClazzBean>>>
  21 + ) {
  22 + addRequest(
  23 + userService.getClazzList(),
  24 + liveData
  25 + )
  26 + }
21 27
22 fun msgList( 28 fun msgList(
23 page: Int, 29 page: Int,
@@ -28,7 +34,7 @@ class ChatRepository(val loadState: MutableLiveData<State>) : ApiRepository(load @@ -28,7 +34,7 @@ class ChatRepository(val loadState: MutableLiveData<State>) : ApiRepository(load
28 34
29 fun msgDetail( 35 fun msgDetail(
30 page: Int, 36 page: Int,
31 - teacherId: Int, 37 + teacherId: String,
32 liveData: MutableLiveData<BaseResponse<CommonDetail<CommonPage<ChatDetailBean>>>> 38 liveData: MutableLiveData<BaseResponse<CommonDetail<CommonPage<ChatDetailBean>>>>
33 ) { 39 ) {
34 addRequest(userService.msgDetail(page, 10, teacherId), liveData) 40 addRequest(userService.msgDetail(page, 10, teacherId), liveData)
@@ -36,7 +42,7 @@ class ChatRepository(val loadState: MutableLiveData<State>) : ApiRepository(load @@ -36,7 +42,7 @@ class ChatRepository(val loadState: MutableLiveData<State>) : ApiRepository(load
36 42
37 fun sendMsg( 43 fun sendMsg(
38 content: String, 44 content: String,
39 - teacherId: Int, 45 + teacherId: String,
40 liveData: MutableLiveData<BaseResponse<Any>> 46 liveData: MutableLiveData<BaseResponse<Any>>
41 ) { 47 ) {
42 addRequest(userService.sendMsg(teacherId, content), liveData) 48 addRequest(userService.sendMsg(teacherId, content), liveData)
@@ -4,7 +4,6 @@ import androidx.lifecycle.MutableLiveData @@ -4,7 +4,6 @@ import androidx.lifecycle.MutableLiveData
4 import com.br_technology.securitytrain_master.base.common.State 4 import com.br_technology.securitytrain_master.base.common.State
5 import com.br_technology.securitytrain_master.base.network.response.BaseResponse 5 import com.br_technology.securitytrain_master.base.network.response.BaseResponse
6 import com.br_technology.securitytrain_master.base.network.response.CommonDataList 6 import com.br_technology.securitytrain_master.base.network.response.CommonDataList
7 -import com.br_technology.securitytrain_master.base.network.response.CommonList  
8 import com.br_technology.securitytrain_master.base.network.response.CommonPage 7 import com.br_technology.securitytrain_master.base.network.response.CommonPage
9 import com.br_technology.securitytrain_master.base.repository.ApiRepository 8 import com.br_technology.securitytrain_master.base.repository.ApiRepository
10 import com.br_technology.securitytrain_master.ui.bean.ErrorListItem 9 import com.br_technology.securitytrain_master.ui.bean.ErrorListItem
@@ -28,7 +27,7 @@ class MyErrorQuestionFragmentRepository(val loadState: MutableLiveData<State>) : @@ -28,7 +27,7 @@ class MyErrorQuestionFragmentRepository(val loadState: MutableLiveData<State>) :
28 27
29 //删除错题 28 //删除错题
30 fun delError( 29 fun delError(
31 - item_id: Int, 30 + item_id: String,
32 type: Int, 31 type: Int,
33 item_type: Int, 32 item_type: Int,
34 liveData: MutableLiveData<BaseResponse<Void>> 33 liveData: MutableLiveData<BaseResponse<Void>>
1 package com.br_technology.securitytrain_master.ui.view.mine.viewmodel 1 package com.br_technology.securitytrain_master.ui.view.mine.viewmodel
2 2
3 import androidx.lifecycle.MutableLiveData 3 import androidx.lifecycle.MutableLiveData
  4 +import com.br_technology.securitytrain_master.base.network.response.BaseResponse
4 import com.br_technology.securitytrain_master.base.view.BaseViewModel 5 import com.br_technology.securitytrain_master.base.view.BaseViewModel
5 import com.br_technology.securitytrain_master.ui.view.mine.bean.AcademicFeedbackBean 6 import com.br_technology.securitytrain_master.ui.view.mine.bean.AcademicFeedbackBean
6 import com.br_technology.securitytrain_master.ui.view.mine.bean.AcademicFeedbackDetailBean 7 import com.br_technology.securitytrain_master.ui.view.mine.bean.AcademicFeedbackDetailBean
7 import com.br_technology.securitytrain_master.ui.view.mine.repository.AcademicFeedbackRepository 8 import com.br_technology.securitytrain_master.ui.view.mine.repository.AcademicFeedbackRepository
8 -import com.br_technology.securitytrain_master.base.network.response.BaseResponse  
9 9
10 /** 10 /**
11 * Time: 8/2/2021 14:29 11 * Time: 8/2/2021 14:29
@@ -21,7 +21,7 @@ class AcademicFeedbackViewModel : BaseViewModel<AcademicFeedbackRepository>() { @@ -21,7 +21,7 @@ class AcademicFeedbackViewModel : BaseViewModel<AcademicFeedbackRepository>() {
21 21
22 var mAcademicFeedbackDetailBean: MutableLiveData<BaseResponse<AcademicFeedbackDetailBean>> = MutableLiveData() 22 var mAcademicFeedbackDetailBean: MutableLiveData<BaseResponse<AcademicFeedbackDetailBean>> = MutableLiveData()
23 23
24 - fun academicFeedbackDetail(train_class_id: Int) { 24 + fun academicFeedbackDetail(train_class_id: String) {
25 mRepository.academicFeedbackDetail(train_class_id, mAcademicFeedbackDetailBean) 25 mRepository.academicFeedbackDetail(train_class_id, mAcademicFeedbackDetailBean)
26 } 26 }
27 } 27 }
1 package com.br_technology.securitytrain_master.ui.view.mine.viewmodel 1 package com.br_technology.securitytrain_master.ui.view.mine.viewmodel
2 2
3 import androidx.lifecycle.MutableLiveData 3 import androidx.lifecycle.MutableLiveData
4 -import com.br_technology.securitytrain_master.base.network.response.BaseResponse  
5 -import com.br_technology.securitytrain_master.base.network.response.CommonDataList  
6 -import com.br_technology.securitytrain_master.base.network.response.CommonDetail  
7 -import com.br_technology.securitytrain_master.base.network.response.CommonPage 4 +import com.br_technology.securitytrain_master.base.network.response.*
8 import com.br_technology.securitytrain_master.base.view.BaseViewModel 5 import com.br_technology.securitytrain_master.base.view.BaseViewModel
  6 +import com.br_technology.securitytrain_master.ui.bean.ClazzBean
9 import com.br_technology.securitytrain_master.ui.view.mine.bean.ChatDetailBean 7 import com.br_technology.securitytrain_master.ui.view.mine.bean.ChatDetailBean
10 import com.br_technology.securitytrain_master.ui.view.mine.bean.ChatRecordBean 8 import com.br_technology.securitytrain_master.ui.view.mine.bean.ChatRecordBean
11 import com.br_technology.securitytrain_master.ui.view.mine.repository.ChatRepository 9 import com.br_technology.securitytrain_master.ui.view.mine.repository.ChatRepository
@@ -23,17 +21,23 @@ class ChatRecordViewModel : BaseViewModel<ChatRepository>() { @@ -23,17 +21,23 @@ class ChatRecordViewModel : BaseViewModel<ChatRepository>() {
23 val detailLiveData: MutableLiveData<BaseResponse<CommonDetail<CommonPage<ChatDetailBean>>>> = 21 val detailLiveData: MutableLiveData<BaseResponse<CommonDetail<CommonPage<ChatDetailBean>>>> =
24 MutableLiveData() 22 MutableLiveData()
25 val sendLiveData: MutableLiveData<BaseResponse<Any>> = MutableLiveData() 23 val sendLiveData: MutableLiveData<BaseResponse<Any>> = MutableLiveData()
  24 + val listClazz = MutableLiveData<BaseResponse<CommonList<ClazzBean>>>()
26 25
27 fun msgList(page: Int) { 26 fun msgList(page: Int) {
28 mRepository.msgList(page, liveData) 27 mRepository.msgList(page, liveData)
29 } 28 }
30 29
31 - fun msgDetail(page: Int, teacherId: Int) { 30 + fun getClazzList() {
  31 + mRepository.getClazzList(listClazz)
  32 + }
  33 +
  34 +
  35 + fun msgDetail(page: Int, teacherId: String) {
32 mRepository.msgDetail(page, teacherId, detailLiveData) 36 mRepository.msgDetail(page, teacherId, detailLiveData)
33 } 37 }
34 38
35 39
36 - fun sendMsg(content: String, teacherId: Int) { 40 + fun sendMsg(content: String, teacherId: String) {
37 mRepository.sendMsg(content, teacherId, sendLiveData) 41 mRepository.sendMsg(content, teacherId, sendLiveData)
38 } 42 }
39 } 43 }
@@ -2,8 +2,10 @@ package com.br_technology.securitytrain_master.ui.view.mine.viewmodel @@ -2,8 +2,10 @@ package com.br_technology.securitytrain_master.ui.view.mine.viewmodel
2 2
3 import androidx.lifecycle.MutableLiveData 3 import androidx.lifecycle.MutableLiveData
4 import com.br_technology.securitytrain_master.base.network.response.BaseResponse 4 import com.br_technology.securitytrain_master.base.network.response.BaseResponse
  5 +import com.br_technology.securitytrain_master.base.network.response.CommonList
5 import com.br_technology.securitytrain_master.base.repository.TrainRepository 6 import com.br_technology.securitytrain_master.base.repository.TrainRepository
6 import com.br_technology.securitytrain_master.base.view.BaseViewModel 7 import com.br_technology.securitytrain_master.base.view.BaseViewModel
  8 +import com.br_technology.securitytrain_master.ui.bean.ClazzBean
7 import com.br_technology.securitytrain_master.ui.bean.UploadFileData 9 import com.br_technology.securitytrain_master.ui.bean.UploadFileData
8 10
9 /** 11 /**
@@ -14,6 +16,11 @@ import com.br_technology.securitytrain_master.ui.bean.UploadFileData @@ -14,6 +16,11 @@ import com.br_technology.securitytrain_master.ui.bean.UploadFileData
14 class ClassDutyViewModel : BaseViewModel<TrainRepository>() { 16 class ClassDutyViewModel : BaseViewModel<TrainRepository>() {
15 var mFaceFile = MutableLiveData<BaseResponse<UploadFileData>>() 17 var mFaceFile = MutableLiveData<BaseResponse<UploadFileData>>()
16 var mFaceCheck = MutableLiveData<BaseResponse<Void>>() 18 var mFaceCheck = MutableLiveData<BaseResponse<Void>>()
  19 + var mClazzList = MutableLiveData<BaseResponse<CommonList<ClazzBean>>>()
  20 +
  21 + fun getClazzList() {
  22 + mRepository.getClazzList(mClazzList)
  23 + }
17 24
18 fun uploadFace(filePath: String) { 25 fun uploadFace(filePath: String) {
19 mRepository.uploadFile(filePath, mFaceFile) 26 mRepository.uploadFile(filePath, mFaceFile)
@@ -7,7 +7,6 @@ import com.br_technology.securitytrain_master.base.repository.UserRepository @@ -7,7 +7,6 @@ import com.br_technology.securitytrain_master.base.repository.UserRepository
7 import com.br_technology.securitytrain_master.base.view.BaseViewModel 7 import com.br_technology.securitytrain_master.base.view.BaseViewModel
8 import com.br_technology.securitytrain_master.ui.bean.CertType 8 import com.br_technology.securitytrain_master.ui.bean.CertType
9 import com.br_technology.securitytrain_master.ui.bean.UploadFileData 9 import com.br_technology.securitytrain_master.ui.bean.UploadFileData
10 -import com.br_technology.securitytrain_master.ui.view.mine.repository.CredentialsUpLoadRepository  
11 10
12 /** 11 /**
13 * Time: 8/2/2021 13:56 12 * Time: 8/2/2021 13:56
@@ -32,8 +31,8 @@ class CredentialsUpLoadViewModel : BaseViewModel<UserRepository>() { @@ -32,8 +31,8 @@ class CredentialsUpLoadViewModel : BaseViewModel<UserRepository>() {
32 } 31 }
33 32
34 fun certAdd( 33 fun certAdd(
35 - id: Int?,  
36 - cert_id: Int, 34 + id: String?,
  35 + cert_id: String,
37 image: String, 36 image: String,
38 start_time: String, 37 start_time: String,
39 end_time: String? 38 end_time: String?
@@ -45,11 +45,27 @@ class DatabaseFViewModel : BaseViewModel<DocRepository>() { @@ -45,11 +45,27 @@ class DatabaseFViewModel : BaseViewModel<DocRepository>() {
45 45
46 fun getDataList(page: Int) { 46 fun getDataList(page: Int) {
47 type.value?.let { 47 type.value?.let {
48 - sortSecond.value?.let { it1 ->  
49 - mRepository.getDocList(  
50 - it,  
51 - it1.id, "", page, 10, classifyDataList  
52 - ) 48 + if (sortSecond.value != null) {
  49 + sortSecond.value?.let { it1 ->
  50 + mRepository.getDocList(
  51 + it,
  52 + it1.id, "", page, 10, classifyDataList
  53 + )
  54 + }
  55 + } else if (sortChild.value != null) {
  56 + sortChild.value?.let { it1 ->
  57 + mRepository.getDocList(
  58 + it,
  59 + it1.id, "", page, 10, classifyDataList
  60 + )
  61 + }
  62 + } else {
  63 + selectClassify.value?.let { it1 ->
  64 + mRepository.getDocList(
  65 + it,
  66 + it1.id, "", page, 10, classifyDataList
  67 + )
  68 + }
53 } 69 }
54 } 70 }
55 } 71 }
@@ -6,7 +6,6 @@ import com.br_technology.securitytrain_master.base.network.response.CommonDetail @@ -6,7 +6,6 @@ import com.br_technology.securitytrain_master.base.network.response.CommonDetail
6 import com.br_technology.securitytrain_master.base.repository.UserRepository 6 import com.br_technology.securitytrain_master.base.repository.UserRepository
7 import com.br_technology.securitytrain_master.base.view.BaseViewModel 7 import com.br_technology.securitytrain_master.base.view.BaseViewModel
8 import com.br_technology.securitytrain_master.ui.bean.UserCertDetail 8 import com.br_technology.securitytrain_master.ui.bean.UserCertDetail
9 -import com.br_technology.securitytrain_master.ui.view.mine.repository.MyCredentialsDetailRepository  
10 9
11 /** 10 /**
12 * Time: 8/2/2021 11:42 11 * Time: 8/2/2021 11:42
@@ -15,7 +14,7 @@ import com.br_technology.securitytrain_master.ui.view.mine.repository.MyCredenti @@ -15,7 +14,7 @@ import com.br_technology.securitytrain_master.ui.view.mine.repository.MyCredenti
15 */ 14 */
16 class MyCredentialDetailViewModel : BaseViewModel<UserRepository>() { 15 class MyCredentialDetailViewModel : BaseViewModel<UserRepository>() {
17 val liveData: MutableLiveData<BaseResponse<CommonDetail<UserCertDetail>>> = MutableLiveData() 16 val liveData: MutableLiveData<BaseResponse<CommonDetail<UserCertDetail>>> = MutableLiveData()
18 - fun certDetail(id:Int){ 17 + fun certDetail(id:String){
19 mRepository.certDetail(id,liveData) 18 mRepository.certDetail(id,liveData)
20 } 19 }
21 } 20 }
@@ -3,7 +3,6 @@ package com.br_technology.securitytrain_master.ui.view.mine.viewmodel @@ -3,7 +3,6 @@ package com.br_technology.securitytrain_master.ui.view.mine.viewmodel
3 import androidx.lifecycle.MutableLiveData 3 import androidx.lifecycle.MutableLiveData
4 import com.br_technology.securitytrain_master.base.network.response.BaseResponse 4 import com.br_technology.securitytrain_master.base.network.response.BaseResponse
5 import com.br_technology.securitytrain_master.base.network.response.CommonDataList 5 import com.br_technology.securitytrain_master.base.network.response.CommonDataList
6 -import com.br_technology.securitytrain_master.base.network.response.CommonList  
7 import com.br_technology.securitytrain_master.base.network.response.CommonPage 6 import com.br_technology.securitytrain_master.base.network.response.CommonPage
8 import com.br_technology.securitytrain_master.base.view.BaseViewModel 7 import com.br_technology.securitytrain_master.base.view.BaseViewModel
9 import com.br_technology.securitytrain_master.ui.bean.ErrorListItem 8 import com.br_technology.securitytrain_master.ui.bean.ErrorListItem
@@ -29,7 +28,7 @@ class MyErrorQuestionFragmentViewModel : BaseViewModel<MyErrorQuestionFragmentRe @@ -29,7 +28,7 @@ class MyErrorQuestionFragmentViewModel : BaseViewModel<MyErrorQuestionFragmentRe
29 28
30 //删除错题 29 //删除错题
31 fun delError( 30 fun delError(
32 - item_id: Int, 31 + item_id: String,
33 type: Int, 32 type: Int,
34 item_type: Int, 33 item_type: Int,
35 ) { 34 ) {