Skip to content

Commit

Permalink
#359 #357 add more interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
heziai committed Mar 9, 2018
1 parent 610ab75 commit f78acae
Show file tree
Hide file tree
Showing 20 changed files with 696 additions and 132 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package com.vip.saturn.job.console.mybatis.entity;

import java.util.Date;

/**
* @author hebelala
*/
public class CommonFields {

private String createdBy;
private Date createTime;
private String lastUpdatedBy;
private Date lastUpdateTime;
private Boolean isDeleted;

public String getCreatedBy() {
return createdBy;
}

public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}

public Date getCreateTime() {
return createTime;
}

public void setCreateTime(Date createTime) {
this.createTime = createTime;
}

public String getLastUpdatedBy() {
return lastUpdatedBy;
}

public void setLastUpdatedBy(String lastUpdatedBy) {
this.lastUpdatedBy = lastUpdatedBy;
}

public Date getLastUpdateTime() {
return lastUpdateTime;
}

public void setLastUpdateTime(Date lastUpdateTime) {
this.lastUpdateTime = lastUpdateTime;
}

public Boolean getDeleted() {
return isDeleted;
}

public void setDeleted(Boolean deleted) {
isDeleted = deleted;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,12 @@
/**
* @author hebelala
*/
public class Permission {
public class Permission extends CommonFields {

private Long id;
private String key;
private String name;
private String description;

public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}

public String getKey() {
return key;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,16 @@
package com.vip.saturn.job.console.mybatis.entity;

import java.util.Set;
import java.util.List;

/**
* @author hebelala
*/
public class Role {
public class Role extends CommonFields {

private Long id;
private String key;
private String name;
private String description;
private String namespace;
private Boolean approval;
private Set<Permission> permissions;

public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}
private List<RolePermission> rolePermissions;

public String getKey() {
return key;
Expand All @@ -47,27 +36,11 @@ public void setDescription(String description) {
this.description = description;
}

public String getNamespace() {
return namespace;
}

public void setNamespace(String namespace) {
this.namespace = namespace;
}

public Boolean getApproval() {
return approval;
}

public void setApproval(Boolean approval) {
this.approval = approval;
}

public Set<Permission> getPermissions() {
return permissions;
public List<RolePermission> getRolePermissions() {
return rolePermissions;
}

public void setPermissions(Set<Permission> permissions) {
this.permissions = permissions;
public void setRolePermissions(List<RolePermission> rolePermissions) {
this.rolePermissions = rolePermissions;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package com.vip.saturn.job.console.mybatis.entity;

/**
* @author hebelala
*/
public class RolePermission extends CommonFields {

private String roleKey;
private String permissionKey;
private Role role;
private Permission permission;

public String getRoleKey() {
return roleKey;
}

public void setRoleKey(String roleKey) {
this.roleKey = roleKey;
}

public String getPermissionKey() {
return permissionKey;
}

public void setPermissionKey(String permissionKey) {
this.permissionKey = permissionKey;
}

public Role getRole() {
return role;
}

public void setRole(Role role) {
this.role = role;
}

public Permission getPermission() {
return permission;
}

public void setPermission(Permission permission) {
this.permission = permission;
}
}
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
package com.vip.saturn.job.console.mybatis.entity;

import java.util.Set;
import java.util.List;

/**
* @author hebelala
*/
public class User {
public class User extends CommonFields {

private Long id;
private String name;
private String password;
private String realName;
private String employeeId;
private String email;
private Set<Role> roles;
private List<UserRole> userRoles;

public Long getId() {
return id;
public User() {
}

public void setId(Long id) {
this.id = id;
public User(String name) {
this.name = name;
}

public String getName() {
Expand Down Expand Up @@ -63,11 +61,11 @@ public void setEmail(String email) {
this.email = email;
}

public Set<Role> getRoles() {
return roles;
public List<UserRole> getUserRoles() {
return userRoles;
}

public void setRoles(Set<Role> roles) {
this.roles = roles;
public void setUserRoles(List<UserRole> userRoles) {
this.userRoles = userRoles;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package com.vip.saturn.job.console.mybatis.entity;

public class UserRole extends CommonFields {

private String userName;
private String roleKey;
private String namespace;
private Boolean approval;
private User user;
private Role role;

public String getUserName() {
return userName;
}

public void setUserName(String userName) {
this.userName = userName;
}

public String getRoleKey() {
return roleKey;
}

public void setRoleKey(String roleKey) {
this.roleKey = roleKey;
}

public String getNamespace() {
return namespace;
}

public void setNamespace(String namespace) {
this.namespace = namespace;
}

public Boolean getApproval() {
return approval;
}

public void setApproval(Boolean approval) {
this.approval = approval;
}

public User getUser() {
return user;
}

public void setUser(User user) {
this.user = user;
}

public Role getRole() {
return role;
}

public void setRole(Role role) {
this.role = role;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.vip.saturn.job.console.mybatis.repository;

import com.vip.saturn.job.console.mybatis.entity.Permission;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
* @author hebelala
*/
@Repository
public interface PermissionRepository {

int insert(Permission permission);

List<Permission> selectAll();

Permission selectByKey(String key);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.vip.saturn.job.console.mybatis.repository;

import com.vip.saturn.job.console.mybatis.entity.RolePermission;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
* @author hebelala
*/
@Repository
public interface RolePermissionRepository {

int insert(RolePermission rolePermission);

List<RolePermission> selectAll();

List<RolePermission> selectByRoleKey(String roleKey);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.vip.saturn.job.console.mybatis.repository;

import com.vip.saturn.job.console.mybatis.entity.Role;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
* @author hebelala
*/
@Repository
public interface RoleRepository {

int insert(Role role);

List<Role> selectAll();

Role selectByKey(String key);

}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.vip.saturn.job.console.mybatis.repository;

import com.vip.saturn.job.console.mybatis.entity.User;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
* @author hebelala
*/
@Repository
public interface UserRepository {

int insert(User user);

int update(User user);

List<User> selectAll();

User select(String name);

User selectWithNotFilterDeleted(String name);

}
Loading

0 comments on commit f78acae

Please sign in to comment.