chore: top.charles7c.continew => top.continew

1.groupId 及基础包名调整,更短的包名,优化品牌形象
2.全局代码格式化
This commit is contained in:
2024-04-22 20:29:17 +08:00
parent da3a4e0756
commit 08eeabc47d
238 changed files with 1121 additions and 1154 deletions

View File

@@ -0,0 +1,111 @@
/*
* Copyright (c) 2022-present Charles7c Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package top.continew.admin.common.model.dto;
import cn.hutool.core.collection.CollUtil;
import lombok.Data;
import top.continew.admin.common.constant.SysConstants;
import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Set;
/**
* 登录用户信息
*
* @author Charles7c
* @since 2022/12/24 13:01
*/
@Data
public class LoginUser implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* ID
*/
private Long id;
/**
* 用户名
*/
private String username;
/**
* 部门 ID
*/
private Long deptId;
/**
* 权限码集合
*/
private Set<String> permissions;
/**
* 角色编码集合
*/
private Set<String> roleCodes;
/**
* 角色集合
*/
private Set<RoleDTO> roles;
/**
* 令牌
*/
private String token;
/**
* IP
*/
private String ip;
/**
* IP 归属地
*/
private String address;
/**
* 浏览器
*/
private String browser;
/**
* 操作系统
*/
private String os;
/**
* 登录时间
*/
private LocalDateTime loginTime;
/**
* 是否为管理员
*
* @return truefalse
*/
public boolean isAdmin() {
if (CollUtil.isEmpty(roleCodes)) {
return false;
}
return roleCodes.contains(SysConstants.ADMIN_ROLE_CODE);
}
}

View File

@@ -0,0 +1,51 @@
/*
* Copyright (c) 2022-present Charles7c Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package top.continew.admin.common.model.dto;
import lombok.Data;
import top.continew.admin.common.enums.DataScopeEnum;
import java.io.Serial;
import java.io.Serializable;
/**
* 角色信息
*
* @author Charles7c
* @since 2023/3/7 22:08
*/
@Data
public class RoleDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* ID
*/
private Long id;
/**
* 角色编码
*/
private String code;
/**
* 数据权限
*/
private DataScopeEnum dataScope;
}

View File

@@ -0,0 +1,51 @@
/*
* Copyright (c) 2022-present Charles7c Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package top.continew.admin.common.model.resp;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 验证码信息
*
* @author Charles7c
* @since 2022/12/11 13:55
*/
@Data
@Builder
@Schema(description = "验证码信息")
public class CaptchaResp implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 验证码标识
*/
@Schema(description = "验证码标识", example = "090b9a2c-1691-4fca-99db-e4ed0cff362f")
private String uuid;
/**
* 验证码图片Base64编码带图片格式data:image/gif;base64
*/
@Schema(description = "验证码图片Base64编码带图片格式data:image/gif;base64", example = "data:image/png;base64,iVBORw0KGgoAAAAN...")
private String img;
}

View File

@@ -0,0 +1,71 @@
/*
* Copyright (c) 2022-present Charles7c Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package top.continew.admin.common.model.resp;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serial;
import java.io.Serializable;
/**
* 键值对信息
*
* @param <T>
* @author Charles7c
* @since 2023/2/24 22:02
*/
@Data
@NoArgsConstructor
@Schema(description = "键值对信息")
public class LabelValueResp<T> implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 标签
*/
@Schema(description = "标签", example = "")
private String label;
/**
* 值
*/
@Schema(description = "", example = "1")
private T value;
/**
* 颜色
*/
@Schema(description = "颜色", example = "#165DFF")
@JsonInclude(JsonInclude.Include.NON_NULL)
private String color;
public LabelValueResp(String label, T value) {
this.label = label;
this.value = value;
}
public LabelValueResp(String label, T value, String color) {
this.label = label;
this.value = value;
this.color = color;
}
}