-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
45 changed files
with
20,763 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package cache; | ||
|
||
/** | ||
* Created by xuweijie on 2017/3/7. | ||
*/ | ||
public class cachedemo { | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package dao; | ||
|
||
import entity.User; | ||
import org.apache.ibatis.annotations.Param; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* Created by xuweijie on 2017/3/7. | ||
*/ | ||
public interface ShiroUserDao { | ||
public User queryByName(String username); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
package entity; | ||
|
||
/** | ||
* Created by xuweijie on 2017/3/7. | ||
*/ | ||
public class User { | ||
private int id; | ||
private String username; | ||
private String password; | ||
private String salt; | ||
private String sex; | ||
private String age; | ||
private String address; | ||
|
||
public int getId() { | ||
return id; | ||
} | ||
|
||
public void setId(int id) { | ||
this.id = id; | ||
} | ||
|
||
public String getUsername() { | ||
return username; | ||
} | ||
|
||
public void setUsername(String username) { | ||
this.username = username; | ||
} | ||
|
||
public String getPassword() { | ||
return password; | ||
} | ||
|
||
public void setPassword(String password) { | ||
this.password = password; | ||
} | ||
|
||
public String getSalt() { | ||
return salt; | ||
} | ||
|
||
public void setSalt(String salt) { | ||
this.salt = salt; | ||
} | ||
|
||
public String getSex() { | ||
return sex; | ||
} | ||
|
||
public void setSex(String sex) { | ||
this.sex = sex; | ||
} | ||
|
||
public String getAge() { | ||
return age; | ||
} | ||
|
||
public void setAge(String age) { | ||
this.age = age; | ||
} | ||
|
||
public String getAddress() { | ||
return address; | ||
} | ||
|
||
public void setAddress(String address) { | ||
this.address = address; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "User{" + | ||
"id=" + id + | ||
", username='" + username + '\'' + | ||
", password='" + password + '\'' + | ||
", salt='" + salt + '\'' + | ||
", sex='" + sex + '\'' + | ||
", age='" + age + '\'' + | ||
", address='" + address + '\'' + | ||
'}'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package exception; | ||
|
||
/** | ||
* Created by xuweijie on 2017/3/3. | ||
* 异常处理公共类 | ||
*/ | ||
public class CustomException extends Exception { | ||
//异常信息 | ||
private String message; | ||
|
||
public CustomException(String message) { | ||
super(message); | ||
this.message = message; | ||
} | ||
|
||
@Override | ||
public String getMessage() { | ||
return message; | ||
} | ||
|
||
public void setMessage(String message) { | ||
this.message = message; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package service; | ||
|
||
import entity.User; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* 认证授权服务接口 | ||
* Created by xuweijie on 2017/3/3. | ||
*/ | ||
public interface ShiroUserService { | ||
public User queryUser(String username); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package service.impl; | ||
|
||
import dao.ShiroUserDao; | ||
import entity.User; | ||
import org.apache.shiro.authc.LockedAccountException; | ||
import org.apache.shiro.authc.UnknownAccountException; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Service; | ||
import org.springframework.transaction.annotation.Transactional; | ||
import service.ShiroUserService; | ||
import util.MD5Util; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* Created by xuweijie on 2017/3/6. | ||
*/ | ||
@Service | ||
public class ShiroUserServiceImpl implements ShiroUserService { | ||
|
||
@Autowired | ||
private ShiroUserDao userDao; | ||
|
||
public User queryUser(String username) { | ||
return userDao.queryByName(username); | ||
} | ||
} |
Oops, something went wrong.