diff --git a/nladmin-system/nlsso-server/src/main/java/org/nl/AppRun.java b/nladmin-system/nlsso-server/src/main/java/org/nl/AppRun.java index a757aaa..bd84712 100644 --- a/nladmin-system/nlsso-server/src/main/java/org/nl/AppRun.java +++ b/nladmin-system/nlsso-server/src/main/java/org/nl/AppRun.java @@ -11,6 +11,8 @@ import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactor import org.springframework.boot.web.servlet.ServletComponentScan; import org.springframework.boot.web.servlet.server.ServletWebServerFactory; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.FilterType; import org.springframework.data.jpa.repository.config.EnableJpaAuditing; import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.transaction.annotation.EnableTransactionManagement; @@ -35,11 +37,15 @@ import org.springframework.web.bind.annotation.RestController; @EnableJpaAuditing(auditorAwareRef = "auditorAware") @EnableMethodCache(basePackages = "org.nl") @EnableCreateCacheAnnotation +@ComponentScan( + excludeFilters = { + @ComponentScan.Filter(type = FilterType.REGEX, pattern = "org.nl.modules.quartz.*")} +) public class AppRun { public static void main(String[] args) { - + SpringApplication.run(AppRun.class, args); } diff --git a/nladmin-system/nlsso-server/src/main/java/org/nl/modules/system/domain/Dept.java b/nladmin-system/nlsso-server/src/main/java/org/nl/modules/system/domain/Dept.java index 8880cc5..420b577 100644 --- a/nladmin-system/nlsso-server/src/main/java/org/nl/modules/system/domain/Dept.java +++ b/nladmin-system/nlsso-server/src/main/java/org/nl/modules/system/domain/Dept.java @@ -34,8 +34,16 @@ import java.util.Set; */ @Getter @Setter +@Entity public class Dept extends BaseEntity implements Serializable { + @Id + @Column(name = "role_id") + @NotNull(groups = {Update.class}) + @GeneratedValue(strategy = GenerationType.IDENTITY) + @ApiModelProperty(value = "ID", hidden = true) + private Long id; + private Long dept_id; diff --git a/nladmin-system/nlsso-server/src/main/java/org/nl/modules/system/domain/Role.java b/nladmin-system/nlsso-server/src/main/java/org/nl/modules/system/domain/Role.java index da649e2..e0a9e93 100644 --- a/nladmin-system/nlsso-server/src/main/java/org/nl/modules/system/domain/Role.java +++ b/nladmin-system/nlsso-server/src/main/java/org/nl/modules/system/domain/Role.java @@ -47,9 +47,7 @@ public class Role extends BaseEntity implements Serializable { @ApiModelProperty(value = "ID", hidden = true) private Long id; - @JsonIgnore - @ManyToMany(mappedBy = "roles") - @ApiModelProperty(value = "用户", hidden = true) + @Transient private Set users; @ManyToMany @@ -59,12 +57,6 @@ public class Role extends BaseEntity implements Serializable { @ApiModelProperty(value = "菜单", hidden = true) private Set menus; - @ManyToMany - @JoinTable(name = "sys_roles_depts", - joinColumns = {@JoinColumn(name = "role_id",referencedColumnName = "role_id")}, - inverseJoinColumns = {@JoinColumn(name = "dept_id",referencedColumnName = "dept_id")}) - @ApiModelProperty(value = "部门", hidden = true) - private Set depts; @NotBlank @ApiModelProperty(value = "名称", hidden = true) diff --git a/nladmin-system/nlsso-server/src/main/java/org/nl/modules/system/domain/User.java b/nladmin-system/nlsso-server/src/main/java/org/nl/modules/system/domain/User.java index 6d7fb45..8da0d35 100644 --- a/nladmin-system/nlsso-server/src/main/java/org/nl/modules/system/domain/User.java +++ b/nladmin-system/nlsso-server/src/main/java/org/nl/modules/system/domain/User.java @@ -36,8 +36,15 @@ import java.util.Set; */ @Getter @Setter +@Entity public class User extends BaseEntity implements Serializable { + @Id + @Column(name = "role_id") + @NotNull(groups = {Update.class}) + @GeneratedValue(strategy = GenerationType.IDENTITY) + @ApiModelProperty(value = "ID", hidden = true) + private Long id; private Long user_id; diff --git a/nladmin-system/nlsso-server/src/main/java/org/nl/modules/system/service/impl/RoleServiceImpl.java b/nladmin-system/nlsso-server/src/main/java/org/nl/modules/system/service/impl/RoleServiceImpl.java index a25697a..ac1fd46 100644 --- a/nladmin-system/nlsso-server/src/main/java/org/nl/modules/system/service/impl/RoleServiceImpl.java +++ b/nladmin-system/nlsso-server/src/main/java/org/nl/modules/system/service/impl/RoleServiceImpl.java @@ -124,7 +124,6 @@ public class RoleServiceImpl implements RoleService { role.setName(resources.getName()); role.setDescription(resources.getDescription()); role.setDataScope(resources.getDataScope()); - role.setDepts(resources.getDepts()); role.setLevel(resources.getLevel()); roleRepository.save(role); // 更新相关缓存 diff --git a/nladmin-system/nlsso-server/src/main/resources/config/application-dev.yml b/nladmin-system/nlsso-server/src/main/resources/config/application-dev.yml index ebb3bc6..91f63f0 100644 --- a/nladmin-system/nlsso-server/src/main/resources/config/application-dev.yml +++ b/nladmin-system/nlsso-server/src/main/resources/config/application-dev.yml @@ -9,7 +9,7 @@ spring: url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:nl-sso-server}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true # url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:yongyu_lms2}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true username: ${DB_USER:root} - password: ${DB_PWD:P@ssw0rd} + password: ${DB_PWD:Root.123456} # password: ${DB_PWD:12356} # 初始连接数 initial-size: 5