Commit 604a6502 by 霍志良

feat:im-灵犀2.0-Json字段调整

parent 540c34fe
......@@ -3,24 +3,39 @@ package com.yidianling.im.session.extension;
import com.alibaba.fastjson.JSONObject;
public class CustomAttachLingxiWhichQuestion extends CustomAttachment {
private final String TYPE="type";
private final String XQUESTIONPAPERID = "xquestionPaperId";//试卷id
private final String XQUESTIONPAPERNAME = "xquestionPaperName";//试卷名称
private final String QUESTIONID = "questionId";//问题id
private final String QUESTIONTITLE = "questionTitle";//问题题目
private final String SELECTTYPE = "selectType";//选项类型:1单选,2多选
private final String SELECTVALS = "selectVals";//选项
private String type;//消息类型
private String maxItemSize;
private String xquestionPaperId;
private String xquestionPaperName;
private String questionId;
private String questionTitle;
private String selectType;
private String selectVals;
public CustomAttachLingxiWhichQuestion() {
super(CustomAttachmentType.TYPE_LINGXI_WHICH_QUESTION);
}
@Override
protected void parseData(JSONObject data) {
this.type=data.getString(TYPE);
this.xquestionPaperId = data.getString(XQUESTIONPAPERID);
}
@Override
protected JSONObject packData()
{
return null;
protected JSONObject packData() {
JSONObject data = new JSONObject();
data.put(XQUESTIONPAPERID, xquestionPaperId);
data.put(XQUESTIONPAPERNAME, xquestionPaperName);
data.put(QUESTIONID, questionId);
data.put(QUESTIONTITLE, questionTitle);
data.put(SELECTTYPE, selectType);
data.put(SELECTVALS, selectVals);
return data;
}
}
package com.yidianling.im.session.extension;
import com.alibaba.fastjson.JSONObject;
public class CustomAttachSimpleDescUQuestion extends CustomAttachment{
CustomAttachSimpleDescUQuestion(int type) {
super(CustomAttachmentType.TYPE_LINGXI_SIMPLY_UQUESTION);
}
@Override
protected void parseData(JSONObject data) {
}
@Override
protected JSONObject packData() {
return null;
}
}
......@@ -44,8 +44,6 @@ public interface CustomAttachmentType {
int TYPE_ORDER_ALREADY_DONE=39;//已完成订单
//灵犀2.0问诊数据
int TYPE_LINGXI_WHICH_QUESTION=50;//您想要咨询哪类问题
int TYPE_LINGXI_SIMPLY_UQUESTION=51;//请简单描述您的问题
int TYPE_LINGXI_WHICH_QUESTION=55;//您想要咨询哪类问题
}
......@@ -41,8 +41,6 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen
return R.layout.im_nim_lingxi_multiple_choice;
case 3://您是先生还是女生
return R.layout.im_nim_lingxi_men_female;
case 4:
return R.layout.im_nim_lingxi_which_question;
default:
return R.layout.im_nim_lingxi_which_question;
}
......
......@@ -4,7 +4,7 @@
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="horizontal"
android:background="drawable/im_custom_message_round_white_6dp_bg"
android:background="@drawable/im_custom_message_round_white_6dp_bg"
android:paddingStart="@dimen/platform_dp_12"
android:paddingEnd="@dimen/platform_dp_12"
android:paddingBottom="@dimen/platform_dp_12"
......
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