From 6d9c71948fe8890dfc1556387e46af3b43fd9855 Mon Sep 17 00:00:00 2001 From: datagear Date: Thu, 25 Oct 2018 16:22:05 +0800 Subject: [PATCH] =?UTF-8?q?[web]=E7=A7=BB=E9=99=A4UserController=E4=B8=AD?= =?UTF-8?q?=E5=B7=B2=E5=BA=9F=E5=BC=83=E7=9A=84=E5=86=85=E5=AD=98=E5=85=B3?= =?UTF-8?q?=E9=94=AE=E5=AD=97=E6=90=9C=E7=B4=A2=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/AbstractMybatisService.java | 2 +- .../web/controller/UserController.java | 23 ------------------- 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/datagear-management/src/main/java/org/datagear/management/service/impl/AbstractMybatisService.java b/datagear-management/src/main/java/org/datagear/management/service/impl/AbstractMybatisService.java index f4912a70..7679a7f3 100644 --- a/datagear-management/src/main/java/org/datagear/management/service/impl/AbstractMybatisService.java +++ b/datagear-management/src/main/java/org/datagear/management/service/impl/AbstractMybatisService.java @@ -440,7 +440,7 @@ public abstract class AbstractMybatisService extends SqlSessionDaoSupport if (keyword != null && !keyword.isEmpty()) { if (!keyword.startsWith("%") && !keyword.endsWith("%")) - keyword = keyword + "%"; + keyword = "%" + keyword + "%"; param.put(QUERY_PARAM_KEYWORD, keyword); } diff --git a/datagear-web/src/main/java/org/datagear/web/controller/UserController.java b/datagear-web/src/main/java/org/datagear/web/controller/UserController.java index fc1608c7..25483f98 100644 --- a/datagear-web/src/main/java/org/datagear/web/controller/UserController.java +++ b/datagear-web/src/main/java/org/datagear/web/controller/UserController.java @@ -9,7 +9,6 @@ import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.datagear.dbinfo.TableInfo; import org.datagear.management.domain.User; import org.datagear.management.service.SchemaService; import org.datagear.management.service.UserService; @@ -17,7 +16,6 @@ import org.datagear.persistence.PagingQuery; import org.datagear.persistence.support.UUID; import org.datagear.web.OperationMessage; import org.datagear.web.convert.ClassDataConverter; -import org.datagear.web.util.KeywordMatcher; import org.datagear.web.util.WebUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.MessageSource; @@ -224,8 +222,6 @@ public class UserController extends AbstractController List users = this.userService.query(WebUtils.getUser(request, response), pagingQuery); - users = findByKeyword(users, pagingQuery.getKeyword()); - return users; } @@ -273,25 +269,6 @@ public class UserController extends AbstractController return buildOperationMessageSaveSuccessResponseEntity(request); } - /** - * 根据表名称关键字查询{@linkplain TableInfo}列表。 - * - * @param users - * @param tableNameKeyword - * @return - */ - protected List findByKeyword(List users, String keyword) - { - return KeywordMatcher. match(users, keyword, new KeywordMatcher.MatchValue() - { - @Override - public String[] get(User t) - { - return new String[] { t.getName() }; - } - }); - } - @Override protected String buildMessageCode(String code) {