Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
caosy
/
fun-golf-mobile
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
1
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f942ea19
authored
Oct 12, 2018
by
Huang Linyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
活动临时用户表
parent
739f7be2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
82 additions
and
0 deletions
src/main/java/com/ctrip/fun/golf/api/version/ActiveCustomerMController.java
src/main/java/com/ctrip/fun/golf/service/user/ActiveCustomerService.java
src/main/resources/rpc.properties
src/main/resources/usercontract.spring.xml
src/main/java/com/ctrip/fun/golf/api/version/ActiveCustomerMController.java
0 → 100644
View file @
f942ea19
package
com
.
ctrip
.
fun
.
golf
.
api
.
version
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.ResponseStatus
;
import
com.ctrip.fun.common.vo.Response
;
import
com.ctrip.fun.common.vo.user.ActiveCustomerBean
;
import
com.ctrip.fun.golf.service.user.ActiveCustomerService
;
@Controller
@RequestMapping
(
value
=
"/activeCustomer"
)
public
class
ActiveCustomerMController
{
@Autowired
private
ActiveCustomerService
activeCustomerService
;
@RequestMapping
(
value
=
"/insertOne"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
Response
<
Integer
>
updateUserContract
(
@RequestBody
ActiveCustomerBean
userContractsBean
)
{
Response
<
Integer
>
response
=
activeCustomerService
.
insertOne
(
userContractsBean
);
return
response
;
}
}
src/main/java/com/ctrip/fun/golf/service/user/ActiveCustomerService.java
0 → 100644
View file @
f942ea19
package
com
.
ctrip
.
fun
.
golf
.
service
.
user
;
import
java.util.HashMap
;
import
java.util.Map
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.core.ParameterizedTypeReference
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpMethod
;
import
com.ctrip.fun.common.vo.Request
;
import
com.ctrip.fun.common.vo.Response
;
import
com.ctrip.fun.common.vo.ResponseStatusEnum
;
import
com.ctrip.fun.common.vo.user.ActiveCustomerBean
;
import
com.ctrip.fun.golf.service.BaseService
;
public
class
ActiveCustomerService
extends
BaseService
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ActiveCustomerService
.
class
);
public
Response
<
Integer
>
insertOne
(
ActiveCustomerBean
userContractsBean
)
{
String
uri
=
super
.
getServiceUri
(
"uri.activeCustomer.insertOne"
);
Request
<
ActiveCustomerBean
>
request
=
new
Request
<
ActiveCustomerBean
>();
request
.
setBody
(
userContractsBean
);
HttpEntity
<
Request
<
ActiveCustomerBean
>>
entity
=
new
HttpEntity
<
Request
<
ActiveCustomerBean
>>(
request
);
Response
<
Integer
>
response
=
super
.
exchange
(
uri
,
HttpMethod
.
POST
,
entity
,
new
ParameterizedTypeReference
<
Response
<
Integer
>>()
{
}).
getBody
();
if
(
null
!=
response
)
{
if
(
response
.
getStatus
()
!=
ResponseStatusEnum
.
SUCCESS
.
getValue
())
{
Map
<
String
,
String
>
tags
=
new
HashMap
<>();
tags
.
put
(
"bean"
,
userContractsBean
.
toString
());
logger
.
error
(
"添加 UserContracts 异常"
,
String
.
format
(
"status: %d, msg: %s"
,
response
.
getStatus
(),
response
.
getMessage
()),
tags
);
}
}
return
response
;
}
}
src/main/resources/rpc.properties
View file @
f942ea19
...
...
@@ -276,6 +276,8 @@ uri.userContract.saveOrUpdate=/fun-golf-service/userContract/saveOrUpdateUserCon
uri.userContract.add
=
/fun-golf-service/userContract/addUserContract
uri.userContract.delete
=
/fun-golf-service/userContract/delete
#active_contracts
uri.activeCustomer.insertOne
=
/fun-golf-service/activeCustomer/insertOne
# mobileClientUser
uri.mobileClientUser.Login
=
/fun-golf-service/MobileClientUser/Login
...
...
src/main/resources/usercontract.spring.xml
View file @
f942ea19
...
...
@@ -4,5 +4,6 @@
xsi:schemaLocation=
"http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd"
>
<bean
name=
"userContractsMService"
class=
"com.ctrip.fun.golf.service.user.UserContractsMService"
parent=
"baseService"
></bean>
<bean
name=
"ActiveCustomerService"
class=
"com.ctrip.fun.golf.service.user.ActiveCustomerService"
parent=
"baseService"
></bean>
</beans>
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