发表于: 2017-09-12 22:14:13

2 1035


今天做的事:

今天把之前说的逻辑整合到任务代码中了

public interface StudentService {
public List<Student> getExcellent();
   public int getStudying();
   public int getWorking();
   public int insert(Student student);
   public boolean sendEmail(String email);
   public boolean putPicture(String picture);
   public boolean sendMessage(Integer tel,Integer verify);
}

实现类就不贴了,就是之前的demo代码,然后做了些改动,将某些地方变为变量

@RequestMapping(value = "/a/success",method = RequestMethod.GET)
public String getSuccess(){
return "success";
}

@RequestMapping(value = "/a/Stu",method = RequestMethod.GET)
public String addStu(Map<String,Object> map){
map.put("student",new Student());
   return "insertStu";
}

@RequestMapping(value = "/a/Stu",method = RequestMethod.POST)
public String insertStu(Student student,Integer checking){
int verify = (int)(Math.random()*1000);
   try {
boolean flag1 = sS.sendMessage(student.getTel(), verify);
       boolean flag2 = (checking == verify) ? true : false;
       boolean flag3 = sS.sendEmail(student.getEmail());
       boolean flag4 = sS.putPicture(student.getImage());
       if (flag1 == true && flag2 == true && flag3 == true && flag4 == true) {
int i =sS.insert(student);
           if(i > 0) {
return "redirect:/a/success";
           }
}
}catch (Exception e){
e.printStackTrace();
   }
return "redirect:/a/error";
}

还没测试逻辑是否有问题,页面如何写也在考虑,因为涉及一个短信验证的问题,明天测试一下能否成功。

还有上传图片这个也有一定问题,因为上传到的是七牛云的对象存储中,那我如何从中取出,并通过我的数据库中的字段调用是个问题,还有上传文件的选择,应该以什么模式,我们常用的选择图片会弹出一个窗口,然后选择图片,不知道这个是怎么实现的,会不会比较难实现,明天也需要看一下。



然后Controller也写好了,正打算写页面,突然噩耗传来。。。


然后我就交了工单,开始处理服务器的问题,最后发现里面的一些文件被删了,还有比特币勒索,真的就搞笑了

最后我决定妥协,因为挖矿软件找不到,每次登陆服务器,这个东西还神烦,提醒我充值比特币,那我只能选择重装系统了。。

然后本来其实挺简单的,毕竟不是第一次那种茫然失措的状态了,但是我发现我按照自己之前写的博客安装mysql竟然有很多问题,为了不误人子弟,目前在排查问题中。

明天计划:写页面,然后测功能,将任务7推进

问题:linux服务器被黑,需要了解一下防火墙和开放特定端口的知识

收获:暂无,一会再看看吧



返回列表 返回列表
评论

    分享到