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

import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;

import com.lingke.xvp.demo.XvpConstants;

public class SessionUtil {
	public final static String SELLER_LOGIN_ID= "SELLER_LOGIN_ID";
	public final static String USER_LOGIN_ID= "USER_LOGIN_ID";
	public final static String SELLER_STORELOGIN_ID= "SELLER_STORELOGIN_ID";
	public final static String USER_STORELOGIN_ID= "USER_STORELOGIN_ID";
	public static void sellerLogin(Long value){
		RequestContextHolder.getRequestAttributes().setAttribute(SELLER_LOGIN_ID, value, RequestAttributes.SCOPE_SESSION);
	}
	public static boolean checkSellerLogin(){
		return RequestContextHolder.getRequestAttributes().getAttribute(SELLER_LOGIN_ID, RequestAttributes.SCOPE_SESSION)!=null;	
	}
	
	public static void sellerSetStoreId(String value){
		RequestContextHolder.getRequestAttributes().setAttribute(SELLER_STORELOGIN_ID, value, RequestAttributes.SCOPE_SESSION);
	}
	public static String sellerGetStoreId(){
		Object ob = RequestContextHolder.getRequestAttributes().getAttribute(SELLER_STORELOGIN_ID, RequestAttributes.SCOPE_SESSION);	
		if(ob==null){
			throw new RuntimeException(XvpConstants.ERROR_MESSAGE04);
		}
		return ob.toString();
	}
	
	public static void userLogin(String value){
		RequestContextHolder.getRequestAttributes().setAttribute(USER_LOGIN_ID, value, RequestAttributes.SCOPE_SESSION);
	}
	public static boolean checkUserLogin(){
		return RequestContextHolder.getRequestAttributes().getAttribute(USER_LOGIN_ID, RequestAttributes.SCOPE_SESSION)!=null;	
	}
	
	
	
	public static void userSetStoreId(String value){
		RequestContextHolder.getRequestAttributes().setAttribute(USER_STORELOGIN_ID, value, RequestAttributes.SCOPE_SESSION);
	}
	public static String userGetStoreId(){
		Object ob = RequestContextHolder.getRequestAttributes().getAttribute(USER_STORELOGIN_ID, RequestAttributes.SCOPE_SESSION);	
		if(ob==null){
			throw new RuntimeException(XvpConstants.ERROR_MESSAGE04);
		}
		return ob.toString();
	}
}<commit_msg>代码格式化<commit_after>package com.lingke.xvp.demo.utils;

import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;

import com.lingke.xvp.demo.XvpConstants;

public class SessionUtil {
	public final static String SELLER_LOGIN_ID = "SELLER_LOGIN_ID";
	public final static String USER_LOGIN_ID = "USER_LOGIN_ID";
	public final static String SELLER_STORELOGIN_ID = "SELLER_STORELOGIN_ID";
	public final static String USER_STORELOGIN_ID = "USER_STORELOGIN_ID";

	public static void sellerLogin(Long value) {
		RequestContextHolder.getRequestAttributes().setAttribute(
				SELLER_LOGIN_ID, value, RequestAttributes.SCOPE_SESSION);
	}

	public static boolean checkSellerLogin() {
		return RequestContextHolder.getRequestAttributes().getAttribute(
				SELLER_LOGIN_ID, RequestAttributes.SCOPE_SESSION) != null;
	}

	public static void sellerSetStoreId(String value) {
		RequestContextHolder.getRequestAttributes().setAttribute(
				SELLER_STORELOGIN_ID, value, RequestAttributes.SCOPE_SESSION);
	}

	public static String sellerGetStoreId() {
		Object ob = RequestContextHolder.getRequestAttributes().getAttribute(
				SELLER_STORELOGIN_ID, RequestAttributes.SCOPE_SESSION);
		if (ob == null) {
			throw new RuntimeException(XvpConstants.ERROR_MESSAGE04);
		}
		return ob.toString();
	}

	public static void userLogin(String value) {
		RequestContextHolder.getRequestAttributes().setAttribute(USER_LOGIN_ID,
				value, RequestAttributes.SCOPE_SESSION);
	}

	public static boolean checkUserLogin() {
		return RequestContextHolder.getRequestAttributes().getAttribute(
				USER_LOGIN_ID, RequestAttributes.SCOPE_SESSION) != null;
	}

	public static void userSetStoreId(String value) {
		RequestContextHolder.getRequestAttributes().setAttribute(
				USER_STORELOGIN_ID, value, RequestAttributes.SCOPE_SESSION);
	}

	public static String userGetStoreId() {
		Object ob = RequestContextHolder.getRequestAttributes().getAttribute(
				USER_STORELOGIN_ID, RequestAttributes.SCOPE_SESSION);
		if (ob == null) {
			throw new RuntimeException(XvpConstants.ERROR_MESSAGE04);
		}
		return ob.toString();
	}
}
{'fraction_non_alphanumeric': 0.08654970760233918, 'fraction_numerical': 0.0018713450292397662, 'mean_word_length': 6.977611940298507, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6537791', 'n_tokens_mistral': 1361, 'n_tokens_neox': 1295, 'n_words': 231}