Skip to content

Commit 3331475

Browse files
committed
[add]添加domain dao service层
1 parent c008446 commit 3331475

25 files changed

+781
-40
lines changed

spring-boot-shiro/pom.xml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,39 @@
4545
<dependency>
4646
<groupId>mysql</groupId>
4747
<artifactId>mysql-connector-java</artifactId>
48-
<scope>runtime</scope>
48+
</dependency>
49+
<dependency>
50+
<groupId>com.alibaba</groupId>
51+
<artifactId>druid-spring-boot-starter</artifactId>
52+
<version>1.1.0</version>
4953
</dependency>
5054
<dependency>
5155
<groupId>org.apache.shiro</groupId>
5256
<artifactId>shiro-spring</artifactId>
5357
<version>1.4.0</version>
5458
</dependency>
59+
60+
<!-- mybatis -->
61+
<dependency>
62+
<groupId>org.mybatis.spring.boot</groupId>
63+
<artifactId>mybatis-spring-boot-starter</artifactId>
64+
<version>1.3.1</version>
65+
</dependency>
66+
67+
<!-- 通用mapper -->
68+
<dependency>
69+
<groupId>tk.mybatis</groupId>
70+
<artifactId>mapper-spring-boot-starter</artifactId>
71+
<version>1.1.5</version>
72+
</dependency>
73+
74+
<!-- pagehelper 分页插件 -->
75+
<dependency>
76+
<groupId>com.github.pagehelper</groupId>
77+
<artifactId>pagehelper-spring-boot-starter</artifactId>
78+
<version>1.2.3</version>
79+
</dependency>
80+
5581
<dependency>
5682
<groupId>org.springframework.boot</groupId>
5783
<artifactId>spring-boot-starter-test</artifactId>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package com.example.springbootshiro.dao;
2+
3+
import tk.mybatis.mapper.common.Mapper;
4+
import tk.mybatis.mapper.common.MySqlMapper;
5+
6+
/**
7+
* Created by Douglee on 2018/3/29.
8+
*/
9+
public interface CommonMapper<T> extends Mapper<T>, MySqlMapper<T> {
10+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package com.example.springbootshiro.dao;
2+
3+
import com.example.springbootshiro.domain.MenuInfo;
4+
5+
import java.util.List;
6+
7+
/**
8+
* Created by Douglee on 2018/3/29.
9+
*/
10+
public interface MenuMapper extends CommonMapper<MenuMapper> {
11+
12+
List<MenuInfo> findUserPermissions(String userName);
13+
14+
List<MenuInfo> findUserMenus(String userName);
15+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.example.springbootshiro.dao;
2+
3+
import com.example.springbootshiro.domain.RoleInfo;
4+
5+
import java.util.List;
6+
7+
/**
8+
* Created by Douglee on 2018/3/29.
9+
*/
10+
public interface RoleMapper extends CommonMapper<RoleInfo> {
11+
12+
List<RoleInfo> findUserRole(String userName);
13+
14+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package com.example.springbootshiro.dao;
2+
3+
import com.example.springbootshiro.domain.RoleMenu;
4+
5+
/**
6+
* Created by Douglee on 2018/3/29.
7+
*/
8+
public interface RoleMenuMapper extends CommonMapper<RoleMenu> {
9+
}

spring-boot-shiro/src/main/java/com/example/springbootshiro/dao/UserInfo.java

Lines changed: 0 additions & 30 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.example.springbootshiro.dao;
2+
3+
import com.example.springbootshiro.domain.UserInfo;
4+
5+
import java.util.List;
6+
7+
/**
8+
* Created by Douglee on 2018/3/29.
9+
*/
10+
public interface UserMapper extends CommonMapper<UserInfo> {
11+
12+
UserInfo findUserProfile(UserInfo user);
13+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package com.example.springbootshiro.dao;
2+
3+
import com.example.springbootshiro.domain.UserRole;
4+
5+
/**
6+
* Created by Douglee on 2018/3/29.
7+
*/
8+
public interface UserRoleMapper extends CommonMapper<UserRole> {
9+
}
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
package com.example.springbootshiro.domain;
2+
3+
import javax.persistence.Column;
4+
import javax.persistence.GeneratedValue;
5+
import javax.persistence.Id;
6+
import javax.persistence.Table;
7+
import java.io.Serializable;
8+
import java.util.Date;
9+
10+
/**
11+
* Created by Douglee on 2018/3/29.
12+
*/
13+
@Table(name = "T_MENU")
14+
public class MenuInfo implements Serializable {
15+
private static final long serialVersionUID = 5653758334711519506L;
16+
17+
@Id
18+
@GeneratedValue(generator = "JDBC")
19+
@Column(name = "MENU_ID")
20+
private Long menuId;
21+
22+
@Column(name = "PARENT_ID")
23+
private Long parentId;
24+
25+
@Column(name = "MENU_NAME")
26+
private String menuName;
27+
28+
@Column(name = "URL")
29+
private String url;
30+
31+
@Column(name = "PERMS")
32+
private String perms;
33+
34+
@Column(name = "TYPE")
35+
private String type;
36+
37+
@Column(name = "ORDER_NUM")
38+
private Long orderNum;
39+
40+
@Column(name = "CREATE_TIME")
41+
private Date createTime;
42+
43+
@Column(name = "MODIFY_TIME")
44+
private Date modifyTime;
45+
46+
public Long getMenuId() {
47+
return menuId;
48+
}
49+
50+
public void setMenuId(Long menuId) {
51+
this.menuId = menuId;
52+
}
53+
54+
public Long getParentId() {
55+
return parentId;
56+
}
57+
58+
public void setParentId(Long parentId) {
59+
this.parentId = parentId;
60+
}
61+
62+
public String getMenuName() {
63+
return menuName;
64+
}
65+
66+
public void setMenuName(String menuName) {
67+
this.menuName = menuName;
68+
}
69+
70+
public String getUrl() {
71+
return url;
72+
}
73+
74+
public void setUrl(String url) {
75+
this.url = url;
76+
}
77+
78+
public String getPerms() {
79+
return perms;
80+
}
81+
82+
public void setPerms(String perms) {
83+
this.perms = perms;
84+
}
85+
86+
public String getType() {
87+
return type;
88+
}
89+
90+
public void setType(String type) {
91+
this.type = type;
92+
}
93+
94+
public Long getOrderNum() {
95+
return orderNum;
96+
}
97+
98+
public void setOrderNum(Long orderNum) {
99+
this.orderNum = orderNum;
100+
}
101+
102+
public Date getCreateTime() {
103+
return createTime;
104+
}
105+
106+
public void setCreateTime(Date createTime) {
107+
this.createTime = createTime;
108+
}
109+
110+
public Date getModifyTime() {
111+
return modifyTime;
112+
}
113+
114+
public void setModifyTime(Date modifyTime) {
115+
this.modifyTime = modifyTime;
116+
}
117+
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
package com.example.springbootshiro.domain;
2+
3+
import javax.persistence.Column;
4+
import javax.persistence.GeneratedValue;
5+
import javax.persistence.Id;
6+
import javax.persistence.Table;
7+
import java.io.Serializable;
8+
import java.util.Date;
9+
10+
/**
11+
* Created by Douglee on 2018/3/29.
12+
*/
13+
@Table(name = "T_ROLE")
14+
public class RoleInfo implements Serializable {
15+
private static final long serialVersionUID = 96520525244968811L;
16+
17+
@Id
18+
@GeneratedValue(generator = "JDBC")
19+
@Column(name = "ROLE_ID")
20+
private Long roleId;
21+
22+
@Column(name = "ROLE_NAME")
23+
private String roleName;
24+
25+
@Column(name = "REMARK")
26+
private String remark;
27+
28+
@Column(name = "CREATE_TIME")
29+
private Date createTime;
30+
31+
@Column(name = "MODIFY_TIME")
32+
private Date modifyTime;
33+
34+
public Long getRoleId() {
35+
return roleId;
36+
}
37+
38+
public void setRoleId(Long roleId) {
39+
this.roleId = roleId;
40+
}
41+
42+
public String getRoleName() {
43+
return roleName;
44+
}
45+
46+
public void setRoleName(String roleName) {
47+
this.roleName = roleName;
48+
}
49+
50+
public String getRemark() {
51+
return remark;
52+
}
53+
54+
public void setRemark(String remark) {
55+
this.remark = remark;
56+
}
57+
58+
public Date getCreateTime() {
59+
return createTime;
60+
}
61+
62+
public void setCreateTime(Date createTime) {
63+
this.createTime = createTime;
64+
}
65+
66+
public Date getModifyTime() {
67+
return modifyTime;
68+
}
69+
70+
public void setModifyTime(Date modifyTime) {
71+
this.modifyTime = modifyTime;
72+
}
73+
}

0 commit comments

Comments
 (0)