Commit f942ea19 by Huang Linyu

活动临时用户表

parent 739f7be2
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;
}
}
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;
}
}
......@@ -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
......
......@@ -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>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment