You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
530 B
25 lines
530 B
4 years ago
|
package com.stone.base;
|
||
|
|
||
|
import org.apache.shiro.SecurityUtils;
|
||
|
import org.apache.shiro.session.Session;
|
||
|
import org.apache.shiro.subject.Subject;
|
||
|
|
||
|
import java.io.Serializable;
|
||
|
import java.util.List;
|
||
|
|
||
|
/**
|
||
|
* JDK8函数式接口注解 仅能包含一个抽象方法
|
||
|
* @author zichen
|
||
|
*/
|
||
|
@FunctionalInterface
|
||
|
public interface BaseService<E, ID extends Serializable> {
|
||
|
|
||
|
BaseMapper<E> getRepository();
|
||
|
|
||
|
default Session getSession() {
|
||
|
Subject sub = SecurityUtils.getSubject();
|
||
|
return sub.getSession();
|
||
|
}
|
||
|
|
||
|
}
|