mdf:剔除qz启动,基础do兼容jpa
This commit is contained in:
@@ -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.ServletComponentScan;
|
||||||
import org.springframework.boot.web.servlet.server.ServletWebServerFactory;
|
import org.springframework.boot.web.servlet.server.ServletWebServerFactory;
|
||||||
import org.springframework.context.annotation.Bean;
|
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.data.jpa.repository.config.EnableJpaAuditing;
|
||||||
import org.springframework.scheduling.annotation.EnableAsync;
|
import org.springframework.scheduling.annotation.EnableAsync;
|
||||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||||
@@ -35,6 +37,10 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
@EnableJpaAuditing(auditorAwareRef = "auditorAware")
|
@EnableJpaAuditing(auditorAwareRef = "auditorAware")
|
||||||
@EnableMethodCache(basePackages = "org.nl")
|
@EnableMethodCache(basePackages = "org.nl")
|
||||||
@EnableCreateCacheAnnotation
|
@EnableCreateCacheAnnotation
|
||||||
|
@ComponentScan(
|
||||||
|
excludeFilters = {
|
||||||
|
@ComponentScan.Filter(type = FilterType.REGEX, pattern = "org.nl.modules.quartz.*")}
|
||||||
|
)
|
||||||
public class AppRun {
|
public class AppRun {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|||||||
@@ -34,8 +34,16 @@ import java.util.Set;
|
|||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
|
@Entity
|
||||||
public class Dept extends BaseEntity implements Serializable {
|
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;
|
private Long dept_id;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -47,9 +47,7 @@ public class Role extends BaseEntity implements Serializable {
|
|||||||
@ApiModelProperty(value = "ID", hidden = true)
|
@ApiModelProperty(value = "ID", hidden = true)
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
@JsonIgnore
|
@Transient
|
||||||
@ManyToMany(mappedBy = "roles")
|
|
||||||
@ApiModelProperty(value = "用户", hidden = true)
|
|
||||||
private Set<User> users;
|
private Set<User> users;
|
||||||
|
|
||||||
@ManyToMany
|
@ManyToMany
|
||||||
@@ -59,12 +57,6 @@ public class Role extends BaseEntity implements Serializable {
|
|||||||
@ApiModelProperty(value = "菜单", hidden = true)
|
@ApiModelProperty(value = "菜单", hidden = true)
|
||||||
private Set<Menu> menus;
|
private Set<Menu> 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<Dept> depts;
|
|
||||||
|
|
||||||
@NotBlank
|
@NotBlank
|
||||||
@ApiModelProperty(value = "名称", hidden = true)
|
@ApiModelProperty(value = "名称", hidden = true)
|
||||||
|
|||||||
@@ -36,8 +36,15 @@ import java.util.Set;
|
|||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
|
@Entity
|
||||||
public class User extends BaseEntity implements Serializable {
|
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;
|
private Long user_id;
|
||||||
|
|
||||||
|
|||||||
@@ -124,7 +124,6 @@ public class RoleServiceImpl implements RoleService {
|
|||||||
role.setName(resources.getName());
|
role.setName(resources.getName());
|
||||||
role.setDescription(resources.getDescription());
|
role.setDescription(resources.getDescription());
|
||||||
role.setDataScope(resources.getDataScope());
|
role.setDataScope(resources.getDataScope());
|
||||||
role.setDepts(resources.getDepts());
|
|
||||||
role.setLevel(resources.getLevel());
|
role.setLevel(resources.getLevel());
|
||||||
roleRepository.save(role);
|
roleRepository.save(role);
|
||||||
// 更新相关缓存
|
// 更新相关缓存
|
||||||
|
|||||||
@@ -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: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
|
# 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}
|
username: ${DB_USER:root}
|
||||||
password: ${DB_PWD:P@ssw0rd}
|
password: ${DB_PWD:Root.123456}
|
||||||
# password: ${DB_PWD:12356}
|
# password: ${DB_PWD:12356}
|
||||||
# 初始连接数
|
# 初始连接数
|
||||||
initial-size: 5
|
initial-size: 5
|
||||||
|
|||||||
Reference in New Issue
Block a user