package com.jw.app.user.utils;

import java.util.HashMap;
import java.util.Map;

import com.gaowj.business.SystemOpeBusiness;
import com.gaowj.business.comp.BusinessManager;
import com.gaowj.business.exception.BusinessException;
import com.gaowj.service.client.utils.AuthenticateUtil;

public class operateGroup {
	//新增用户时添加个人编辑权限
	public static void insertGroup(String userid) throws BusinessException{
		String gid = AuthenticateUtil.getEndpoint("groupiduser");
		SystemOpeBusiness systemOpeBusiness = BusinessManager.getBusiness(SystemOpeBusiness.class);
		Map<String, Object> gu_entity = new HashMap<String, Object>();
		gu_entity.put("G_ID", gid);
		gu_entity.put("U_ID", userid);
		systemOpeBusiness.insert_group_c_u(gu_entity);
	}
	
	//删除用户时去除个人编辑权限
    public static void deleteGroup(String userid) throws BusinessException{
    	String gid = AuthenticateUtil.getEndpoint("groupiduser");
		SystemOpeBusiness systemOpeBusiness = BusinessManager.getBusiness(SystemOpeBusiness.class);
		Map<String, Object> gu_entity = new HashMap<String, Object>();
		gu_entity.put("G_ID", gid);
		gu_entity.put("U_ID", userid);
		systemOpeBusiness.delete_group_c_u(gu_entity);
    }
}
