Merge remote-tracking branch 'origin/dev_1.1.2' into dev_1.1.2
This commit is contained in:
@@ -10,6 +10,7 @@ import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.mogo.utils.DateTimeUtils;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.zhidao.mogo.module.event.panel.R;
|
||||
import com.zhidao.mogo.module.event.panel.bean.ShareEventDescription;
|
||||
@@ -21,10 +22,10 @@ import java.util.ArrayList;
|
||||
|
||||
public class ShareEventAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
||||
private Context context;
|
||||
private ArrayList<ShareEventItemBase> dataArrayList;
|
||||
private ArrayList dataArrayList;
|
||||
private final LayoutInflater shareLayoutInflater;
|
||||
|
||||
public ShareEventAdapter(Context context, ArrayList<ShareEventItemBase> dataArrayList) {
|
||||
public ShareEventAdapter(Context context, ArrayList dataArrayList) {
|
||||
this.context = context;
|
||||
this.dataArrayList = dataArrayList;
|
||||
shareLayoutInflater = LayoutInflater.from(context);
|
||||
@@ -61,16 +62,17 @@ public class ShareEventAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
|
||||
if (holder instanceof shareDescriptionViewHolder) {
|
||||
ShareEventDescription data = (ShareEventDescription) dataArrayList.get(position);
|
||||
((shareDescriptionViewHolder) holder).shareNumTextView.setText(data.shareNum);
|
||||
((shareDescriptionViewHolder) holder).approveNumTextView.setText(data.approveNum);
|
||||
// ShareEventDescription.ResultBean.EnthusiasmIndexBean data = (ShareEventDescription.ResultBean.EnthusiasmIndexBean) dataArrayList.get(position);
|
||||
// ((shareDescriptionViewHolder) holder).shareNumTextView.setText(data.getShareNum());
|
||||
// ((shareDescriptionViewHolder) holder).approveNumTextView.setText(data.getLikeNum());
|
||||
} else if (holder instanceof shareItemViewHolder) {
|
||||
ShareEventItem data = (ShareEventItem) dataArrayList.get(position);
|
||||
((shareItemViewHolder) holder).caseStyleTextView.setText(data.caseStyle);
|
||||
((shareItemViewHolder) holder).caseAddressTextView.setText(data.caseAddress);
|
||||
((shareItemViewHolder) holder).caseTimeTextView.setText(data.caseTime);
|
||||
((shareItemViewHolder) holder).caseUsefulTextView.setText(data.usefulNum);
|
||||
((shareItemViewHolder) holder).caseUselessTextView.setText(data.uselessNum);
|
||||
// ShareEventItem.ResultBean.PageBean.ContentBean data = (ShareEventItem.ResultBean.PageBean.ContentBean) dataArrayList.get(position);
|
||||
//
|
||||
// ((shareItemViewHolder) holder).caseStyleTextView.setText(data.getSourceType());
|
||||
// ((shareItemViewHolder) holder).caseAddressTextView.setText(data.getUploadAddress());
|
||||
// ((shareItemViewHolder) holder).caseTimeTextView.setText(DateTimeUtils.getTimeText(data.getUploadTimestamp()));
|
||||
// ((shareItemViewHolder) holder).caseUsefulTextView.setText(data.getLikeNum());
|
||||
// ((shareItemViewHolder) holder).caseUselessTextView.setText(data.getLikeNum());
|
||||
} else if (holder instanceof shareLoadStatusViewHolder) {
|
||||
((shareLoadStatusViewHolder) holder).statusButton.setText("加载更多");
|
||||
}
|
||||
@@ -84,8 +86,10 @@ public class ShareEventAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
||||
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
int viewType = dataArrayList.get(position).getViewType();
|
||||
return viewType;
|
||||
if (position == 0){
|
||||
return ShareEventItemEnum.ITEM_TYPE_NUM_DES;
|
||||
}
|
||||
return ShareEventItemEnum.ITEM_TYPE_SHARE_LIST;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -3,8 +3,154 @@ package com.zhidao.mogo.module.event.panel.bean;
|
||||
import java.io.Serializable;
|
||||
|
||||
public class ShareEventDescription extends ShareEventItemBase implements Serializable {
|
||||
/**
|
||||
* detailMsg :
|
||||
* result : {"enthusiasmIndex":{"id":68,"sn":"ZD802B1932L00622","score":10,"shareNum":1024,"likeNum":0,"notLikeNum":0,"enthusiasmIndex":1,"createTime":"2020-07-28T06:21:11.523+0000","updateTime":"2020-07-28T06:21:11.523+0000"}}
|
||||
*/
|
||||
|
||||
public String shareNum;
|
||||
public String approveNum;
|
||||
private String detailMsg;
|
||||
private ResultBean result;
|
||||
|
||||
public String getDetailMsg() {
|
||||
return detailMsg;
|
||||
}
|
||||
|
||||
public void setDetailMsg(String detailMsg) {
|
||||
this.detailMsg = detailMsg;
|
||||
}
|
||||
|
||||
public ResultBean getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(ResultBean result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
public static class ResultBean {
|
||||
/**
|
||||
* enthusiasmIndex : {"id":68,"sn":"ZD802B1932L00622","score":10,"shareNum":1024,"likeNum":0,"notLikeNum":0,"enthusiasmIndex":1,"createTime":"2020-07-28T06:21:11.523+0000","updateTime":"2020-07-28T06:21:11.523+0000"}
|
||||
*/
|
||||
|
||||
private EnthusiasmIndexBean enthusiasmIndex;
|
||||
|
||||
public EnthusiasmIndexBean getEnthusiasmIndex() {
|
||||
return enthusiasmIndex;
|
||||
}
|
||||
|
||||
public void setEnthusiasmIndex(EnthusiasmIndexBean enthusiasmIndex) {
|
||||
this.enthusiasmIndex = enthusiasmIndex;
|
||||
}
|
||||
|
||||
public static class EnthusiasmIndexBean {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "EnthusiasmIndexBean{" +
|
||||
"id=" + id +
|
||||
", sn='" + sn + '\'' +
|
||||
", score=" + score +
|
||||
", shareNum=" + shareNum +
|
||||
", likeNum=" + likeNum +
|
||||
", notLikeNum=" + notLikeNum +
|
||||
", enthusiasmIndex=" + enthusiasmIndex +
|
||||
", createTime='" + createTime + '\'' +
|
||||
", updateTime='" + updateTime + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
/**
|
||||
* id : 68
|
||||
* sn : ZD802B1932L00622
|
||||
* score : 10
|
||||
* shareNum : 1024
|
||||
* likeNum : 0
|
||||
* notLikeNum : 0
|
||||
* enthusiasmIndex : 1.0
|
||||
* createTime : 2020-07-28T06:21:11.523+0000
|
||||
* updateTime : 2020-07-28T06:21:11.523+0000
|
||||
*/
|
||||
|
||||
private int id;
|
||||
private String sn;
|
||||
private int score;
|
||||
private int shareNum;
|
||||
private int likeNum;
|
||||
private int notLikeNum;
|
||||
private double enthusiasmIndex;
|
||||
private String createTime;
|
||||
private String updateTime;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getSn() {
|
||||
return sn;
|
||||
}
|
||||
|
||||
public void setSn(String sn) {
|
||||
this.sn = sn;
|
||||
}
|
||||
|
||||
public int getScore() {
|
||||
return score;
|
||||
}
|
||||
|
||||
public void setScore(int score) {
|
||||
this.score = score;
|
||||
}
|
||||
|
||||
public int getShareNum() {
|
||||
return shareNum;
|
||||
}
|
||||
|
||||
public void setShareNum(int shareNum) {
|
||||
this.shareNum = shareNum;
|
||||
}
|
||||
|
||||
public int getLikeNum() {
|
||||
return likeNum;
|
||||
}
|
||||
|
||||
public void setLikeNum(int likeNum) {
|
||||
this.likeNum = likeNum;
|
||||
}
|
||||
|
||||
public int getNotLikeNum() {
|
||||
return notLikeNum;
|
||||
}
|
||||
|
||||
public void setNotLikeNum(int notLikeNum) {
|
||||
this.notLikeNum = notLikeNum;
|
||||
}
|
||||
|
||||
public double getEnthusiasmIndex() {
|
||||
return enthusiasmIndex;
|
||||
}
|
||||
|
||||
public void setEnthusiasmIndex(double enthusiasmIndex) {
|
||||
this.enthusiasmIndex = enthusiasmIndex;
|
||||
}
|
||||
|
||||
public String getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(String createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public String getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(String updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,472 @@
|
||||
package com.zhidao.mogo.module.event.panel.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
public class ShareEventItem extends ShareEventItemBase implements Serializable {
|
||||
|
||||
public String caseStyle;
|
||||
public String caseAddress;
|
||||
public String caseTime;
|
||||
public String usefulNum;
|
||||
public String uselessNum;
|
||||
/**
|
||||
* detailMsg :
|
||||
* result : {"page":{"total":1024,"pageSize":1,"pageNum":4,"content":[{"coordinates":[116.407653,39.966487],"uploadTimestamp":1592901273966,"timeout":1593100800000,"uploadAddress":"安定门外大街","distance":0,"dbId":"725026095564550144","poiType":"10002","sn":"ZD802B1932L00622","userId":0,"userName":"小松鼠艾德蒙","userHead":"http://yycp-static-1255510688.cos.ap-beijing.myqcloud.com/sso-server-image/1592476328925.png","likeNum":18,"uploadType":2,"uploadUser":"123","imgUrl":null,"content":null,"gasStationId":null,"gasStationName":null,"gasImg":null,"gasPrices":null,"endDate":"2020-06-26 00:00:00","fabulous":false,"direction":180,"virtualLikeNum":822,"status":1,"sourceType":"10002","hitId":"0K-mf3MBeovPWpwE9IfR","userType":2,"data":[{"url":"http://petchfile-1255510688.cos.ap-beijing.myqcloud.com/sso-server-image/1592546939076.mp4%3Fsign%3Dq-sign-algorithm%253Dsha1%2526q-ak%253DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%2526q-sign-time%253D1592546939%253B1592550539%2526q-key-time%253D1592546939%253B1592550539%2526q-header-list%253D%2526q-url-param-list%253D%2526q-signature%253D74a4058ad7579ea210dafcf78d7a19460cffb899?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%26q-sign-time%3D1595574735%3B1595578335%26q-key-time%3D1595574735%3B1595578335%26q-header-list%3D%26q-url-param-list%3D%26q-signature%3D679bff1838c7d497d38f48ef999b50e80c5856c4","thumbnail":"http://petchfile-1255510688.cos.ap-beijing.myqcloud.com/sso-server-image/1592546956790.png%3Fsign%3Dq-sign-algorithm%253Dsha1%2526q-ak%253DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%2526q-sign-time%253D1592546956%253B1592550556%2526q-key-time%253D1592546956%253B1592550556%2526q-header-list%253D%2526q-url-param-list%253D%2526q-signature%253Dcc9a35349fc55e433f934af88df576ae792b3987?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%26q-sign-time%3D1595574735%3B1595578335%26q-key-time%3D1595574735%3B1595578335%26q-header-list%3D%26q-url-param-list%3D%26q-signature%3D99b5a92a4f97909d8c217dbeec2ec6e9ec1052f4","content":null,"illegalCount":null}]}]}}
|
||||
*/
|
||||
|
||||
private String detailMsg;
|
||||
private ResultBean result;
|
||||
|
||||
public String getDetailMsg() {
|
||||
return detailMsg;
|
||||
}
|
||||
|
||||
public void setDetailMsg(String detailMsg) {
|
||||
this.detailMsg = detailMsg;
|
||||
}
|
||||
|
||||
public ResultBean getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(ResultBean result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
public static class ResultBean {
|
||||
/**
|
||||
* page : {"total":1024,"pageSize":1,"pageNum":4,"content":[{"coordinates":[116.407653,39.966487],"uploadTimestamp":1592901273966,"timeout":1593100800000,"uploadAddress":"安定门外大街","distance":0,"dbId":"725026095564550144","poiType":"10002","sn":"ZD802B1932L00622","userId":0,"userName":"小松鼠艾德蒙","userHead":"http://yycp-static-1255510688.cos.ap-beijing.myqcloud.com/sso-server-image/1592476328925.png","likeNum":18,"uploadType":2,"uploadUser":"123","imgUrl":null,"content":null,"gasStationId":null,"gasStationName":null,"gasImg":null,"gasPrices":null,"endDate":"2020-06-26 00:00:00","fabulous":false,"direction":180,"virtualLikeNum":822,"status":1,"sourceType":"10002","hitId":"0K-mf3MBeovPWpwE9IfR","userType":2,"data":[{"url":"http://petchfile-1255510688.cos.ap-beijing.myqcloud.com/sso-server-image/1592546939076.mp4%3Fsign%3Dq-sign-algorithm%253Dsha1%2526q-ak%253DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%2526q-sign-time%253D1592546939%253B1592550539%2526q-key-time%253D1592546939%253B1592550539%2526q-header-list%253D%2526q-url-param-list%253D%2526q-signature%253D74a4058ad7579ea210dafcf78d7a19460cffb899?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%26q-sign-time%3D1595574735%3B1595578335%26q-key-time%3D1595574735%3B1595578335%26q-header-list%3D%26q-url-param-list%3D%26q-signature%3D679bff1838c7d497d38f48ef999b50e80c5856c4","thumbnail":"http://petchfile-1255510688.cos.ap-beijing.myqcloud.com/sso-server-image/1592546956790.png%3Fsign%3Dq-sign-algorithm%253Dsha1%2526q-ak%253DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%2526q-sign-time%253D1592546956%253B1592550556%2526q-key-time%253D1592546956%253B1592550556%2526q-header-list%253D%2526q-url-param-list%253D%2526q-signature%253Dcc9a35349fc55e433f934af88df576ae792b3987?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%26q-sign-time%3D1595574735%3B1595578335%26q-key-time%3D1595574735%3B1595578335%26q-header-list%3D%26q-url-param-list%3D%26q-signature%3D99b5a92a4f97909d8c217dbeec2ec6e9ec1052f4","content":null,"illegalCount":null}]}]}
|
||||
*/
|
||||
|
||||
private PageBean page;
|
||||
|
||||
public PageBean getPage() {
|
||||
return page;
|
||||
}
|
||||
|
||||
public void setPage(PageBean page) {
|
||||
this.page = page;
|
||||
}
|
||||
|
||||
public static class PageBean {
|
||||
/**
|
||||
* total : 1024
|
||||
* pageSize : 1
|
||||
* pageNum : 4
|
||||
* content : [{"coordinates":[116.407653,39.966487],"uploadTimestamp":1592901273966,"timeout":1593100800000,"uploadAddress":"安定门外大街","distance":0,"dbId":"725026095564550144","poiType":"10002","sn":"ZD802B1932L00622","userId":0,"userName":"小松鼠艾德蒙","userHead":"http://yycp-static-1255510688.cos.ap-beijing.myqcloud.com/sso-server-image/1592476328925.png","likeNum":18,"uploadType":2,"uploadUser":"123","imgUrl":null,"content":null,"gasStationId":null,"gasStationName":null,"gasImg":null,"gasPrices":null,"endDate":"2020-06-26 00:00:00","fabulous":false,"direction":180,"virtualLikeNum":822,"status":1,"sourceType":"10002","hitId":"0K-mf3MBeovPWpwE9IfR","userType":2,"data":[{"url":"http://petchfile-1255510688.cos.ap-beijing.myqcloud.com/sso-server-image/1592546939076.mp4%3Fsign%3Dq-sign-algorithm%253Dsha1%2526q-ak%253DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%2526q-sign-time%253D1592546939%253B1592550539%2526q-key-time%253D1592546939%253B1592550539%2526q-header-list%253D%2526q-url-param-list%253D%2526q-signature%253D74a4058ad7579ea210dafcf78d7a19460cffb899?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%26q-sign-time%3D1595574735%3B1595578335%26q-key-time%3D1595574735%3B1595578335%26q-header-list%3D%26q-url-param-list%3D%26q-signature%3D679bff1838c7d497d38f48ef999b50e80c5856c4","thumbnail":"http://petchfile-1255510688.cos.ap-beijing.myqcloud.com/sso-server-image/1592546956790.png%3Fsign%3Dq-sign-algorithm%253Dsha1%2526q-ak%253DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%2526q-sign-time%253D1592546956%253B1592550556%2526q-key-time%253D1592546956%253B1592550556%2526q-header-list%253D%2526q-url-param-list%253D%2526q-signature%253Dcc9a35349fc55e433f934af88df576ae792b3987?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%26q-sign-time%3D1595574735%3B1595578335%26q-key-time%3D1595574735%3B1595578335%26q-header-list%3D%26q-url-param-list%3D%26q-signature%3D99b5a92a4f97909d8c217dbeec2ec6e9ec1052f4","content":null,"illegalCount":null}]}]
|
||||
*/
|
||||
|
||||
private int total;
|
||||
private int pageSize;
|
||||
private int pageNum;
|
||||
private List<ContentBean> content;
|
||||
|
||||
public int getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotal(int total) {
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
public int getPageSize() {
|
||||
return pageSize;
|
||||
}
|
||||
|
||||
public void setPageSize(int pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
public int getPageNum() {
|
||||
return pageNum;
|
||||
}
|
||||
|
||||
public void setPageNum(int pageNum) {
|
||||
this.pageNum = pageNum;
|
||||
}
|
||||
|
||||
public List<ContentBean> getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(List<ContentBean> content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public static class ContentBean {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ContentBean{" +
|
||||
"uploadTimestamp=" + uploadTimestamp +
|
||||
", timeout=" + timeout +
|
||||
", uploadAddress='" + uploadAddress + '\'' +
|
||||
", distance=" + distance +
|
||||
", dbId='" + dbId + '\'' +
|
||||
", poiType='" + poiType + '\'' +
|
||||
", sn='" + sn + '\'' +
|
||||
", userId=" + userId +
|
||||
", userName='" + userName + '\'' +
|
||||
", userHead='" + userHead + '\'' +
|
||||
", likeNum=" + likeNum +
|
||||
", uploadType=" + uploadType +
|
||||
", uploadUser='" + uploadUser + '\'' +
|
||||
", imgUrl=" + imgUrl +
|
||||
", content=" + content +
|
||||
", gasStationId=" + gasStationId +
|
||||
", gasStationName=" + gasStationName +
|
||||
", gasImg=" + gasImg +
|
||||
", gasPrices=" + gasPrices +
|
||||
", endDate='" + endDate + '\'' +
|
||||
", fabulous=" + fabulous +
|
||||
", direction=" + direction +
|
||||
", virtualLikeNum=" + virtualLikeNum +
|
||||
", status=" + status +
|
||||
", sourceType='" + sourceType + '\'' +
|
||||
", hitId='" + hitId + '\'' +
|
||||
", userType=" + userType +
|
||||
", coordinates=" + coordinates +
|
||||
", data=" + data +
|
||||
'}';
|
||||
}
|
||||
|
||||
/**
|
||||
* coordinates : [116.407653,39.966487]
|
||||
* uploadTimestamp : 1592901273966
|
||||
* timeout : 1593100800000
|
||||
* uploadAddress : 安定门外大街
|
||||
* distance : 0
|
||||
* dbId : 725026095564550144
|
||||
* poiType : 10002
|
||||
* sn : ZD802B1932L00622
|
||||
* userId : 0
|
||||
* userName : 小松鼠艾德蒙
|
||||
* userHead : http://yycp-static-1255510688.cos.ap-beijing.myqcloud.com/sso-server-image/1592476328925.png
|
||||
* likeNum : 18
|
||||
* uploadType : 2
|
||||
* uploadUser : 123
|
||||
* imgUrl : null
|
||||
* content : null
|
||||
* gasStationId : null
|
||||
* gasStationName : null
|
||||
* gasImg : null
|
||||
* gasPrices : null
|
||||
* endDate : 2020-06-26 00:00:00
|
||||
* fabulous : false
|
||||
* direction : 180
|
||||
* virtualLikeNum : 822
|
||||
* status : 1
|
||||
* sourceType : 10002
|
||||
* hitId : 0K-mf3MBeovPWpwE9IfR
|
||||
* userType : 2
|
||||
* data : [{"url":"http://petchfile-1255510688.cos.ap-beijing.myqcloud.com/sso-server-image/1592546939076.mp4%3Fsign%3Dq-sign-algorithm%253Dsha1%2526q-ak%253DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%2526q-sign-time%253D1592546939%253B1592550539%2526q-key-time%253D1592546939%253B1592550539%2526q-header-list%253D%2526q-url-param-list%253D%2526q-signature%253D74a4058ad7579ea210dafcf78d7a19460cffb899?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%26q-sign-time%3D1595574735%3B1595578335%26q-key-time%3D1595574735%3B1595578335%26q-header-list%3D%26q-url-param-list%3D%26q-signature%3D679bff1838c7d497d38f48ef999b50e80c5856c4","thumbnail":"http://petchfile-1255510688.cos.ap-beijing.myqcloud.com/sso-server-image/1592546956790.png%3Fsign%3Dq-sign-algorithm%253Dsha1%2526q-ak%253DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%2526q-sign-time%253D1592546956%253B1592550556%2526q-key-time%253D1592546956%253B1592550556%2526q-header-list%253D%2526q-url-param-list%253D%2526q-signature%253Dcc9a35349fc55e433f934af88df576ae792b3987?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%26q-sign-time%3D1595574735%3B1595578335%26q-key-time%3D1595574735%3B1595578335%26q-header-list%3D%26q-url-param-list%3D%26q-signature%3D99b5a92a4f97909d8c217dbeec2ec6e9ec1052f4","content":null,"illegalCount":null}]
|
||||
*/
|
||||
|
||||
private long uploadTimestamp;
|
||||
private long timeout;
|
||||
private String uploadAddress;
|
||||
private int distance;
|
||||
private String dbId;
|
||||
private String poiType;
|
||||
private String sn;
|
||||
private int userId;
|
||||
private String userName;
|
||||
private String userHead;
|
||||
private int likeNum;
|
||||
private int uploadType;
|
||||
private String uploadUser;
|
||||
private Object imgUrl;
|
||||
private Object content;
|
||||
private Object gasStationId;
|
||||
private Object gasStationName;
|
||||
private Object gasImg;
|
||||
private Object gasPrices;
|
||||
private String endDate;
|
||||
private boolean fabulous;
|
||||
private int direction;
|
||||
private int virtualLikeNum;
|
||||
private int status;
|
||||
private String sourceType;
|
||||
private String hitId;
|
||||
private int userType;
|
||||
private List<Double> coordinates;
|
||||
private List<DataBean> data;
|
||||
|
||||
public long getUploadTimestamp() {
|
||||
return uploadTimestamp;
|
||||
}
|
||||
|
||||
public void setUploadTimestamp(long uploadTimestamp) {
|
||||
this.uploadTimestamp = uploadTimestamp;
|
||||
}
|
||||
|
||||
public long getTimeout() {
|
||||
return timeout;
|
||||
}
|
||||
|
||||
public void setTimeout(long timeout) {
|
||||
this.timeout = timeout;
|
||||
}
|
||||
|
||||
public String getUploadAddress() {
|
||||
return uploadAddress;
|
||||
}
|
||||
|
||||
public void setUploadAddress(String uploadAddress) {
|
||||
this.uploadAddress = uploadAddress;
|
||||
}
|
||||
|
||||
public int getDistance() {
|
||||
return distance;
|
||||
}
|
||||
|
||||
public void setDistance(int distance) {
|
||||
this.distance = distance;
|
||||
}
|
||||
|
||||
public String getDbId() {
|
||||
return dbId;
|
||||
}
|
||||
|
||||
public void setDbId(String dbId) {
|
||||
this.dbId = dbId;
|
||||
}
|
||||
|
||||
public String getPoiType() {
|
||||
return poiType;
|
||||
}
|
||||
|
||||
public void setPoiType(String poiType) {
|
||||
this.poiType = poiType;
|
||||
}
|
||||
|
||||
public String getSn() {
|
||||
return sn;
|
||||
}
|
||||
|
||||
public void setSn(String sn) {
|
||||
this.sn = sn;
|
||||
}
|
||||
|
||||
public int getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(int userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getUserHead() {
|
||||
return userHead;
|
||||
}
|
||||
|
||||
public void setUserHead(String userHead) {
|
||||
this.userHead = userHead;
|
||||
}
|
||||
|
||||
public int getLikeNum() {
|
||||
return likeNum;
|
||||
}
|
||||
|
||||
public void setLikeNum(int likeNum) {
|
||||
this.likeNum = likeNum;
|
||||
}
|
||||
|
||||
public int getUploadType() {
|
||||
return uploadType;
|
||||
}
|
||||
|
||||
public void setUploadType(int uploadType) {
|
||||
this.uploadType = uploadType;
|
||||
}
|
||||
|
||||
public String getUploadUser() {
|
||||
return uploadUser;
|
||||
}
|
||||
|
||||
public void setUploadUser(String uploadUser) {
|
||||
this.uploadUser = uploadUser;
|
||||
}
|
||||
|
||||
public Object getImgUrl() {
|
||||
return imgUrl;
|
||||
}
|
||||
|
||||
public void setImgUrl(Object imgUrl) {
|
||||
this.imgUrl = imgUrl;
|
||||
}
|
||||
|
||||
public Object getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(Object content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public Object getGasStationId() {
|
||||
return gasStationId;
|
||||
}
|
||||
|
||||
public void setGasStationId(Object gasStationId) {
|
||||
this.gasStationId = gasStationId;
|
||||
}
|
||||
|
||||
public Object getGasStationName() {
|
||||
return gasStationName;
|
||||
}
|
||||
|
||||
public void setGasStationName(Object gasStationName) {
|
||||
this.gasStationName = gasStationName;
|
||||
}
|
||||
|
||||
public Object getGasImg() {
|
||||
return gasImg;
|
||||
}
|
||||
|
||||
public void setGasImg(Object gasImg) {
|
||||
this.gasImg = gasImg;
|
||||
}
|
||||
|
||||
public Object getGasPrices() {
|
||||
return gasPrices;
|
||||
}
|
||||
|
||||
public void setGasPrices(Object gasPrices) {
|
||||
this.gasPrices = gasPrices;
|
||||
}
|
||||
|
||||
public String getEndDate() {
|
||||
return endDate;
|
||||
}
|
||||
|
||||
public void setEndDate(String endDate) {
|
||||
this.endDate = endDate;
|
||||
}
|
||||
|
||||
public boolean isFabulous() {
|
||||
return fabulous;
|
||||
}
|
||||
|
||||
public void setFabulous(boolean fabulous) {
|
||||
this.fabulous = fabulous;
|
||||
}
|
||||
|
||||
public int getDirection() {
|
||||
return direction;
|
||||
}
|
||||
|
||||
public void setDirection(int direction) {
|
||||
this.direction = direction;
|
||||
}
|
||||
|
||||
public int getVirtualLikeNum() {
|
||||
return virtualLikeNum;
|
||||
}
|
||||
|
||||
public void setVirtualLikeNum(int virtualLikeNum) {
|
||||
this.virtualLikeNum = virtualLikeNum;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getSourceType() {
|
||||
return sourceType;
|
||||
}
|
||||
|
||||
public void setSourceType(String sourceType) {
|
||||
this.sourceType = sourceType;
|
||||
}
|
||||
|
||||
public String getHitId() {
|
||||
return hitId;
|
||||
}
|
||||
|
||||
public void setHitId(String hitId) {
|
||||
this.hitId = hitId;
|
||||
}
|
||||
|
||||
public int getUserType() {
|
||||
return userType;
|
||||
}
|
||||
|
||||
public void setUserType(int userType) {
|
||||
this.userType = userType;
|
||||
}
|
||||
|
||||
public List<Double> getCoordinates() {
|
||||
return coordinates;
|
||||
}
|
||||
|
||||
public void setCoordinates(List<Double> coordinates) {
|
||||
this.coordinates = coordinates;
|
||||
}
|
||||
|
||||
public List<DataBean> getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(List<DataBean> data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public static class DataBean {
|
||||
/**
|
||||
* url : http://petchfile-1255510688.cos.ap-beijing.myqcloud.com/sso-server-image/1592546939076.mp4%3Fsign%3Dq-sign-algorithm%253Dsha1%2526q-ak%253DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%2526q-sign-time%253D1592546939%253B1592550539%2526q-key-time%253D1592546939%253B1592550539%2526q-header-list%253D%2526q-url-param-list%253D%2526q-signature%253D74a4058ad7579ea210dafcf78d7a19460cffb899?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%26q-sign-time%3D1595574735%3B1595578335%26q-key-time%3D1595574735%3B1595578335%26q-header-list%3D%26q-url-param-list%3D%26q-signature%3D679bff1838c7d497d38f48ef999b50e80c5856c4
|
||||
* thumbnail : http://petchfile-1255510688.cos.ap-beijing.myqcloud.com/sso-server-image/1592546956790.png%3Fsign%3Dq-sign-algorithm%253Dsha1%2526q-ak%253DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%2526q-sign-time%253D1592546956%253B1592550556%2526q-key-time%253D1592546956%253B1592550556%2526q-header-list%253D%2526q-url-param-list%253D%2526q-signature%253Dcc9a35349fc55e433f934af88df576ae792b3987?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%26q-sign-time%3D1595574735%3B1595578335%26q-key-time%3D1595574735%3B1595578335%26q-header-list%3D%26q-url-param-list%3D%26q-signature%3D99b5a92a4f97909d8c217dbeec2ec6e9ec1052f4
|
||||
* content : null
|
||||
* illegalCount : null
|
||||
*/
|
||||
|
||||
private String url;
|
||||
private String thumbnail;
|
||||
private Object content;
|
||||
private Object illegalCount;
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public String getThumbnail() {
|
||||
return thumbnail;
|
||||
}
|
||||
|
||||
public void setThumbnail(String thumbnail) {
|
||||
this.thumbnail = thumbnail;
|
||||
}
|
||||
|
||||
public Object getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(Object content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public Object getIllegalCount() {
|
||||
return illegalCount;
|
||||
}
|
||||
|
||||
public void setIllegalCount(Object illegalCount) {
|
||||
this.illegalCount = illegalCount;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.zhidao.mogo.module.event.panel.bean;
|
||||
|
||||
public class ShareEventItemBase {
|
||||
import com.mogo.commons.data.BaseData;
|
||||
|
||||
public class ShareEventItemBase extends BaseData {
|
||||
|
||||
private int viewType;
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.zhidao.mogo.module.event.panel.fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -10,22 +11,38 @@ import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.mogo.commons.network.SubscribeImpl;
|
||||
import com.mogo.commons.network.Utils;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.network.IMogoNetwork;
|
||||
import com.mogo.utils.network.RequestOptions;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
import com.zhidao.mogo.module.event.panel.R;
|
||||
import com.zhidao.mogo.module.event.panel.adapter.ShareEventAdapter;
|
||||
import com.zhidao.mogo.module.event.panel.bean.ShareEventDescription;
|
||||
import com.zhidao.mogo.module.event.panel.bean.ShareEventItem;
|
||||
import com.zhidao.mogo.module.event.panel.bean.ShareEventItemBase;
|
||||
import com.zhidao.mogo.module.event.panel.bean.ShareEventItemEnum;
|
||||
import com.zhidao.mogo.module.event.panel.network.HostConstant;
|
||||
import com.zhidao.mogo.module.event.panel.network.ShareEventApiService;
|
||||
import com.zhidao.mogo.module.event.panel.presenter.ShareEventsPresenter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
public class ShareEventsFragment extends MvpFragment<ShareEventsFragment, ShareEventsPresenter> {
|
||||
|
||||
private static final String TAG = "ShareEventsFragment";
|
||||
private RecyclerView recyclerView;
|
||||
private View view;
|
||||
private ShareEventAdapter adapter;
|
||||
private ArrayList dataArrayList = new ArrayList();
|
||||
private ShareEventApiService shareEventApiService;
|
||||
private int pageNum = 1;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
@@ -34,7 +51,6 @@ public class ShareEventsFragment extends MvpFragment<ShareEventsFragment, ShareE
|
||||
|
||||
@Override
|
||||
protected void initViews() {
|
||||
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -56,36 +72,75 @@ public class ShareEventsFragment extends MvpFragment<ShareEventsFragment, ShareE
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
//描述数据
|
||||
ShareEventDescription descdata = new ShareEventDescription();
|
||||
descdata.setViewType(ShareEventItemEnum.ITEM_TYPE_NUM_DES);
|
||||
descdata.shareNum = "2";
|
||||
descdata.approveNum = "4";
|
||||
dataArrayList.add(descdata);
|
||||
//列表数据
|
||||
boolean empty = false;
|
||||
//空白
|
||||
if (empty){
|
||||
ShareEventItemBase emptydata = new ShareEventItemBase();
|
||||
emptydata.setViewType(ShareEventItemEnum.ITEM_TYPE_SHARE_EMPTY);
|
||||
dataArrayList.add(emptydata);
|
||||
}else {
|
||||
for (int i = 0; i < 5; i++) {
|
||||
ShareEventItem data = new ShareEventItem();
|
||||
data.setViewType(ShareEventItemEnum.ITEM_TYPE_SHARE_LIST);
|
||||
data.caseStyle = "道路拥堵";
|
||||
data.caseAddress = "环球贸易中心";
|
||||
data.caseTime = "2020-07-21 12:00:00";
|
||||
data.usefulNum = "2";
|
||||
data.uselessNum = "4";
|
||||
dataArrayList.add(data);
|
||||
}
|
||||
//加载更多
|
||||
ShareEventItemBase loaddata = new ShareEventItemBase();
|
||||
loaddata.setViewType(ShareEventItemEnum.ITEM_TYPE_LOAD_STATUS);
|
||||
dataArrayList.add(loaddata);
|
||||
}
|
||||
IMogoNetwork network = (IMogoNetwork) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICES_NETWORK).navigation(getContext());
|
||||
this.shareEventApiService = network.create(ShareEventApiService.class, HostConstant.getNetHost());
|
||||
|
||||
getShareEventDescription();
|
||||
getShareEventList(pageNum, 10);
|
||||
}
|
||||
|
||||
/*
|
||||
* 热心指数等信息
|
||||
* */
|
||||
private void getShareEventDescription() {
|
||||
String sn = Utils.getSn();
|
||||
HashMap<String, Object> hashMap = new HashMap<>();
|
||||
hashMap.put("sn", sn);
|
||||
Map<String, Object> parameters = new HashMap<>();
|
||||
parameters.put("data", GsonUtil.jsonFromObject(hashMap));
|
||||
|
||||
shareEventApiService.getEnthusiasmIndex(parameters)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new SubscribeImpl<ShareEventDescription>(RequestOptions.create(getContext())) {
|
||||
@Override
|
||||
public void onSuccess(ShareEventDescription resultData) {
|
||||
if (resultData != null && resultData.getResult() != null
|
||||
&& resultData.getResult().getEnthusiasmIndex() != null) {
|
||||
dataArrayList.add(resultData.getResult().getEnthusiasmIndex());
|
||||
adapter.notifyDataSetChanged();
|
||||
Log.d(TAG, "热心指数---:" + resultData.getResult().getEnthusiasmIndex());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String message, int code) {
|
||||
super.onError(message, code);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 分享列表
|
||||
* */
|
||||
private void getShareEventList(int page, int size) {
|
||||
String sn = Utils.getSn();
|
||||
HashMap<String, Object> hashMap = new HashMap<>();
|
||||
hashMap.put("sn", sn);
|
||||
hashMap.put("pageNum", String.valueOf(pageNum));
|
||||
hashMap.put("pageSize", "10");
|
||||
Map<String, Object> parameters = new HashMap<>();
|
||||
parameters.put("data", GsonUtil.jsonFromObject(hashMap));
|
||||
shareEventApiService.getShareEventList(parameters)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new SubscribeImpl<ShareEventItem>(RequestOptions.create(getContext())) {
|
||||
@Override
|
||||
public void onSuccess(ShareEventItem resultData) {
|
||||
if (resultData != null && resultData.getResult() != null
|
||||
&& resultData.getResult().getPage().getContent().size() > 0) {
|
||||
dataArrayList.addAll(resultData.getResult().getPage().getContent());
|
||||
Log.d(TAG, "分享列表---:" + dataArrayList.get(0));
|
||||
adapter.notifyDataSetChanged();
|
||||
} else {
|
||||
//没有分享内容
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String message, int code) { super.onError(message, code); }
|
||||
});
|
||||
}
|
||||
|
||||
@NonNull
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.zhidao.mogo.module.event.panel.network;
|
||||
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
|
||||
public class HostConstant {
|
||||
public static final String HOST_DEV = "http://dzt-test.zhidaohulian.com";
|
||||
public static final String HOST_TEST = "http://dzt-test.zhidaohulian.com";
|
||||
public static final String HOST_DEMO = "http://dzt-show.zhidaohulian.com";
|
||||
public static final String HOST_PRODUCT = "https://dzt.zhidaohulian.com";
|
||||
|
||||
public static String getNetHost() {
|
||||
switch ( DebugConfig.getNetMode() ) {
|
||||
case DebugConfig.NET_MODE_DEV:
|
||||
return HOST_DEV;
|
||||
case DebugConfig.NET_MODE_QA:
|
||||
return HOST_TEST;
|
||||
case DebugConfig.NET_MODE_DEMO:
|
||||
return HOST_DEMO;
|
||||
default:
|
||||
return HOST_PRODUCT;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.zhidao.mogo.module.event.panel.network;
|
||||
|
||||
import com.zhidao.mogo.module.event.panel.bean.ShareEventDescription;
|
||||
import com.zhidao.mogo.module.event.panel.bean.ShareEventItem;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.FieldMap;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.QueryMap;
|
||||
|
||||
public interface ShareEventApiService {
|
||||
|
||||
//我的分享-热心指数等
|
||||
@FormUrlEncoded
|
||||
@POST("/deva/poiInfoFabulous/car/poi/no/queryEnthusiasmIndex/v1")
|
||||
Observable<ShareEventDescription> getEnthusiasmIndex(@FieldMap Map<String, Object> parames);
|
||||
|
||||
//我的分享-列表
|
||||
@FormUrlEncoded
|
||||
@POST("/deva/car/pathAndPoi/no/queryInfo")
|
||||
Observable<ShareEventItem> getShareEventList(@FieldMap Map<String, Object> parames);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user