package com.imed.costaccount.web; import com.imed.costaccount.model.User; import org.apache.shiro.SecurityUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Controller公共组件 * * @author Mark sunlightcs@gmail.com */ public abstract class AbstractController { protected Logger logger = LoggerFactory.getLogger(getClass()); protected User getUser() { return (User) SecurityUtils.getSubject().getPrincipal(); } protected Long getUserId() { return getUser().getId(); } protected Long getHospId(){ User principal = (User) SecurityUtils.getSubject().getPrincipal(); return principal.getHospId(); } }