Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
SooonerHotel
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
吴贤德
SooonerHotel
Commits
6a546299
Commit
6a546299
authored
Jul 29, 2019
by
wangjiangze
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
http://code.dev.soooner.com:18000/wuxiande/SooonerHotel
into develop
parents
e425d76b
6e23d9ab
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
103 additions
and
11 deletions
+103
-11
.gitignore
.gitignore
+1
-1
WasuChecker.go
Services/CenterService/Controller/WasuChecker.go
+3
-2
main.go
Services/CenterService/main.go
+3
-3
run.sh
Services/CenterService/run.sh
+3
-2
CenterAction.class.php
SooonerHotel/App/Lib/Action/Api/CenterAction.class.php
+4
-2
FrontAction.class.php
SooonerHotel/App/Lib/Action/Api/FrontAction.class.php
+1
-1
readme.html
SooonerHotel/docs/front/readme.html
+88
-0
No files found.
.gitignore
View file @
6a546299
...
...
@@ -7,4 +7,4 @@ nbproject/
Services/CenterService/build/
Services/CenterService/*.log*
/Docker/*
Services/CenterService/Controller/WasuChecker.go
View file @
6a546299
...
...
@@ -2,6 +2,7 @@ package Controller
import
(
log
"github.com/sirupsen/logrus"
"src/Common/DateTime"
"src/Common/Unit"
"src/Config"
"src/Model/Wasu"
...
...
@@ -29,8 +30,8 @@ func (this *WasuChecker) checkIncrementList() {
log
.
Infoln
(
"WasuChecker.checkIncrementList Starting..."
)
mediaModel
:=
new
(
Wasu
.
MediaListModel
)
mediaModel
.
Config
=
this
.
Config
//
date := DateTime.Format("YYYYMMDD", time.Now())
date
:=
"20171213"
date
:=
DateTime
.
Format
(
"YYYYMMDD"
,
time
.
Now
())
//
date:="20171213"
mediaList
:=
mediaModel
.
FetchList
(
date
,
1
)
ok
:=
mediaModel
.
UpdateMediaList
(
mediaList
)
if
!
ok
{
...
...
Services/CenterService/main.go
View file @
6a546299
...
...
@@ -19,9 +19,9 @@ func main() {
configCHK
.
Start
()
//华数媒资拉取
//
wasuCHK := new (WasuChecker)
//
wasuCHK.Config=config
//
wasuCHK.Start()
wasuCHK
:=
new
(
WasuChecker
)
wasuCHK
.
Config
=
config
wasuCHK
.
Start
()
//合作方媒资推送
spCHK
:=
new
(
SpChecker
)
...
...
Services/CenterService/run.sh
View file @
6a546299
...
...
@@ -3,7 +3,7 @@
#标准输出日志文件路径
LOG_PATH
=
"./nohup.log"
#进程名
PROGRAM
=
"Soooner
IMTraffic
"
PROGRAM
=
"Soooner
HotelCS
"
BAK_TIME
=
""
while
true
;
do
...
...
@@ -13,7 +13,8 @@ while true ; do
if
[
$PRO_NOW
-lt
1
]
;
then
mv
$LOG_PATH
$LOG_PATH
.bak
$BAK_TIME
nohup
./
$PROGRAM
>
$LOG_PATH
2>&1 &
#nohup ./$PROGRAM > $LOG_PATH 2>&1 &
nohup
./
$PROGRAM
>
/dev/null 2>
$LOG_PATH
&
date
>>
./service_check.log
echo
"start1"
>>
./service_check.log
fi
...
...
SooonerHotel/App/Lib/Action/Api/CenterAction.class.php
View file @
6a546299
...
...
@@ -151,7 +151,7 @@ class CenterAction extends Action
.
",mw.year,mw.type,mw.score,mw.region,mw.actor,mw.director"
.
",h.code hotelId,hm.status,hm.status_inject statusInject"
.
" FROM (SELECT media_id,hotel_id,status,status_inject FROM sh_hotel_media_map_
$spid
"
.
" WHERE updatetime BETWEEN'
$start
' AND '
$end
' ORDER BY updatetime ASC LIMIT
$limit_from
,
$page_size
) hm"
.
" WHERE updatetime BETWEEN'
$start
' AND '
$end
' ORDER BY updatetime
,media_id
ASC LIMIT
$limit_from
,
$page_size
) hm"
.
" JOIN sh_media_wasu mw ON mw.id=hm.media_id"
.
" JOIN sh_hotel h ON h.id=hm.hotel_id"
;
...
...
@@ -226,6 +226,7 @@ class CenterAction extends Action
$page_size
=
10
;
$rawData
=
@
file_get_contents
(
"php://input"
);
// echo "rawData:".$rawData;
$json
=
json_decode
(
$rawData
,
true
);
$spid
=
$json
[
"spid"
];
...
...
@@ -245,7 +246,7 @@ class CenterAction extends Action
.
",mw.year,mw.type,mw.score,mw.region,mw.actor,mw.director"
.
",h.code hotelId,hm.status,hm.status_inject statusInject"
.
" FROM (SELECT media_id,hotel_id,status,status_inject FROM sh_hotel_media_map_
$spid
"
.
" WHERE updatetime BETWEEN'
$start
' AND '
$end
' ORDER BY updatetime ASC LIMIT
$limit_from
,
$page_size
) hm"
.
" WHERE updatetime BETWEEN'
$start
' AND '
$end
' ORDER BY updatetime
,media_id
ASC LIMIT
$limit_from
,
$page_size
) hm"
.
" JOIN sh_media_wasu mw ON mw.id=hm.media_id"
.
" JOIN sh_hotel h ON h.id=hm.hotel_id"
;
...
...
@@ -266,6 +267,7 @@ class CenterAction extends Action
// exit;
$data
=
$this
->
HttpPost
(
$api_push
,
$json
);
// echo "post result: ".$data;
$jsonR
=
json_decode
(
$data
,
true
);
if
(
$jsonR
[
"code"
]
==
0
)
{
...
...
SooonerHotel/App/Lib/Action/Api/FrontAction.class.php
View file @
6a546299
...
...
@@ -99,7 +99,7 @@ class FrontAction extends Action
$sql
=
"SELECT mw.id,mw.code,mw.url_play,hm.status,hm.status_inject"
.
" FROM (SELECT media_id,hotel_id,status,status_inject FROM sh_hotel_media_map_
$spid
"
.
" WHERE hotel_id=
$hid
AND updatetime BETWEEN '
$start
' AND '
$end
' ORDER BY updatetime ASC LIMIT
$limit_from
,
$page_size
) hm"
.
" WHERE hotel_id=
$hid
AND updatetime BETWEEN '
$start
' AND '
$end
' ORDER BY updatetime
,media_id
ASC LIMIT
$limit_from
,
$page_size
) hm"
.
" JOIN sh_media_wasu mw ON mw.id=hm.media_id"
;
...
...
SooonerHotel/docs/front/readme.html
0 → 100644
View file @
6a546299
<!DOCTYPE html>
<html><head>
<meta
http-equiv=
"content-type"
content=
"text/html; charset=UTF-8"
>
<title>
# 分前端部署说明
</title>
<meta
charset=
"utf-8"
>
<style
type=
"text/css"
>
body
{
margin
:
0
auto
;
font-family
:
Georgia
,
Palatino
,
serif
;
color
:
#444
;
line-height
:
1
;
max-width
:
960px
;
padding
:
5px
}
h1
,
h2
,
h3
,
h4
{
color
:
#111
;
font-weight
:
400
}
h1
,
h2
,
h3
,
h4
,
h5
,
p
{
margin-bottom
:
16px
;
padding
:
0
}
h1
{
font-size
:
28px
}
h2
{
font-size
:
22px
;
margin
:
20px
0
6px
}
h3
{
font-size
:
21px
}
h4
{
font-size
:
18px
}
h5
{
font-size
:
16px
}
a
{
color
:
#09f
;
margin
:
0
;
padding
:
0
;
vertical-align
:
baseline
}
a
:hover
{
text-decoration
:
none
;
color
:
#f60
}
a
:visited
{
color
:
purple
}
ul
,
ol
{
padding
:
0
;
margin
:
0
}
li
{
line-height
:
24px
;
margin-left
:
44px
}
li
ul
,
li
ul
{
margin-left
:
24px
}
p
,
ul
,
ol
{
font-size
:
14px
;
line-height
:
20px
;
max-width
:
540px
}
pre
{
padding
:
0
24px
;
max-width
:
800px
;
white-space
:
pre-wrap
}
code
{
font-family
:
Consolas
,
Monaco
,
Andale
Mono
,
monospace
;
line-height
:
1.5
;
font-size
:
13px
}
aside
{
display
:
block
;
float
:
right
;
width
:
390px
}
blockquote
{
border-left
:
.5em
solid
#eee
;
padding
:
0
2em
;
margin-left
:
0
;
max-width
:
476px
}
blockquote
cite
{
font-size
:
14px
;
line-height
:
20px
;
color
:
#bfbfbf
}
blockquote
cite
:before
{
content
:
'�4 �A0'
}
blockquote
p
{
color
:
#666
;
max-width
:
460px
}
hr
{
width
:
540px
;
text-align
:
left
;
margin
:
0
auto
0
0
;
color
:
#999
}
button
,
input
,
select
,
textarea
{
font-size
:
100%
;
margin
:
0
;
vertical-align
:
baseline
;
*
vertical-align
:
middle
}
button
,
input
{
line-height
:
normal
;
*
overflow
:
visible
}
button
::-moz-focus-inner
,
input
::-moz-focus-inner
{
border
:
0
;
padding
:
0
}
button
,
input
[
type
=
"button"
],
input
[
type
=
"reset"
],
input
[
type
=
"submit"
]
{
cursor
:
pointer
;
-webkit-appearance
:
button
}
input
[
type
=
checkbox
],
input
[
type
=
radio
]
{
cursor
:
pointer
}
input
:not
([
type
=
"image"
]),
textarea
{
-webkit-box-sizing
:
content-box
;
-moz-box-sizing
:
content-box
;
box-sizing
:
content-box
}
input
[
type
=
"search"
]
{
-webkit-appearance
:
textfield
;
-webkit-box-sizing
:
content-box
;
-moz-box-sizing
:
content-box
;
box-sizing
:
content-box
}
input
[
type
=
"search"
]
::-webkit-search-decoration
{
-webkit-appearance
:
none
}
label
,
input
,
select
,
textarea
{
font-family
:
"Helvetica Neue"
,
Helvetica
,
Arial
,
sans-serif
;
font-size
:
13px
;
font-weight
:
normal
;
line-height
:
normal
;
margin-bottom
:
18px
}
input
[
type
=
checkbox
],
input
[
type
=
radio
]
{
cursor
:
pointer
;
margin-bottom
:
0
}
input
[
type
=
text
],
input
[
type
=
password
],
textarea
,
select
{
display
:
inline-block
;
width
:
210px
;
padding
:
4px
;
font-size
:
13px
;
font-weight
:
normal
;
line-height
:
18px
;
height
:
18px
;
color
:
gray
;
border
:
1px
solid
#ccc
;
-webkit-border-radius
:
3px
;
-moz-border-radius
:
3px
;
border-radius
:
3px
}
select
,
input
[
type
=
file
]
{
height
:
27px
;
line-height
:
27px
}
textarea
{
height
:
auto
}
:-moz-placeholder
{
color
:
#bfbfbf
}
::-webkit-input-placeholder
{
color
:
#bfbfbf
}
input
[
type
=
text
],
input
[
type
=
password
],
select
,
textarea
{
-webkit-transition
:
border
linear
.2s
,
box-shadow
linear
.2s
;
-moz-transition
:
border
linear
.2s
,
box-shadow
linear
.2s
;
transition
:
border
linear
.2s
,
box-shadow
linear
.2s
;
-webkit-box-shadow
:
inset
0
1px
3px
rgba
(
0
,
0
,
0
,
0.1
);
-moz-box-shadow
:
inset
0
1px
3px
rgba
(
0
,
0
,
0
,
0.1
);
box-shadow
:
inset
0
1px
3px
rgba
(
0
,
0
,
0
,
0.1
)}
input
[
type
=
text
]
:focus
,
input
[
type
=
password
]
:focus
,
textarea
:focus
{
outline
:
0
;
border-color
:
rgba
(
82
,
168
,
236
,
0.8
);
-webkit-box-shadow
:
inset
0
1px
3px
rgba
(
0
,
0
,
0
,
0.1
),
0
0
8px
rgba
(
82
,
168
,
236
,
0.6
);
-moz-box-shadow
:
inset
0
1px
3px
rgba
(
0
,
0
,
0
,
0.1
),
0
0
8px
rgba
(
82
,
168
,
236
,
0.6
);
box-shadow
:
inset
0
1px
3px
rgba
(
0
,
0
,
0
,
0.1
),
0
0
8px
rgba
(
82
,
168
,
236
,
0.6
)}
button
{
display
:
inline-block
;
padding
:
4px
14px
;
font-family
:
"Helvetica Neue"
,
Helvetica
,
Arial
,
sans-serif
;
font-size
:
13px
;
line-height
:
18px
;
-webkit-border-radius
:
4px
;
-moz-border-radius
:
4px
;
border-radius
:
4px
;
-webkit-box-shadow
:
inset
0
1px
0
rgba
(
255
,
255
,
255
,
0.2
),
0
1px
2px
rgba
(
0
,
0
,
0
,
0.05
);
-moz-box-shadow
:
inset
0
1px
0
rgba
(
255
,
255
,
255
,
0.2
),
0
1px
2px
rgba
(
0
,
0
,
0
,
0.05
);
box-shadow
:
inset
0
1px
0
rgba
(
255
,
255
,
255
,
0.2
),
0
1px
2px
rgba
(
0
,
0
,
0
,
0.05
);
background-color
:
#0064cd
;
background-repeat
:
repeat-x
;
background-image
:
-khtml-gradient
(
linear
,
left
top
,
left
bottom
,
from
(
#049cdb
),
to
(
#0064cd
));
background-image
:
-moz-linear-gradient
(
top
,
#049cdb
,
#0064cd
);
background-image
:
-ms-linear-gradient
(
top
,
#049cdb
,
#0064cd
);
background-image
:
-webkit-gradient
(
linear
,
left
top
,
left
bottom
,
color-stop
(
0%
,
#049cdb
),
color-stop
(
100%
,
#0064cd
));
background-image
:
-webkit-linear-gradient
(
top
,
#049cdb
,
#0064cd
);
background-image
:
-o-linear-gradient
(
top
,
#049cdb
,
#0064cd
);
background-image
:
linear-gradient
(
top
,
#049cdb
,
#0064cd
);
color
:
#fff
;
text-shadow
:
0
-1px
0
rgba
(
0
,
0
,
0
,
0.25
);
border
:
1px
solid
#004b9a
;
border-bottom-color
:
#003f81
;
-webkit-transition
:
.1s
linear
all
;
-moz-transition
:
.1s
linear
all
;
transition
:
.1s
linear
all
;
border-color
:
#0064cd
#0064cd
#003f81
;
border-color
:
rgba
(
0
,
0
,
0
,
0.1
)
rgba
(
0
,
0
,
0
,
0.1
)
rgba
(
0
,
0
,
0
,
0.25
)}
button
:hover
{
color
:
#fff
;
background-position
:
0
-15px
;
text-decoration
:
none
}
button
:active
{
-webkit-box-shadow
:
inset
0
3px
7px
rgba
(
0
,
0
,
0
,
0.15
),
0
1px
2px
rgba
(
0
,
0
,
0
,
0.05
);
-moz-box-shadow
:
inset
0
3px
7px
rgba
(
0
,
0
,
0
,
0.15
),
0
1px
2px
rgba
(
0
,
0
,
0
,
0.05
);
box-shadow
:
inset
0
3px
7px
rgba
(
0
,
0
,
0
,
0.15
),
0
1px
2px
rgba
(
0
,
0
,
0
,
0.05
)}
button
::-moz-focus-inner
{
padding
:
0
;
border
:
0
}
</style>
</head>
<body>
<h1>
分前端部署说明
</h1>
<p>
## 镜像地址
</p>
<pre><code>
code.dev.soooner.com:65000/hotel/front:19.7.29.2
</code></pre>
<p>
## 部署(centos7 docker-ce 最新版)
</p>
<p>
### 安装docker运行环境
</p>
<pre><code>
** 已安装请跳过这一步
** 不会安装请参考
docker安装教程 : https://www.jianshu.com/p/d9dbf7e23722
</code></pre>
<p>
#### 安装yum管理工具
</p>
<pre><code>
>
yum install -y yum-utils
>
yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
</code></pre>
<p>
#### 查看防火墙状态并禁用
</p>
<pre><code>
>
systemctl status firewalld
>
systemctl stop firewalld
>
systemctl disable firewalld
</code></pre>
<p>
#### 查看是否已安装docker
</p>
<pre><code>
>
ps -ef|grep docker
# 安装docker-ce最新版
>
yum install docker-ce
...等其它步骤完成环境的安装配置
# 启动容器
>
systemctl start docker
# 查看docker状态
>
systemctl status docker
</code></pre>
<p>
#### 修改docker配置
</p>
<pre><code>
>
vi /etc/docker/daemon.json
如:
{
"registry-mirrors":["http://hub-mirror.c.163.com"],
"data-root":"/home/soooner/docker-home",
"insecure-registries":["code.dev.soooner.com:65000"]
}
</code></pre>
<p>
##运行容器
</p>
<p>
### 配置私有仓库地址
</p>
<pre><code>
vi /etc/docker/daemon.json
# 增加配置项: "insecure-registries":["code.dev.soooner.com:65000"]
# 例如我本地的配置:
{
"registry-mirrors":["http://hub-mirror.c.163.com"],
"data-root":"/home/soooner/docker-home",
"insecure-registries":["code.dev.soooner.com:65000"]
}
</code></pre>
<p>
### 拉取镜像
</p>
<pre><code>
>
docker pull code.dev.soooner.com:65000/hotel/front:19.7.29.2
</code></pre>
<p>
### 运行命令
</p>
<pre><code>
docker run -itd --name front1 --privileged=true --restart=always \
-p 1801:801 \
-p 16000:6000 \
-e "FRONT_CODE=F1" \
-e "CENTER_SERVER=api.hotel.wasu.tv" \
-v /home/soooner/data:/data1 \
-v /dev/mem:/dev/mem \
code.dev.soooner.com:65000/hotel/front:19.7.29.2
</code></pre>
<p>
#### 参数说明:
</p>
<pre><code>
--name front1 # 指定运行容器的容器名称,可以更改为其他名称
-p 1801:801 # 端口映射, 1801 可以改成其他端口, 该端口为分前端对外提供服务的端口
-p 16000:6000 # 没有冲突可以不改
-e "FRONT_CODE=F1" # 分前端标识
-e "CENTER_SERVER=api.hotel.wasu.tv" # 指定中心API地址
-v /home/soooner/data:/data1 \ # 映射分前端数据存储路径
code.dev.soooner.com:65000/hotel/front:19.7.29.2 # 容器镜像地址(这里为私有仓库,需修改docker配置文件并重启docker)
</code></pre>
<!-- Use style in style2-->
</body></html>
\ No newline at end of file
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