Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
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
hujun
tl_estate
Commits
ee74588a
Commit
ee74588a
authored
Jan 20, 2018
by
clone
Committed by
hujun
Mar 01, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
f8e419bd
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
58 additions
and
30 deletions
+58
-30
AppChat.php
application/chat/controller/AppChat.php
+15
-15
ChatService.php
application/chat/service/ChatService.php
+9
-8
RPush.php
application/chat/utils/RPush.php
+3
-1
curl_cookie.txt
application/chat/utils/curl_cookie.txt
+1
-1
ChatMsg.php
application/model/ChatMsg.php
+1
-1
ChatMsgExt.php
application/model/ChatMsgExt.php
+3
-4
log.txt
log.txt
+26
-0
No files found.
application/chat/controller/AppChat.php
View file @
ee74588a
...
@@ -114,21 +114,21 @@ class AppChat extends Basic
...
@@ -114,21 +114,21 @@ class AppChat extends Basic
public
function
pushMsg
()
public
function
pushMsg
()
{
{
$params
=
$this
->
params
;
$params
=
$this
->
params
;
if
(
!
isset
(
$params
[
'target_type'
])
||
!
isset
(
$params
[
'target'
])
||
!
isset
(
$params
[
'type'
])
||
!
isset
(
$params
[
'msg_content'
])
if
(
!
isset
(
$params
[
'target_type'
])
||
!
isset
(
$params
[
'target'
])
||
!
isset
(
$params
[
'type'
])
||
!
isset
(
$params
[
'msg_content'
])
||
!
isset
(
$params
[
'source'
])
||
!
isset
(
$params
[
'is_user'
])
||
!
isset
(
$params
[
'from'
]))
{
||
!
isset
(
$params
[
'source'
])
||
!
isset
(
$params
[
'is_user'
])
||
!
isset
(
$params
[
'from'
]))
{
return
$this
->
response
(
ErrorCodeConst
::
ERROR_CODE_PARAM_NOT_EXIST
,
"请求参数错误"
);
return
$this
->
response
(
ErrorCodeConst
::
ERROR_CODE_PARAM_NOT_EXIST
,
"请求参数错误"
);
}
}
/*$params = array(
/*
$params = array(
'msg_content' => '111',
'msg_content' => '111',
'target_type' => 'users',
'target_type' => 'users',
'source' => '1',
'source' => '1',
'from' => 'app_64',
'from' => 'app_64',
'type' => '1',
'type' => '1',
'is_user' => '0',
'is_user' => '0',
'target' => '18112347151',
'target' => '18112347151',
);*/
);*/
$target_type
=
$params
[
'target_type'
];
// 消息类型 users 给用户发消息。chatgroups: 给群发消息,chatrooms: 给聊天室发消息
$target_type
=
$params
[
'target_type'
];
// 消息类型 users 给用户发消息。chatgroups: 给群发消息,chatrooms: 给聊天室发消息
$target
=
$params
[
'target'
];
//接受人 if target_type 群 者表示群id
$target
=
$params
[
'target'
];
//接受人 if target_type 群 者表示群id
$source
=
$params
[
'source'
];
//消息来源 1c端app 2b端app 3其他
$source
=
$params
[
'source'
];
//消息来源 1c端app 2b端app 3其他
...
...
application/chat/service/ChatService.php
View file @
ee74588a
...
@@ -200,6 +200,7 @@ class ChatService
...
@@ -200,6 +200,7 @@ class ChatService
$msgModel
=
new
ChatMsg
();
$msgModel
=
new
ChatMsg
();
$id
=
$msgModel
->
addChatMsg
(
$params
);
$id
=
$msgModel
->
addChatMsg
(
$params
);
if
(
$id
>
0
)
{
if
(
$id
>
0
)
{
//todo 插入msg_ext
//todo 插入msg_ext
$group_id
=
0
;
$group_id
=
0
;
...
@@ -220,16 +221,16 @@ class ChatService
...
@@ -220,16 +221,16 @@ class ChatService
*/
*/
private
function
insetMsgExt
(
$id
,
$type
,
$msg_content
,
$is_group
,
$group_id
)
private
function
insetMsgExt
(
$id
,
$type
,
$msg_content
,
$is_group
,
$group_id
)
{
{
$param
s
[
"msg_id"
]
=
$id
;
$param
[
"msg_id"
]
=
$id
;
$param
s
[
"type"
]
=
$type
;
$param
[
"type"
]
=
$type
;
$param
s
[
"body"
]
=
$msg_content
;
$param
[
"body"
]
=
$msg_content
;
$param
s
[
"send_type"
]
=
$is_group
;
$param
[
"send_type"
]
=
$is_group
;
$param
s
[
"group_id"
]
=
$group_id
;
$param
[
"group_id"
]
=
$group_id
;
$param
s
[
"create_at"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$param
[
"create_at"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$param
s
[
"updated_at"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$param
[
"updated_at"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$msgExtModel
=
new
ChatMsgExt
();
$msgExtModel
=
new
ChatMsgExt
();
$msgExtModel
->
addChatMsgExt
(
$param
s
);
$msgExtModel
->
addChatMsgExt
(
$param
);
}
}
/** 获取聊天记录
/** 获取聊天记录
...
...
application/chat/utils/RPush.php
View file @
ee74588a
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
namespace
app\chat\utils
;
namespace
app\chat\utils
;
use
app\chat\consts\ConfigConst
;
use
app\chat\consts\ConfigConst
;
use
Think\Log
;
/**
/**
...
@@ -53,6 +54,7 @@ class RPush
...
@@ -53,6 +54,7 @@ class RPush
'from'
=>
$from
,
'from'
=>
$from
,
);
);
$data
=
json_encode
(
$arr
);
$data
=
json_encode
(
$arr
);
echo
$data
;
echo
"-------------"
;
$curl
=
new
\app\chat\utils\CurlUtil
();
$curl
=
new
\app\chat\utils\CurlUtil
();
$curl
->
headers
=
[
$curl
->
headers
=
[
"Accept"
=>
"application/json"
,
"Accept"
=>
"application/json"
,
...
@@ -65,7 +67,7 @@ class RPush
...
@@ -65,7 +67,7 @@ class RPush
];
];
$url
=
$this
->
buildSendUrl
();
$url
=
$this
->
buildSendUrl
();
$response
=
$curl
->
post
(
$url
,
$data
);
$response
=
$curl
->
post
(
$url
,
$data
);
dump
(
$response
);
Log
::
record
(
'info -------------'
,
json_encode
(
$response
)
);
return
$response
;
return
$response
;
}
}
...
...
application/chat/utils/curl_cookie.txt
View file @
ee74588a
...
@@ -2,4 +2,4 @@
...
@@ -2,4 +2,4 @@
# http://curl.haxx.se/docs/http-cookies.html
# http://curl.haxx.se/docs/http-cookies.html
# This file was generated by libcurl! Edit at your own risk.
# This file was generated by libcurl! Edit at your own risk.
a1.easemob.com FALSE / FALSE 151641
6547
rememberMe deleteMe
a1.easemob.com FALSE / FALSE 151641
9232
rememberMe deleteMe
application/model/ChatMsg.php
View file @
ee74588a
...
@@ -29,8 +29,8 @@ class ChatMsg extends Model
...
@@ -29,8 +29,8 @@ class ChatMsg extends Model
try
{
try
{
$this
->
save
(
$params
);
$this
->
save
(
$params
);
$id
=
$this
->
id
;
$id
=
$this
->
id
;
return
$id
;
Db
::
commit
();
Db
::
commit
();
return
$id
;
}
catch
(
\Exception
$e
)
{
}
catch
(
\Exception
$e
)
{
Db
::
rollback
();
Db
::
rollback
();
...
...
application/model/ChatMsgExt.php
View file @
ee74588a
...
@@ -20,18 +20,17 @@ class ChatMsgExt extends Model
...
@@ -20,18 +20,17 @@ class ChatMsgExt extends Model
public
function
__construct
()
public
function
__construct
()
{
{
$this
->
db
=
Db
(
$this
->
table
);
$this
->
db
=
Db
::
name
(
$this
->
table
);
}
}
public
function
addChatMsgExt
(
$params
)
public
function
addChatMsgExt
(
$params
)
{
{
Db
::
startTrans
();
Db
::
startTrans
();
try
{
try
{
$this
->
save
(
$params
);
$this
->
db
->
insert
(
$params
);
$id
=
$this
->
id
;
return
$id
;
Db
::
commit
();
Db
::
commit
();
}
catch
(
\Exception
$e
)
{
}
catch
(
\Exception
$e
)
{
dump
(
$e
);
Db
::
rollback
();
Db
::
rollback
();
}
}
...
...
log.txt
View file @
ee74588a
...
@@ -258,3 +258,29 @@ response body = <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
...
@@ -258,3 +258,29 @@ response body = <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<statusMsg>IP鉴权失败</statusMsg>
<statusMsg>IP鉴权失败</statusMsg>
</Response>
</Response>
request body = <TemplateSMS>
<to>18756256666</to>
<appId>8a216da85f5c89b1015f7718e2b90a63</appId>
<templateId>214759</templateId>
<datas><data>3450</data><data>5分钟</data></datas>
</TemplateSMS>
request url = https://app.cloopen.com:8883/2013-12-26/Accounts/8a48b55153eae51101540e763d3b3888/SMS/TemplateSMS?sig=40EE1C43A1B08B698B610DC95026AF74
response body = <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Response>
<statusCode>160053</statusCode>
<statusMsg>IP鉴权失败</statusMsg>
</Response>
request body = <TemplateSMS>
<to>18756255555</to>
<appId>8a216da85f5c89b1015f7718e2b90a63</appId>
<templateId>214759</templateId>
<datas><data>5919</data><data>5分钟</data></datas>
</TemplateSMS>
request url = https://app.cloopen.com:8883/2013-12-26/Accounts/8a48b55153eae51101540e763d3b3888/SMS/TemplateSMS?sig=8DABD7C3A3D79365F4AA65E92613F6A1
response body = <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Response>
<statusCode>160053</statusCode>
<statusMsg>IP鉴权失败</statusMsg>
</Response>
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