refactor: 根包由 com.bestsch.bschclassmanage 重命名为 com.yunhai.bschclassmanage
- git mv src/main/java/com/bestsch/bschclassmanage -> src/main/java/com/yunhai/bschclassmanage - 255 个 Java 文件的 package/import 同步替换为 com.yunhai.bschclassmanage - pom.xml 项目 groupId 设为 com.yunhai(与外部依赖 com.bestsch:bsch-* 无关,未改动) - IDE 缓存 workspace.xml 路径同步更新(外部依赖坐标 com.bestsch:bsch-* 保持不动)
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package com.yunhai.bschclassmanage.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public enum AcademicStage
|
||||
{
|
||||
PRESCHOOL(0, "学前"),
|
||||
PRIMARY(1, "小学"),
|
||||
JUNIOR(2, "初中"),//106
|
||||
SENIOR(3, "高中"),//108
|
||||
HIGHER_EDUCATION(4, "高等");
|
||||
|
||||
private Integer key;
|
||||
private String value;
|
||||
|
||||
public static List<AcademicStage> list()
|
||||
{
|
||||
return new ArrayList<>(EnumSet.allOf(AcademicStage.class));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package com.yunhai.bschclassmanage.enums;
|
||||
|
||||
import com.yunhai.bschclassmanage.model.vo.SelectIntVO;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Getter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public enum CourseType
|
||||
{
|
||||
PUBLIC_COURSE(1, "公共课"),
|
||||
ELECTIVE_COURSE(2, "选修课"),
|
||||
PROFESSIONAL_COURSE(3, "专业课");
|
||||
|
||||
private Integer id;
|
||||
private String name;
|
||||
|
||||
CourseType(int id, String name)
|
||||
{
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public int getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
public static List<CourseType> list()
|
||||
{
|
||||
return new ArrayList<>(EnumSet.allOf(CourseType.class));
|
||||
}
|
||||
|
||||
public static String nameById(int id) {
|
||||
for (CourseType type : list()) {
|
||||
if (type.getId() == id) return type.getName();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static Integer getIdByName(String name) {
|
||||
for (CourseType type : list()) {
|
||||
if (type.getName().equals(name)) return type.getId();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static CourseType getById(int id)
|
||||
{
|
||||
for (CourseType na : list())
|
||||
{
|
||||
if (na.getId() == id)
|
||||
{
|
||||
return na;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static List<SelectIntVO> select() {
|
||||
List<SelectIntVO> list= CourseType.list().stream()
|
||||
.map(type -> new SelectIntVO(type.getId(), type.getName()))
|
||||
.collect(Collectors.toList());
|
||||
return new ArrayList<>(list);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package com.yunhai.bschclassmanage.enums;
|
||||
|
||||
import com.yunhai.bschclassmanage.model.vo.SelectIntVO;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Getter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public enum CustomGroupType
|
||||
{
|
||||
PUBLIC_COURSE(1, "年级组"),
|
||||
ELECTIVE_COURSE(2, "教研组"),
|
||||
PROFESSIONAL_COURSE(3, "备课组");
|
||||
|
||||
private Integer id;
|
||||
private String name;
|
||||
|
||||
CustomGroupType(int id, String name)
|
||||
{
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public int getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
public static List<CustomGroupType> list()
|
||||
{
|
||||
return new ArrayList<>(EnumSet.allOf(CustomGroupType.class));
|
||||
}
|
||||
|
||||
public static String nameById(int id) {
|
||||
for (CustomGroupType type : list()) {
|
||||
if (type.getId() == id) return type.getName();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static Integer getIdByName(String name) {
|
||||
for (CustomGroupType type : list()) {
|
||||
if (type.getName().equals(name)) return type.getId();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static CustomGroupType getById(int id)
|
||||
{
|
||||
for (CustomGroupType na : list())
|
||||
{
|
||||
if (na.getId() == id)
|
||||
{
|
||||
return na;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static List<SelectIntVO> select() {
|
||||
List<SelectIntVO> list= CustomGroupType.list().stream()
|
||||
.map(type -> new SelectIntVO(type.getId(), type.getName()))
|
||||
.collect(Collectors.toList());
|
||||
return new ArrayList<>(list);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.yunhai.bschclassmanage.enums;
|
||||
|
||||
public enum FileType {
|
||||
|
||||
|
||||
IMG_TYPE(1,"图片"),
|
||||
VIDEO_TYPE(2,"视频"),
|
||||
AUDIO_TYPE(3,"音频"),
|
||||
OTHER_TYPE(4,"其他");
|
||||
|
||||
|
||||
|
||||
|
||||
private int id;
|
||||
private String name;
|
||||
|
||||
FileType(int id, String name) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.yunhai.bschclassmanage.enums;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
public enum NodeType {
|
||||
NORMAL(1, "普通组"),
|
||||
SCHOOL(2, "学校组"),
|
||||
GRADE(3, "年级组"),
|
||||
CLASS(4, "班级组"),
|
||||
REGION(5, "区域组"),
|
||||
SECTION(6, "学段组"),
|
||||
TEACHER(7, "教师组"),
|
||||
STUDENT(8, "学生组");
|
||||
|
||||
private int id;
|
||||
private String name;
|
||||
|
||||
NodeType(int id, String name)
|
||||
{
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public int getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public static List<NodeType> list()
|
||||
{
|
||||
return new ArrayList<>(EnumSet.allOf(NodeType.class));
|
||||
}
|
||||
|
||||
public static Map<Integer, NodeType> map()
|
||||
{
|
||||
return list().stream().collect(Collectors.toMap(NodeType::getId, QuestionType->QuestionType));
|
||||
}
|
||||
|
||||
public static String nameById(int id) {
|
||||
for (NodeType type : list()) {
|
||||
if (type.getId() == id) return type.getName();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static Integer getIdByName(String name) {
|
||||
for (NodeType type : list()) {
|
||||
if (type.getName().equals(name)) return type.getId();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static NodeType getById(int id)
|
||||
{
|
||||
for (NodeType na : list())
|
||||
{
|
||||
if (na.getId() == id)
|
||||
{
|
||||
return na;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.yunhai.bschclassmanage.enums;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public enum Question
|
||||
{
|
||||
I(1, "单选题"),
|
||||
II(2, "多选题"),
|
||||
III(3, "判断题"),
|
||||
IV(4, "解答题"),
|
||||
V(6, "组合题"),
|
||||
VI(5, "填空题"),
|
||||
VII(7, "英语题");
|
||||
|
||||
private int id;
|
||||
private String name;
|
||||
|
||||
Question(int id, String name)
|
||||
{
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public int getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public static List<Question> list()
|
||||
{
|
||||
return new ArrayList<>(EnumSet.allOf(Question.class));
|
||||
}
|
||||
|
||||
public static Map<Integer, Question> map()
|
||||
{
|
||||
return list().stream().collect(Collectors.toMap(Question::getId, QuestionType->QuestionType));
|
||||
}
|
||||
|
||||
public static String nameById(int id) {
|
||||
for (Question type : list()) {
|
||||
if (type.getId() == id) return type.getName();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static Integer getIdByName(String name) {
|
||||
for (Question type : list()) {
|
||||
if (type.getName().equals(name)) return type.getId();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static Question getById(int id)
|
||||
{
|
||||
for (Question na : list())
|
||||
{
|
||||
if (na.getId() == id)
|
||||
{
|
||||
return na;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.yunhai.bschclassmanage.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public enum SchType
|
||||
{
|
||||
BASICEDUCATION(1, "基础教育"),
|
||||
VOCATIONALEDUCATION(2, "职业教育");
|
||||
|
||||
private Integer key;
|
||||
private String value;
|
||||
|
||||
public static List<SchType> list()
|
||||
{
|
||||
return new ArrayList<>(EnumSet.allOf(SchType.class));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.yunhai.bschclassmanage.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Optional;
|
||||
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Getter
|
||||
public enum Source {
|
||||
|
||||
UNKNOWN(null,"未知"),
|
||||
SYSTEM(0,"系统级"),
|
||||
SCHOOL(1,"校级");
|
||||
|
||||
private Integer id;
|
||||
private String name;
|
||||
|
||||
public static Source getById(String name) {
|
||||
String nameKey = name.toUpperCase();
|
||||
Source[] enums = Source.values();
|
||||
Optional<Source> opt = Arrays.stream(enums).filter(item -> item.getId().equals(nameKey.toUpperCase())).findAny();
|
||||
if(opt.isPresent()){
|
||||
return opt.get();
|
||||
}
|
||||
return UNKNOWN;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.yunhai.bschclassmanage.enums;
|
||||
|
||||
import com.yunhai.bschclassmanage.model.vo.SelectIntVO;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Getter
|
||||
@NoArgsConstructor
|
||||
public enum StuAbnormalStatus
|
||||
{
|
||||
NORMAL(1,"正常"),
|
||||
SUSPEND_SCHOOLING(2,"休学"),
|
||||
GO_ABROAD(3,"出国"),
|
||||
STUDY_ABROAD(4,"留学"),
|
||||
RESUME_SCHOOLING(5,"复学"),
|
||||
STOP_SCHOOLING(6,"停学"),
|
||||
VOLUNTARY_RETREAT_SCHOOLING(7,"自愿退学"),
|
||||
VOLUNTARY_REPEAT_GRADE(8,"自愿留级"),
|
||||
VOLUNTARY_DROP_GRADE(9,"自愿降级"),
|
||||
ELSE(99,"其他");
|
||||
|
||||
|
||||
private int id;
|
||||
private String name;
|
||||
|
||||
StuAbnormalStatus(int id, String name)
|
||||
{
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public int getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public static List<StuAbnormalStatus> list()
|
||||
{
|
||||
return new ArrayList<>(EnumSet.allOf(StuAbnormalStatus.class));
|
||||
}
|
||||
|
||||
public static List<SelectIntVO> select() {
|
||||
List<SelectIntVO> list= list().stream()
|
||||
.map(type -> new SelectIntVO(type.getId(), type.getName()))
|
||||
.collect(Collectors.toList());
|
||||
return new ArrayList<>(list);
|
||||
}
|
||||
|
||||
public static Map<Integer, StuAbnormalStatus> map()
|
||||
{
|
||||
return list().stream().collect(Collectors.toMap(StuAbnormalStatus::getId, QuestionType->QuestionType));
|
||||
}
|
||||
|
||||
public static String nameById(int id) {
|
||||
for (StuAbnormalStatus type : list()) {
|
||||
if (type.getId() == id) return type.getName();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static Integer getIdByName(String name) {
|
||||
for (StuAbnormalStatus type : list()) {
|
||||
if (type.getName().equals(name)) return type.getId();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static StuAbnormalStatus getById(int id)
|
||||
{
|
||||
for (StuAbnormalStatus na : list())
|
||||
{
|
||||
if (na.getId() == id)
|
||||
{
|
||||
return na;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package com.yunhai.bschclassmanage.enums;
|
||||
|
||||
import com.yunhai.bschclassmanage.model.vo.SelectIntVO;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Getter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public enum TransferStatus
|
||||
{
|
||||
OUT(0,"转出"),
|
||||
IN(1,"转入");
|
||||
|
||||
private Integer id;
|
||||
private String name;
|
||||
|
||||
public int getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public static List<TransferStatus> list()
|
||||
{
|
||||
return new ArrayList<>(EnumSet.allOf(TransferStatus.class));
|
||||
}
|
||||
|
||||
public static List<SelectIntVO> select() {
|
||||
List<SelectIntVO> list= list().stream()
|
||||
.map(type -> new SelectIntVO(type.getId(), type.getName()))
|
||||
.collect(Collectors.toList());
|
||||
return new ArrayList<>(list);
|
||||
}
|
||||
|
||||
public static Map<Integer, TransferStatus> map()
|
||||
{
|
||||
return list().stream().collect(Collectors.toMap(TransferStatus::getId, QuestionType->QuestionType));
|
||||
}
|
||||
|
||||
public static String nameById(int id) {
|
||||
for (TransferStatus type : list()) {
|
||||
if (type.getId() == id) return type.getName();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static Integer getIdByName(String name) {
|
||||
for (TransferStatus type : list()) {
|
||||
if (type.getName().equals(name)) return type.getId();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static TransferStatus getById(int id)
|
||||
{
|
||||
for (TransferStatus na : list())
|
||||
{
|
||||
if (na.getId() == id)
|
||||
{
|
||||
return na;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package com.yunhai.bschclassmanage.enums;
|
||||
|
||||
import com.yunhai.bschclassmanage.model.vo.SelectIntVO;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
@Getter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public enum UserGender
|
||||
{
|
||||
FEMALE(0, "女"),
|
||||
MALE(1, "男");
|
||||
|
||||
|
||||
private Integer id;
|
||||
private String name;
|
||||
|
||||
public int getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public static List<UserGender> list()
|
||||
{
|
||||
return new ArrayList<>(EnumSet.allOf(UserGender.class));
|
||||
}
|
||||
|
||||
public static List<SelectIntVO> select() {
|
||||
List<SelectIntVO> list= list().stream()
|
||||
.map(type -> new SelectIntVO(type.getId(), type.getName()))
|
||||
.collect(Collectors.toList());
|
||||
return new ArrayList<>(list);
|
||||
}
|
||||
|
||||
public static Map<Integer, UserGender> map()
|
||||
{
|
||||
return list().stream().collect(Collectors.toMap(UserGender::getId, QuestionType->QuestionType));
|
||||
}
|
||||
|
||||
public static String nameById(int id) {
|
||||
for (UserGender type : list()) {
|
||||
if (type.getId() == id) return type.getName();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static Integer getIdByName(String name) {
|
||||
for (UserGender type : list()) {
|
||||
if (type.getName().equals(name)) return type.getId();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static UserGender getById(int id)
|
||||
{
|
||||
for (UserGender na : list())
|
||||
{
|
||||
if (na.getId() == id)
|
||||
{
|
||||
return na;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.yunhai.bschclassmanage.enums;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public enum UserRole {
|
||||
AREAADMIN(7,"管理员"),
|
||||
TEACHER_USER(1,"教师"),
|
||||
SCH_LEADER_USER(2,"校领导"),
|
||||
STU_USER(3,"学生"),
|
||||
PATRIARCH_USER(4,"家长"),
|
||||
BUREAU_LEADER_USER(5,"局领导"),
|
||||
BUSINESS(6,"工作号"),
|
||||
GENERAL_USER(8,"普通用户");
|
||||
|
||||
private Integer value;
|
||||
private String name;
|
||||
|
||||
UserRole () {
|
||||
}
|
||||
|
||||
UserRole ( Integer value, String name) {
|
||||
this.value = value;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public static List<Map<String,Object>> getAll(){
|
||||
UserRole[] users = UserRole.values();
|
||||
List<Map<String,Object>> list = new ArrayList<>();
|
||||
for(UserRole user : users){
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("name",user.getName());
|
||||
map.put("value",user.getValue());
|
||||
list.add(map);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package com.yunhai.bschclassmanage.enums;
|
||||
|
||||
import com.yunhai.bschclassmanage.model.vo.SelectIntVO;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Getter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public enum UserStatus
|
||||
{
|
||||
//状态 0禁用 1 正常 2休学 3出国 4留学 5复学 6停学 7退学 8留级 9其他
|
||||
|
||||
DISABLED(0,"禁用"),
|
||||
NORMAL(1,"正常");
|
||||
|
||||
private Integer id;
|
||||
private String name;
|
||||
|
||||
public int getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public static List<UserStatus> list()
|
||||
{
|
||||
return new ArrayList<>(EnumSet.allOf(UserStatus.class));
|
||||
}
|
||||
|
||||
public static List<SelectIntVO> select() {
|
||||
List<SelectIntVO> list= list().stream()
|
||||
.map(type -> new SelectIntVO(type.getId(), type.getName()))
|
||||
.collect(Collectors.toList());
|
||||
return new ArrayList<>(list);
|
||||
}
|
||||
|
||||
public static Map<Integer, UserStatus> map()
|
||||
{
|
||||
return list().stream().collect(Collectors.toMap(UserStatus::getId, QuestionType->QuestionType));
|
||||
}
|
||||
|
||||
public static String nameById(int id) {
|
||||
for (UserStatus type : list()) {
|
||||
if (type.getId() == id) return type.getName();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static Integer getIdByName(String name) {
|
||||
for (UserStatus type : list()) {
|
||||
if (type.getName().equals(name)) return type.getId();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static UserStatus getById(int id)
|
||||
{
|
||||
for (UserStatus na : list())
|
||||
{
|
||||
if (na.getId() == id)
|
||||
{
|
||||
return na;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.yunhai.bschclassmanage.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Getter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public enum UserType
|
||||
{
|
||||
//状态 0禁用 1 正常 2休学 3出国 4留学 5复学 6停学 7退学 8留级 9其他
|
||||
|
||||
SUPER_ADMINISTRATOR(1,"超级管理员"),
|
||||
REGULAR_USER(2,"普通用户");
|
||||
|
||||
private Integer id;
|
||||
private String name;
|
||||
}
|
||||
Reference in New Issue
Block a user