dao层
增加图片
主要就是把不同的属性先赋值
再给一个对象,用于存储
public boolean save(PhotoModel photo) {
Document dom = Dom4jFactory.getDocument();
Element root = dom.getRootElement();
//添加属性
Element p = root.addElement("photo");
p.addAttribute("uuid", photo.getUuid());
p.addAttribute("realName", photo.getRealName());
p.addAttribute("dateTime", photo.getDateTime());
p.addAttribute("ip", photo.getIp());
p.addAttribute("ext", photo.getExt());
p.addAttribute("dir", photo.getDir());
p.addAttribute("desc", photo.getDesc());
return Dom4jFactory.save();
}