refactor:数据接口修改

V0.5.x
xiwa 2023-05-17 08:21:58 +08:00 committed by jiangang.song
parent 80f261dc9e
commit edc219291e
26 changed files with 293 additions and 53 deletions

View File

@ -39,6 +39,11 @@ public interface ICommonData<T extends Id<ID>, ID> {
*/
void deleteById(ID id);
/**
* id
*/
void deleteByIds(ID[] ids);
/**
*
*/

View File

@ -1,8 +1,28 @@
package cc.iotkit.data.system;
import cc.iotkit.data.manager.ICommonData;
import cc.iotkit.model.Paging;
import cc.iotkit.model.system.SysConfig;
/**
*
*
* @author sjg
*/
public interface ISysConfigData {
public interface ISysConfigData extends ICommonData<SysConfig, Long> {
/**
*
*/
Paging<SysConfig> findByConditions(String configKey, String configName,
int page, int size);
/**
*
*
* @param configKey
* @return
*/
SysConfig findByConfigKey(String configKey);
}

View File

@ -1,10 +1,39 @@
package cc.iotkit.data.system;
import cc.iotkit.data.manager.ICommonData;
import cc.iotkit.model.Paging;
import cc.iotkit.model.system.SysDept;
import java.util.List;
/**
*
*
* @author sjg
*/
public interface ISysDeptData {
public interface ISysDeptData extends ICommonData<SysDept, Long> {
/**
*
*/
Paging<SysDept> findByConditions(Long parentId, String deptName,
String status, int page, int size);
/**
* ID
*
* @param roleId ID
* @return
*/
List<SysDept> findByRoleId(Long roleId);
/**
* ID
*
* @param parentId ID
* @return
*/
long countByParentId(Long parentId);
}

View File

@ -1,9 +1,40 @@
package cc.iotkit.data.system;
import cc.iotkit.data.manager.ICommonData;
import cc.iotkit.model.Paging;
import cc.iotkit.model.system.SysDictData;
import cc.iotkit.model.system.SysDictType;
import java.util.List;
/**
*
*
* @author sjg
*/
public interface ISysDictData {
public interface ISysDictData extends ICommonData<SysDictData, Long> {
/**
*
*/
Paging<SysDictData> findByConditions(String dictType, String dictValue,
String status, int page, int size);
/**
*
*
* @param dictType
* @param dictValue
* @return
*/
SysDictData findByDictTypeAndDictValue(String dictType, String dictValue);
/**
*
*
* @param dictType
* @return
*/
List<SysDictType> findByDicType(String dictType);
}

View File

@ -1,9 +1,31 @@
package cc.iotkit.data.system;
import cc.iotkit.data.manager.ICommonData;
import cc.iotkit.model.Paging;
import cc.iotkit.model.system.SysDictData;
import cc.iotkit.model.system.SysDictType;
import java.util.List;
/**
*
*
* @author sjg
*/
public interface ISysDictTypeData {
public interface ISysDictTypeData extends ICommonData<SysDictType, Long> {
/**
*
*/
Paging<SysDictType> findByConditions(String dictName, String dictType,
String status, int page, int size);
/**
*
*
* @param dictType
* @return
*/
SysDictType findByDicType(String dictType);
}

View File

@ -1,9 +1,27 @@
package cc.iotkit.data.system;
import cc.iotkit.data.manager.ICommonData;
import cc.iotkit.model.Paging;
import cc.iotkit.model.system.SysLogininfor;
/**
*
*
* @author sjg
*/
public interface ISysLogininforData {
public interface ISysLogininforData extends ICommonData<SysLogininfor, Long> {
/**
*
*/
Paging<SysLogininfor> findByConditions(String tenantId, String userName,
String status, int page, int size);
/**
*
*
* @param tenantId id
*/
void deleteByTenantId(String tenantId);
}

View File

@ -1,9 +1,23 @@
package cc.iotkit.data.system;
import cc.iotkit.data.manager.ICommonData;
import cc.iotkit.model.system.SysMenu;
import java.util.List;
/**
*
*
* @author sjg
*/
public interface ISysMenuData {
public interface ISysMenuData extends ICommonData<SysMenu, Long> {
/**
*
*
* @param userId ID
* @return
*/
List<SysMenu> findByUserId(Long userId);
}

View File

@ -1,9 +1,20 @@
package cc.iotkit.data.system;
import cc.iotkit.data.manager.ICommonData;
import cc.iotkit.model.Paging;
import cc.iotkit.model.system.SysNotice;
/**
*
*
* @author sjg
*/
public interface ISysNoticeData {
public interface ISysNoticeData extends ICommonData<SysNotice, Long> {
/**
*
*/
Paging<SysNotice> findByConditions(String noticeTitle, String noticeType,
String status, int page, int size);
}

View File

@ -1,9 +1,26 @@
package cc.iotkit.data.system;
import cc.iotkit.data.manager.ICommonData;
import cc.iotkit.model.Paging;
import cc.iotkit.model.system.SysOperLog;
/**
*
*
* @author sjg
*/
public interface ISysOperLogData {
public interface ISysOperLogData extends ICommonData<SysOperLog, Long> {
/**
*
*/
Paging<SysOperLog> findByConditions(String tenantId, String title, Integer businessType,
Integer status, int page, int size);
/**
*
*
* @param tenantId id
*/
void deleteByTenantId(String tenantId);
}

View File

@ -0,0 +1,43 @@
package cc.iotkit.model;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* Entity
*
* @author Lion Li
*/
@Data
public class BaseEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private Long createDept;
/**
*
*/
private Long createBy;
/**
*
*/
private Date createTime;
/**
*
*/
private Long updateBy;
/**
*
*/
private Date updateTime;
}

View File

@ -0,0 +1,20 @@
package cc.iotkit.model;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
*
*
* @author Michelle.Chung
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class TenantEntity extends BaseEntity {
/**
*
*/
private String tenantId;
}

View File

@ -1,7 +1,9 @@
package cc.iotkit.model.system;
import cc.iotkit.model.Id;
import cc.iotkit.model.TenantEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@ -12,8 +14,9 @@ import java.util.Date;
*
* @author Michelle.Chung
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class SysConfig implements Id<Long>, Serializable {
public class SysConfig extends TenantEntity implements Id<Long>, Serializable {
private static final long serialVersionUID = 1L;
/**

View File

@ -1,7 +1,9 @@
package cc.iotkit.model.system;
import cc.iotkit.model.Id;
import cc.iotkit.model.TenantEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@ -11,8 +13,9 @@ import java.util.Date;
*
* @author Michelle.Chung
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class SysDept implements Id<Long>, Serializable {
public class SysDept extends TenantEntity implements Id<Long>, Serializable {
private static final long serialVersionUID = 1L;
/**

View File

@ -1,7 +1,10 @@
package cc.iotkit.model.system;
import cc.iotkit.model.Id;
import cc.iotkit.model.TenantEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@ -11,8 +14,9 @@ import java.util.Date;
*
* @author Michelle.Chung
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class SysDictData implements Id<Long>,Serializable {
public class SysDictData extends TenantEntity implements Id<Long>,Serializable {
private static final long serialVersionUID = 1L;
/**

View File

@ -1,7 +1,10 @@
package cc.iotkit.model.system;
import cc.iotkit.model.Id;
import cc.iotkit.model.TenantEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@ -11,8 +14,9 @@ import java.util.Date;
*
* @author Michelle.Chung
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class SysDictType implements Id<Long>,Serializable {
public class SysDictType extends TenantEntity implements Id<Long>,Serializable {
private static final long serialVersionUID = 1L;
/**

View File

@ -14,7 +14,6 @@ import java.util.Date;
* @date 2023-02-07
*/
@Data
@AutoMapper(target = SysLogininfor.class)
public class SysLogininfor implements Id<Long>,Serializable {
private static final long serialVersionUID = 1L;

View File

@ -1,7 +1,9 @@
package cc.iotkit.model.system;
import cc.iotkit.model.BaseEntity;
import cc.iotkit.model.Id;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.ArrayList;
@ -14,8 +16,9 @@ import java.util.List;
*
* @author Michelle.Chung
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class SysMenu implements Id<Long>,Serializable {
public class SysMenu extends BaseEntity implements Id<Long>,Serializable {
private static final long serialVersionUID = 1L;
/**

View File

@ -1,7 +1,10 @@
package cc.iotkit.model.system;
import cc.iotkit.model.Id;
import cc.iotkit.model.TenantEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@ -11,8 +14,9 @@ import java.util.Date;
*
* @author Michelle.Chung
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class SysNotice implements Id<Long>,Serializable {
public class SysNotice extends TenantEntity implements Id<Long>, Serializable {
private static final long serialVersionUID = 1L;
/**

View File

@ -1,7 +1,9 @@
package cc.iotkit.model.system;
import cc.iotkit.model.Id;
import cc.iotkit.model.TenantEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@ -11,8 +13,9 @@ import java.util.Date;
*
* @author Lion Li
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class SysOss implements Id<Long>,Serializable {
public class SysOss extends TenantEntity implements Id<Long>,Serializable {
private static final long serialVersionUID = 1L;
/**

View File

@ -1,7 +1,9 @@
package cc.iotkit.model.system;
import cc.iotkit.model.Id;
import cc.iotkit.model.TenantEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
@ -13,8 +15,9 @@ import java.io.Serializable;
* @author
* @date 2021-08-13
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class SysOssConfig implements Id<Long>,Serializable {
public class SysOssConfig extends TenantEntity implements Id<Long>, Serializable {
private static final long serialVersionUID = 1L;
/**

View File

@ -1,7 +1,9 @@
package cc.iotkit.model.system;
import cc.iotkit.model.Id;
import cc.iotkit.model.TenantEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@ -12,8 +14,9 @@ import java.util.Date;
*
* @author Michelle.Chung
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class SysPost implements Id<Long>,Serializable {
public class SysPost extends TenantEntity implements Id<Long>,Serializable {
private static final long serialVersionUID = 1L;
/**

View File

@ -2,7 +2,9 @@ package cc.iotkit.model.system;
import cc.iotkit.common.constant.UserConstants;
import cc.iotkit.model.Id;
import cc.iotkit.model.TenantEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@ -12,8 +14,9 @@ import java.util.Date;
*
* @author Michelle.Chung
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class SysRole implements Id<Long>,Serializable {
public class SysRole extends TenantEntity implements Id<Long>,Serializable {
private static final long serialVersionUID = 1L;
/**

View File

@ -1,7 +1,9 @@
package cc.iotkit.model.system;
import cc.iotkit.model.BaseEntity;
import cc.iotkit.model.Id;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@ -12,8 +14,9 @@ import java.util.Date;
*
* @author Michelle.Chung
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class SysTenant implements Id<Long>,Serializable {
public class SysTenant extends BaseEntity implements Id<Long>,Serializable {
private static final long serialVersionUID = 1L;
/**

View File

@ -1,7 +1,9 @@
package cc.iotkit.model.system;
import cc.iotkit.model.BaseEntity;
import cc.iotkit.model.Id;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
@ -11,8 +13,9 @@ import java.io.Serializable;
*
* @author Michelle.Chung
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class SysTenantPackage implements Id<Long>,Serializable {
public class SysTenantPackage extends BaseEntity implements Id<Long>, Serializable {
private static final long serialVersionUID = 1L;
/**

View File

@ -1,7 +1,9 @@
package cc.iotkit.model.system;
import cc.iotkit.model.Id;
import cc.iotkit.model.TenantEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@ -13,8 +15,9 @@ import java.util.List;
*
* @author Michelle.Chung
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class SysUser implements Id<Long>, Serializable {
public class SysUser extends TenantEntity implements Id<Long>, Serializable {
private static final long serialVersionUID = 1L;
/**
@ -22,11 +25,6 @@ public class SysUser implements Id<Long>, Serializable {
*/
private Long id;
/**
* ID
*/
private String tenantId;
/**
* ID
*/

View File

@ -1,26 +0,0 @@
package cc.iotkit.system.service;
/**
*
*
* @author Lion Li
*/
public interface ISysDataScopeService {
/**
*
*
* @param roleId id
* @return id
*/
String getRoleCustom(Long roleId);
/**
*
*
* @param deptId id
* @return id
*/
String getDeptAndChild(Long deptId);
}