hutool-all
5.4.4
注意:我们默认是已经配置好mybatis的web项目,还未配置myBatis?点击此处
用来跳过验证的PassToken
@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface PassToken {
boolean required() default true;
}
需要登录才能进行操作的注解UserLoginToken
@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface UserLoginToken {
boolean required() default true;
}
@Target:注解的作用目标
-
@Target(ElementType.TYPE)——接口、类、枚举、注解
-
@Target(ElementType.FIELD)——字段、枚举的常量
-
@Target(ElementType.METHOD)——方法
-
@Target(ElementType.PARAMETER)——方法参数
-
@Target(ElementType.CONSTRUCTOR) ——构造函数
-
@Target(ElementType.LOCAL_VARIABLE)——局部变量
-
@Target(ElementType.ANNOTATION_TYPE)——注解
-
@Target(ElementType.PACKAGE)——包
@Retention:注解的保留位置
-
RetentionPolicy.SOURCE:这种类型的Annotations只在源代码级别保留,编译时就会被忽略,在class字节码文件中不包含。
-
RetentionPolicy.CLASS:这种类型的Annotations编译时被保留,默认的保留策略,在class文件中存在,但JVM将会忽略,运行时无法获得。
-
RetentionPolicy.RUNTIME:这种类型的Annotations将被JVM保留,所以他们能在运行时被JVM或其他使用反射机制的代码所读取和使用。
-
@Document:说明该注解将被包含在javadoc中
-
@Inherited:说明子类可以继承父类中的该注解
public class User implements java.io.Serializable {
/** 版本号 */
private static final long serialVersionUID = 6111899065812654266L;
/** 主键自增Id */
private Integer userId;
/** 用户民 */
private String userName;
/** 用户密码 */
private String password;
/**
-
获取主键自增Id
-
@return 主键自增Id
*/
public Integer getUserId() {
return this.userId;
}
/**
-
设置主键自增Id
-
@param userId
-
主键自增Id
*/
public void setUserId(Integer userId) {
this.userId = userId;
}
/**
-
获取用户民
-
@return 用户民
*/
public String getUserName() {
return this.userName;
}
/**
-
设置用户民
-
@param userName
-
用户民
*/
public void setUserName(String userName) {
this.userName = userName;
}
/**
-
获取用户密码
-
@return 用户密码
*/
public String getPassword() {
return this.password;
}
/**
-
设置用户密码
-
@param password
-
用户密码
*/
public void setPassword(String password) {
this.password = password;
}
}
public interface UserMapper {
public List getUs