Commit 3616e775 by 霍志良

feat:im-灵犀2.0-回答问题接口

parent 5d070de9
...@@ -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
...@@ -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 = "xquestionPaperId";//试卷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, xquestionPaperId); data.put(QUESTIONPAPERID, questionPaperId);
data.put(XQUESTIONPAPERNAME, xquestionPaperName); data.put(TYPE,type);
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;
} }
......
...@@ -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].value holder.tvWhichQuestion.text=tagList[position].name
holder.tvWhichQuestion.setOnClickListener { holder.tvWhichQuestion.setOnClickListener {
onItemClickListener?.onMultipleItemClick( onItemClickListener?.onMultipleItemClick(
tagList[position], position tagList[position], position
......
...@@ -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].value holder.tvWhichQuestion.text = tagList[position].name
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))
......
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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment