Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wwwanlingxiao
mall
Commits
c4cb28cf
Commit
c4cb28cf
authored
Aug 07, 2018
by
zhh
Browse files
tomcat配置修改
parent
50e89326
Changes
2
Hide whitespace changes
Inline
Side-by-side
mall-portal/src/main/java/com/macro/mall/portal/config/TomcatConfig.java
0 → 100644
View file @
c4cb28cf
package
com.macro.mall.portal.config
;
import
org.apache.catalina.connector.Connector
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.context.embedded.EmbeddedServletContainerFactory
;
import
org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
/**
* tomcat相关配置
* Created by macro on 2018/8/7.
*/
@Configuration
public
class
TomcatConfig
{
@Value
(
"${http.port}"
)
private
Integer
port
;
@Bean
public
EmbeddedServletContainerFactory
servletContainer
()
{
TomcatEmbeddedServletContainerFactory
tomcat
=
new
TomcatEmbeddedServletContainerFactory
();
tomcat
.
addAdditionalTomcatConnectors
(
createStandardConnector
());
// 添加http
return
tomcat
;
}
//配置http
private
Connector
createStandardConnector
()
{
Connector
connector
=
new
Connector
(
"org.apache.coyote.http11.Http11NioProtocol"
);
connector
.
setPort
(
port
);
return
connector
;
}
}
mall-portal/src/main/java/com/macro/mall/portal/service/impl/OmsCartItemServiceImpl.java
View file @
c4cb28cf
...
...
@@ -26,14 +26,15 @@ public class OmsCartItemServiceImpl implements OmsCartItemService {
@Override
public
int
add
(
OmsCartItem
cartItem
)
{
int
count
;
OmsCartItem
existCartItem
=
getCartItem
(
cartItem
);
if
(
existCartItem
==
null
)
{
cartItemMapper
.
insert
(
cartItem
);
count
=
cartItemMapper
.
insert
(
cartItem
);
}
else
{
existCartItem
.
setQuantity
(
existCartItem
.
getQuantity
()
+
cartItem
.
getQuantity
());
cartItemMapper
.
updateByPrimaryKey
(
existCartItem
);
count
=
cartItemMapper
.
updateByPrimaryKey
(
existCartItem
);
}
return
1
;
return
count
;
}
/**
...
...
Write
Preview
Supports
Markdown
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