This commit is contained in:
Vindicator645 2020-02-17 17:42:17 +08:00
commit 9b32dd25a2
32 changed files with 356 additions and 70 deletions

13
pom.xml
View File

@ -113,6 +113,19 @@
<version>1.16.10</version> <version>1.16.10</version>
</dependency> </dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.14</version>
</dependency>
<!-- 使用 xlsx 格式需要额外引入此依赖 -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.14</version>
</dependency>
</dependencies> </dependencies>
<build> <build>

View File

@ -0,0 +1,21 @@
package com.codesdream.ase.component;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
/**
* 手动获得Bean的工具类
*/
@Component
public class ASESpringUtil {
@Resource
private ApplicationContext applicationContext;
public <T> T getBean(Class<T> tClass){
return applicationContext.getBean(tClass);
}
}

View File

@ -0,0 +1,46 @@
package com.codesdream.ase.component.datamanager;
import com.codesdream.ase.component.ASESpringUtil;
import lombok.Data;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
/**
* DataModel对应Repository层查询器
*/
@Data
@Component
@Scope("prototype")
public class DataModelRepositorySearcher {
@Resource
ASESpringUtil springUtil;
public final String repositoryPath = "com.codesdream.ase.repository.";
private Class<?> repositoryClass = null;
private boolean present;
public void getDataModelRepositoryClass(String subSystem, String dataModel){
try {
this.repositoryClass = Class.forName(dataModelFullNameGenerator(subSystem, dataModel));
this.setPresent(true);
} catch (ClassNotFoundException e) {
this.setPresent(false);
}
}
public <T> T getDataModelRepositoryInstance(Class<T> dataModeRepositoryClass) {
if(isPresent()) {
return springUtil.getBean(dataModeRepositoryClass);
}
return null;
}
private String dataModelFullNameGenerator(String subSystem, String dataModel){
return new String(repositoryPath + subSystem + "." + dataModel + "Repository");
}
}

View File

@ -0,0 +1,62 @@
package com.codesdream.ase.component.datamanager;
import lombok.Data;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import javax.swing.text.html.parser.Entity;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Collection;
/**
* 查找特定的Model以创建相应的操作表单(多例模式)
*/
@Data
@Component
@Scope("prototype")
public class DataModelSearcher {
public final String modelPath = "com.codesdream.ase.model.";
private Class<?> dataModelClass = null;
private boolean present;
public void getDataModelClass(String subSystem, String dataModel) {
try {
dataModelClass = Class.forName(dataModelFullNameGenerator(subSystem, dataModel));
this.setPresent(true);
}catch (ClassNotFoundException e){
this.setPresent(false);
}
}
public Collection<String> getDataModelParamArgs() {
if(isPresent()) {
Collection<String> paramArgs = new ArrayList<>();
for (Field field : dataModelClass.getDeclaredFields()) {
paramArgs.add(field.getName());
}
return paramArgs;
}
return null;
}
public <T> T getDataModelInstance(Class<T> dataModelClass) {
if(isPresent()){
try {
return dataModelClass.newInstance();
} catch (IllegalAccessException e) {
this.setPresent(false);
return null;
} catch (InstantiationException e) {
e.printStackTrace();
return null;
}
}
return null;
}
private String dataModelFullNameGenerator(String subSystem, String dataModel){
return new String(modelPath + subSystem + "." + dataModel);
}
}

View File

@ -1,4 +1,4 @@
package com.codesdream.ase.component; package com.codesdream.ase.component.permission;
import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.codec.digest.DigestUtils;
import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.security.crypto.password.PasswordEncoder;

View File

@ -1,4 +1,4 @@
package com.codesdream.ase.component; package com.codesdream.ase.component.permission;
import org.springframework.security.authentication.*; import org.springframework.security.authentication.*;
import org.springframework.security.core.Authentication; import org.springframework.security.core.Authentication;
@ -11,8 +11,6 @@ import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.UnsupportedEncodingException;
import java.security.NoSuchAlgorithmException;
import java.util.Collection; import java.util.Collection;
@Component @Component

View File

@ -1,4 +1,4 @@
package com.codesdream.ase.component; package com.codesdream.ase.component.permission;
import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.codec.digest.DigestUtils;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;

View File

@ -1,4 +1,4 @@
package com.codesdream.ase.component; package com.codesdream.ase.component.permission;
import com.codesdream.ase.model.permission.User; import com.codesdream.ase.model.permission.User;
import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.GrantedAuthority;

View File

@ -1,8 +1,9 @@
package com.codesdream.ase.component; package com.codesdream.ase.component.permission;
import com.codesdream.ase.model.permission.*; import com.codesdream.ase.model.permission.*;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
@ -11,16 +12,9 @@ import java.util.Collection;
*/ */
@Component @Component
public class UserFunctionalPermissionContainersListGenerator { public class UserFunctionalPermissionContainersListGenerator {
@Resource
private UserFunctionalScopeRelationsListGenerator functionalScopeRelationsListGenerator; private UserFunctionalScopeRelationsListGenerator functionalScopeRelationsListGenerator;
public UserFunctionalPermissionContainersListGenerator(
UserFunctionalScopeRelationsListGenerator userFunctionalScopeRelationsListGenerator)
{
if(userFunctionalScopeRelationsListGenerator == null) throw new NullPointerException();
this.functionalScopeRelationsListGenerator = userFunctionalScopeRelationsListGenerator;
}
public Collection<FunctionalPermissionContainer> generateFunctionalContainers( public Collection<FunctionalPermissionContainer> generateFunctionalContainers(
Collection<FunctionalScopeRelation> functionalScopeRelations){ Collection<FunctionalScopeRelation> functionalScopeRelations){
Collection<FunctionalPermissionContainer> functionalPermissionContainers Collection<FunctionalPermissionContainer> functionalPermissionContainers

View File

@ -1,10 +1,11 @@
package com.codesdream.ase.component; package com.codesdream.ase.component.permission;
import com.codesdream.ase.model.permission.FunctionalScopeRelation; import com.codesdream.ase.model.permission.FunctionalScopeRelation;
import com.codesdream.ase.model.permission.PermissionContainersCollection; import com.codesdream.ase.model.permission.PermissionContainersCollection;
import com.codesdream.ase.model.permission.User; import com.codesdream.ase.model.permission.User;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
@ -14,15 +15,9 @@ import java.util.Collection;
@Component @Component
public class UserFunctionalScopeRelationsListGenerator { public class UserFunctionalScopeRelationsListGenerator {
@Resource
private UserPermissionContainersCollectionsListGenerator userPermissionContainersCollectionsListGenerator; private UserPermissionContainersCollectionsListGenerator userPermissionContainersCollectionsListGenerator;
public UserFunctionalScopeRelationsListGenerator(
UserPermissionContainersCollectionsListGenerator userPermissionContainersCollectionsListGenerator)
{
if(userPermissionContainersCollectionsListGenerator == null) throw new NullPointerException();
this.userPermissionContainersCollectionsListGenerator =
userPermissionContainersCollectionsListGenerator;
}
public Collection<FunctionalScopeRelation> generateFunctionalScopeRelations( public Collection<FunctionalScopeRelation> generateFunctionalScopeRelations(
Collection<PermissionContainersCollection> permissionContainersCollections){ Collection<PermissionContainersCollection> permissionContainersCollections){

View File

@ -1,10 +1,11 @@
package com.codesdream.ase.component; package com.codesdream.ase.component.permission;
import com.codesdream.ase.model.permission.PermissionContainersCollection; import com.codesdream.ase.model.permission.PermissionContainersCollection;
import com.codesdream.ase.model.permission.Tag; import com.codesdream.ase.model.permission.Tag;
import com.codesdream.ase.model.permission.User; import com.codesdream.ase.model.permission.User;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
@ -13,15 +14,9 @@ import java.util.Collection;
*/ */
@Component @Component
public class UserPermissionContainersCollectionsListGenerator { public class UserPermissionContainersCollectionsListGenerator {
@Resource
private UserTagsListGenerator userTagsListGenerator; private UserTagsListGenerator userTagsListGenerator;
public UserPermissionContainersCollectionsListGenerator(UserTagsListGenerator userTagsListGenerator)
{
if(userTagsListGenerator == null) throw new NullPointerException();
this.userTagsListGenerator = userTagsListGenerator;
}
public Collection<PermissionContainersCollection> generatePermissionContainerCollections( public Collection<PermissionContainersCollection> generatePermissionContainerCollections(
Collection<Tag> tags){ Collection<Tag> tags){
Collection<PermissionContainersCollection> permissionContainersCollections = Collection<PermissionContainersCollection> permissionContainersCollections =

View File

@ -1,11 +1,13 @@
package com.codesdream.ase.component; package com.codesdream.ase.component.permission;
import com.codesdream.ase.component.permission.UserFunctionalPermissionContainersListGenerator;
import com.codesdream.ase.model.permission.FunctionalPermissionContainer; import com.codesdream.ase.model.permission.FunctionalPermissionContainer;
import com.codesdream.ase.model.permission.User; import com.codesdream.ase.model.permission.User;
import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
@ -14,16 +16,9 @@ import java.util.Collection;
*/ */
@Component @Component
public class UserRolesListGenerator { public class UserRolesListGenerator {
@Resource
private UserFunctionalPermissionContainersListGenerator functionalPermissionContainersListGenerator; private UserFunctionalPermissionContainersListGenerator functionalPermissionContainersListGenerator;
public UserRolesListGenerator(
UserFunctionalPermissionContainersListGenerator userFunctionalPermissionContainersListGenerator)
{
this.functionalPermissionContainersListGenerator =
userFunctionalPermissionContainersListGenerator;
}
public Collection<GrantedAuthority> generateRoles( public Collection<GrantedAuthority> generateRoles(
Collection<FunctionalPermissionContainer> functionalPermissionContainers){ Collection<FunctionalPermissionContainer> functionalPermissionContainers){
Collection<GrantedAuthority> authorities = new ArrayList<>(); Collection<GrantedAuthority> authorities = new ArrayList<>();

View File

@ -1,9 +1,9 @@
package com.codesdream.ase.component; package com.codesdream.ase.component.permission;
import com.codesdream.ase.model.permission.ScopePermissionContainer; import com.codesdream.ase.model.permission.ScopePermissionContainer;
import com.codesdream.ase.model.permission.Tag; import com.codesdream.ase.model.permission.Tag;
import com.codesdream.ase.model.permission.User; import com.codesdream.ase.model.permission.User;
import com.codesdream.ase.repository.UserRepository; import com.codesdream.ase.repository.permission.UserRepository;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.annotation.Resource; import javax.annotation.Resource;

View File

@ -1,4 +1,4 @@
package com.codesdream.ase.component; package com.codesdream.ase.component.permission;
import com.codesdream.ase.model.permission.Tag; import com.codesdream.ase.model.permission.Tag;
import com.codesdream.ase.model.permission.User; import com.codesdream.ase.model.permission.User;

View File

@ -1,9 +1,8 @@
package com.codesdream.ase.configure; package com.codesdream.ase.configure;
import com.codesdream.ase.component.ASEPasswordEncoder; import com.codesdream.ase.component.permission.ASEPasswordEncoder;
import com.codesdream.ase.component.ASESecurityAuthenticationProvider; import com.codesdream.ase.component.permission.ASESecurityAuthenticationProvider;
import com.codesdream.ase.service.ASEUserDetailsService; import com.codesdream.ase.service.ASEUserDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.builders.HttpSecurity;

View File

@ -0,0 +1,40 @@
package com.codesdream.ase.controller;
import org.apache.catalina.core.ApplicationContext;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.w3c.dom.Entity;
import javax.annotation.Resource;
import java.lang.reflect.Array;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
@Controller
@RequestMapping(value = "/database")
public class DataManagerController {
@RequestMapping(value = "{subSystem}/{dataModel}/query")
private String queryView(Model model, @PathVariable String dataModel, @PathVariable String subSystem)
throws InstantiationException, IllegalAccessException, ClassNotFoundException {
String dataModelFullName = "com.codesdream.ase.model." + subSystem + "." + dataModel;
String repositoryFullName = "com.codesdream.ase.repository." + subSystem + "." + dataModel + "Repository";
try {
Class<?> entityModelClass = Class.forName(dataModelFullName);
Collection<String> paramArgs = new ArrayList<>();
for(Field field :entityModelClass.getDeclaredFields()){
paramArgs.add(field.getName());
}
model.addAttribute("paramArgs", paramArgs);
Object entityModel = entityModelClass.newInstance();
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
throw e;
}
return null;
}
}

View File

@ -0,0 +1,20 @@
package com.codesdream.ase.model.information;
import lombok.Data;
import javax.persistence.*;
/**
* 考生类别
*/
@Data
@Entity
@Table(name = "base_candidate_category")
public class BaseCandidateCategory {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private int id;
private String name;
}

View File

@ -16,4 +16,7 @@ public class BaseCollege {
private int id; private int id;
private String name; private String name;
// 学院代码
private int number;
} }

View File

@ -0,0 +1,19 @@
package com.codesdream.ase.model.information;
import lombok.Data;
import javax.persistence.*;
/**
* 政治面貌
*/
@Data
@Entity
@Table(name = "base_political_status")
public class BasePoliticalStatus {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private int id;
private String name;
}

View File

@ -0,0 +1,42 @@
package com.codesdream.ase.model.information;
import lombok.Data;
import javax.persistence.*;
/**
* 学生基本真实信息
*/
@Data
@Entity
@Table(name = "base_student_info")
public class BaseStudentInfo {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private int id;
// 真实姓名
private String name;
// 学号
private String studentId;
// 班号
private String classId;
// 性别
private String sex;
// 民族
@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
private BaseEthnic ethnic;
// 学院
@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
private BaseCollege college;
// 专业
@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
private BaseMajor major;
// 政治面貌
@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
private BasePoliticalStatus politicalStatus;
// 省份地区
@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
private BaseAdministrativeDivision administrativeDivision;
}

View File

@ -1,15 +1,10 @@
package com.codesdream.ase.model.permission; package com.codesdream.ase.model.permission;
import com.codesdream.ase.component.UserAuthoritiesGenerator;
import com.codesdream.ase.component.UserRolesListGenerator;
import com.codesdream.ase.model.activity.UserActivity; import com.codesdream.ase.model.activity.UserActivity;
import com.codesdream.ase.service.IUserService;
import lombok.Data; import lombok.Data;
import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetails;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import javax.persistence.*; import javax.persistence.*;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;

View File

@ -0,0 +1,14 @@
package com.codesdream.ase.repository.information;
import com.codesdream.ase.model.information.BaseStudentInfo;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;
import java.util.Optional;
@Repository
public interface BaseStudentInfoRepository extends CrudRepository<BaseStudentInfo, Integer> {
// 通过学号查找
Optional<BaseStudentInfo> findByStudentId(String student_id);
}

View File

@ -1,4 +1,4 @@
package com.codesdream.ase.repository; package com.codesdream.ase.repository.permission;
import com.codesdream.ase.model.permission.FunctionalPermissionContainer; import com.codesdream.ase.model.permission.FunctionalPermissionContainer;
import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.CrudRepository;

View File

@ -1,4 +1,4 @@
package com.codesdream.ase.repository; package com.codesdream.ase.repository.permission;
import com.codesdream.ase.model.permission.PermissionContainersCollection; import com.codesdream.ase.model.permission.PermissionContainersCollection;
import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.CrudRepository;

View File

@ -1,4 +1,4 @@
package com.codesdream.ase.repository; package com.codesdream.ase.repository.permission;
import com.codesdream.ase.model.permission.ScopePermissionContainer; import com.codesdream.ase.model.permission.ScopePermissionContainer;
import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.CrudRepository;

View File

@ -1,4 +1,4 @@
package com.codesdream.ase.repository; package com.codesdream.ase.repository.permission;
import com.codesdream.ase.model.permission.FunctionalPermissionContainer; import com.codesdream.ase.model.permission.FunctionalPermissionContainer;
import com.codesdream.ase.model.permission.Tag; import com.codesdream.ase.model.permission.Tag;

View File

@ -1,4 +1,4 @@
package com.codesdream.ase.repository; package com.codesdream.ase.repository.permission;
import com.codesdream.ase.model.permission.Tag; import com.codesdream.ase.model.permission.Tag;
import com.codesdream.ase.model.permission.User; import com.codesdream.ase.model.permission.User;

View File

@ -1,6 +1,6 @@
package com.codesdream.ase.service; package com.codesdream.ase.service;
import com.codesdream.ase.component.UserAuthoritiesGenerator; import com.codesdream.ase.component.permission.UserAuthoritiesGenerator;
import com.codesdream.ase.model.permission.User; import com.codesdream.ase.model.permission.User;
import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UserDetailsService;
@ -9,7 +9,6 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.transaction.Transactional; import javax.transaction.Transactional;
import java.util.Optional;
@Service @Service
public class ASEUserDetailsService implements UserDetailsService { public class ASEUserDetailsService implements UserDetailsService {

View File

@ -1,11 +1,11 @@
package com.codesdream.ase.service; package com.codesdream.ase.service;
import com.codesdream.ase.component.UserFunctionalPermissionContainersListGenerator; import com.codesdream.ase.component.permission.UserFunctionalPermissionContainersListGenerator;
import com.codesdream.ase.component.UserFunctionalScopeRelationsListGenerator; import com.codesdream.ase.component.permission.UserFunctionalScopeRelationsListGenerator;
import com.codesdream.ase.model.permission.*; import com.codesdream.ase.model.permission.*;
import com.codesdream.ase.repository.FunctionalPermissionRepository; import com.codesdream.ase.repository.permission.FunctionalPermissionRepository;
import com.codesdream.ase.repository.ScopePermissionRepository; import com.codesdream.ase.repository.permission.ScopePermissionRepository;
import com.codesdream.ase.repository.TagRepository; import com.codesdream.ase.repository.permission.TagRepository;
import javafx.util.Pair; import javafx.util.Pair;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -30,7 +30,7 @@ public class PermissionService implements IPermissionService {
private UserFunctionalPermissionContainersListGenerator userFunctionalPermissionContainersListGenerator; private UserFunctionalPermissionContainersListGenerator userFunctionalPermissionContainersListGenerator;
@Resource @Resource
UserFunctionalScopeRelationsListGenerator userFunctionalScopeRelationsListGenerator; private UserFunctionalScopeRelationsListGenerator userFunctionalScopeRelationsListGenerator;
@Override @Override
public Optional<Tag> findTag(String name) { public Optional<Tag> findTag(String name) {

View File

@ -1,10 +1,10 @@
package com.codesdream.ase.service; package com.codesdream.ase.service;
import com.codesdream.ase.component.ASEPasswordEncoder; import com.codesdream.ase.component.permission.ASEPasswordEncoder;
import com.codesdream.ase.component.ASEUsernameEncoder; import com.codesdream.ase.component.permission.ASEUsernameEncoder;
import com.codesdream.ase.component.UserRolesListGenerator; import com.codesdream.ase.component.permission.UserRolesListGenerator;
import com.codesdream.ase.model.permission.User; import com.codesdream.ase.model.permission.User;
import com.codesdream.ase.repository.UserRepository; import com.codesdream.ase.repository.permission.UserRepository;
import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;

View File

@ -0,0 +1,37 @@
package com.codesdream.ase.test;
import com.codesdream.ase.component.ASESpringUtil;
import com.codesdream.ase.component.datamanager.DataModelSearcher;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import javax.annotation.Resource;
@RunWith(SpringRunner.class)
@SpringBootTest
public class DataManagerTest {
@Resource
ASESpringUtil springUtil;
@Test
public void dataModelSearcherTest() {
DataModelSearcher dataModelSearcher = springUtil.getBean(DataModelSearcher.class);
dataModelSearcher.getDataModelClass("permission", "Tag");
Assert.assertTrue(dataModelSearcher.isPresent());
for(String param : dataModelSearcher.getDataModelParamArgs()){
System.out.println(param);
}
}
@Test
public void dataModelRepositorySearcherTest(){
}
}

View File

@ -3,7 +3,7 @@ package com.codesdream.ase.test;
import com.codesdream.ase.model.permission.FunctionalPermissionContainer; import com.codesdream.ase.model.permission.FunctionalPermissionContainer;
import com.codesdream.ase.model.permission.Tag; import com.codesdream.ase.model.permission.Tag;
import com.codesdream.ase.model.permission.User; import com.codesdream.ase.model.permission.User;
import com.codesdream.ase.repository.UserRepository; import com.codesdream.ase.repository.permission.UserRepository;
import static org.junit.Assert.*; import static org.junit.Assert.*;
@ -14,7 +14,6 @@ import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.boot.test.autoconfigure.orm.jpa.TestEntityManager; import org.springframework.boot.test.autoconfigure.orm.jpa.TestEntityManager;
import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.context.junit4.SpringRunner;
import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
/** /**