# ClassroomReservationSystemForAndroid **Repository Path**: zyy98/ClassroomReservationSystemForAndroid ## Basic Information - **Project Name**: ClassroomReservationSystemForAndroid - **Description**: 大三下Android教室预约系统SSM后台 - **Primary Language**: Java - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 0 - **Created**: 2019-05-23 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ### 大三下Android教室预约系统SSM后台 - 在gitee添加部署公钥后可用如下脚本在服务器上一键部署: ```bash git pull echo "-----pull------" mv ./out/artifacts/ClassroomReservationSystemForAndroid_war/ClassroomReservationSystemForAndroid_war.war ./out/artifacts/ClassroomReservationSystemForAndroid_war/ClassroomReservationSystemForAndroid.war echo "------rename------" sudo rm -rf /usr/tomcat/apache-tomcat-9.0.6/webapps/ClassroomReservationSystemForAndroid* echo "------remove old------" cp ./out/artifacts/ClassroomReservationSystemForAndroid_war/ClassroomReservationSystemForAndroid.war /usr/tomcat/apache-tomcat-9.0.6/webapps/ClassroomReservationSystemForAndroid.war echo "------copy new------" sudo chmod -R 775 /usr/tomcat/apache-tomcat-9.0.6/webapps/ClassroomReservationSystemForAndroid* echo "------chmod------" ``` 生成公钥命令 ``` ssh-keygen -t rsa -b 4096 -C ``` - 为了和json以及数据库命名规则一致,本项目中的javabean使用匈牙利命名法 - 相同url参数不同返回数据不同的实现方法: ``` @RequestMapping(value = "/test2",params = "t1") @ResponseBody public Msg test(@RequestParam(value = "t1")String t1){ return Msg.success().add("t1",t1); } @RequestMapping(value = "/test2",params ={"t1","t2"} ) @ResponseBody public Msg test(@RequestParam(value = "t1")String t1,@RequestParam(value = "t2")String t2){ return Msg.success().add("t1",t1).add("t2",t2); } ``` - ArrayList的contains方法原理:底层依赖于equals方法. HashSet的add()方法和contains方法()底层都依赖 hashCode()方法与equals方法() - java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986 at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:460) 在本地conf/catalina.properties 中添加(适用于8.5以下版本) ``` tomcat.util.http.parser.HttpParser.requestTargetAllow=|{} ``` conf/server.xml(高版本): ``` ``` - spring接收对象参数时不能直接使用@RequestParam,而是@ModelAttribute ```java @RequestMapping(value = "/usertest",method = RequestMethod.POST) @ResponseBody public Msg test2(@ModelAttribute User user) { //这里不用再加value = "xxx",传数据直接传user对象的各个字段值即可 System.out.println(user); return Msg.success().add("user", user); } ``` > @ModelAttribute与@RequestBody都是用来注解解析前端发来数据,并自动对应到所定义的字段名称。 这里先放结论,使用@ModelAttribute注解的实体类接收前端发来的数据格式需要为"x-www-form-urlencoded",@RequestBody注解的实体类接收前端的数据格式为JSON(application/json)格式。(若是使用@ModelAttribute接收application/json格式,虽然不会报错,但是值并不会自动填入) > RESTful 使用POST来创建一个资源,使用PUT或者PATCH来更新一个资源。 区别是: – PUT用来整体更新一个资源,所以请求中必须包含完整的资源信息。如果缺少部分信息,会导致这部分数据被更新为NULL。 – PATCH则是部分更新。仅更新提供的字段,请求中缺少的字段仍保持不变。 - Mybatis配置文件中大于小于需转义 ``` ]]>``` ### 参考资料 - [相关子查询与不相关子查询](https://blog.csdn.net/shiyong1949/article/details/80923083) - [Mybatis关系映射](https://www.cnblogs.com/zhaopengcheng/p/7094880.html) - [Mybatis反向生成及Mybatis实践总结](https://blog.csdn.net/zb408112217/article/details/81284142) - [Mybatis中resultMap是否可以共享(每个mapper.xml中都要重复定义相同的resultMap吗)](https://blog.csdn.net/lianzhang861/article/details/79475637) - [mybatis配置文件中小于大于号的处理](https://blog.csdn.net/u022812849/article/details/42123007) - [spring mvc中请求方式相同url相同参数不相同的两个url方法分开](https://blog.csdn.net/hgx2014/article/details/73162652) - [ArrayList,HashSet判断对象是否重复的原因](https://blog.csdn.net/fang0321/article/details/83857661) - [git 几个commit点合并成一个commit点](https://blog.csdn.net/u013276277/article/details/82470177) - [后台报错java.lang.IllegalArgumentException: Invalid character found in the request target.](https://www.cnblogs.com/dygrkf/p/9088370.html) - [Tomcat 8 Invalid character found in the request target. The valid characters are defined in RFC 3986](https://yq.aliyun.com/articles/641394) - [Tomcat 8 is not able to handle get request with '|' in query parameters?](https://stackoverflow.com/questions/41053653/tomcat-8-is-not-able-to-handle-get-request-with-in-query-parameters/51212677#51212677) - [SpringMVC中@ModelAttribute与@RequestBody的区别](https://blog.csdn.net/qq_42684642/article/details/83058211) - [REST中更新操作使用PUT,还是PATCH?](https://blog.csdn.net/hxg117/article/details/87877530 ) - [REST API: 该使用部分更新还是全部更新?](https://blog.csdn.net/bychahaha/article/details/53271394)