Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
crm_java_search
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ikcrm_server
crm_java_search
Commits
f87c7c2c
Commit
f87c7c2c
authored
Mar 14, 2019
by
dongfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix readme.md && version
parent
7abc85bb
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
20 additions
and
9 deletions
+20
-9
Gemfile.lock
+1
-1
README.md
+13
-1
lib/crm_java_search.rb
+0
-1
lib/crm_java_search/checkers/api_check_service.rb
+0
-1
lib/crm_java_search/config.rb
+5
-5
lib/crm_java_search/trans/http_handler.rb
+1
-0
No files found.
Gemfile.lock
View file @
f87c7c2c
PATH
PATH
remote: .
remote: .
specs:
specs:
crm_java_search (0.
1.
3)
crm_java_search (0.3)
GEM
GEM
remote: https://rubygems.org/
remote: https://rubygems.org/
...
...
README.md
View file @
f87c7c2c
...
@@ -22,7 +22,19 @@ Or install it yourself as:
...
@@ -22,7 +22,19 @@ Or install it yourself as:
## Usage
## Usage
TODO: Write usage instructions here
在cofig 文件下新建文件crm_java_search.rb, 读取相关配置:
```
ruby
# 配置文件例子
# es:
# enabled: true
# search_enabled: true
# check_enabled: true
# sync_enabled: true
# host: 'http://dev-pc-search.ikcrm.com'
crm_java_search_config
=
HashWithIndifferentAccess
.
new
YAML
.
load_file
(
"
#{
Rails
.
root
}
/config/microservices.yml"
)[
Rails
.
env
][
'es'
]
CrmJavaSearch
::
Config
.
init
(
crm_java_search_config
)
```
## Development
## Development
...
...
lib/crm_java_search.rb
View file @
f87c7c2c
...
@@ -20,6 +20,5 @@ end
...
@@ -20,6 +20,5 @@ end
Dir
[
File
.
dirname
(
__FILE__
)
+
'/crm_java_search/agents/*.rb'
].
sort
.
each
do
|
path
|
Dir
[
File
.
dirname
(
__FILE__
)
+
'/crm_java_search/agents/*.rb'
].
sort
.
each
do
|
path
|
filename
=
File
.
basename
(
path
)
filename
=
File
.
basename
(
path
)
p
filename
require
"crm_java_search/agents/
#{
filename
}
"
require
"crm_java_search/agents/
#{
filename
}
"
end
end
lib/crm_java_search/checkers/api_check_service.rb
View file @
f87c7c2c
...
@@ -34,7 +34,6 @@ module CrmJavaSearch
...
@@ -34,7 +34,6 @@ module CrmJavaSearch
checker
=
"CrmJavaSearch::Checkers::
#{
@klass
}
Checker"
.
constantize
.
new
(
user:
user
,
entity:
record
,
params:
dup_params
)
checker
=
"CrmJavaSearch::Checkers::
#{
@klass
}
Checker"
.
constantize
.
new
(
user:
user
,
entity:
record
,
params:
dup_params
)
checker
.
check
checker
.
check
Log
.
logger
.
info
(
"Checkers::ApiCheckService checker:
#{
checker
.
inspect
}
"
)
Log
.
logger
.
info
(
"Checkers::ApiCheckService checker:
#{
checker
.
inspect
}
"
)
if
[
'1'
,
'2'
].
include?
(
checker
.
result
[
:code
])
if
[
'1'
,
'2'
].
include?
(
checker
.
result
[
:code
])
message
=
checker
.
result
[
:remark
]
message
=
checker
.
result
[
:remark
]
...
...
lib/crm_java_search/config.rb
View file @
f87c7c2c
...
@@ -8,11 +8,11 @@ module CrmJavaSearch
...
@@ -8,11 +8,11 @@ module CrmJavaSearch
def
default_settings
def
default_settings
{
{
enabled:
tru
e
,
enabled:
fals
e
,
search_enabled:
tru
e
,
search_enabled:
fals
e
,
check_enabled:
tru
e
,
check_enabled:
fals
e
,
sync_enabled:
tru
e
,
sync_enabled:
fals
e
,
host:
'
http://dev-pc-search.ikcrm.com
'
host:
''
}.
with_indifferent_access
}.
with_indifferent_access
end
end
...
...
lib/crm_java_search/trans/http_handler.rb
View file @
f87c7c2c
...
@@ -15,6 +15,7 @@ module CrmJavaSearch
...
@@ -15,6 +15,7 @@ module CrmJavaSearch
end_time
=
Time
.
now
.
getlocal
end_time
=
Time
.
now
.
getlocal
Log
.
logger
.
info
(
"start_time:
#{
start_time
}
end_time:
#{
end_time
}
"
)
Log
.
logger
.
info
(
"start_time:
#{
start_time
}
end_time:
#{
end_time
}
"
)
Log
.
logger
.
info
(
"ESRequest Time:
#{
end_time
-
start_time
}
"
)
Log
.
logger
.
info
(
"ESRequest Time:
#{
end_time
-
start_time
}
"
)
Log
.
logger
.
info
(
"res:
#{
res
}
"
)
res
res
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment