Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨凯
YDL-Component-Medical
Commits
3616e775
Commit
3616e775
authored
Jun 25, 2021
by
霍志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:im-灵犀2.0-回答问题接口
parent
5d070de9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
67 additions
and
36 deletions
+67
-36
ImRetrofitApi.kt
m-im/src/main/java/com/yidianling/im/http/ImRetrofitApi.kt
+6
-0
CustomAttachLingxiWhichQuestion.java
m-im/src/main/java/com/yidianling/im/session/extension/CustomAttachLingxiWhichQuestion.java
+24
-25
MsgViewHolderLingxiWhichQuestion.java
m-im/src/main/java/com/yidianling/im/session/viewholder/MsgViewHolderLingxiWhichQuestion.java
+0
-0
AdapterLingxiMultipleChoice.kt
m-im/src/main/java/com/yidianling/im/session/viewholder/adapter/AdapterLingxiMultipleChoice.kt
+1
-1
AdapterLingxiWhichQuestion.kt
m-im/src/main/java/com/yidianling/im/session/viewholder/adapter/AdapterLingxiWhichQuestion.kt
+1
-1
LingxiWhichQuestionBean.kt
m-im/src/main/java/com/yidianling/im/session/viewholder/bean/LingxiWhichQuestionBean.kt
+35
-9
No files found.
m-im/src/main/java/com/yidianling/im/http/ImRetrofitApi.kt
View file @
3616e775
...
@@ -119,4 +119,9 @@ interface ImRetrofitApi {
...
@@ -119,4 +119,9 @@ interface ImRetrofitApi {
@GET
(
"consult/user/order/affirmComplete"
)
@GET
(
"consult/user/order/affirmComplete"
)
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
)
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
)
fun
affirmComplete
(
@Query
(
"id"
)
orderId
:
String
):
Observable
<
BaseAPIResponse
<
Any
>>
fun
affirmComplete
(
@Query
(
"id"
)
orderId
:
String
):
Observable
<
BaseAPIResponse
<
Any
>>
//回答问题接口
@POST
(
"chat/sendCustomizeMessage"
)
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
)
fun
lingxiAnswerQuestion
(
@Body
body
:
RequestBody
):
Observable
<
BaseAPIResponse
<
Any
>>
}
}
\ No newline at end of file
m-im/src/main/java/com/yidianling/im/session/extension/CustomAttachLingxiWhichQuestion.java
View file @
3616e775
...
@@ -11,46 +11,45 @@ import java.util.ArrayList;
...
@@ -11,46 +11,45 @@ import java.util.ArrayList;
import
java.util.List
;
import
java.util.List
;
public
class
CustomAttachLingxiWhichQuestion
extends
CustomAttachment
{
public
class
CustomAttachLingxiWhichQuestion
extends
CustomAttachment
{
private
final
String
XQUESTIONPAPERID
=
"x
questionPaperId"
;
//试卷id
private
final
String
QUESTIONPAPERID
=
"
questionPaperId"
;
//试卷id
private
final
String
XQUESTIONPAPERNAME
=
"xquestionPaperName"
;
//试卷名称
private
final
String
TYPE
=
"type"
;
//选项类型:radio单选,check多选
private
final
String
QUESTIONID
=
"questionId"
;
//问题id
private
final
String
OPTIONS
=
"options"
;
//选项
private
final
String
QUESTIONTITLE
=
"questionTitle"
;
//问题题目
private
final
String
EXAMID
=
"examId"
;
//考试ID
private
final
String
SELECTTYPE
=
"selectType"
;
//选项类型:1单选,2多选
private
final
String
ID
=
"id"
;
//id
private
final
String
SELECTVALS
=
"selectVals"
;
//选项
private
final
String
NAME
=
"name"
;
//name
public
String
xquestionPaperId
;
public
String
xquestionPaperName
;
public
String
questionId
;
public
String
questionTitle
;
public
String
selectType
;
public
List
<
QuestionItemBean
>
selectVals
;
public
String
questionPaperId
;
public
String
type
;
public
List
<
QuestionItemBean
>
options
;
public
String
examId
;
public
String
id
;
public
String
name
;
public
CustomAttachLingxiWhichQuestion
()
{
public
CustomAttachLingxiWhichQuestion
()
{
super
(
CustomAttachmentType
.
TYPE_LINGXI_WHICH_QUESTION
);
super
(
CustomAttachmentType
.
TYPE_LINGXI_WHICH_QUESTION
);
}
}
@Override
@Override
protected
void
parseData
(
JSONObject
data
)
{
protected
void
parseData
(
JSONObject
data
)
{
this
.
xquestionPaperId
=
data
.
getString
(
XQUESTIONPAPERID
);
this
.
questionPaperId
=
data
.
getString
(
QUESTIONPAPERID
);
this
.
xquestionPaperName
=
data
.
getString
(
XQUESTIONPAPERNAME
);
this
.
type
=
data
.
getString
(
TYPE
);
this
.
questionId
=
data
.
getString
(
QUESTIONID
);
this
.
examId
=
data
.
getString
(
EXAMID
);
this
.
questionTitle
=
data
.
getString
(
QUESTIONTITLE
);
this
.
id
=
data
.
getString
(
ID
);
this
.
selectType
=
data
.
getString
(
SELECTTYPE
);
this
.
name
=
data
.
getString
(
NAME
);
LogUtil
.
e
(
"aaaaa"
+
data
.
getString
(
SELECTVALS
));
this
.
options
=(
ArrayList
<
QuestionItemBean
>)
JSON
.
parseArray
(
data
.
getString
(
OPTIONS
),
QuestionItemBean
.
class
);
this
.
selectVals
=(
ArrayList
<
QuestionItemBean
>)
JSON
.
parseArray
(
data
.
getString
(
SELECTVALS
),
QuestionItemBean
.
class
);
}
}
@Override
@Override
protected
JSONObject
packData
()
{
protected
JSONObject
packData
()
{
JSONObject
data
=
new
JSONObject
();
JSONObject
data
=
new
JSONObject
();
data
.
put
(
XQUESTIONPAPERID
,
x
questionPaperId
);
data
.
put
(
QUESTIONPAPERID
,
questionPaperId
);
data
.
put
(
XQUESTIONPAPERNAME
,
xquestionPaperNam
e
);
data
.
put
(
TYPE
,
typ
e
);
data
.
put
(
QUESTIONID
,
questionId
);
data
.
put
(
OPTIONS
,
options
);
data
.
put
(
QUESTIONTITLE
,
questionTitle
);
data
.
put
(
EXAMID
,
examId
);
data
.
put
(
SELECTTYPE
,
selectType
);
data
.
put
(
ID
,
id
);
data
.
put
(
SELECTVALS
,
selectVals
);
data
.
put
(
NAME
,
name
);
return
data
;
return
data
;
}
}
...
...
m-im/src/main/java/com/yidianling/im/session/viewholder/MsgViewHolderLingxiWhichQuestion.java
View file @
3616e775
This diff is collapsed.
Click to expand it.
m-im/src/main/java/com/yidianling/im/session/viewholder/adapter/AdapterLingxiMultipleChoice.kt
View file @
3616e775
...
@@ -41,7 +41,7 @@ class AdapterLingxiMultipleChoice : RecyclerView.Adapter<AdapterLingxiMultipleCh
...
@@ -41,7 +41,7 @@ class AdapterLingxiMultipleChoice : RecyclerView.Adapter<AdapterLingxiMultipleCh
}
}
override
fun
onBindViewHolder
(
holder
:
ViewHolder
,
position
:
Int
)
{
override
fun
onBindViewHolder
(
holder
:
ViewHolder
,
position
:
Int
)
{
holder
.
tvWhichQuestion
.
text
=
tagList
[
position
].
valu
e
holder
.
tvWhichQuestion
.
text
=
tagList
[
position
].
nam
e
holder
.
tvWhichQuestion
.
setOnClickListener
{
holder
.
tvWhichQuestion
.
setOnClickListener
{
onItemClickListener
?.
onMultipleItemClick
(
onItemClickListener
?.
onMultipleItemClick
(
tagList
[
position
],
position
tagList
[
position
],
position
...
...
m-im/src/main/java/com/yidianling/im/session/viewholder/adapter/AdapterLingxiWhichQuestion.kt
View file @
3616e775
...
@@ -45,7 +45,7 @@ class AdapterLingxiWhichQuestion : RecyclerView.Adapter<AdapterLingxiWhichQuesti
...
@@ -45,7 +45,7 @@ class AdapterLingxiWhichQuestion : RecyclerView.Adapter<AdapterLingxiWhichQuesti
}
}
override
fun
onBindViewHolder
(
holder
:
ViewHolder
,
position
:
Int
)
{
override
fun
onBindViewHolder
(
holder
:
ViewHolder
,
position
:
Int
)
{
holder
.
tvWhichQuestion
.
text
=
tagList
[
position
].
valu
e
holder
.
tvWhichQuestion
.
text
=
tagList
[
position
].
nam
e
if
(
tagList
[
position
].
isSelected
!!
){
if
(
tagList
[
position
].
isSelected
!!
){
holder
.
tvWhichQuestion
.
background
=
ContextCompat
.
getDrawable
(
holder
.
itemView
.
context
,
R
.
drawable
.
im_background_18dp_1da1f2
)
holder
.
tvWhichQuestion
.
background
=
ContextCompat
.
getDrawable
(
holder
.
itemView
.
context
,
R
.
drawable
.
im_background_18dp_1da1f2
)
holder
.
tvWhichQuestion
.
setTextColor
(
ContextCompat
.
getColor
(
holder
.
itemView
.
context
,
R
.
color
.
white
))
holder
.
tvWhichQuestion
.
setTextColor
(
ContextCompat
.
getColor
(
holder
.
itemView
.
context
,
R
.
color
.
white
))
...
...
m-im/src/main/java/com/yidianling/im/session/viewholder/bean/LingxiWhichQuestionBean.kt
View file @
3616e775
package
com.yidianling.im.session.viewholder.bean
package
com.yidianling.im.session.viewholder.bean
import
com.google.gson.annotations.SerializedName
data class
LingxiWhichQuestionBean
(
data class
LingxiWhichQuestionBean
(
var
isSelected
:
Boolean
,
var
isSelected
:
Boolean
,
var
xquestionPaperId
:
String
?,
//试卷ID
var
id
:
String
?,
//ID
var
xquestionPaperName
:
String
?,
//试卷名称
var
questionPaperId
:
String
?,
//试卷ID
var
questionId
:
String
?,
//问题ID
var
name
:
String
?,
//问题题目
var
questionTitle
:
String
?,
//问题题目
var
type
:
String
?,
//试卷type radio单选,check 多选
var
selectType
:
String
?,
//试卷type 1单选 2多选
var
options
:
ArrayList
<
QuestionItemBean
>?
//选项
var
selectVals
:
ArrayList
<
QuestionItemBean
>?
//选项
)
)
data class
QuestionItemBean
(
data class
QuestionItemBean
(
var
id
:
String
?,
var
id
:
String
?,
var
value
:
String
?,
var
name
:
String
?,
var
isSelected
:
Boolean
?=
false
var
relates
:
ArrayList
<
Relates
>?,
var
isSelected
:
Boolean
=
false
)
//回答问题bean
data class
LingxiAnswerBean
(
var
data
:
AnswerBean
,
var
fromUid
:
String
,
var
type
:
String
,
var
toUid
:
String
)
data class
AnswerBean
(
var
examId
:
String
,
var
questionPaperId
:
String
,
var
uid
:
String
,
var
questionId
:
String
,
var
answers
:
ArrayList
<
AnswersItem
>
)
data class
AnswersItem
(
var
optionId
:
String
,
var
name
:
String
,
var
other
:
String
,
var
relates
:
ArrayList
<
Relates
>
)
data class
Relates
(
var
id
:
String
?,
var
category
:
String
?,
var
name
:
String
?,
var
score
:
String
?
)
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment