<commit_before>package com.ks.ssm.controller;

import java.util.List;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import com.ks.ssm.domain.Article;
import com.ks.ssm.domain.Comment;
import com.ks.ssm.domain.User;
import com.ks.ssm.interceptors.LoginCheck;
import com.ks.ssm.service.IArticleService;
import com.ks.ssm.service.ICommentService;
import com.ks.ssm.service.IUserService;
import com.ks.ssm.utils.SSMUtils;

@Controller
@RequestMapping("/user")
public class UserCenterController {
	
	private static Logger log4j = Logger.getLogger(UserCenterController.class);
	
	@Resource
	private IUserService userService;
	
	@Resource
	private IArticleService articleService;

	@Resource
	private ICommentService commentService;
	
	@RequestMapping(value = "/userManager")
	@LoginCheck(check=true,autoLogin=true)
	public String userManager(HttpServletRequest request,HttpSession session, Model model) {
		
		User user=userService.getUserById(SSMUtils.getUserId(session));
		model.addAttribute("user", user);
		return "userManager";
	}

	@RequestMapping(value = "/userPublishArticle")
	@LoginCheck(check=true,autoLogin=true)
	public String userPublishArticle(HttpServletRequest request,HttpSession session, Model model) {
		
		List<Article> articles=articleService.selectByUserID(SSMUtils.getUserId(session));
		model.addAttribute("articles", articles);
		return "userPublishArticle";
	}
	@RequestMapping(value = "/userPublishComment")
	@LoginCheck(check=true,autoLogin=true)
	public String userPublishComment(HttpServletRequest request,HttpSession session, Model model) {
		
		List<Comment> comments=commentService.selectByUserID(SSMUtils.getUserId(session));
		model.addAttribute("comments", comments);
		return "userPublishComment";
	}
	/**查看别人的主页 restful风格的url*/
	@RequestMapping(value = "/{userId}")
	@LoginCheck(saveInfo=true,autoLogin=true)
	public String user(@PathVariable Long userId,HttpServletRequest request,HttpSession session, Model model) {
		
		/**进入了自己的主页*/
		if(userId==SSMUtils.getUserId(session))
		{
			
		}
		else/**别人的主页*/
		{
			
		}
		return "userManager";
	}
	
}
<commit_msg>usermanager<commit_after>package com.ks.ssm.controller;

import java.util.List;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.ks.ssm.domain.Article;
import com.ks.ssm.domain.Comment;
import com.ks.ssm.domain.User;
import com.ks.ssm.interceptors.LoginCheck;
import com.ks.ssm.interceptors.TokenCheck;
import com.ks.ssm.service.IArticleService;
import com.ks.ssm.service.ICommentService;
import com.ks.ssm.service.IUserService;
import com.ks.ssm.utils.SSMUtils;

@Controller
@RequestMapping("/user")
public class UserCenterController {
	
	private static Logger log4j = Logger.getLogger(UserCenterController.class);
	
	@Resource
	private IUserService userService;
	
	@Resource
	private IArticleService articleService;

	@Resource
	private ICommentService commentService;
	
	@RequestMapping(value = "/userManager",method=RequestMethod.GET)
	@LoginCheck(check=true,autoLogin=true)
	@TokenCheck(generateToken=true)
	public String userManagerGet(HttpServletRequest request,HttpSession session, Model model) {
		
		User user=userService.getUserById(SSMUtils.getUserId(session));
		model.addAttribute("user", user);
		return "userManager";
	}

	@RequestMapping(value = "/userManager",method=RequestMethod.POST)
	@LoginCheck(check=true,autoLogin=true)
	@TokenCheck(generateToken=true)
	public String userManagerPost(HttpServletRequest request,HttpSession session, Model model) {
		
		User user=userService.getUserById(SSMUtils.getUserId(session));
		model.addAttribute("user", user);
		return "userManager";
	}
	
	@RequestMapping(value = "/userPublishArticle")
	@LoginCheck(check=true,autoLogin=true)
	public String userPublishArticle(HttpServletRequest request,HttpSession session, Model model) {
		
		List<Article> articles=articleService.selectByUserID(SSMUtils.getUserId(session));
		model.addAttribute("articles", articles);
		return "userPublishArticle";
	}
	@RequestMapping(value = "/userPublishComment")
	@LoginCheck(check=true,autoLogin=true)
	public String userPublishComment(HttpServletRequest request,HttpSession session, Model model) {
		
		List<Comment> comments=commentService.selectByUserID(SSMUtils.getUserId(session));
		model.addAttribute("comments", comments);
		return "userPublishComment";
	}
	
	
	
	/**查看别人的主页 restful风格的url*/
	@RequestMapping(value = "/{userId}")
	@LoginCheck(saveInfo=true,autoLogin=true)
	public String user(@PathVariable Long userId,HttpServletRequest request,HttpSession session, Model model) {
		
		/**进入了自己的主页*/
		if(userId==SSMUtils.getUserId(session))
		{
			
		}
		else/**别人的主页*/
		{
			
		}
		return "userManager";
	}
	
}

{'fraction_non_alphanumeric': 0.11322160148975792, 'fraction_numerical': 0.0007448789571694599, 'mean_word_length': 6.501396648044692, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '5395980', 'n_tokens_mistral': 1748, 'n_tokens_neox': 1670, 'n_words': 272}