From 10563775477260524de86a363057c41aae36ebf8 Mon Sep 17 00:00:00 2001
From: zhangchao <zc857179121@qq.com>
Date: 星期三, 23 十月 2024 21:27:41 +0800
Subject: [PATCH] 1
---
src/main/java/com/zy/system/controller/UserLoginController.java | 28 ++++++++++++++--------------
1 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/src/main/java/com/zy/system/controller/UserLoginController.java b/src/main/java/com/zy/system/controller/UserLoginController.java
index 69960f1..43d9403 100644
--- a/src/main/java/com/zy/system/controller/UserLoginController.java
+++ b/src/main/java/com/zy/system/controller/UserLoginController.java
@@ -1,8 +1,8 @@
package com.zy.system.controller;
import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.mapper.EntityWrapper;
-import com.baomidou.mybatisplus.plugins.Page;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.core.annotations.ManagerAuth;
import com.core.common.Cools;
import com.core.common.DateUtils;
@@ -24,7 +24,7 @@
@RequestMapping(value = "/userLogin/{id}/auth")
@ManagerAuth
public R get(@PathVariable("id") Long id) {
- return R.ok(userLoginService.selectById(String.valueOf(id)));
+ return R.ok(userLoginService.getById(String.valueOf(id)));
}
@RequestMapping(value = "/userLogin/list/auth")
@@ -35,13 +35,13 @@
@RequestParam(required = false)String orderByType,
@RequestParam Map<String, Object> param){
excludeTrash(param);
- EntityWrapper<UserLogin> wrapper = new EntityWrapper<>();
+ QueryWrapper<UserLogin> wrapper = new QueryWrapper<>();
convert(param, wrapper);
- wrapper.orderBy("id", false);
- return R.ok(userLoginService.selectPage(new Page<>(curr, limit), wrapper));
+ wrapper.orderByDesc("id");
+ return R.ok(userLoginService.page(new Page<>(curr, limit), wrapper));
}
- private void convert(Map<String, Object> map, EntityWrapper wrapper){
+ private void convert(Map<String, Object> map, QueryWrapper wrapper){
for (Map.Entry<String, Object> entry : map.entrySet()){
if (entry.getKey().endsWith(">")) {
wrapper.ge(Cools.deleteChar(entry.getKey()), DateUtils.convert(String.valueOf(entry.getValue())));
@@ -60,7 +60,7 @@
return R.error();
}
if (null == userLogin.getId()){
- userLoginService.insert(userLogin);
+ userLoginService.save(userLogin);
} else {
userLoginService.updateById(userLogin);
}
@@ -70,7 +70,7 @@
@RequestMapping(value = "/userLogin/add/auth")
@ManagerAuth
public R add(UserLogin userLogin) {
- userLoginService.insert(userLogin);
+ userLoginService.save(userLogin);
return R.ok();
}
@@ -90,7 +90,7 @@
if (Cools.isEmpty(ids)){
return R.error();
}
- userLoginService.deleteBatchIds(Arrays.asList(ids));
+ userLoginService.removeByIds(Arrays.asList(ids));
return R.ok();
}
@@ -98,19 +98,19 @@
@ManagerAuth
public R export(@RequestBody JSONObject param){
List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class);
- EntityWrapper<UserLogin> wrapper = new EntityWrapper<>();
+ QueryWrapper<UserLogin> wrapper = new QueryWrapper<>();
Map<String, Object> map = excludeTrash(param.getJSONObject("userLogin"));
convert(map, wrapper);
- List<UserLogin> list = userLoginService.selectList(wrapper);
+ List<UserLogin> list = userLoginService.list(wrapper);
return R.ok(exportSupport(list, fields));
}
@RequestMapping(value = "/userLoginQuery/auth")
@ManagerAuth
public R query(String condition) {
- EntityWrapper<UserLogin> wrapper = new EntityWrapper<>();
+ QueryWrapper<UserLogin> wrapper = new QueryWrapper<>();
wrapper.like("token", condition);
- Page<UserLogin> page = userLoginService.selectPage(new Page<>(0, 10), wrapper);
+ Page<UserLogin> page = userLoginService.page(new Page<>(0, 10), wrapper);
List<Map<String, Object>> result = new ArrayList<>();
for (UserLogin userLogin : page.getRecords()){
Map<String, Object> map = new HashMap<>();
--
Gitblit v1.9.1