Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wecloud_im_server
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
hewei
wecloud_im_server
Commits
3235203d
Commit
3235203d
authored
Feb 08, 2022
by
Future
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
证书文件存储单测类调整
parent
e82187d9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
5 deletions
+30
-5
bootstrap/src/test/java/io/geekidea/springbootplus/test/SaveApnsTest.java
+29
-4
core/src/main/java/com/wecloud/im/service/impl/ImIosApnsServiceImpl.java
+1
-1
No files found.
bootstrap/src/test/java/io/geekidea/springbootplus/test/SaveApnsTest.java
View file @
3235203d
...
@@ -12,6 +12,10 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -12,6 +12,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.FileNotFoundException
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStream
;
/**
/**
...
@@ -33,14 +37,35 @@ public class SaveApnsTest {
...
@@ -33,14 +37,35 @@ public class SaveApnsTest {
String
pwd
=
"123456"
;
String
pwd
=
"123456"
;
InputStream
certificate
=
IosPush
.
getApnsCertificate
(
apnsCertificatePath
);
// InputStream certificate = IosPush.getApnsCertificate(apnsCertificatePath);
String
encode
=
Base64
.
encode
(
certificate
);
// String encode = Base64.encode(certificate);
File
file
=
new
File
(
"C:\\wenzhd\\res\\ios\\ChatSdk_ios.p12"
);
String
base64
=
null
;
FileInputStream
fin
=
null
;
try
{
fin
=
new
FileInputStream
(
file
);
byte
[]
buff
=
new
byte
[
fin
.
available
()];
fin
.
read
(
buff
);
base64
=
Base64
.
encode
(
buff
);
}
catch
(
FileNotFoundException
e
)
{
e
.
printStackTrace
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
finally
{
if
(
fin
!=
null
)
{
try
{
fin
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
ImIosApns
imIosApns
=
new
ImIosApns
();
ImIosApns
imIosApns
=
new
ImIosApns
();
imIosApns
.
setId
(
SnowflakeUtil
.
getId
());
imIosApns
.
setId
(
SnowflakeUtil
.
getId
());
imIosApns
.
setFkAppId
(
0
L
);
imIosApns
.
setFkAppId
(
1
L
);
imIosApns
.
setApnsFileValue
(
encode
);
imIosApns
.
setApnsFileValue
(
base64
);
imIosApns
.
setEnv
(
1
);
imIosApns
.
setEnv
(
1
);
imIosApns
.
setBundleId
(
topicBundleId
);
imIosApns
.
setBundleId
(
topicBundleId
);
imIosApns
.
setPwd
(
pwd
);
imIosApns
.
setPwd
(
pwd
);
...
...
core/src/main/java/com/wecloud/im/service/impl/ImIosApnsServiceImpl.java
View file @
3235203d
...
@@ -51,7 +51,7 @@ public class ImIosApnsServiceImpl extends BaseServiceImpl<ImIosApnsMapper, ImIos
...
@@ -51,7 +51,7 @@ public class ImIosApnsServiceImpl extends BaseServiceImpl<ImIosApnsMapper, ImIos
}
}
@Override
@Override
@Cacheable
(
key
=
"#p0"
)
//
@Cacheable(key = "#p0")
public
ImIosApns
getImIosApnsByAppId
(
Long
appId
)
{
public
ImIosApns
getImIosApnsByAppId
(
Long
appId
)
{
return
this
.
getOne
(
new
QueryWrapper
<
ImIosApns
>().
lambda
().
eq
(
return
this
.
getOne
(
new
QueryWrapper
<
ImIosApns
>().
lambda
().
eq
(
ImIosApns:
:
getFkAppId
,
appId
ImIosApns:
:
getFkAppId
,
appId
...
...
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