This commit is contained in:
雷欧(林平凡)
2025-08-14 11:43:39 +08:00
parent 28bb9f29a2
commit 58cb1ef742
6 changed files with 162 additions and 2 deletions

View File

@@ -21,12 +21,26 @@ public class XbGroup
/** 启用状态0-禁用1-启用 */
private Integer isActive;
/** 类型1管理群2评论群3线报来源群4线报推送群 */
private Integer groupType;
public String getGroupTypeName() {
return groupTypeName;
}
public void setGroupTypeName(String groupTypeName) {
this.groupTypeName = groupTypeName;
}
private String groupTypeName;
/** 创建时间 */
private Date createDate;
/** 更新时间 */
private Date updateDate;
public Integer getId() {
return id;
}
@@ -59,6 +73,14 @@ public class XbGroup
this.isActive = isActive;
}
public Integer getGroupType() {
return groupType;
}
public void setGroupType(Integer groupType) {
this.groupType = groupType;
}
public Date getCreateDate() {
return createDate;
}
@@ -82,6 +104,7 @@ public class XbGroup
", name='" + name + '\'' +
", wxid='" + wxid + '\'' +
", isActive=" + isActive +
", groupType=" + groupType +
", createDate=" + createDate +
", updateDate=" + updateDate +
'}';

View File

@@ -0,0 +1,89 @@
package com.ruoyi.jarvis.enums;
/**
* @author Leo
* @version 1.0
* @create 2023/12/19 0019 上午 10:27
* @description
*/
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public enum GroupType implements IEnum {
/**
* 类型1管理群2评论群3线报来源群4线报推送群
* */
MANAGEMENT(1, "管理群"),
COMMENT(2, "评论群"),
LINE_REPORT_SOURCE(3, "线报来源群"),
LINE_REPORT_PUSH(4, "线报推送群");
private final int key;
private final String name;
GroupType(int key, String name) {
this.key = key;
this.name = name;
}
public static GroupType get(int key) {
for (GroupType e : GroupType.values()) {
if (e.getKey() == key) {
return e;
}
}
return null;
}
public static String getName(Integer key) {
//if (Object.isNotEmpty(key)) {
GroupType[] items = GroupType.values();
for (GroupType item : items) {
if (item.getKey() == key) {
return item.getName();
}
}
//}
return "";
}
public static Map<String, String> getKeyVlue() {
Map<String, String> map = new HashMap<>();
GroupType[] items = GroupType.values();
for (GroupType item : items) {
map.put(item.getKey() + "", item.getName());
}
return map;
}
public static List<Map<String, Object>> getSelectItems() {
List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
GroupType[] items = GroupType.values();
for (GroupType item : items) {
Map<String, Object> map = new HashMap<>();
map.put("label", item.getName());
map.put("value", item.getKey());
result.add(map);
}
return result;
}
@Override
@JsonValue
public Integer getKey() {
return key;
}
@Override
public String getName() {
return name;
}
}

View File

@@ -0,0 +1,14 @@
package com.ruoyi.jarvis.enums;
/**
* @author Leo
* @version 1.0
* @create 2023/12/19 0019 上午 10:33
* @description
*/
public interface IEnum {
Integer getKey();
String getName();
}

View File

@@ -0,0 +1,14 @@
package com.ruoyi.jarvis.enums;
/**
* @author Leo
* @version 1.0
* @create 2023/12/19 0019 上午 10:33
* @description
*/
public interface IEnumForString {
String getKey();
String getName();
}