添加消息通知接口
This commit is contained in:
@@ -0,0 +1,145 @@
|
||||
package com.navinfo.outdoor.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MessageNoticeBean {
|
||||
|
||||
private Integer code;
|
||||
private String message;
|
||||
private List<BodyBean> body;
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(Integer code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public List<BodyBean> getBody() {
|
||||
return body;
|
||||
}
|
||||
|
||||
public void setBody(List<BodyBean> body) {
|
||||
this.body = body;
|
||||
}
|
||||
|
||||
public static class BodyBean {
|
||||
private Integer id;
|
||||
private String title;
|
||||
private String subtitle;
|
||||
private Object context;
|
||||
private String iconurl;
|
||||
private Integer createpid;
|
||||
private String createtime;
|
||||
private Integer fid;
|
||||
private Integer updatepid;
|
||||
private String updatetime;
|
||||
private Object status;
|
||||
private Object appoint;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getSubtitle() {
|
||||
return subtitle;
|
||||
}
|
||||
|
||||
public void setSubtitle(String subtitle) {
|
||||
this.subtitle = subtitle;
|
||||
}
|
||||
|
||||
public Object getContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
public void setContext(Object context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public String getIconurl() {
|
||||
return iconurl;
|
||||
}
|
||||
|
||||
public void setIconurl(String iconurl) {
|
||||
this.iconurl = iconurl;
|
||||
}
|
||||
|
||||
public Integer getCreatepid() {
|
||||
return createpid;
|
||||
}
|
||||
|
||||
public void setCreatepid(Integer createpid) {
|
||||
this.createpid = createpid;
|
||||
}
|
||||
|
||||
public String getCreatetime() {
|
||||
return createtime;
|
||||
}
|
||||
|
||||
public void setCreatetime(String createtime) {
|
||||
this.createtime = createtime;
|
||||
}
|
||||
|
||||
public Integer getFid() {
|
||||
return fid;
|
||||
}
|
||||
|
||||
public void setFid(Integer fid) {
|
||||
this.fid = fid;
|
||||
}
|
||||
|
||||
public Integer getUpdatepid() {
|
||||
return updatepid;
|
||||
}
|
||||
|
||||
public void setUpdatepid(Integer updatepid) {
|
||||
this.updatepid = updatepid;
|
||||
}
|
||||
|
||||
public String getUpdatetime() {
|
||||
return updatetime;
|
||||
}
|
||||
|
||||
public void setUpdatetime(String updatetime) {
|
||||
this.updatetime = updatetime;
|
||||
}
|
||||
|
||||
public Object getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Object status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Object getAppoint() {
|
||||
return appoint;
|
||||
}
|
||||
|
||||
public void setAppoint(Object appoint) {
|
||||
this.appoint = appoint;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -55,6 +55,7 @@ import com.navinfo.outdoor.base.BaseDrawerFragment;
|
||||
import com.navinfo.outdoor.base.BaseFragment;
|
||||
import com.navinfo.outdoor.bean.GetPhoneBean;
|
||||
import com.navinfo.outdoor.bean.JobSearchBean;
|
||||
import com.navinfo.outdoor.bean.TaskPrefectureBean;
|
||||
import com.navinfo.outdoor.bean.UserBean;
|
||||
import com.navinfo.outdoor.http.Callback;
|
||||
import com.navinfo.outdoor.http.HttpInterface;
|
||||
@@ -104,7 +105,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
/**
|
||||
* 寻宝的Fragment
|
||||
@@ -136,9 +136,15 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
if (msg.what == 0x100) {
|
||||
isBack = false;
|
||||
}
|
||||
if (msg.what == 0x101){
|
||||
initMessageNotice();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* bitmapDescriptor1
|
||||
*/
|
||||
@@ -154,6 +160,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
private HashMap<String, List<Marker>> removableHashMap;
|
||||
private ArrayList<LatLng> latList;
|
||||
private ArrayList<PoiEntity> poiEntityArrayList;
|
||||
private ImageView ivMassNotification;
|
||||
private int messageType=0;
|
||||
|
||||
|
||||
public static TreasureFragment newInstance(Bundle bundle) {
|
||||
@@ -184,7 +192,33 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
}
|
||||
|
||||
}
|
||||
private void initMessageNotice() {
|
||||
|
||||
OkGoBuilder.getInstance()
|
||||
.Builder(getActivity())
|
||||
.url(HttpInterface.MESSAGE_INFO_PUSH)
|
||||
.params( new HttpParams("type",messageType+""))
|
||||
.cls(TaskPrefectureBean.class)
|
||||
.token(Constant.ACCESS_TOKEN)
|
||||
.getRequest(new Callback<GetPhoneBean>() {
|
||||
@Override
|
||||
public void onSuccess(GetPhoneBean getPhoneBean, int id) {
|
||||
if (getPhoneBean.getCode() == 200) {
|
||||
String code = getPhoneBean.getBody().getCode();
|
||||
Integer telLength = getPhoneBean.getBody().getTelLength();
|
||||
Constant.CODE = code;
|
||||
Constant.TelLength = telLength;
|
||||
} else {
|
||||
Toast.makeText(getActivity(), getPhoneBean.getMessage() + "", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
@@ -206,6 +240,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
ivMessage.setOnClickListener(this);
|
||||
treasureMap = (MapView) findViewById(R.id.treasure_map);
|
||||
tencentMap = treasureMap.getMap();
|
||||
ivMassNotification = findViewById(R.id.iv_mas_notification);//定时消息小红点
|
||||
MapManager.getInstance().init(getActivity(), tencentMap);
|
||||
// if (getClass().getCanonicalName().equals("PioFragment")){
|
||||
// ivMessage.setVisibility(View.VISIBLE);
|
||||
@@ -297,19 +332,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
|
||||
|
||||
}
|
||||
public class TimerTest {
|
||||
class MyTimerTask extends TimerTask {
|
||||
public void run() {
|
||||
|
||||
System.out.println("我爱你中国");
|
||||
}
|
||||
}
|
||||
public void main(String[] args) {
|
||||
Timer timer = new Timer();
|
||||
timer.schedule(new MyTimerTask(), 0, 5000);
|
||||
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 得到电话区号,电话位数
|
||||
*/
|
||||
|
||||
@@ -135,6 +135,8 @@ public class HttpInterface {
|
||||
public static String UNRECEIVED_POLYGON_TASK;//所有類型结束领取
|
||||
public static String COMPLETE;//面状任务结束领取
|
||||
public static String SUBMIT_POLYGON_TASK;//面状任务开始采集
|
||||
//http://dtxbmaps.navinfo.com/dtxb_test/m4/msgList/InfoPush/28/push?type=0
|
||||
public static String MESSAGE_INFO_PUSH;//消息通知
|
||||
|
||||
public static void initHttpInter(String USERID) {
|
||||
/**
|
||||
@@ -168,7 +170,7 @@ public class HttpInterface {
|
||||
EXAM_CONTENT = TEST_IP + MSG_LIST_PATH + "findAndMessage/" + USERID + "/exam_content";//发现 -能力测评获取试题接口
|
||||
//http://172.23.139.4:8002/findAndMessage/1/submitExam
|
||||
EXAM_SUBMIT = TEST_IP + MSG_LIST_PATH + "findAndMessage/" + USERID + "/submitExam";//发现 -能力测评提交试卷 post
|
||||
|
||||
MESSAGE_INFO_PUSH = TEST_IP+MSG_LIST_PATH+"InfoPush/"+USERID+"/push";//寻宝-消息通知
|
||||
/**
|
||||
* 提现 金额
|
||||
* Path=/m4/price/**
|
||||
|
||||
Reference in New Issue
Block a user