<commit_before>package com.yueny.cropui.controller.charts;

import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.yueny.blog.bo.model.document.ChartData;
import com.yueny.blog.service.manage.ITagQueryManageService;
import com.yueny.cropui.controller.BaseController;
import com.yueny.rapid.lang.exception.DataVerifyAnomalyException;
import com.yueny.superclub.util.common.pojo.json.NormalJsonResponse;
import com.yueny.superclub.util.web.security.contanst.WebAttributes;

/**
 * 报表控制器
 *
 * @author yueny09 <<EMAIL>>
 *
 * @DATE 2016年9月12日 下午8:17:40
 *
 */
@Controller
public class ChartsController extends BaseController {
	@Autowired
	private ITagQueryManageService tagQueryService;

	/**
	 * 报表
	 */
	@RequestMapping(value = "/charts/", method = { RequestMethod.GET })
	public String articleWritePage(@RequestParam(value = "type", defaultValue = "1") final String type,
			final HttpServletResponse response) {
		setModelAttribute(WebAttributes.ACTION, "fks_chart");

		return "charts/fks_chart";
	}

	/**
	 * 报表数据
	 */
	@RequestMapping(value = "/charts/front-end.json", method = { RequestMethod.POST })
	@ResponseBody
	public NormalJsonResponse<ChartData> chartsFrontEndJson(final HttpServletResponse response) {
		final NormalJsonResponse<ChartData> res = new NormalJsonResponse<>();
		try {
			final ChartData chartData = tagQueryService.getChartData();
			res.setData(chartData);
		} catch (final DataVerifyAnomalyException e) {
			res.setCode(e.getErrorCode());
			res.setMessage(e.getErrorMsg());
		}
		return res;
	}

}<commit_msg>@CrossOrigin // 允许跨域<commit_after>package com.yueny.cropui.controller.charts;

import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.yueny.blog.bo.model.document.ChartData;
import com.yueny.blog.service.manage.ITagQueryManageService;
import com.yueny.cropui.controller.BaseController;
import com.yueny.rapid.lang.exception.DataVerifyAnomalyException;
import com.yueny.superclub.util.common.pojo.json.NormalJsonResponse;
import com.yueny.superclub.util.web.security.contanst.WebAttributes;

/**
 * 报表控制器
 *
 * @author yueny09 <<EMAIL>>
 *
 * @DATE 2016年9月12日 下午8:17:40
 *
 */
@Controller
public class ChartsController extends BaseController {
	@Autowired
	private ITagQueryManageService tagQueryService;

	/**
	 * 报表
	 */
	@RequestMapping(value = "/charts/", method = { RequestMethod.GET })
	public String articleWritePage(@RequestParam(value = "type", defaultValue = "1") final String type,
			final HttpServletResponse response) {
		setModelAttribute(WebAttributes.ACTION, "fks_chart");

		return "charts/fks_chart";
	}

	/**
	 * 报表数据
	 */
	@RequestMapping(value = "/charts/front-end.json", method = { RequestMethod.POST })
	@ResponseBody
	@CrossOrigin // 允许跨域
	public NormalJsonResponse<ChartData> chartsFrontEndJson(final HttpServletResponse response) {
		final NormalJsonResponse<ChartData> res = new NormalJsonResponse<>();
		try {
			final ChartData chartData = tagQueryService.getChartData();
			res.setData(chartData);
		} catch (final DataVerifyAnomalyException e) {
			res.setCode(e.getErrorCode());
			res.setMessage(e.getErrorMsg());
		}
		return res;
	}

}
{'fraction_non_alphanumeric': 0.11638041527813381, 'fraction_numerical': 0.007690335811330428, 'mean_word_length': 5.636054421768708, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '5327703', 'n_tokens_mistral': 1284, 'n_tokens_neox': 1241, 'n_words': 197}