发表于: 2018-01-11 21:48:54

1 526


今天完成的事情:

今天早点休息。

 顺利完成了数据库表格的设计。

学生表:

签到表:

多媒体表:

还有一些表格就不一一贴出来了。

然后尝试做了一些微信的东西:

/**
* 检查签名
* @param request
* @param response
* @throws IOException
*/
//微信api 获取微信测试公众号使用权限
@RequestMapping(value = "/weixinapi",method = RequestMethod.GET)
private void checkSignature(HttpServletRequest request, HttpServletResponse response)
throws IOException {
String signature = request.getParameter("signature");
   String timestamp = request.getParameter("timestamp");
   String nonce = request.getParameter("nonce");
   String echostr = request.getParameter("echostr");
   String token = "12345678";
   ArrayList<String> list = new ArrayList<String>();
   list.add(token);
   list.add(timestamp);
   list.add(nonce);
   Collections.sort(list,new Comparator<String>() {
public int compare(String o1, String o2) {
return o1.compareTo(o2);
       }
});
   System.out.println("token:"+token+"..."+"timestamp:"+timestamp+"..."+"nonce:"+nonce);
   String tempStr = list.get(0)+list.get(1)+list.get(2);
   tempStr = sha1util.encode(tempStr);
   //tempStr = ECDSASignature.SHA1.encode(tempStr);
   if(signature.equals(tempStr)){
response.getWriter().print(echostr);
   }else{
response.getWriter().print(tempStr);
   }

}

//获取微信code

在手机上通过微信访问对应的url  可以直接获取code 然后通过code向微信服务器发送get请求可以获得openid 通过openid即可获取对应的用户信息。

不过这个还没来得及测试。阿里的服务器貌似都炸了。

明天计划的事情:

设计api接口定义参数。

遇到的问题:

第一次接触微信api很多东西都需要学习。
收获:

有了初步接触。


返回列表 返回列表
评论

    分享到