新增账号管理,用户添加telegram相关字段
This commit is contained in:
parent
f1de3f4417
commit
8fd6011905
1
pom.xml
1
pom.xml
@ -26,6 +26,7 @@
|
|||||||
<module>zayac-admin-system</module>
|
<module>zayac-admin-system</module>
|
||||||
<module>zayac-admin-generator</module>
|
<module>zayac-admin-generator</module>
|
||||||
<module>zayac-admin-common</module>
|
<module>zayac-admin-common</module>
|
||||||
|
<module>zayac-admin-account</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
31
zayac-admin-account/pom.xml
Normal file
31
zayac-admin-account/pom.xml
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.zayac</groupId>
|
||||||
|
<artifactId>zayac-admin</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>zayac-admin-account</artifactId>
|
||||||
|
<description>后台账号相关组件</description>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<!--引入webflux使用spring自带的Webclient请求第三方数据-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-webflux</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-amqp</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.zayac</groupId>
|
||||||
|
<artifactId>zayac-admin-system</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
@ -0,0 +1,33 @@
|
|||||||
|
package com.zayac.admin.system.enums;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import top.continew.starter.data.mybatis.plus.base.IBaseEnum;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public enum AccountTypeEnum implements IBaseEnum<Integer> {
|
||||||
|
/**
|
||||||
|
* 开云
|
||||||
|
*/
|
||||||
|
KY(0, "开云"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 华体会
|
||||||
|
*/
|
||||||
|
HTH(1, "华体会"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 九游
|
||||||
|
*/
|
||||||
|
JY(2, "九游"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 爱体育
|
||||||
|
*/
|
||||||
|
ATY(3, "爱体育"),
|
||||||
|
;
|
||||||
|
|
||||||
|
private final Integer value;
|
||||||
|
private final String description;
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
package com.zayac.admin.system.mapper;
|
||||||
|
|
||||||
|
import com.zayac.admin.system.model.entity.AccountDO;
|
||||||
|
import top.continew.starter.data.mybatis.plus.base.BaseMapper;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 账号 Mapper
|
||||||
|
*
|
||||||
|
* @author zayac
|
||||||
|
* @since 2024/05/10 20:44
|
||||||
|
*/
|
||||||
|
public interface AccountMapper extends BaseMapper<AccountDO> {}
|
@ -0,0 +1,65 @@
|
|||||||
|
package com.zayac.admin.system.model.entity;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
import com.zayac.admin.common.enums.DisEnableStatusEnum;
|
||||||
|
import com.zayac.admin.system.enums.AccountTypeEnum;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
|
||||||
|
import top.continew.starter.extension.crud.model.entity.BaseDO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 账号实体
|
||||||
|
*
|
||||||
|
* @author zayac
|
||||||
|
* @since 2024/05/10 20:44
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("sys_account")
|
||||||
|
public class AccountDO extends BaseDO {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 账号昵称
|
||||||
|
*/
|
||||||
|
private String nickname;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 账号
|
||||||
|
*/
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 密码
|
||||||
|
*/
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 账号类型(0:开云,1:华体会,2:九游,3:爱游戏)
|
||||||
|
*/
|
||||||
|
private AccountTypeEnum type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* headers
|
||||||
|
*/
|
||||||
|
private String headers;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态(1:启用;2:禁用)
|
||||||
|
*/
|
||||||
|
private DisEnableStatusEnum status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对应平台的url
|
||||||
|
*/
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户ID
|
||||||
|
*/
|
||||||
|
private Long userId;
|
||||||
|
}
|
@ -102,4 +102,32 @@ public class UserDO extends BaseDO {
|
|||||||
* 部门 ID
|
* 部门 ID
|
||||||
*/
|
*/
|
||||||
private Long deptId;
|
private Long deptId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否需要消息通知
|
||||||
|
*/
|
||||||
|
private DisEnableStatusEnum needNotify;
|
||||||
|
/**
|
||||||
|
* telegram机器人token
|
||||||
|
*/
|
||||||
|
private String botToken;
|
||||||
|
/**
|
||||||
|
* telegram_ids 以逗号分割,判断是否有权限使用机器人
|
||||||
|
*/
|
||||||
|
private String telegramIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 注册新增的目标群组id
|
||||||
|
*/
|
||||||
|
private Long groupId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 定时报数的目标群组id
|
||||||
|
*/
|
||||||
|
private Long countGroupId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息发送的个人id
|
||||||
|
*/
|
||||||
|
private Long chatId;
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,54 @@
|
|||||||
|
package com.zayac.admin.system.model.query;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
|
||||||
|
import top.continew.starter.data.core.annotation.Query;
|
||||||
|
import top.continew.starter.data.core.enums.QueryType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 账号查询条件
|
||||||
|
*
|
||||||
|
* @author zayac
|
||||||
|
* @since 2024/05/10 20:44
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Schema(description = "账号查询条件")
|
||||||
|
public class AccountQuery implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 账号昵称
|
||||||
|
*/
|
||||||
|
@Schema(description = "账号昵称")
|
||||||
|
@Query(type = QueryType.EQ)
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 账号
|
||||||
|
*/
|
||||||
|
@Schema(description = "账号")
|
||||||
|
@Query(type = QueryType.EQ)
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 账号类型(0:开云,1:华体会,2:九游,3:爱游戏)
|
||||||
|
*/
|
||||||
|
@Schema(description = "账号类型(0:开云,1:华体会,2:九游,3:爱游戏)")
|
||||||
|
@Query(type = QueryType.EQ)
|
||||||
|
private Boolean type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态(1:启用;2:禁用)
|
||||||
|
*/
|
||||||
|
@Schema(description = "状态(1:启用;2:禁用)")
|
||||||
|
@Query(type = QueryType.EQ)
|
||||||
|
private Integer status;
|
||||||
|
}
|
@ -0,0 +1,64 @@
|
|||||||
|
package com.zayac.admin.system.model.req;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
|
||||||
|
import org.hibernate.validator.constraints.Length;
|
||||||
|
|
||||||
|
import top.continew.starter.extension.crud.model.req.BaseReq;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建或修改账号信息
|
||||||
|
*
|
||||||
|
* @author zayac
|
||||||
|
* @since 2024/05/10 20:44
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Schema(description = "创建或修改账号信息")
|
||||||
|
public class AccountReq extends BaseReq {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 账号昵称
|
||||||
|
*/
|
||||||
|
@Schema(description = "账号昵称")
|
||||||
|
@Length(max = 60, message = "账号昵称长度不能超过 {max} 个字符")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 账号
|
||||||
|
*/
|
||||||
|
@Schema(description = "账号")
|
||||||
|
@NotBlank(message = "账号不能为空")
|
||||||
|
@Length(max = 20, message = "账号长度不能超过 {max} 个字符")
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 账号类型(0:开云,1:华体会,2:九游,3:爱游戏)
|
||||||
|
*/
|
||||||
|
@Schema(description = "账号类型(0:开云,1:华体会,2:九游,3:爱游戏)")
|
||||||
|
@NotNull(message = "账号类型(0:开云,1:华体会,2:九游,3:爱游戏)不能为空")
|
||||||
|
private Boolean type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态(1:启用;2:禁用)
|
||||||
|
*/
|
||||||
|
@Schema(description = "状态(1:启用;2:禁用)")
|
||||||
|
@NotNull(message = "状态(1:启用;2:禁用)不能为空")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对应平台的url
|
||||||
|
*/
|
||||||
|
@Schema(description = "对应平台的url")
|
||||||
|
@Length(max = 100, message = "对应平台的url长度不能超过 {max} 个字符")
|
||||||
|
private String url;
|
||||||
|
}
|
@ -77,6 +77,45 @@ public class UserReq extends BaseReq {
|
|||||||
@Length(max = 255, message = "邮箱长度不能超过 {max} 个字符")
|
@Length(max = 255, message = "邮箱长度不能超过 {max} 个字符")
|
||||||
private String email;
|
private String email;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* botToken
|
||||||
|
*/
|
||||||
|
@Schema(description = "机器人token", example = "1234567890:AAGzq1Tgtr_ZejU7bv0mab14xOwi0_64d0w")
|
||||||
|
@Length(max = 64, message = "botToken不能超过 {max} 个字符")
|
||||||
|
private String botToken;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 注册新增通知群组ID
|
||||||
|
*/
|
||||||
|
@Schema(description = "注册新增通知群组ID", example = "-1234522455730")
|
||||||
|
private Long groupId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报数群组ID
|
||||||
|
*/
|
||||||
|
@Schema(description = "报数群组ID", example = "-1234522455730")
|
||||||
|
private Long countGroupId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 私聊消息ID
|
||||||
|
*/
|
||||||
|
@Schema(description = "邮箱", example = "123456789")
|
||||||
|
private Long chatId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户telegram
|
||||||
|
*/
|
||||||
|
@Schema(description = "telegram", example = "6054562838")
|
||||||
|
private List<Long> telegramIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否启用消息通知
|
||||||
|
*/
|
||||||
|
@Schema(description = "消息通知状态(1:启用;2:禁用)", type = "Integer", allowableValues = {"1", "2"}, example = "1")
|
||||||
|
@NotNull(message = "消息通知非法")
|
||||||
|
private DisEnableStatusEnum needNotify;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 手机号码
|
* 手机号码
|
||||||
*/
|
*/
|
||||||
|
@ -0,0 +1,83 @@
|
|||||||
|
package com.zayac.admin.system.model.resp;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
|
||||||
|
import top.continew.starter.extension.crud.model.resp.BaseDetailResp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 账号详情信息
|
||||||
|
*
|
||||||
|
* @author zayac
|
||||||
|
* @since 2024/05/10 20:44
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
@Schema(description = "账号详情信息")
|
||||||
|
public class AccountDetailResp extends BaseDetailResp {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 账号昵称
|
||||||
|
*/
|
||||||
|
@Schema(description = "账号昵称")
|
||||||
|
@ExcelProperty(value = "账号昵称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 账号
|
||||||
|
*/
|
||||||
|
@Schema(description = "账号")
|
||||||
|
@ExcelProperty(value = "账号")
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 密码
|
||||||
|
*/
|
||||||
|
@Schema(description = "密码")
|
||||||
|
@ExcelProperty(value = "密码")
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 账号类型(0:开云,1:华体会,2:九游,3:爱游戏)
|
||||||
|
*/
|
||||||
|
@Schema(description = "账号类型(0:开云,1:华体会,2:九游,3:爱游戏)")
|
||||||
|
@ExcelProperty(value = "账号类型(0:开云,1:华体会,2:九游,3:爱游戏)")
|
||||||
|
private Boolean type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* headers
|
||||||
|
*/
|
||||||
|
@Schema(description = "headers")
|
||||||
|
@ExcelProperty(value = "headers")
|
||||||
|
private String headers;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态(1:启用;2:禁用)
|
||||||
|
*/
|
||||||
|
@Schema(description = "状态(1:启用;2:禁用)")
|
||||||
|
@ExcelProperty(value = "状态(1:启用;2:禁用)")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对应平台的url
|
||||||
|
*/
|
||||||
|
@Schema(description = "对应平台的url")
|
||||||
|
@ExcelProperty(value = "对应平台的url")
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户ID
|
||||||
|
*/
|
||||||
|
@Schema(description = "用户ID")
|
||||||
|
@ExcelProperty(value = "用户ID")
|
||||||
|
private Long userId;
|
||||||
|
}
|
@ -0,0 +1,69 @@
|
|||||||
|
package com.zayac.admin.system.model.resp;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import com.zayac.admin.common.enums.DisEnableStatusEnum;
|
||||||
|
import com.zayac.admin.system.enums.AccountTypeEnum;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
|
||||||
|
import top.continew.starter.extension.crud.model.resp.BaseResp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 账号信息
|
||||||
|
*
|
||||||
|
* @author zayac
|
||||||
|
* @since 2024/05/10 20:44
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Schema(description = "账号信息")
|
||||||
|
public class AccountResp extends BaseResp {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 账号昵称
|
||||||
|
*/
|
||||||
|
@Schema(description = "账号昵称", example = "ky1线")
|
||||||
|
private String nickname;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 账号
|
||||||
|
*/
|
||||||
|
@Schema(description = "账号", example = "ky3tg107001")
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 平台(0:开云,1:华体会,2:九游,3:爱游戏)
|
||||||
|
*/
|
||||||
|
@Schema(description = "平台(0:开云,1:华体会,2:九游,3:爱游戏)", type = "Integer", allowableValues = {"0", "1", "2", "3", "4"}, example = "1")
|
||||||
|
private AccountTypeEnum type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* headers
|
||||||
|
*/
|
||||||
|
@Schema(description = "headers",type = "JSON")
|
||||||
|
private String headers;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态(1:启用;2:禁用)
|
||||||
|
*/
|
||||||
|
@Schema(description = "状态(1:启用;2:禁用)")
|
||||||
|
private DisEnableStatusEnum status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对应平台的url
|
||||||
|
*/
|
||||||
|
@Schema(description = "平台地址")
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户ID
|
||||||
|
*/
|
||||||
|
@Schema(description = "用户ID")
|
||||||
|
private Long userId;
|
||||||
|
}
|
@ -148,6 +148,43 @@ public class UserDetailResp extends BaseDetailResp {
|
|||||||
@ExcelProperty(value = "角色")
|
@ExcelProperty(value = "角色")
|
||||||
private String roleNames;
|
private String roleNames;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* telegram的bot_token
|
||||||
|
*/
|
||||||
|
@Schema(description = "telegram bot_token", example = "bot:xxxx")
|
||||||
|
private String botToken;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 注册新增消息通知群组id
|
||||||
|
*/
|
||||||
|
@Schema(description = "注册消息通知群组", example = "bot:xxxx")
|
||||||
|
private Long groupId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报数消息通知群组id
|
||||||
|
*/
|
||||||
|
@Schema(description = "报数消息通知群组", example = "bot:xxxx")
|
||||||
|
private Long countGroupId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 聊天消息id
|
||||||
|
*/
|
||||||
|
@Schema(description = "聊天消息", example = "bot:xxxx")
|
||||||
|
private Long chatId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* telegram ID 列表
|
||||||
|
*/
|
||||||
|
@Schema(description = "telegram ID 列表", example = "6054562838")
|
||||||
|
private List<Long> telegramIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否需要消息通知
|
||||||
|
*/
|
||||||
|
@Schema(description = "状态(1:启用;2:禁用)", type = "Integer", allowableValues = {"1", "2"}, example = "1")
|
||||||
|
private DisEnableStatusEnum needNotify;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean getDisabled() {
|
public Boolean getDisabled() {
|
||||||
return this.getIsSystem() || Objects.equals(this.getId(), LoginHelper.getUserId());
|
return this.getIsSystem() || Objects.equals(this.getId(), LoginHelper.getUserId());
|
||||||
|
@ -30,6 +30,7 @@ import top.continew.starter.security.mask.annotation.JsonMask;
|
|||||||
import top.continew.starter.security.mask.enums.MaskType;
|
import top.continew.starter.security.mask.enums.MaskType;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -114,6 +115,43 @@ public class UserResp extends BaseDetailResp {
|
|||||||
@Schema(description = "所属部门", example = "测试部")
|
@Schema(description = "所属部门", example = "测试部")
|
||||||
private String deptName;
|
private String deptName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* telegram的bot_token
|
||||||
|
*/
|
||||||
|
@Schema(description = "telegram bot_token", example = "bot:xxxx")
|
||||||
|
private String botToken;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 注册新增消息通知群组
|
||||||
|
*/
|
||||||
|
@Schema(description = "注册消息通知群组", example = "bot:xxxx")
|
||||||
|
private String groupId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报数消息通知群组id
|
||||||
|
*/
|
||||||
|
@Schema(description = "报数消息通知群组", example = "bot:xxxx")
|
||||||
|
private String countGroupId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 聊天消息id
|
||||||
|
*/
|
||||||
|
@Schema(description = "聊天消息", example = "bot:xxxx")
|
||||||
|
private String chatId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户telegram
|
||||||
|
*/
|
||||||
|
@Schema(description = "telegram", example = "6054562838")
|
||||||
|
private List<Long> telegramIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否需要发送消息通知
|
||||||
|
*/
|
||||||
|
@Schema(description = "状态(1:启用;2:禁用)", type = "Integer", allowableValues = {"1", "2"}, example = "1")
|
||||||
|
private DisEnableStatusEnum needNotify;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean getDisabled() {
|
public Boolean getDisabled() {
|
||||||
return this.getIsSystem() || Objects.equals(this.getId(), LoginHelper.getUserId());
|
return this.getIsSystem() || Objects.equals(this.getId(), LoginHelper.getUserId());
|
||||||
|
@ -0,0 +1,16 @@
|
|||||||
|
package com.zayac.admin.system.service;
|
||||||
|
|
||||||
|
import com.zayac.admin.system.model.query.AccountQuery;
|
||||||
|
import com.zayac.admin.system.model.req.AccountReq;
|
||||||
|
import com.zayac.admin.system.model.resp.AccountDetailResp;
|
||||||
|
import com.zayac.admin.system.model.resp.AccountResp;
|
||||||
|
import top.continew.starter.extension.crud.service.BaseService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 账号业务接口
|
||||||
|
*
|
||||||
|
* @author zayac
|
||||||
|
* @since 2024/05/10 20:44
|
||||||
|
*/
|
||||||
|
public interface AccountService extends BaseService<AccountResp, AccountDetailResp, AccountQuery, AccountReq> {}
|
@ -0,0 +1,25 @@
|
|||||||
|
package com.zayac.admin.system.service.impl;
|
||||||
|
|
||||||
|
import com.zayac.admin.system.mapper.AccountMapper;
|
||||||
|
import com.zayac.admin.system.model.entity.AccountDO;
|
||||||
|
import com.zayac.admin.system.model.query.AccountQuery;
|
||||||
|
import com.zayac.admin.system.model.req.AccountReq;
|
||||||
|
import com.zayac.admin.system.model.resp.AccountDetailResp;
|
||||||
|
import com.zayac.admin.system.model.resp.AccountResp;
|
||||||
|
import com.zayac.admin.system.service.AccountService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import top.continew.starter.extension.crud.service.impl.BaseServiceImpl;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 账号业务实现
|
||||||
|
*
|
||||||
|
* @author zayac
|
||||||
|
* @since 2024/05/10 20:44
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class AccountServiceImpl extends BaseServiceImpl<AccountMapper, AccountDO, AccountResp, AccountDetailResp, AccountQuery, AccountReq> implements AccountService {}
|
@ -0,0 +1,27 @@
|
|||||||
|
package com.zayac.admin.webapi.system;
|
||||||
|
|
||||||
|
import com.zayac.admin.system.model.query.AccountQuery;
|
||||||
|
import com.zayac.admin.system.model.req.AccountReq;
|
||||||
|
import com.zayac.admin.system.model.resp.AccountDetailResp;
|
||||||
|
import com.zayac.admin.system.model.resp.AccountResp;
|
||||||
|
import com.zayac.admin.system.service.AccountService;
|
||||||
|
import top.continew.starter.extension.crud.enums.Api;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import top.continew.starter.extension.crud.annotation.CrudRequestMapping;
|
||||||
|
import top.continew.starter.extension.crud.controller.BaseController;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 账号管理 API
|
||||||
|
*
|
||||||
|
* @author zayac
|
||||||
|
* @since 2024/05/10 20:44
|
||||||
|
*/
|
||||||
|
@Tag(name = "账号管理 API")
|
||||||
|
@RestController
|
||||||
|
@CrudRequestMapping(value = "/system/account", api = {Api.PAGE, Api.GET, Api.ADD, Api.UPDATE, Api.DELETE, Api.EXPORT})
|
||||||
|
public class AccountController extends BaseController<AccountService, AccountResp, AccountDetailResp, AccountQuery, AccountReq> {}
|
@ -1,9 +1,9 @@
|
|||||||
--- ### 项目配置
|
--- ### 项目配置
|
||||||
project:
|
project:
|
||||||
# 名称
|
# 名称
|
||||||
name: ContiNew Admin
|
name: Zayac Admin
|
||||||
# 应用名称
|
# 应用名称
|
||||||
app-name: continew-admin
|
app-name: zayac-admin
|
||||||
# 版本
|
# 版本
|
||||||
version: 3.1.0-SNAPSHOT
|
version: 3.1.0-SNAPSHOT
|
||||||
# 描述
|
# 描述
|
||||||
@ -12,8 +12,8 @@ project:
|
|||||||
base-package: com.zayac
|
base-package: com.zayac
|
||||||
## 作者信息配置
|
## 作者信息配置
|
||||||
contact:
|
contact:
|
||||||
name: Charles7c
|
name: zayac
|
||||||
email: charles7c@126.com
|
email: stupidzayac@gmail.com
|
||||||
url: https://blog.charles7c.top/about/me
|
url: https://blog.charles7c.top/about/me
|
||||||
## 许可协议信息配置
|
## 许可协议信息配置
|
||||||
license:
|
license:
|
||||||
|
@ -82,6 +82,12 @@ CREATE TABLE IF NOT EXISTS `sys_user` (
|
|||||||
`is_system` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否为系统内置数据',
|
`is_system` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否为系统内置数据',
|
||||||
`pwd_reset_time` datetime DEFAULT NULL COMMENT '最后一次修改密码时间',
|
`pwd_reset_time` datetime DEFAULT NULL COMMENT '最后一次修改密码时间',
|
||||||
`dept_id` bigint(20) NOT NULL COMMENT '部门ID',
|
`dept_id` bigint(20) NOT NULL COMMENT '部门ID',
|
||||||
|
`need_notify` tinyint(1) UNSIGNED NOT NULL DEFAULT 2 COMMENT '是否启用消息通知(1:启用;2:禁用)',
|
||||||
|
`bot_token` varchar(100) DEFAULT NULL COMMENT 'telegram机器人token',
|
||||||
|
`telegram_ids` varchar(255) DEFAULT NULL COMMENT '以逗号分割',
|
||||||
|
`group_id` varchar(100) DEFAULT NULL COMMENT '注册新增的目标群组id',
|
||||||
|
`count_group_id` varchar(100) DEFAULT NULL COMMENT '定时报数的目标群组id',
|
||||||
|
`chat_id` varchar(100) DEFAULT NULL COMMENT '消息发送的个人id',
|
||||||
`create_user` bigint(20) DEFAULT NULL COMMENT '创建人',
|
`create_user` bigint(20) DEFAULT NULL COMMENT '创建人',
|
||||||
`create_time` datetime NOT NULL COMMENT '创建时间',
|
`create_time` datetime NOT NULL COMMENT '创建时间',
|
||||||
`update_user` bigint(20) DEFAULT NULL COMMENT '修改人',
|
`update_user` bigint(20) DEFAULT NULL COMMENT '修改人',
|
||||||
|
Loading…
Reference in New Issue
Block a user