#8:30-9:00 签到打卡
#9:30-12:00 观看java视频
#14:00-18:00 写qq项目
1.好友同意后数据库保存信息并将信息加载到客服端
}else if(m.getS().equals("23")){
Mysql my=new Mysql();
Massage ms=new Massage();
String ss=my.inlt("2",m.getMyid());//好友信息取出
if(ss==null){ss=m.getOid();}//好友信息添加
else{ ss=ss+"|"+m.getOid();}
my.update(m.getMyid(),"好友='"+ss+"'");
ss=my.inlt("2",m.getOid());
if(ss==null){ss=m.getMyid();}
else{ ss=ss+"|"+m.getMyid();
}
my.update(m.getOid(),"好友='"+ss+"'");//好友图片加载
m.ss=new ArrayList<String>();
m.ss1=new ArrayList<Integer>();
m.ss2=new ArrayList<byte[]>();
File fl = new File("src\\qqserver\\view\\" + m.getOid()+ ".jpg");
FileInputStream fis = new FileInputStream(fl.getCanonicalPath());
byte[] buf = new byte[1024];
int len;
while ((len = fis.read(buf)) != -1) {
m.ss.add(m.getOid());
m.ss1.add(len);
m.ss2.add(buf);
buf = new byte[1024];
}
oos=new ObjectOutputStream(s.getOutputStream());
oos.writeObject(m);
ms.setS("23");
ms.setMyid(m.getOid());
ms.setOid(m.getMyid());
ms.setOname(m.getMyname());
ms.setMyname(m.getOname());
ms.ss=new ArrayList<String>();
ms.ss1=new ArrayList<Integer>();
ms.ss2=new ArrayList<byte[]>();
fl = new File("src\\qqserver\\view\\" + ms.getOid()+ ".jpg");
fis = new FileInputStream(fl.getCanonicalPath());
buf = new byte[1024];
while ((len = fis.read(buf)) != -1) {
ms.ss.add(ms.getOid());
ms.ss1.add(len);
ms.ss2.add(buf);
buf = new byte[1024];
}
oos=new ObjectOutputStream(Mythreads.getthread(ms.getMyid()).s.getOutputStream());
oos.writeObject(ms);
}
2.客服端好友加载
}else if(m.getS().equals("23")){//好友添加完后的加载
String s3=null;
FileOutputStream fos=null;
for(int i=0;i<m.ss.size();i++)
{
File fl=new File("src\\qqc\\massage\\"+m.getMyid());
fl=new File(fl.getCanonicalPath());
if(!fl.exists()){
fl.mkdir();
}
if(s3!=m.ss.get(i)){
s3=m.ss.get(i);
fl=new File("src\\qqc\\massage\\"+m.getMyid()+"\\"+s3+".jpg");
fos=new FileOutputStream(fl.getCanonicalPath());
}
fos.write(m.ss2.get(i),0,m.ss1.get(i));
}
Mqqchat.getqqin(m.getMyid()).shows(m.getOid(),m.getOname());