src/main/java/top/phrack/ctf/utils/CommonUtils.java
public class CommonUtils {
	
	private static String flag_salt = "OtN0onrc1BWPfsHpczuWiEYZbRDzvRAOZLYySuVeWwd3PQ0Lj0PiGOjVBP9ZU4ab";
	/**

	 * 

	 * 获取当前控制器名称

	 */
	public static void setControllerName(final HttpServletRequest request,final ModelAndView mv){
		String servpath = request.getServletPath().substring(1);
		mv.addObject("ctrlname",servpath);
	} 
	
	private final static Whitelist user_content_filter = Whitelist.relaxed();  
	static {  
	    user_content_filter.addTags("embed","object","param","span","div");  
	    user_content_filter.addAttributes(":all", "style", "class", "id", "name");  
	    user_content_filter.addAttributes("object", "width", "height","classid","codebase");      
	    user_content_filter.addAttributes("param", "name", "value");  
	    user_content_filter.addAttributes("embed", "src","quality","width","height","allowFullScreen","allowScriptAccess","flashvars","name","type","pluginspage");  
	}  
	  
	/** 

	 * 对用户输入内容进行过滤 

	 * @param html 

	 * @return 

	 */  
	public static String filterUserInputContent(String html) {  
	    if(StringUtils.isBlank(html)) return "";  
	    return Jsoup.clean(html, user_content_filter);  
	    //return filterScriptAndStyle(html);  


	}  
	
	
	/**

	 *  统计用户使用信息

	 */
	public static void storeUserIpUsageInfo(HttpServletRequest request,UserServices userServices,IPlogServices ipLogServices,String username){
		String userip = request.getRemoteAddr(); 
		Users userobj = userServices.getUserByEmail(username);
		IpLogs oldrec = ipLogServices.getLogsByAddrAndId(userip, userobj.getId());
		Date current = new Date();
		if (oldrec==null) {
			oldrec = new IpLogs();
			oldrec.setAdded(current);
			oldrec.setIpaddr(userip);
			oldrec.setLastused(current);
			oldrec.setTimesused(Long.valueOf(1));
			oldrec.setUserid(userobj.getId());
			ipLogServices.insertNewLog(oldrec);
		} else {
			oldrec.setLastused(current);
			oldrec.setTimesused(oldrec.getTimesused()+1);
			ipLogServices.updateLogInfo(oldrec);
		}
		userobj.setLastactive(current);
		userServices.updateUser(userobj);
	}
	
	public static Users setUserInfo(Subject currentUser,UserServices userServices,SubmissionServices submissionServices,ModelAndView mv) {
		if (currentUser==null) {
			return null;
		}
		if (currentUser.isRemembered()||currentUser.isAuthenticated()) {
			
			Users userobj = userServices.getUserByEmail((String)currentUser.getPrincipal());
			String NickName = userobj.getUsername();
			Long score = userobj.getScore();
			long rank = getUserrank(userobj,userServices,submissionServices);
			mv.addObject("nickname", NickName);
			mv.addObject("score", score);
			mv.addObject("rank", rank);
			return userobj;
		}
		return null;
	}
	
	@SuppressWarnings("unchecked")
	public static long getUserrank(Users userobj,UserServices userServices,SubmissionServices submissionServices) {
		if (userobj.getRole().equals("admin")) {
			return 0;
		}
		List<Users> userforrank = userServices.getUsersForRank();
		ArrayList<RanklistObj> ranklist = new ArrayList<RanklistObj>();
		List<Submissions> allcorrect = submissionServices.getAllCorrectAndOrderByUserId();
		RanklistObj thisuser = null;
		for (Users u:userforrank) {
			RanklistObj aobj = new RanklistObj();
			Submissions last = null;//submissionServices.getLastCorrectSubmitByUserId(u.getId());
			for (Submissions sb:allcorrect) {
				if (sb.getUserid().longValue()==u.getId().longValue()) {
					last = sb;
					break;
				}
			}
			if (last==null) {
				aobj.setLastSummit(new Date());
			} else {
				aobj.setLastSummit(last.getSubmitTime());
			}
			aobj.setuserobj(u);
			ranklist.add(aobj);
			if (u.getId()-userobj.getId()==0) {
				thisuser = aobj;
			}
		}
		CompareScore c = new CompareScore();
		Collections.sort(ranklist,c);
		/*for (int i=0;i<ranklist.size()-1;i++) {
			for (int j=0;j<ranklist.size()-1;j++) {
				if (c.compare(ranklist.get(j),ranklist.get(j+1))==1) {
					RanklistObj tmp = ranklist.get(j);
					ranklist.set(j, ranklist.get(j+1));
					ranklist.set(j+1, tmp);
				}
			}
		}*/

//		for (RanklistObj robj:ranklist) {


//			System.out.println(robj.getuserobj().getScore()+" "+robj.getuserobj().getUsername()+" "+robj.getLastSummit());


//		}


		

		return ranklist.indexOf(thisuser)+1;
	}
	
	/**

	 * xss过滤器

	 * @param rawstr

	 * @return

	 */
	public static String XSSFilter(String rawstr) {
		String tmp = StringEscapeUtils.escapeHtml(rawstr);
		//tmp = StringEscapeUtils.escapeJavaScript(tmp);


		//tmp = StringEscapeUtils.escapeSql(tmp);


		return tmp;
	}
	
	public static boolean CheckIpBanned(HttpServletRequest request,BannedIpServices bannedIpServices) {
		String userip = request.getRemoteAddr();
		BannedIps banip = bannedIpServices.getRecordByIp(userip);
		if (banip!=null) {
			return true;
		} else {
			return false;
		}
		
	}
	
	public static String getFlagSalt() {
		return flag_salt;
	}
	
	public static boolean isValidDate(String str) {	
		boolean convertSuccess=true;
		// 指定日期格式为四位年/两位月份/两位日期，注意yyyy/MM/dd区分大小写；


		SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
		try {
			// 设置lenient为false. 否则SimpleDateFormat会比较宽松地验证日期，比如2007/02/29会被接受，并转换成2007/03/01


			format.setLenient(false);
			format.parse(str);
		} catch (ParseException e) {
			// e.printStackTrace();


			// 如果throw java.text.ParseException或者NullPointerException，就说明格式不对


			convertSuccess=false;
		} 
		return convertSuccess;
	}
	
}
src/main/java/top/phrack/ctf/pojo/News.java
public class News implements Serializable{
	private static final long serialVersionUID = 1L;  
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.news.id
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private Long id;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.news.title
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private String title;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.news.content
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private String content;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.news.posttime
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private Date posttime;

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.news.id
     *
     * @return the value of public.news.id
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public Long getId() {
        return id;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.news.id
     *
     * @param id the value for public.news.id
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.news.title
     *
     * @return the value of public.news.title
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public String getTitle() {
        return title;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.news.title
     *
     * @param title the value for public.news.title
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setTitle(String title) {
        this.title = title == null ? null : title.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.news.content
     *
     * @return the value of public.news.content
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public String getContent() {
        return content;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.news.content
     *
     * @param content the value for public.news.content
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setContent(String content) {
        this.content = content == null ? null : content.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.news.posttime
     *
     * @return the value of public.news.posttime
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public Date getPosttime() {
        return posttime;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.news.posttime
     *
     * @param posttime the value for public.news.posttime
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setPosttime(Date posttime) {
        this.posttime = posttime;
    }
}
src/main/java/top/phrack/ctf/models/services/SubmissionServices.java
public interface SubmissionServices {

	public List<Submissions> getAllCorrectSubmitByTaskId(Long taskid);
	
	public List<Submissions> getAllSubmitByUserId(Long userid);
	
	public int insertNewSubmission(Submissions aSubmission);
	
	public Submissions getLastCorrectSubmitByUserId(Long userid);
	
	public Long getSolvedByUseridAndTaskId(Long userid,Long taskid);
	
	public Submissions getLastSubmitByUserId(Long userid);
	
	public List<Submissions> getCorrectSubmitByUserid(Long userid);
	
	public Submissions getCorrectByUserIdAndTaskId(Long userid,Long taskid);
	
	public List<Submissions> getAllSubmissions();
	
	public List<Submissions> getAllCorrectAndOrderByUserId();
	
	public Submissions getSubmissionById(Long id);
	
	public int updateSubmission(Submissions newsub);
	
	public int deleteSubmission(Long id);
	
	public Long getsubmitTimesByUserIdAndTaskId(Long userid,Long taskid);
}
src/main/java/top/phrack/ctf/pojo/Operatelog.java
public class Operatelog implements Serializable{
	private static final long serialVersionUID = 1L;  
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.operatelog.id
     *
     * @mbggenerated Sat Apr 16 18:15:07 CST 2016
     */
    private Long id;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.operatelog.operatorid
     *
     * @mbggenerated Sat Apr 16 18:15:07 CST 2016
     */
    private Long operatorid;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.operatelog.operatefunc
     *
     * @mbggenerated Sat Apr 16 18:15:07 CST 2016
     */
    private String operatefunc;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.operatelog.operatetime
     *
     * @mbggenerated Sat Apr 16 18:15:07 CST 2016
     */
    private Date operatetime;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.operatelog.ipaddr
     *
     * @mbggenerated Sat Apr 16 18:15:07 CST 2016
     */
    private String ipaddr;

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.operatelog.id
     *
     * @return the value of public.operatelog.id
     *
     * @mbggenerated Sat Apr 16 18:15:07 CST 2016
     */
    public Long getId() {
        return id;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.operatelog.id
     *
     * @param id the value for public.operatelog.id
     *
     * @mbggenerated Sat Apr 16 18:15:07 CST 2016
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.operatelog.operatorid
     *
     * @return the value of public.operatelog.operatorid
     *
     * @mbggenerated Sat Apr 16 18:15:07 CST 2016
     */
    public Long getOperatorid() {
        return operatorid;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.operatelog.operatorid
     *
     * @param operatorid the value for public.operatelog.operatorid
     *
     * @mbggenerated Sat Apr 16 18:15:07 CST 2016
     */
    public void setOperatorid(Long operatorid) {
        this.operatorid = operatorid;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.operatelog.operatefunc
     *
     * @return the value of public.operatelog.operatefunc
     *
     * @mbggenerated Sat Apr 16 18:15:07 CST 2016
     */
    public String getOperatefunc() {
        return operatefunc;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.operatelog.operatefunc
     *
     * @param operatefunc the value for public.operatelog.operatefunc
     *
     * @mbggenerated Sat Apr 16 18:15:07 CST 2016
     */
    public void setOperatefunc(String operatefunc) {
        this.operatefunc = operatefunc == null ? null : operatefunc.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.operatelog.operatetime
     *
     * @return the value of public.operatelog.operatetime
     *
     * @mbggenerated Sat Apr 16 18:15:07 CST 2016
     */
    public Date getOperatetime() {
        return operatetime;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.operatelog.operatetime
     *
     * @param operatetime the value for public.operatelog.operatetime
     *
     * @mbggenerated Sat Apr 16 18:15:07 CST 2016
     */
    public void setOperatetime(Date operatetime) {
        this.operatetime = operatetime;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.operatelog.ipaddr
     *
     * @return the value of public.operatelog.ipaddr
     *
     * @mbggenerated Sat Apr 16 18:15:07 CST 2016
     */
    public String getIpaddr() {
        return ipaddr;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.operatelog.ipaddr
     *
     * @param ipaddr the value for public.operatelog.ipaddr
     *
     * @mbggenerated Sat Apr 16 18:15:07 CST 2016
     */
    public void setIpaddr(String ipaddr) {
        this.ipaddr = ipaddr == null ? null : ipaddr.trim();
    }
}
src/main/java/top/phrack/ctf/comparators/CompareDate.java
public class CompareDate implements Comparator{

	/* (non-Javadoc)
	 * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
	 */
	public int compare(Object o1, Object o2) {
		Date begin = ((News)o1).getPosttime();
		Date end = ((News)o2).getPosttime();
		if (begin.after(end)) {
			return -1;
		} else {
			if (begin.before(end)) {
				return 1;
			} else {
				return 0;
			}
		}
	}
}
src/main/java/top/phrack/ctf/models/services/CountryServices.java
public interface CountryServices {
	public List<Countries> SelectAllCountry(); 
	
	public Countries getCountryById(Long id);
	
	public Countries getCountryByCode(String code);
}
src/main/java/top/phrack/ctf/models/services/RuleServices.java
public interface RuleServices {
	public Rules getRulesById(long id);
	
	public int updateRule(Rules newRule);
	
}
src/main/java/top/phrack/ctf/pojo/Countries.java
public class Countries implements Serializable{
	private static final long serialVersionUID = 1L;  
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.countries.id
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private Long id;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.countries.countryname
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private String countryname;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.countries.countrycode
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private String countrycode;

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.countries.id
     *
     * @return the value of public.countries.id
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public Long getId() {
        return id;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.countries.id
     *
     * @param id the value for public.countries.id
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.countries.countryname
     *
     * @return the value of public.countries.countryname
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public String getCountryname() {
        return countryname;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.countries.countryname
     *
     * @param countryname the value for public.countries.countryname
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setCountryname(String countryname) {
        this.countryname = countryname == null ? null : countryname.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.countries.countrycode
     *
     * @return the value of public.countries.countrycode
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public String getCountrycode() {
        return countrycode;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.countries.countrycode
     *
     * @param countrycode the value for public.countries.countrycode
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setCountrycode(String countrycode) {
        this.countrycode = countrycode == null ? null : countrycode.trim();
    }
}
src/main/java/top/phrack/ctf/pojo/SolveTable.java
public class SolveTable {
	
	private long id;
	
	private String title;
	
	private String catemark;
	
	private String catename;
	
	private long score;
	
	private Date passtime;
	
	public long getid() {
		return id;
	}
	
	public void setid(long id) {
		this.id = id;
	}
	public String gettitle(){
		return title;
	}
	
	public void settitle(String title) {
		this.title = title;
	}
	
	public String getcatemark(){
		return catemark;
	}
	
	public void setcatemark(String catemark) {
		this.catemark = catemark;
	}
	
	public long getscore(){
		return score;
	}
	
	public void setscore(long score) {
		this.score = score;
	}
	
	public String getcatename(){
		return catename;
	}
	
	public void setcatename(String catename) {
		this.catename = catename;
	}
	
	public Date getpasstime(){
		return passtime;
	}
	
	public void setpasstime(Date passtime) {
		this.passtime = passtime;
	}
	
	
}
src/main/java/top/phrack/ctf/models/services/NewsServices.java
public interface NewsServices {
	public News getNewsById(long id); //查询新闻
	
	public int createNews(String title,String content,Date posttime);
	
	public List<News> selectAll();
	
	public int updateNews(News newNews);
	
	public int deleteNewsById(long id);
	
	
}
src/main/java/top/phrack/ctf/pojo/BannedIps.java
public class BannedIps implements Serializable{
	
	private static final long serialVersionUID = 1L;  
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.banned_ips.id
     *
     * @mbggenerated Sun Apr 10 19:05:37 CST 2016
     */
    private Long id;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.banned_ips.ip_addr
     *
     * @mbggenerated Sun Apr 10 19:05:37 CST 2016
     */
    private String ipAddr;

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.banned_ips.id
     *
     * @return the value of public.banned_ips.id
     *
     * @mbggenerated Sun Apr 10 19:05:37 CST 2016
     */
    public Long getId() {
        return id;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.banned_ips.id
     *
     * @param id the value for public.banned_ips.id
     *
     * @mbggenerated Sun Apr 10 19:05:37 CST 2016
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.banned_ips.ip_addr
     *
     * @return the value of public.banned_ips.ip_addr
     *
     * @mbggenerated Sun Apr 10 19:05:37 CST 2016
     */
    public String getIpAddr() {
        return ipAddr;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.banned_ips.ip_addr
     *
     * @param ipAddr the value for public.banned_ips.ip_addr
     *
     * @mbggenerated Sun Apr 10 19:05:37 CST 2016
     */
    public void setIpAddr(String ipAddr) {
        this.ipAddr = ipAddr == null ? null : ipAddr.trim();
    }
}
src/main/java/top/phrack/ctf/pojo/IpLogs.java
public class IpLogs implements Serializable{
	private static final long serialVersionUID = 1L;  
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.ip_logs.id
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private Long id;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.ip_logs.ipaddr
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private Object ipaddr;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.ip_logs.userid
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private Long userid;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.ip_logs.added
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private Date added;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.ip_logs.lastused
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private Date lastused;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.ip_logs.timesused
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private Long timesused;

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.ip_logs.id
     *
     * @return the value of public.ip_logs.id
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public Long getId() {
        return id;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.ip_logs.id
     *
     * @param id the value for public.ip_logs.id
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.ip_logs.ipaddr
     *
     * @return the value of public.ip_logs.ipaddr
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public Object getIpaddr() {
        return ipaddr;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.ip_logs.ipaddr
     *
     * @param ipaddr the value for public.ip_logs.ipaddr
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setIpaddr(Object ipaddr) {
        this.ipaddr = ipaddr;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.ip_logs.userid
     *
     * @return the value of public.ip_logs.userid
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public Long getUserid() {
        return userid;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.ip_logs.userid
     *
     * @param userid the value for public.ip_logs.userid
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setUserid(Long userid) {
        this.userid = userid;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.ip_logs.added
     *
     * @return the value of public.ip_logs.added
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public Date getAdded() {
        return added;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.ip_logs.added
     *
     * @param added the value for public.ip_logs.added
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setAdded(Date added) {
        this.added = added;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.ip_logs.lastused
     *
     * @return the value of public.ip_logs.lastused
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public Date getLastused() {
        return lastused;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.ip_logs.lastused
     *
     * @param lastused the value for public.ip_logs.lastused
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setLastused(Date lastused) {
        this.lastused = lastused;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.ip_logs.timesused
     *
     * @return the value of public.ip_logs.timesused
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public Long getTimesused() {
        return timesused;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.ip_logs.timesused
     *
     * @param timesused the value for public.ip_logs.timesused
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setTimesused(Long timesused) {
        this.timesused = timesused;
    }
}
src/main/java/top/phrack/ctf/pojo/Users.java
public class Users implements Serializable{
	private static final long serialVersionUID = 1L;  
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.users.id
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private Long id;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.users.username
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private String username;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.users.password
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private String password;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.users.email
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private String email;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.users.phone
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private String phone;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.users.organization
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private String organization;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.users.countryid
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private Long countryid;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.users.description
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private String description;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.users.isenabled
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private Boolean isenabled;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.users.score
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private Long score;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.users.token
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private String token;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.users.salt
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private String salt;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.users.regtime
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private Date regtime;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.users.lastactive
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private Date lastactive;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.users.role
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private String role;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.users.teamid
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private Long teamid;

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.users.id
     *
     * @return the value of public.users.id
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public Long getId() {
        return id;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.users.id
     *
     * @param id the value for public.users.id
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.users.username
     *
     * @return the value of public.users.username
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public String getUsername() {
        return username;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.users.username
     *
     * @param username the value for public.users.username
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setUsername(String username) {
        this.username = username == null ? null : username.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.users.password
     *
     * @return the value of public.users.password
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public String getPassword() {
        return password;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.users.password
     *
     * @param password the value for public.users.password
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setPassword(String password) {
        this.password = password == null ? null : password.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.users.email
     *
     * @return the value of public.users.email
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public String getEmail() {
        return email;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.users.email
     *
     * @param email the value for public.users.email
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setEmail(String email) {
        this.email = email == null ? null : email.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.users.phone
     *
     * @return the value of public.users.phone
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public String getPhone() {
        return phone;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.users.phone
     *
     * @param phone the value for public.users.phone
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setPhone(String phone) {
        this.phone = phone == null ? null : phone.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.users.organization
     *
     * @return the value of public.users.organization
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public String getOrganization() {
        return organization;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.users.organization
     *
     * @param organization the value for public.users.organization
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setOrganization(String organization) {
        this.organization = organization == null ? null : organization.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.users.countryid
     *
     * @return the value of public.users.countryid
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public Long getCountryid() {
        return countryid;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.users.countryid
     *
     * @param countryid the value for public.users.countryid
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setCountryid(Long countryid) {
        this.countryid = countryid;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.users.description
     *
     * @return the value of public.users.description
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public String getDescription() {
        return description;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.users.description
     *
     * @param description the value for public.users.description
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setDescription(String description) {
        this.description = description == null ? null : description.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.users.isenabled
     *
     * @return the value of public.users.isenabled
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public Boolean getIsenabled() {
        return isenabled;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.users.isenabled
     *
     * @param isenabled the value for public.users.isenabled
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setIsenabled(Boolean isenabled) {
        this.isenabled = isenabled;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.users.score
     *
     * @return the value of public.users.score
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public Long getScore() {
        return score;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.users.score
     *
     * @param score the value for public.users.score
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setScore(Long score) {
        this.score = score;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.users.token
     *
     * @return the value of public.users.token
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public String getToken() {
        return token;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.users.token
     *
     * @param token the value for public.users.token
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setToken(String token) {
        this.token = token == null ? null : token.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.users.salt
     *
     * @return the value of public.users.salt
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public String getSalt() {
        return salt;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.users.salt
     *
     * @param salt the value for public.users.salt
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setSalt(String salt) {
        this.salt = salt == null ? null : salt.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.users.regtime
     *
     * @return the value of public.users.regtime
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public Date getRegtime() {
        return regtime;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.users.regtime
     *
     * @param regtime the value for public.users.regtime
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setRegtime(Date regtime) {
        this.regtime = regtime;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.users.lastactive
     *
     * @return the value of public.users.lastactive
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public Date getLastactive() {
        return lastactive;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.users.lastactive
     *
     * @param lastactive the value for public.users.lastactive
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setLastactive(Date lastactive) {
        this.lastactive = lastactive;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.users.role
     *
     * @return the value of public.users.role
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public String getRole() {
        return role;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.users.role
     *
     * @param role the value for public.users.role
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setRole(String role) {
        this.role = role == null ? null : role.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.users.teamid
     *
     * @return the value of public.users.teamid
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public Long getTeamid() {
        return teamid;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.users.teamid
     *
     * @param teamid the value for public.users.teamid
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setTeamid(Long teamid) {
        this.teamid = teamid;
    }
    
    @Override
    public int hashCode() {
        return id.intValue();
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        Users other = (Users) obj;
        if (id != other.id)
            return false;
        return true;
    }
}
src/main/java/top/phrack/ctf/models/services/ChallengeServices.java
public interface ChallengeServices {

	public List<Challenges> getAllAvailChallenges();
	
	public int updateChallenge(Challenges challenge);
	
	public Challenges getChallengeById(Long id);
	
	public Long getCateScoreByCateId(Long cateid);
	
	public List<Challenges> getAllChallenges();
	
	public int createNewChallenge(Challenges challenge);
	
	public List<Challenges> getAllChallengesInCateById(Long id);
	
	public int deleteChallengeById(Long id);
}
src/main/java/top/phrack/ctf/pojo/OpLogDisp.java
public class OpLogDisp extends Operatelog {
	private String name;
	
	public String getname(){
		return name;
	}
	
	public void setname(String name) {
		this.name = name;
	}
}
src/main/java/top/phrack/ctf/pojo/Files.java
public class Files implements Serializable{
	private static final long serialVersionUID = 1L;  
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.files.id
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private Long id;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.files.filename
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private String filename;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.files.addby
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private String addby;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.files.size
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private Long size;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.files.md5
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private String md5;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.files.challengeid
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private Long challengeid;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.files.resindex
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private String resindex;

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.files.id
     *
     * @return the value of public.files.id
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public Long getId() {
        return id;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.files.id
     *
     * @param id the value for public.files.id
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.files.filename
     *
     * @return the value of public.files.filename
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public String getFilename() {
        return filename;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.files.filename
     *
     * @param filename the value for public.files.filename
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setFilename(String filename) {
        this.filename = filename == null ? null : filename.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.files.addby
     *
     * @return the value of public.files.addby
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public String getAddby() {
        return addby;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.files.addby
     *
     * @param addby the value for public.files.addby
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setAddby(String addby) {
        this.addby = addby == null ? null : addby.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.files.size
     *
     * @return the value of public.files.size
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public Long getSize() {
        return size;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.files.size
     *
     * @param size the value for public.files.size
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setSize(Long size) {
        this.size = size;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.files.md5
     *
     * @return the value of public.files.md5
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public String getMd5() {
        return md5;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.files.md5
     *
     * @param md5 the value for public.files.md5
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setMd5(String md5) {
        this.md5 = md5 == null ? null : md5.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.files.challengeid
     *
     * @return the value of public.files.challengeid
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public Long getChallengeid() {
        return challengeid;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.files.challengeid
     *
     * @param challengeid the value for public.files.challengeid
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setChallengeid(Long challengeid) {
        this.challengeid = challengeid;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.files.resindex
     *
     * @return the value of public.files.resindex
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public String getResindex() {
        return resindex;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.files.resindex
     *
     * @param resindex the value for public.files.resindex
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setResindex(String resindex) {
        this.resindex = resindex == null ? null : resindex.trim();
    }
}
src/main/java/top/phrack/ctf/pojo/ChallengeInManager.java
public class ChallengeInManager {
	 /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.challenges.id
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    private Long id;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.challenges.title
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    private String title;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.challenges.score
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    private Long score;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.challenges.categoryid
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    private String catename;
    
    private String catemark;
    
    

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.challenges.available
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    private Date available;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.challenges.invalidate
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    private Date invalidate;

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.challenges.id
     *
     * @return the value of public.challenges.id
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    public Long getId() {
        return id;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.challenges.id
     *
     * @param id the value for public.challenges.id
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.challenges.title
     *
     * @return the value of public.challenges.title
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    public String getTitle() {
        return title;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.challenges.title
     *
     * @param title the value for public.challenges.title
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    public void setTitle(String title) {
        this.title = title == null ? null : title.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.challenges.score
     *
     * @return the value of public.challenges.score
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    public Long getScore() {
        return score;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.challenges.score
     *
     * @param score the value for public.challenges.score
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    public void setScore(Long score) {
        this.score = score;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.challenges.categoryid
     *
     * @return the value of public.challenges.categoryid
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    public String getcatename() {
        return catename;
    }

    public void setcatename(String catename) {
        this.catename = catename;
    }
    
    public String getcatemark() {
        return catemark;
    }

    public void setcatemark(String catemark) {
        this.catemark = catemark;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.challenges.available
     *
     * @return the value of public.challenges.available
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    public Date getAvailable() {
        return available;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.challenges.available
     *
     * @param available the value for public.challenges.available
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    public void setAvailable(Date available) {
        this.available = available;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.challenges.invalidate
     *
     * @return the value of public.challenges.invalidate
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    public Date getInvalidate() {
        return invalidate;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.challenges.invalidate
     *
     * @param invalidate the value for public.challenges.invalidate
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    public void setInvalidate(Date invalidate) {
        this.invalidate = invalidate;
    }
}
src/main/java/top/phrack/ctf/pojo/CateProcess.java
public class CateProcess {
	
	private String name;
	
	private long proc;
	
	private long total;
	
	private double percent;
	
	private String style;
	
	private double percentall;
	
	public String getname() {
		return name;
	}
	
	public void setname(String name) {
		this.name = name;
	}
	
	public long getproc() {
		return proc;
	}
	
	public void setproc(long proc){
		this.proc = proc;
	}
	
	public long gettotal(){
		return total;
	}
	
	public void settotal(long total) {
		this.total = total;
	}
	
	public double getpercent() {
		return percent;
	}
	
	public void setpercent(double percent) {
		this.percent = percent;
	}
	
	public String getstyle() {
		return style;
	}
	
	public void setstyle(String style) {
		this.style = style;
	}
	
	public double getpercentall() {
		return percentall;
	} 
	
	public void setpercentall(double percentall) {
		this.percentall = percentall;
	}
	
	
}
src/main/java/top/phrack/ctf/pojo/SubmissionList.java
public class SubmissionList extends Submissions {
	
	private String taskname;
	
	private String user;
	
	public String gettaskname() {
		return taskname;
	}
	
	public void settaskname(String taskname) {
		this.taskname = taskname;
	}
	
	public String getuser(){
		return user;
	}
	
	public void setuser(String user) {
		this.user = user;
	}

}
src/main/java/top/phrack/ctf/pojo/Categories.java
public class Categories implements Serializable{
	private static final long serialVersionUID = 1L;  
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.categories.id
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private Long id;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.categories.name
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private String name;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.categories.mark
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private String mark;

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.categories.id
     *
     * @return the value of public.categories.id
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public Long getId() {
        return id;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.categories.id
     *
     * @param id the value for public.categories.id
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.categories.name
     *
     * @return the value of public.categories.name
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public String getName() {
        return name;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.categories.name
     *
     * @param name the value for public.categories.name
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.categories.mark
     *
     * @return the value of public.categories.mark
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public String getMark() {
        return mark;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.categories.mark
     *
     * @param mark the value for public.categories.mark
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setMark(String mark) {
        this.mark = mark == null ? null : mark.trim();
    }
    
    @Override
    public int hashCode() {
        return id.intValue();
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        Categories other = (Categories) obj;
        if (id != other.id)
            return false;
        return true;
    }
}
src/main/java/top/phrack/ctf/pojo/UserList.java
public class UserList extends Users{
	
	private String countrycode;
	
	private String countryname;
	
	private long ips;
	
	public String getcountrycode(){
		return countrycode;
	}
	
	public void setcountrycode(String countrycode){
		this.countrycode = countrycode;
	}
	
	public String getcountryname() {
		return countryname;
	}
	
	public void setcountryname(String countryname) {
		this.countryname = countryname;
	}
	
	public long getips() {
		return ips;
	}
	
	public void setips(long ips) {
		this.ips = ips;
	}

}
src/main/java/top/phrack/ctf/models/services/IPlogServices.java
public interface IPlogServices {
	public IpLogs getLogsByAddrAndId(String addr,long uid);
	
	public int insertNewLog(IpLogs aLog);
	
	public int updateLogInfo(IpLogs newLog);
	
	public long countByUserId(Long userid);
	
	public List<IpLogs> getAllIpLogsByUserId(Long userid);
	
	public List<IpLogs> getAllOrderByUserId();
}
src/main/java/top/phrack/ctf/pojo/Challenges.java
public class Challenges implements Serializable{
	private static final long serialVersionUID = 1L;  
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.challenges.id
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    private Long id;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.challenges.title
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    private String title;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.challenges.description
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    private String description;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.challenges.attachids
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    private String attachids;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.challenges.score
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    private Long score;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.challenges.categoryid
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    private Long categoryid;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.challenges.flag
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    private String flag;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.challenges.exposed
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    private Boolean exposed;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.challenges.available
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    private Date available;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.challenges.invalidate
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    private Date invalidate;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.challenges.watchby
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    private String watchby;

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.challenges.id
     *
     * @return the value of public.challenges.id
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    public Long getId() {
        return id;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.challenges.id
     *
     * @param id the value for public.challenges.id
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.challenges.title
     *
     * @return the value of public.challenges.title
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    public String getTitle() {
        return title;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.challenges.title
     *
     * @param title the value for public.challenges.title
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    public void setTitle(String title) {
        this.title = title == null ? null : title.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.challenges.description
     *
     * @return the value of public.challenges.description
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    public String getDescription() {
        return description;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.challenges.description
     *
     * @param description the value for public.challenges.description
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    public void setDescription(String description) {
        this.description = description == null ? null : description.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.challenges.attachids
     *
     * @return the value of public.challenges.attachids
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    public String getAttachids() {
        return attachids;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.challenges.attachids
     *
     * @param attachids the value for public.challenges.attachids
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    public void setAttachids(String attachids) {
        this.attachids = attachids == null ? null : attachids.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.challenges.score
     *
     * @return the value of public.challenges.score
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    public Long getScore() {
        return score;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.challenges.score
     *
     * @param score the value for public.challenges.score
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    public void setScore(Long score) {
        this.score = score;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.challenges.categoryid
     *
     * @return the value of public.challenges.categoryid
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    public Long getCategoryid() {
        return categoryid;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.challenges.categoryid
     *
     * @param categoryid the value for public.challenges.categoryid
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    public void setCategoryid(Long categoryid) {
        this.categoryid = categoryid;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.challenges.flag
     *
     * @return the value of public.challenges.flag
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    public String getFlag() {
        return flag;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.challenges.flag
     *
     * @param flag the value for public.challenges.flag
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    public void setFlag(String flag) {
        this.flag = flag == null ? null : flag.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.challenges.exposed
     *
     * @return the value of public.challenges.exposed
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    public Boolean getExposed() {
        return exposed;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.challenges.exposed
     *
     * @param exposed the value for public.challenges.exposed
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    public void setExposed(Boolean exposed) {
        this.exposed = exposed;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.challenges.available
     *
     * @return the value of public.challenges.available
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    public Date getAvailable() {
        return available;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.challenges.available
     *
     * @param available the value for public.challenges.available
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    public void setAvailable(Date available) {
        this.available = available;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.challenges.invalidate
     *
     * @return the value of public.challenges.invalidate
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    public Date getInvalidate() {
        return invalidate;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.challenges.invalidate
     *
     * @param invalidate the value for public.challenges.invalidate
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    public void setInvalidate(Date invalidate) {
        this.invalidate = invalidate;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.challenges.watchby
     *
     * @return the value of public.challenges.watchby
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    public String getWatchby() {
        return watchby;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.challenges.watchby
     *
     * @param watchby the value for public.challenges.watchby
     *
     * @mbggenerated Sun Apr 10 21:02:51 CST 2016
     */
    public void setWatchby(String watchby) {
        this.watchby = watchby == null ? null : watchby.trim();
    }
}
src/main/java/top/phrack/ctf/pojo/HintDisp.java
public class HintDisp {
	
	private long id;
	
	private String challname;
	
	private Date adddate;
	
	private String content;
	
	public long getid() {
		return id;
	}
	
	public void setid(long id){
		this.id = id;
	}
	
	public String getchallname() {
		return challname;
	
	}
	
	public void setchallname(String challname) {
		this.challname = challname;
	} 
	
	public Date getadddate(){
		return adddate;
	}
	
	public void setadddate(Date adddate) {
		this.adddate = adddate;
	}
	
	public String getcontent(){
		return content;
	}
	
	public void setcontent(String content) {
		this.content = content;
	} 
}
src/main/java/top/phrack/ctf/models/services/OperateLogServices.java
public interface OperateLogServices {
	public int insertNewlog(Operatelog alog);
	
	public List<Operatelog> getAllLogs();
	
	
}
src/main/java/top/phrack/ctf/pojo/Hints.java
public class Hints implements Serializable{
	private static final long serialVersionUID = 1L;  
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.hints.id
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private Long id;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.hints.challengeid
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private Long challengeid;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.hints.content
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private String content;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.hints.addtime
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private Date addtime;

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.hints.id
     *
     * @return the value of public.hints.id
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public Long getId() {
        return id;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.hints.id
     *
     * @param id the value for public.hints.id
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.hints.challengeid
     *
     * @return the value of public.hints.challengeid
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public Long getChallengeid() {
        return challengeid;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.hints.challengeid
     *
     * @param challengeid the value for public.hints.challengeid
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setChallengeid(Long challengeid) {
        this.challengeid = challengeid;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.hints.content
     *
     * @return the value of public.hints.content
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public String getContent() {
        return content;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.hints.content
     *
     * @param content the value for public.hints.content
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setContent(String content) {
        this.content = content == null ? null : content.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.hints.addtime
     *
     * @return the value of public.hints.addtime
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public Date getAddtime() {
        return addtime;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.hints.addtime
     *
     * @param addtime the value for public.hints.addtime
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setAddtime(Date addtime) {
        this.addtime = addtime;
    }
}
src/main/java/top/phrack/ctf/pojo/Rules.java
public class Rules implements Serializable{
	private static final long serialVersionUID = 1L;  
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.rules.id
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private Long id;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.rules.content
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private String content;

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.rules.id
     *
     * @return the value of public.rules.id
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public Long getId() {
        return id;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.rules.id
     *
     * @param id the value for public.rules.id
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.rules.content
     *
     * @return the value of public.rules.content
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public String getContent() {
        return content;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.rules.content
     *
     * @param content the value for public.rules.content
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setContent(String content) {
        this.content = content == null ? null : content.trim();
    }
}
src/main/java/top/phrack/ctf/utils/LogUtils.java
public class LogUtils {

	
	public static void recordOperateLog(HttpServletRequest request,Users userobj,OperateLogServices operatelogServices,String logcontent) {
		String userip = request.getRemoteAddr(); 
		Date current = new Date();
		Operatelog alog = new Operatelog();
		alog.setIpaddr(userip);
		alog.setOperatefunc(logcontent);
		alog.setOperatetime(current);
		alog.setOperatorid(userobj.getId());
		
		operatelogServices.insertNewlog(alog);
	}
}
src/main/java/top/phrack/ctf/models/services/CategoryServices.java
public interface CategoryServices {
	
	public List<Categories> selectAllCategory();
	
	public Categories selectById(Long id);

	public int insertNewCategory(Categories cate);
	
	public int deleteCategoryById(Long id);
	
	public int updateCategory(Categories cate);
	
}
src/main/java/top/phrack/ctf/models/services/BannedIpServices.java
public interface BannedIpServices {
	
	public BannedIps getRecordByIp(String ip);
	
	public List<BannedIps> getAllIps();
	
	public int deleteRecordById(Long id);
	
	public int updateRecord(BannedIps ip);
	
	public int insertIpRecord(BannedIps newip);
	
	public BannedIps getRecordById(Long id);
	
}
src/main/java/top/phrack/ctf/models/services/FileServices.java
public interface FileServices {
	public List<Files> getFilesByChallengeId(Long id);
	
	public int insertNewFileRecord(Files afile);
	
	public Files getFileNotAttachedByName(String name);
	
	public Files getFileById(Long id);
	
	public int updateFileInfo(Files file);
	
	public int deleteFileRecordById(Long id);
	
	public List<Files> getAllFiles();
}
src/main/java/top/phrack/ctf/pojo/Submissions.java
public class Submissions implements Serializable{
	private static final long serialVersionUID = 1L;  
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.submissions.id
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private Long id;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.submissions.userid
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private Long userid;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.submissions.challenge_id
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private Long challengeId;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.submissions.submit_time
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private Date submitTime;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.submissions.content
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private String content;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column public.submissions.correct
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    private Boolean correct;

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.submissions.id
     *
     * @return the value of public.submissions.id
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public Long getId() {
        return id;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.submissions.id
     *
     * @param id the value for public.submissions.id
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.submissions.userid
     *
     * @return the value of public.submissions.userid
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public Long getUserid() {
        return userid;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.submissions.userid
     *
     * @param userid the value for public.submissions.userid
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setUserid(Long userid) {
        this.userid = userid;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.submissions.challenge_id
     *
     * @return the value of public.submissions.challenge_id
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public Long getChallengeId() {
        return challengeId;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.submissions.challenge_id
     *
     * @param challengeId the value for public.submissions.challenge_id
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setChallengeId(Long challengeId) {
        this.challengeId = challengeId;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.submissions.submit_time
     *
     * @return the value of public.submissions.submit_time
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public Date getSubmitTime() {
        return submitTime;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.submissions.submit_time
     *
     * @param submitTime the value for public.submissions.submit_time
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setSubmitTime(Date submitTime) {
        this.submitTime = submitTime;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.submissions.content
     *
     * @return the value of public.submissions.content
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public String getContent() {
        return content;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.submissions.content
     *
     * @param content the value for public.submissions.content
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setContent(String content) {
        this.content = content == null ? null : content.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column public.submissions.correct
     *
     * @return the value of public.submissions.correct
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public Boolean getCorrect() {
        return correct;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column public.submissions.correct
     *
     * @param correct the value for public.submissions.correct
     *
     * @mbggenerated Thu Mar 31 16:07:59 CST 2016
     */
    public void setCorrect(Boolean correct) {
        this.correct = correct;
    }
    
    @Override
    public int hashCode() {
        return id.intValue();
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        Submissions other = (Submissions) obj;
        if (id != other.id)
            return false;
        return true;
    }
}
src/main/java/top/phrack/ctf/models/services/HintServices.java
public interface HintServices {
	public List<Hints> getHintsByTaskId(Long id);
	
	public int createNewHint(Hints hint);
	
	public List<Hints> getAllHints();
	
	public Hints getHintById(Long id);
	
	public int updateHint(Hints hint);
	
	public int deleteById(Long id);
}
src/main/java/top/phrack/ctf/models/services/UserServices.java
public interface UserServices {
	
	public Users getUserByEmail(String email);
	
	public Users getUserByName(String username);
	
	public int insertNewUser(Users auser);
	
	public int updateUser(Users User);
	
	public Users getUserById(Long id);
	
	public List<Users> getUsersForRank();
	
	public List<Users> getAllUsers();
	
	public int deleteUserById(Long id);
}


Question: import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.RandomStringUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.crypto.hash.SimpleHash;
import org.apache.shiro.subject.Subject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
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.servlet.ModelAndView;
import net.sf.json.JSONObject;
import top.phrack.ctf.comparators.CompareDate;
import top.phrack.ctf.models.services.BannedIpServices;
import top.phrack.ctf.models.services.CategoryServices;
import top.phrack.ctf.models.services.ChallengeServices;
import top.phrack.ctf.models.services.CountryServices;
import top.phrack.ctf.models.services.FileServices;
import top.phrack.ctf.models.services.HintServices;
import top.phrack.ctf.models.services.IPlogServices;
import top.phrack.ctf.models.services.NewsServices;
import top.phrack.ctf.models.services.OperateLogServices;
import top.phrack.ctf.models.services.RuleServices;
import top.phrack.ctf.models.services.SubmissionServices;
import top.phrack.ctf.models.services.UserServices;
import top.phrack.ctf.pojo.BannedIps;
import top.phrack.ctf.pojo.CateProcess;
import top.phrack.ctf.pojo.Categories;
import top.phrack.ctf.pojo.Challenges;
import top.phrack.ctf.pojo.Countries;
import top.phrack.ctf.pojo.Files;
import top.phrack.ctf.pojo.HintDisp;
import top.phrack.ctf.pojo.Hints;
import top.phrack.ctf.pojo.IpLogs;
import top.phrack.ctf.pojo.News;
import top.phrack.ctf.pojo.OpLogDisp;
import top.phrack.ctf.pojo.Operatelog;
import top.phrack.ctf.pojo.Rules;
import top.phrack.ctf.pojo.SolveTable;
import top.phrack.ctf.pojo.SubmissionList;
import top.phrack.ctf.pojo.Submissions;
import top.phrack.ctf.pojo.UserList;
import top.phrack.ctf.pojo.Users;
import top.phrack.ctf.pojo.ChallengeInManager;
import top.phrack.ctf.utils.CommonUtils;
import top.phrack.ctf.utils.LogUtils;
/**
 * 
 */
package top.phrack.ctf.controller;





/**
 * 后台主页
 *
 * @author Jarvis
 * @date 2016年4月15日
 */
@Controller
public class ManageController {
	private Logger log = LoggerFactory.getLogger(ManageController.class);
	
	
	@Autowired
	private HttpServletRequest request;
	@Resource 
	private UserServices userServices;
	@Resource
	private BannedIpServices bannedIpServices;
	@Resource
	private SubmissionServices submissionServices;
	@Resource
	private NewsServices newsServices;
	@Resource 
	private IPlogServices ipLogServices;
	@Resource
	private RuleServices ruleServices;
	@Resource
	private CategoryServices categoryServices;
	@Resource 
	private OperateLogServices operateLogServices;
	@Resource
	private ChallengeServices challengeServices;
	@Resource
	private FileServices fileServices;
	@Resource
	private HintServices hintServices;
	@Resource
Answer: 	private CountryServices countryServices;