Toggle navigation
Toggle navigation
This project
Loading...
Sign in
YOHOBUY
/
yohobuy-union
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
ping
9 years ago
Commit
af8137bafb96c11a690517f9dcf9c93af4caab0f
1 parent
38be4a5e
update
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
83 additions
and
21 deletions
common/src/main/resources/META-INF/spring/spring-interceptor-config.xml
common/src/main/resources/security-key.yml
server/src/main/java/com/yoho/unions/server/restapi/ActivateUnionRest.java
web/src/main/resources/META-INF/spring/spring-mvc.xml
common/src/main/resources/META-INF/spring/spring-interceptor-config.xml
0 → 100644
View file @
af8137b
<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns=
"http://www.springframework.org/schema/beans"
xsi:schemaLocation=
"http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd"
>
<!-- secutity configs -->
<bean
id=
"securityConfigMap"
class=
"org.springframework.beans.factory.config.YamlMapFactoryBean"
>
<property
name=
"resources"
>
<list>
<value>
classpath:security-key.yml
</value>
</list>
</property>
</bean>
<bean
id=
"securityInterceptor"
class=
"com.yoho.unions.interceptor.SecurityInterceptor"
>
<property
name=
"keyConfigMap"
ref=
"securityConfigMap"
/>
<property
name=
"isDebugEnable"
value=
"${is_debug_enable:true}"
/>
<property
name=
"excludeUrls"
>
<list>
<value>
/UnionRest/addUnion
</value>
<value>
/ActivateUnionRest/activateUnion
</value>
</list>
</property>
<property
name=
"excludeMethods"
>
<list>
</list>
</property>
</bean>
</beans>
...
...
common/src/main/resources/security-key.yml
0 → 100644
View file @
af8137b
client_keys
:
-
type
:
iphone
key
:
a85bb0674e08986c6b115d5e3a4884fa
-
type
:
ipad
key
:
ad9fcda2e679cf9229e37feae2cdcf80
-
type
:
android
key
:
fd4ad5fcfa0de589ef238c0e7331b585
-
type
:
yoho
key
:
fd4ad5fcsa0de589af23234ks1923ks
-
type
:
h5
key
:
fd4ad5fcfa0de589ef238c0e7331b585
-
type
:
web
key
:
0ed29744ed318fd28d2c07985d3ba633
\ No newline at end of file
...
...
server/src/main/java/com/yoho/unions/server/restapi/ActivateUnionRest.java
View file @
af8137b
...
...
@@ -3,6 +3,9 @@
*/
package
com
.
yoho
.
unions
.
server
.
restapi
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Executors
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.BeanUtils
;
...
...
@@ -29,6 +32,8 @@ public class ActivateUnionRest {
static
Logger
log
=
LoggerFactory
.
getLogger
(
ActivateUnionRest
.
class
);
static
ExecutorService
exe
=
Executors
.
newFixedThreadPool
(
50
);
/**
* 激活联盟
* @param request
...
...
@@ -39,27 +44,37 @@ public class ActivateUnionRest {
log
.
info
(
"addUnion with param is {}"
,
vo
);
ActivateUnionRequestBO
bo
=
new
ActivateUnionRequestBO
();
BeanUtils
.
copyProperties
(
vo
,
bo
);
MainUnionService
service
=
null
;
//处理安卓的服务
for
(
String
str
:
UnionConstant
.
andriodServiceList
)
{
//捕获异常,不影响后面的联盟
try
{
service
=
SpringContextUtil
.
getBean
(
str
,
MainUnionService
.
class
);
service
.
activeUnion
(
bo
);
}
catch
(
Exception
e
)
{
log
.
warn
(
"addUnion error with param is {}"
,
vo
);
}
}
//处理iOS的服务
for
(
String
str
:
UnionConstant
.
iOSServiceList
)
{
//捕获异常,不影响后面的联盟
try
{
service
=
SpringContextUtil
.
getBean
(
str
,
MainUnionService
.
class
);
service
.
activeUnion
(
bo
);
}
catch
(
Exception
e
)
{
log
.
warn
(
"addUnion error with param is {}"
,
vo
);
//多线程处理
exe
.
execute
(
new
Runnable
()
{
@Override
public
void
run
()
{
MainUnionService
service
=
null
;
//处理安卓的服务
for
(
String
str
:
UnionConstant
.
andriodServiceList
)
{
//捕获异常,不影响后面的联盟
try
{
service
=
SpringContextUtil
.
getBean
(
str
,
MainUnionService
.
class
);
service
.
activeUnion
(
bo
);
}
catch
(
Exception
e
)
{
log
.
warn
(
"addUnion error with param is {}"
,
vo
);
}
}
//处理iOS的服务
for
(
String
str
:
UnionConstant
.
iOSServiceList
)
{
//捕获异常,不影响后面的联盟
try
{
service
=
SpringContextUtil
.
getBean
(
str
,
MainUnionService
.
class
);
service
.
activeUnion
(
bo
);
}
catch
(
Exception
e
)
{
log
.
warn
(
"addUnion error with param is {}"
,
vo
);
}
}
}
}
});
return
new
ActiveUnionResponseBO
(
200
,
"success"
);
}
}
...
...
web/src/main/resources/META-INF/spring/spring-mvc.xml
View file @
af8137b
...
...
@@ -58,7 +58,7 @@
</bean>
<mvc:interceptors>
<
!-- <ref bean="securityInterceptor" /> --
>
<
ref
bean=
"securityInterceptor"
/
>
<ref
bean=
"threadProfileInterceptor"
/>
</mvc:interceptors>
</beans>
...
...
Please
register
or
login
to post a comment