♻️ Refactoring code. 简化租户套餐维护功能,删除 sys_tenant_menu表

This commit is contained in:
lbw committed 2023-09-01 14:35:29 +08:00
1 parent 406d83e8be
commit e61920cbde
9 files changed
+230 -55

No files matched your search

@@ -69,6 +69,12 @@ public class SysFile extends Model<SysFile> {
@Schema(description = "文件类型")
private String type;
/**
* 文件组
*/
@Schema(description = "文件组")
private Long groupId;
/**
* 文件大小
*/
@@ -9,67 +9,52 @@ import lombok.EqualsAndHashCode;
import java.time.LocalDateTime;
/**
* 租户菜单
* 文件类型
*
* @author lengleng
* @date 2023/7/25
*/
@Data
@Schema(description = "租户菜单")
@Schema(description = "文件")
@EqualsAndHashCode(callSuper = true)
public class SysTenantMenu extends Model<SysTenantMenu> {
public class SysFileGroup extends Model<SysFile> {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "id")
@Schema(description = "主键ID")
private Long id;
/**
* 租户菜单名称
*/
@Schema(description = "租户菜单名称")
@Schema(description = "父级ID")
private Long pid;
@Schema(description = "分类类型: [10=图片,20=视频]")
private Long type;
@Schema(description = "分类名称")
private String name;
/**
* 菜单id集合
*/
@Schema(description = "菜单id集合")
private String menuIds;
/**
* 0正常 9-冻结
*/
@Schema(description = "租户菜单,9:冻结,0:正常")
private String status;
/**
* 创建人
* 上传人
*/
@TableField(fill = FieldFill.INSERT)
@Schema(description = "创建人")
@Schema(description = "创建者")
private String createBy;
/**
* 修改人
*/
@TableField(fill = FieldFill.UPDATE)
@Schema(description = "修改人")
private String updateBy;
/**
* 删除标记
*/
@TableLogic
@TableField(fill = FieldFill.INSERT)
@Schema(description = "删除标记,1:已删除,0:正常")
private String delFlag;
/**
* 创建时间
* 上传时间
*/
@TableField(fill = FieldFill.INSERT)
@Schema(description = "创建时间")
private LocalDateTime createTime;
/**
* 更新人
*/
@TableField(fill = FieldFill.INSERT)
@Schema(description = "更新者")
private String updateBy;
/**
* 更新时间
*/
@@ -77,4 +62,12 @@ public class SysTenantMenu extends Model<SysTenantMenu> {
@Schema(description = "更新时间")
private LocalDateTime updateTime;
/**
* 删除标识:1-删除,0-正常
*/
@TableLogic
@TableField(fill = FieldFill.INSERT)
@Schema(description = "删除标记,1:已删除,0:正常")
private String delFlag;
}
@@ -68,6 +68,41 @@ public class SysTenant extends Model<SysTenant> {
@ExcelProperty("租户域名")
private String tenantDomain;
/**
* 网站名称
*/
@Schema(description = "网站名称")
@ExcelProperty("网站名称")
private String websiteName;
/**
* logo
*/
@Schema(description = "logo")
@ExcelProperty("logo")
private String logo;
/**
* footer
*/
@Schema(description = "footer")
@ExcelProperty("footer")
private String footer;
/**
* 移动端二维码
*/
@Schema(description = "移动端二维码")
@ExcelProperty("移动端二维码")
private String miniQr;
/**
* 登录页图片
*/
@Schema(description = "登录页图片")
@ExcelProperty("登录页图片")
private String background;
/**
* 开始时间
*/
@@ -0,0 +1,53 @@
/*
*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*
*/
package com.pig4cloud.pigx.admin.api.feign;
import com.pig4cloud.pigx.admin.api.entity.SysDept;
import com.pig4cloud.pigx.common.core.constant.ServiceNameConstants;
import com.pig4cloud.pigx.common.core.util.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import java.util.List;
/**
* @author lengleng
* @date 2018/6/22
*/
@FeignClient(contextId = "remoteDeptService", value = ServiceNameConstants.UPMS_SERVICE)
public interface RemoteDeptService {
/**
* 获取所有部门接口
* @return R 返回结果对象,包含所有部门信息列表
*/
@GetMapping("/dept/list")
R<List<SysDept>> getAllDept();
/**
* 通过部门ID获取负责人列表
* @param deptId 部门ID
* @return 负责人ID列表
*/
@GetMapping("/dept/leader/{deptId}")
R<List<Long>> getAllDeptLeader(@PathVariable("deptId") Long deptId);
}
@@ -3,10 +3,14 @@ package com.pig4cloud.pigx.admin.api.feign;
import com.pig4cloud.pigx.common.core.constant.SecurityConstants;
import com.pig4cloud.pigx.common.core.constant.ServiceNameConstants;
import com.pig4cloud.pigx.common.core.util.R;
import com.pig4cloud.pigx.common.core.util.RetOps;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.Map;
/**
* @author lengleng
@@ -26,4 +30,14 @@ public interface RemoteParamService {
@GetMapping("/param/publicValue/{key}")
R<String> getByKey(@PathVariable("key") String key, @RequestHeader(SecurityConstants.FROM) String from);
/**
* 通过keys 查询参数配置
* @param keys keys
* @param from 声明成内部调用,避免MQ 等无法调用
* @return map
*/
@GetMapping("/param/publicValues")
R<Map<String, Object>> getByKeys(@RequestParam("keys") String[] keys,
@RequestHeader(SecurityConstants.FROM) String from);
}
@@ -0,0 +1,44 @@
/*
*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*
*/
package com.pig4cloud.pigx.admin.api.feign;
import com.pig4cloud.pigx.admin.api.entity.SysRole;
import com.pig4cloud.pigx.common.core.constant.ServiceNameConstants;
import com.pig4cloud.pigx.common.core.util.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import java.util.List;
/**
* @author lengleng
* @date 2018/6/22
*/
@FeignClient(contextId = "remoteRoleService", value = ServiceNameConstants.UPMS_SERVICE)
public interface RemoteRoleService {
/**
* 获取所有部门接口
* @return R 返回结果对象,包含所有部门信息列表
*/
@GetMapping("/role/list")
R<List<SysRole>> getAllRole();
}
@@ -25,10 +25,7 @@ import com.pig4cloud.pigx.common.core.constant.SecurityConstants;
import com.pig4cloud.pigx.common.core.constant.ServiceNameConstants;
import com.pig4cloud.pigx.common.core.util.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@@ -48,6 +45,14 @@ public interface RemoteUserService {
@GetMapping("/user/info/{username}")
R<UserInfo> info(@PathVariable("username") String username, @RequestHeader(SecurityConstants.FROM) String from);
/**
* 根据用户ID获取用户
* @param userId ID
* @return SysUser
*/
@GetMapping("/user/details/{userId}")
R<SysUser> getUserById(@PathVariable("userId") Long userId);
/**
* 通过社交账号或手机号查询用户、角色信息
* @param inStr appid@code
@@ -74,4 +79,28 @@ public interface RemoteUserService {
@PutMapping("/user/lock/{username}")
R<Boolean> lockUser(@PathVariable("username") String username, @RequestHeader(SecurityConstants.FROM) String from);
/**
* 根据角色ID查询用户列表
* @param roleIdList 角色ID列表
* @return 用户ID列表
*/
@GetMapping("/user/getUserIdListByRoleIdList")
R<List<Long>> getUserIdListByRoleIdList(@RequestParam("roleIdList") List<Long> roleIdList);
/**
* 根据部门ID列表获取用户ID列表接口
* @param deptIdList 部门ID列表
* @return 用户ID列表
*/
@GetMapping("/user/getUserIdListByDeptIdList")
R<List<SysUser>> getUserIdListByDeptIdList(@RequestParam("deptIdList") List<Long> deptIdList);
/**
* 通过用户名查询用户列表
* @param userName 用户名
* @return 用户列表
*/
@GetMapping("/user/getUserListByUserName")
R<List<SysUser>> getUserListByUserName(@RequestParam("username") String userName);
}
@@ -1,10 +0,0 @@
com.pig4cloud.pigx.common.feign.PigxFeignAutoConfiguration=\
com.pig4cloud.pigx.admin.api.feign.RemoteDataScopeService,\
com.pig4cloud.pigx.admin.api.feign.RemoteClientDetailsService,\
com.pig4cloud.pigx.admin.api.feign.RemoteLogService,\
com.pig4cloud.pigx.admin.api.feign.RemoteParamService,\
com.pig4cloud.pigx.admin.api.feign.RemoteTenantService,\
com.pig4cloud.pigx.admin.api.feign.RemoteTokenService,\
com.pig4cloud.pigx.admin.api.feign.RemoteUserService,\
com.pig4cloud.pigx.admin.api.feign.RemoteDictService,\
com.pig4cloud.pigx.admin.api.feign.RemoteAuditLogService
@@ -0,0 +1,11 @@
com.pig4cloud.pigx.admin.api.feign.RemoteDataScopeService
com.pig4cloud.pigx.admin.api.feign.RemoteClientDetailsService
com.pig4cloud.pigx.admin.api.feign.RemoteLogService
com.pig4cloud.pigx.admin.api.feign.RemoteParamService
com.pig4cloud.pigx.admin.api.feign.RemoteTenantService
com.pig4cloud.pigx.admin.api.feign.RemoteTokenService
com.pig4cloud.pigx.admin.api.feign.RemoteUserService
com.pig4cloud.pigx.admin.api.feign.RemoteRoleService
com.pig4cloud.pigx.admin.api.feign.RemoteDeptService
com.pig4cloud.pigx.admin.api.feign.RemoteDictService
com.pig4cloud.pigx.admin.api.feign.RemoteAuditLogService