- 博客(14)
- 收藏
- 关注
原创 714
IndexControllerpackage com.zr.web;import com.zr.po.*;import com.zr.service.IBlogService;import com.zr.service.ICommentService;import com.zr.service.ITagService;import com.zr.service.ITypeService;import org.springframework.beans.factory.annotation.A
2020-07-17 00:03:53 163
原创 713
BlogDaopublic interface BlogDao extends JpaRepository<Blog,Long>, JpaSpecificationExecutor<Blog> { @Query("select b from Blog b where b.recommend=true") List<Blog> findTop(Pageable pageable);}TagDaopublic interface TagDao ext
2020-07-15 16:29:43 216
原创 710
Blog //1,2,3 private String tagsToIds(List<Tag> tags) { if (!tags.isEmpty()) { StringBuffer ids = new StringBuffer(); boolean flag = false; for (Tag tag : tags) { if (flag) {
2020-07-13 21:27:05 205
原创 79
TagDaopackage com.zr.dao;import com.zr.po.Tag;import org.springframework.data.jpa.repository.JpaRepository;public interface TagDao extends JpaRepository<Tag,Long> {}TagServiceImplpackage com.zr.service.impl;import com.zr.dao.TagDao;impo
2020-07-13 16:03:48 228
原创 78
TypeDaopackage com.zr.dao;import com.zr.po.Type;import org.springframework.data.jpa.repository.JpaRepository;public interface TypeDao extends JpaRepository<Type,Long> {}TypeServiceImplpackage com.zr.service.impl;import com.zr.dao.TypeDao
2020-07-13 01:42:58 143
原创 77
loginControllerpackage com.zr.web;import com.zr.po.User;import com.zr.service.IUserService;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.stereotype.Controller;import org.springframework.web.bind.annotation
2020-07-12 23:11:26 214
原创 7.6
UserRolepackage com.zhongruan.bean;public class UserRole { public UserRole() { } public UserRole(int id, int userId, int roleId) { this.id = id; this.userId = userId; this.roleId = roleId; } private int id;
2020-07-07 13:57:13 111
原创 7.3
user-list <td><input id="ids" name="ids" type="checkbox" value="${user.id}"></td>function deleteAll() { var checkNum=$("input[name='ids']:checked").length; if(checkNum==0){ alert("请至少选择一个进行删除!!!"); return; }
2020-07-06 00:05:19 114
原创 7.2过滤器filter
PageInfopackage com.zhongruan.bean;import java.util.List;public class PageInfo<T> { private List<T> list; private int totalPage; private int size; private int totalCount; private int currentPage; public List<T&g
2020-07-03 23:40:21 105
原创 7.1
UserController package com.zhongruan.controller; import com.zhongruan.bean.User; import com.zhongruan.service.IUserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller
2020-07-02 00:33:52 131
原创 6.30spring
ssm(spring,springmvc,mybatis)spring:1、控制反转 控制权的转移2、依赖注入 DI3、面向切面 aopspringmvc: servletmybatis: jdbcmaven:管理我们的jar包 -->把镜像改为阿里的镜像
2020-07-01 14:53:48 126
原创 6.29servlet
分层1、bean 实体层 实体类 --》属性,get set ,toString,构造方法2、dao 持久层 --》数据库的增删改查3、service 业务层4、controller 控制层UserDaopackage com.sqn.dao;import com.sqn.bean.User;import com.sqn.util.DBUtil;import java.sql.*;public class UserDao { public static void main(S
2020-06-30 15:34:21 105
原创 6.28JDBC
jdbc1、加载驱动2、创建连接3、写sql语句4、得到statement对象5、执行sql得到结果集6、处理结果集7、关闭资源DBUtilpackage sqn.util;import java.sql.*;public class DBUtil { public static Connection getConnection() throws ClassNotFoundException, SQLException { //1、加载驱动
2020-06-29 15:36:25 161
原创 6.27java斗地主
斗地主源代码package sqn;import java.util.ArrayList;import java.util.Collection;import java.util.Collections;import java.util.List;public class DouDiZhu { public static void main(String[] args){ //新建54张牌 List<String> pokes=new Ar
2020-06-28 15:38:25 277
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人