<commit_before>package com.lingke.xvp.demo.controller;

import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
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.RestController;

import com.Rop.api.RopResponse;
import com.Rop.api.domain.Area;
import com.Rop.api.request.XvpCommonGetcityareasRequest;
import com.Rop.api.request.XvpCommonGetcountyareasRequest;
import com.Rop.api.request.XvpCommonGetprovinceareasRequest;
import com.Rop.api.response.XvpCommonGetcityareasResponse;
import com.Rop.api.response.XvpCommonGetcountyareasResponse;
import com.Rop.api.response.XvpCommonGetprovinceareasResponse;
import com.lingke.xvp.demo.XvpRopClient;
import com.lingke.xvp.demo.controller.request.CommonRequest;
import com.lingke.xvp.demo.controller.response.CommonListResponse;
import com.lingke.xvp.demo.controller.response.CommonResponse;
import com.lingke.xvp.demo.controller.response.XvpResponse;
import com.lingke.xvp.demo.utils.BeanCopyUtil;

/**
 * Created by yuwb on 2017-03-13. 通用类相关业务处理
 */
@RestController
@RequestMapping(value = "/common")
public class CommonController {
	@Autowired
	private XvpRopClient ropClientAdapter;

	/**
	 * 获取省行政区划
	 * 
	 * @param request
	 *            前台参数
	 * @return
	 * @throws Exception 
	 */
	@RequestMapping(path = "/getprovinceareas", method = RequestMethod.POST)
	public XvpResponse getprovinceareas(@RequestBody CommonRequest commonRequest) throws Exception {
		XvpCommonGetprovinceareasRequest request = new XvpCommonGetprovinceareasRequest();
		XvpCommonGetprovinceareasResponse ropResponse = ropClientAdapter.ropInvoke(request);
		return convertRopRespToXvpResp(ropResponse);
	}

	/**
	 * 获取市行政区划
	 * 
	 * @param request
	 *            前台参数
	 * @return<commit_msg>删除getprovinceareas参数<commit_after>package com.lingke.xvp.demo.controller;

import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
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.RestController;

import com.Rop.api.RopResponse;
import com.Rop.api.domain.Area;
import com.Rop.api.request.XvpCommonGetcityareasRequest;
import com.Rop.api.request.XvpCommonGetcountyareasRequest;
import com.Rop.api.request.XvpCommonGetprovinceareasRequest;
import com.Rop.api.response.XvpCommonGetcityareasResponse;
import com.Rop.api.response.XvpCommonGetcountyareasResponse;
import com.Rop.api.response.XvpCommonGetprovinceareasResponse;
import com.lingke.xvp.demo.XvpRopClient;
import com.lingke.xvp.demo.controller.request.CommonRequest;
import com.lingke.xvp.demo.controller.response.CommonListResponse;
import com.lingke.xvp.demo.controller.response.CommonResponse;
import com.lingke.xvp.demo.controller.response.XvpResponse;
import com.lingke.xvp.demo.utils.BeanCopyUtil;

/**
 * Created by yuwb on 2017-03-13. 通用类相关业务处理
 */
@RestController
@RequestMapping(value = "/common")
public class CommonController {
	@Autowired
	private XvpRopClient ropClientAdapter;

	/**
	 * 获取省行政区划
	 * 
	 * @param request
	 *            前台参数
	 * @return
	 * @throws Exception 
	 */
	@RequestMapping(path = "/getprovinceareas", method = RequestMethod.POST)
	public XvpResponse getprovinceareas(CommonRequest commonRequest) throws Exception {
		XvpCommonGetprovinceareasRequest request = new XvpCommonGetprovinceareasRequest();
		XvpCommonGetprovinceareasResponse ropResponse = ropClientAdapter.ropInvoke(request);
		return convertRopRespToXvpResp(ropResponse);
	}

	/**
	 * 获取市行政区划
	 * 
	 * @param request
	 *            前台参数
	 * @return
{'fraction_non_alphanumeric': 0.09820089955022489, 'fraction_numerical': 0.00399800099950025, 'mean_word_length': 5.671666666666667, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1792689', 'n_tokens_mistral': 1333, 'n_tokens_neox': 1311, 'n_words': 186}