zoukankan      html  css  js  c++  java
  • Android debugger 出现提示Connected to the target VM, address: 'localhost:xxxx', transport: 'socket'

    1 api接口

     [HttpPost]
            public Response<int> setItemSign(string companyDB,string signPath,List<ItemConfirmData> data)
            {
                Response<int> response = new Response<int>();
                try
                {
                    int result = AppApi.setItemSign(companyDB, signPath, data);
                    response.Status = true;
                    response.Message = result.ToString();
                    response.Data = new List<int>();//如果不加这句,会导致app获取返回体时无反应
                }
                catch (Exception e)
                {
    
                    response.Status = false;
                    response.Message = e.Message;
                }
    
                return response;
            }

    2 调api接口

                String p="?companyDB="+PublicVal.TM_COMPANY.getBindMES()+"&signPath="+path;
                HttpRequestUtil.post(mContext, PublicVal.ServerURL + PublicVal.API_setItemSign+p, mSignData,
                        new JsonCallback<ResponseBean<Object>>() {
    
                            @Override
                            public void onDataSuccess(ResponseBean<Object> responseBean) {                           
                                if (responseBean.Status) {
                                    mHandler.obtainMessage(SignFinish_CALLBACK_SUCCESS).sendToTarget();
                                } else {
                                    mMessageDia.ShowAlertMessage(responseBean.Message);
                                }
                            }
    
                            @Override
                            public void onError(Response<ResponseBean<Object>> response) {
                                super.onError(response);
                                closeLoadingDialog();
                                if (response.body() != null) {
                                    ResponseBean<Object> body = response.body();
                                      mMessageDia.ShowAlertMessage(body.Message);
                                }
                            }
                        });

    3 ResponseBean<T> 定义

    public class ResponseBean<T> implements Serializable {
    
        public boolean Status;
        public int Code;
        public String Message;
        public T Data;
    
    
    }

    4 出现的错误

    
    
  • 相关阅读:
    〖Python〗-- Tornado自定义session组件
    〖Python〗-- Tornado异步非阻塞
    〖Python〗-- Tornado基础
    〖Python〗-- Flask
    〖Python〗-- 设计模式
    〖Python〗-- Celery分布式任务队列
    〖Demo〗-- CosPlayPermission
    05——wepy框架中的一些细节
    04——wepy框架搭建
    03——微信小程序官方demo讲解——page部分
  • 原文地址:https://www.cnblogs.com/-7999/p/13775466.html
Copyright © 2011-2022 走看看