角色模板
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
package com.czg.account.dto;
|
||||
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class RoleTemplateDTO {
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 模板名称
|
||||
*/
|
||||
@NotBlank(message = "模板名称不能为空")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
private Integer isEnable;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 角色id列表
|
||||
*/
|
||||
private Integer roleId;
|
||||
/**
|
||||
* 上级id
|
||||
*/
|
||||
private Integer pid;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.czg.account.dto.role;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public record RoleSaveTemplateDTO(
|
||||
/* 角色名称 */
|
||||
@NotBlank
|
||||
List<Integer> roleTemplateIdList
|
||||
) {
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import com.czg.account.dto.PageDTO;
|
||||
import com.czg.account.dto.role.RoleAddDTO;
|
||||
import com.czg.account.dto.role.RoleEditDTO;
|
||||
import com.czg.account.dto.role.RolePermissionDTO;
|
||||
import com.czg.account.dto.role.RoleSaveTemplateDTO;
|
||||
import com.czg.account.entity.SysRole;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.service.IService;
|
||||
@@ -29,4 +30,7 @@ public interface SysRoleService extends IService<SysRole> {
|
||||
List<Long> getRoleMenu(long loginIdAsLong, Integer id, Integer type);
|
||||
|
||||
Boolean editPermission(long userId, RolePermissionDTO rolePermissionDTO);
|
||||
|
||||
Boolean saveByTemplate(long shopId, RoleSaveTemplateDTO dto);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
|
||||
package com.czg.market.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import lombok.experimental.Accessors;
|
||||
import java.io.Serial;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 角色模板 实体类。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-12-08
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public class SysRoleTemplateDTO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 模板名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
private Integer isEnable;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 操作人
|
||||
*/
|
||||
private String opUser;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 角色id列表
|
||||
*/
|
||||
private String roleIdList;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package com.czg.market.entity;
|
||||
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 角色模板 实体类。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-12-08
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("sys_role_template")
|
||||
public class SysRoleTemplate implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id(keyType = KeyType.Auto)
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 模板名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
private Integer isEnable;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 操作人
|
||||
*/
|
||||
private String opUser;
|
||||
private Long opSysUserId;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 角色id列表
|
||||
*/
|
||||
private String roleId;
|
||||
|
||||
/**
|
||||
* 上级id
|
||||
*/
|
||||
private Integer pid;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.czg.market.service;
|
||||
|
||||
import com.czg.account.dto.RoleTemplateDTO;
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import com.czg.market.entity.SysRoleTemplate;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 角色模板 服务层。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-12-08
|
||||
*/
|
||||
public interface SysRoleTemplateService extends IService<SysRoleTemplate> {
|
||||
|
||||
Boolean saveInfo(RoleTemplateDTO dto);
|
||||
|
||||
List<SysRoleTemplate> listInfo();
|
||||
|
||||
Boolean editInfo(RoleTemplateDTO dto);
|
||||
}
|
||||
Reference in New Issue
Block a user