- 博客(99)
- 收藏
- 关注
原创 分页查询的详细实现步骤
分页查询的详细实现步骤Controller/** * 分页查询 * @param * @return */ @ApiOperation(value = "分页查询") @PostMapping("pageBook") @LogAction(module = "李渊斌", method = "分页查询", logType = LogTypeEnum.SELECT, operatorType = OperatorTypeEnum.WEB).
2022-01-12 14:56:04
2642
原创 RJsoft 注解的使用
RJsoft 注解的使用@ApiOperation(value = "增加操作")首先@ApiOperation注解不是Spring自带的,它是是swagger里的注解@ApiOperation是用来构建Api文档的@ApiOperation(value = “接口说明”, httpMethod = “接口请求方式”, response =“接口返回参数类型”, notes = “接口发布说明”;其他参数可参考源码; @LogAction(module = "李渊斌", metho.
2022-01-11 14:34:05
330
原创 RJsoft的实体类
RJsoft的实体类Vo概念:VO(View Object):视图对象,用于展示层,它的作用是把某个指定页面(或组件)的所有数据封装起来。Ao概念:AO(Application Object) 应用对象,在 Web 层与 Service 层之间抽象的复用对象模型,极为贴近展示层,复用度不高。使用率感觉也不高,可以忽略ToTO(Transfer Object) ,数据传输对象在应用程序不同 tie( 关系 ) 之间传输的对象DToDTO(Data Transfer Object)数据.
2022-01-11 13:46:47
375
原创 RjsoftVO实体类
**RjsoftVO实体类**ResponseVo用来做返回的可以接收响应码,响应信息,响应结果 @ApiModelProperty(value = "响应码") private Integer code; @ApiModelProperty(value = "响应信息") private String msg; @ApiModelProperty(value = "响应结果") private T data;实体类要实现序列化接口public cla
2022-01-07 16:38:03
276
原创 RJsoft
Controller控制层@RestController@RequestMapping("/admin/cloth")public class UploadClothExeclController { @Autowired private IUploadClothExeclService clothExeclService;@RestController 相当于 @ResponseBody + @Controller 返回JSON字符串@RequestMapping 访
2022-01-07 14:24:08
203
原创 springboot的邮件任务
springboot的邮件任务首先导入mail的pom文件 <!--邮件的--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-mail</artifactId> </dependency> @Autow.
2021-09-05 14:32:27
193
原创 springboot实现异步任务
springboot实现异步任务@Servicepublic class AsyncService { @Async public void hello(){ try { Thread.sleep(3000); } catch (InterruptedException e) { e.printStackTrace(); } System.out.println("数据正在.
2021-09-05 12:20:27
118
原创 swagger的使用
swagger的使用可以声明在SwaggerConfig类中可以声明多个Docket方法每个Docket方法可以扫描一个basePackage:指定要扫描的包方便开发package com.lishao.config;import org.springframework.context.annotation.Bean;import org.springframework.context.annotation.Configuration;import org.springframe.
2021-09-04 11:38:06
195
原创 springboot的swagger使用
**springboot的swagger使用**<dependency> <groupId>io.springfox</groupId> <artifactId>springfox-boot-starter</artifactId> <version>3.0.0</version> </dependency>首先导入
2021-09-02 14:18:42
274
原创 shiro-springboot和mybatis整合
shiro-springboot和mybatis整合导入必要的pox文件 <!--引入mysql--> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.6</version>.
2021-08-31 13:51:18
200
原创 springboot的security使用
springboot的security使用package com.lishao.config;import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;import org.springframework.security.config.annotation.web.builders.HttpSecurity;import org.spri.
2021-08-30 12:44:42
236
原创 springboot的security使用
springboot的security使用 <!--thymeleaf-springsecurity4--> <dependency> <groupId>org.thymeleaf.extras</groupId> <artifactId>thymeleaf-extras-springsecurity4</artifactId> <ver.
2021-08-27 13:55:07
177
原创 mybatis的增删改查
mybatis的增删改查以下是springboot的整合mybatis的xml文件写在resource下面@Mapper //知道是myabtis@Repository //被springboot接管public interface UserMapper { //查询全部用户 List<User> queryUserList(); //根据id查询用户 User queryUserById(Integer id); //增加 .
2021-08-27 10:02:37
176
原创 Druid实现后台监控和过滤器
Druid实现后台监控和过滤器application.yaml的配置spring: datasource: username: root password: root url: jdbc:mysql://localhost:3306/mybatis?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai driver-class-name: com.mysql.cj..
2021-08-26 15:54:47
347
原创 Springboot的自定义视图和拦截器
Springboot的自定义视图和拦截器@Configurationpublic class MyMvcConfig implements WebMvcConfigurer { @Override public void addViewControllers(ViewControllerRegistry registry) { registry.addViewController("/").setViewName("/index"); registry.
2021-08-25 17:14:40
259
原创 thymeleaf的if和else的用法
thymeleaf的if和else的用法<a th:class="${active=='main.html'? 'nav-link active':'nav-link'}"active:为自定义的名字如果选的是main.html 那么执行 nav-link active如果选的不是main.html那么执行 nav-link如下也是一样因为上面写的是在整合中写的 都是公用的 怎么在调用公用的页面上使用呢?语法<div th:insert="~{/commons/com.
2021-08-25 16:51:26
4635
原创 springboot中的thymeleaf
springboot中的thymeleafthymeleaf提取公共部分的代码将公用的顶部和侧边的导航栏整合在一块格式th:fragment=“topbar”~~00000000000000000000000000000000000000000000000000000000 ~~怎么用语法 th:insert=~{/commons/commons :: topbar}<div th:insert="~{/commons/commons :: topbar}"&g.
2021-08-25 16:41:19
195
原创 springboot的templates用法
**springboot的templates用法**@Controllerpublic class HelloController { @RequestMapping("/test") public String test(Model model){ model.addAttribute("msg","<h1>templates测试</h1>"); model.addAttribute("users", Arrays.asLis
2021-08-21 15:38:28
5462
原创 springboot的精髓
springboot的精髓springBoot启动会加载大量的自动配置类我们看我们需要的功能有没有在Spring Boot默认写好的自动配置类当中;我们再来看这个自动配置类中到底配置了哪些组件;(只要我们要用的组件存在在其中,我们就不需要再手动配置了)给容器中自动配置类添加组件的时候,会从properties类中获取某些属性。我们只需要在配置文件中指定这些属性的值即可;xxxxAutoConfigurartion:自动装配类;给容器中添加组件xxxxProperties:封装配置文件中相关.
2021-08-20 16:26:46
299
原创 springboot的多环境配置
springboot的多环境配置每个都定义不同的端口号,运行的顺序是这样的!也可以这样写,更简单方便阅读!不写第五行的话他就会运行的是8081这个端口,写了第五行的action是运行的dev的也就是8082的端口...
2021-08-20 14:23:58
60
原创 spring boot的JSR-303校验
spring boot的JSR-303校验如@Email这个注解也可能要导入<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-validation</artifactId> </dependency>这个pom文件如图,name的值就必须为邮箱的格式才能运行成功,我的不是邮箱的格式,所以就运行报.
2021-08-19 16:47:24
57
原创 springboot的数据校验@Validated
springboot的数据校验@Validated可能需要导入的jar包是 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-validation</artifactId> </dependency>在pojo类上定义这个注解pri.
2021-08-19 16:43:03
241
原创 springboot的yaml的微微进阶
**springboot的yaml的微微进阶**name: lishao${random.uuid}这个代码可以运行出来随机的uuid 简单方便下面dog的name属性是 如果person中存在asd这个 那就用asd的value赋值我这个有person的asd为lili 那么我这个运行的结果就为lili_小陈要是Person没有asd这个属性,那么运行的结果就为xiaochen_小陈...
2021-08-19 16:38:21
64
原创 springboot的yaml用法
springboot的yaml用法首先把默认的application.pro…文件删了,新建一个application.yaml文件直接把对应的值写上面再运行test下的注意pojo类上要加上这个这个注解yaml的代码Person: name: lishao age: 19 happy: false birth: 2020/10/31 maps: {k1: v1,k2: v2} asd: lili lists: - code - music.
2021-08-19 16:33:25
160
原创 Vue的运行原理
Vue的运行原理在src下的components文件夹下编写Content和Main.vue组件内容并且在router文件夹下的index.js路由配置进行路径绑定,然后main.vue主程序入口导入并申明使用,最后在APP.vue组件中嵌套两个路由便签...
2021-08-16 16:32:19
492
原创 Vue的插槽slot使用
Vue的插槽slot使用这三个title是对应的这两个title是对应的同理v-for的这个item 也是对应的这三个是对应的自定义的标签
2021-08-14 15:37:35
64
原创 springmvc的json 乱码处理和时间戳工具类
springmvc的json 乱码处理@ResponseBody 不会执行跳转到视图@RequestMapping(value = “/j1” ,produces = “application/json;charset=utf-8”)这个是防止乱码的@RestController//@Controllerpublic class UserController { @RequestMapping(value = "/j1" ,produces = "application/jso.
2021-07-16 17:00:15
119
原创 springmvc的乱码处理
springmvc的乱码处理用psot请求写一个表单提交 会出现乱码 <!--乱码处理--> <filter> <filter-name>encoding</filter-name> <filter-class>com.lishao.filter.EncodingFilter</filter-class> </filter> <filter-mapp.
2021-07-16 16:54:37
60
原创 springmvc的url重定向和转发
springmvc的url重定向和转发这个网址上必须得传的是username= 而不是name=当写一个实体类User的时候 可以直接传User
2021-07-16 16:49:02
293
原创 springMVC的URL的RestFul用法
SpringMVC的URL的RestFul用法普通的URL网址是 http://localhost:8080/add?method= a大概就是这样 很不安全RestFul的是URl的网址显示为 http://localhost:8080/add/1/2客户看起开都不知到是啥 很安全默认的是GET请求public class RestFulController { @RequestMapping("/add/{a}/{b}") public String test1(@.
2021-07-15 17:23:28
98
原创 SpringMVC的初级认识
SpringMVC的实现称不上原理web.xml的基本配置<?xml version="1.0" encoding="UTF-8"?><web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/ja.
2021-07-15 09:28:40
91
原创 整合mybatis-spring的方法一
整合mybatis-spring的方法一1.先导入必要的jar包<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.
2021-07-12 21:17:34
129
1
原创 mybatis的关于 resultType 与 parameterType 的基本使用的区别
***~~mybatis的关于 resultType 与 parameterType 的基本使用的区别~~ *********以下关于 resultType 与 parameterType 的基本使用的区别 :1、使用 resultType : 主要针对于从数据库中提取相应的数据出来2、使用parameterType : 主要针对于 将信息存入到数据库中 如: insert 增加数据到数据库中 Update更新等***...
2021-07-02 13:32:54
155
原创 Myabtis一对多
Myabtis一对多一个老师对应多个学生嵌套查询<!--嵌套查询--> <select id="getTeacher2" resultMap="teacherMap"> select s.id sid,s.name sname , t.id tid,t.name tname from student s,teacher t where s.tid =t.id and t.id=#{tid} .
2021-07-01 19:31:50
92
原创 mybatis实现注解增删改查
mybatis实现注解增删改查UserMapper /*查询全部*/ @Select("select * from mybatis.user ") List<User> getUsers(); /*根据ID查询*/ @Select("select * from mybatis.user where id=#{id} ") User getUserById(@Param("id") String id); /*添加*/ @Insert.
2021-07-01 19:20:03
268
原创 mybatis的多对一
mybatis的多对一多个学生对一个老师public interface StudentMapper { public List<Student> getStudent(); public List<Student> getStudent2();}学生接口 <!--第二种--> <select id="getStudent2" resultMap="StudentTeacher2"> select s.
2021-07-01 15:22:46
84
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人