当前位置:网站首页>Function development of user information management
Function development of user information management
2022-06-11 18:37:00 【C_ x_ three hundred and thirty】
List of articles
Background login function development
Demand analysis
Code development
A functional test
Background exit function development
Demand analysis
Code development
A functional test
Improve the background login function
Log in first when the user is not logged in
Use filter / Interceptor
filter
- How to create a filter
- First create a class
- Add annotations @WebFilter(filtername=" This is the same as the class name ",urlPatterns=“/*”)
- Implementation interface Filter
- Rewriting methods General writing doFilter The method will do
- Add an annotation to the startup class @ServletComponentScan
Implementation logic
New employees
Paging query of employee information
- How to configure MybatisPlus Pagination plug-in for ?
@Configuration public class MybatisPlusConfig { @Bean public MybatisPlusInterceptor mybatisPlusInterceptor(){ MybatisPlusInterceptor mpi = new MybatisPlusInterceptor(); mpi.addInnerInterceptor(new PaginationInnerInterceptor()); return mpi; } }
@GetMapping("/page") public R<Page> page(int page,int pageSize,String name){ log.info("page= {}, pageSize= {}, name= {}",page,pageSize,name); // Construct a paging constructor Page pageinfo= new Page(page,pageSize); // Construct condition constructors LambdaQueryWrapper<Employee> lqw=new LambdaQueryWrapper(); lqw.like(StringUtils.isNotEmpty(name),Employee::getName,name); // Add sorting criteria By update time lqw.orderByAsc(Employee::getUpdateTime); // Execute the query employeeService.page(pageinfo,lqw); return R.success(pageinfo); }
Enable / disable employee account
- Js Yes Long Loss of precision in data processing , That leads to the submission of id And in the database id atypism
- resolvent
- We will respond to the server Json Data time , United will Long Type data is converted to string data for processing
Edit employee information
- Echo employee information
@GetMapping("/{id}") public R<Employee> edit(@PathVariable Long id){ log.info(" according to id Query employee information "); Employee emp = employeeService.getById(id); if(emp!=null){ return R.success(emp); } return R.error(" Edit failed "); }
- There's a little detail : @GetMapping(“/{id}”)
- This "/{id}" Don't add it in front by mistake "/${id}" Don't confuse
边栏推荐
猜你喜欢

*Use of jetpack notes room
Téléchargement et téléchargement des fichiers nécessaires au développement

使用Visdom对损失函数进行监控

Niu Ke's question -- finding the least common multiple

力扣刷题——根据二叉树创建字符串

「案例分享」基于 AM57x+ Artix-7 FPGA开发板——PRU开发手册详解

Surveillance des fonctions de perte avec visdom

金融银行_催收系统简介

Quanzhi T3 development board (4-core arm cortex-a7) - detailed explanation of logo display during system startup

Easycwmp source code analysis
随机推荐
用户信息管理的功能开发
全国院校MBA、EMBA、MPA、MEM、提前面试(预面试)时间批次已出(持续更新中)-文都管联院
Quanzhi technology T3 development board (4-core arm cortex-a7) - mqtt communication protocol case
防止敌方坦克重叠
On the sequence traversal of binary tree Ⅱ
构造敌方坦克
Quanzhi Technology T3 Development Board (4 Core ARM Cortex - A7) - mqtt Communication Protocol case
The nearest common ancestor of binary tree
Non recursive traversal of binary tree
Async leads to unexpected function results and changes the intention of the original code; await is only valid in async functions and the top level bodies of modules
Force deduction 32 questions longest valid bracket
初识企业级平台
v-for循环遍历
全志科技T3開發板(4核ARM Cortex-A7)——MQTT通信協議案例
新项目 搭建环境方法
Easycwmp source code analysis
On the problem that the while loop condition in keil does not hold but cannot jump out
New project construction environment method
Force buckle 34 finds the first and last positions of elements in a sorted array
力扣23题,合并K个升序链表