Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
石磊
/
cihai
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit be04608f
authored
Dec 07, 2017
by
侯昆
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
添加从自定义词库搜索
1 parent
b7f01ebc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
serverside/cihai-wechat/src/main/java/com/dookay/cihai/wechat/controller/HomeController.java
serverside/cihai-wechat/src/main/java/com/dookay/cihai/wechat/controller/HomeController.java
View file @
be04608
...
@@ -18,10 +18,7 @@ import com.dookay.cihai.core.aip.AipWordUtilBean;
...
@@ -18,10 +18,7 @@ import com.dookay.cihai.core.aip.AipWordUtilBean;
import
com.dookay.cihai.core.theme.domain.ThemeDomain
;
import
com.dookay.cihai.core.theme.domain.ThemeDomain
;
import
com.dookay.cihai.core.theme.query.ThemeQuery
;
import
com.dookay.cihai.core.theme.query.ThemeQuery
;
import
com.dookay.cihai.core.theme.service.IThemeService
;
import
com.dookay.cihai.core.theme.service.IThemeService
;
import
com.dookay.cihai.core.word.domain.CustomDictionaryDomain
;
import
com.dookay.cihai.core.word.domain.WordDomain
;
import
com.dookay.cihai.core.word.query.CustomDictionaryQuery
;
import
com.dookay.cihai.core.word.query.CustomDictionaryQuery
;
import
com.dookay.cihai.core.word.query.WordQuery
;
import
com.dookay.cihai.core.word.service.ICustomDictionaryService
;
import
com.dookay.cihai.core.word.service.ICustomDictionaryService
;
import
com.dookay.cihai.core.word.service.IWordService
;
import
com.dookay.cihai.core.word.service.IWordService
;
import
com.dookay.coral.common.web.controller.BaseController
;
import
com.dookay.coral.common.web.controller.BaseController
;
...
@@ -72,8 +69,16 @@ public class HomeController extends BaseController {
...
@@ -72,8 +69,16 @@ public class HomeController extends BaseController {
@ResponseBody
@ResponseBody
public
JsonResult
search
(
String
keyword
)
{
public
JsonResult
search
(
String
keyword
)
{
System
.
out
.
println
(
"进入搜索"
);
System
.
out
.
println
(
"进入搜索"
);
String
result
=
null
;
CustomDictionaryQuery
query1
=
new
CustomDictionaryQuery
();
query1
.
setWord
(
keyword
);
try
{
try
{
String
result
=
aipWordUtilBean
.
extractQueryKeyword
(
keyword
);
int
count
=
customDictionaryService
.
count
(
query1
);
if
(
count
>
0
)
{
result
=
keyword
;
}
else
{
result
=
aipWordUtilBean
.
extractQueryKeyword
(
keyword
);
}
ThemeQuery
query
=
new
ThemeQuery
();
ThemeQuery
query
=
new
ThemeQuery
();
query
.
setKeyword
(
result
);
query
.
setKeyword
(
result
);
ThemeDomain
themeDomain
=
themeService
.
getFirst
(
query
);
ThemeDomain
themeDomain
=
themeService
.
getFirst
(
query
);
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment