Commit 83dc7f8a authored by zhengjie's avatar zhengjie
Browse files

优化user列表中的岗位DTO,修改@author信息,新增验证码登录

parent c01435a0
...@@ -6,7 +6,7 @@ import java.io.Serializable; ...@@ -6,7 +6,7 @@ import java.io.Serializable;
import java.sql.Timestamp; import java.sql.Timestamp;
/** /**
* @author jie * @author Zheng Jie
* @date 2019-5-22 * @date 2019-5-22
*/ */
@Data @Data
......
...@@ -21,7 +21,7 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -21,7 +21,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.lang.reflect.Method; import java.lang.reflect.Method;
/** /**
* @author jie * @author Zheng Jie
* @date 2018-11-24 * @date 2018-11-24
*/ */
@Service @Service
......
...@@ -7,7 +7,7 @@ import org.mapstruct.Mapper; ...@@ -7,7 +7,7 @@ import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy; import org.mapstruct.ReportingPolicy;
/** /**
* @author jie * @author Zheng Jie
* @date 2019-5-22 * @date 2019-5-22
*/ */
@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) @Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE)
......
...@@ -7,7 +7,7 @@ import org.mapstruct.Mapper; ...@@ -7,7 +7,7 @@ import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy; import org.mapstruct.ReportingPolicy;
/** /**
* @author jie * @author Zheng Jie
* @date 2019-5-22 * @date 2019-5-22
*/ */
@Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE) @Mapper(componentModel = "spring",uses = {},unmappedTargetPolicy = ReportingPolicy.IGNORE)
......
...@@ -15,8 +15,22 @@ ...@@ -15,8 +15,22 @@
<jjwt.version>0.9.1</jjwt.version> <jjwt.version>0.9.1</jjwt.version>
</properties> </properties>
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies> <dependencies>
<!-- 验证码 -->
<dependency>
<groupId>com.github.whvcse</groupId>
<artifactId>EasyCaptcha</artifactId>
<version>1.5.0</version>
</dependency>
<dependency> <dependency>
<groupId>me.zhengjie</groupId> <groupId>me.zhengjie</groupId>
<artifactId>eladmin-generator</artifactId> <artifactId>eladmin-generator</artifactId>
......
...@@ -8,7 +8,7 @@ import org.springframework.scheduling.annotation.EnableAsync; ...@@ -8,7 +8,7 @@ import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.transaction.annotation.EnableTransactionManagement;
/** /**
* @author jie * @author Zheng Jie
* @date 2018/11/15 9:20:19 * @date 2018/11/15 9:20:19
*/ */
@EnableAsync @EnableAsync
......
...@@ -18,7 +18,7 @@ import java.util.List; ...@@ -18,7 +18,7 @@ import java.util.List;
/** /**
* WebMvcConfigurer * WebMvcConfigurer
* *
* @author jie * @author Zheng Jie
* @date 2018-11-30 * @date 2018-11-30
*/ */
@Configuration @Configuration
......
...@@ -17,7 +17,7 @@ import java.util.Set; ...@@ -17,7 +17,7 @@ import java.util.Set;
/** /**
* 数据权限配置 * 数据权限配置
* @author jie * @author Zheng Jie
* @date 2019-4-1 * @date 2019-4-1
*/ */
@Component @Component
......
...@@ -8,7 +8,7 @@ import org.springframework.stereotype.Component; ...@@ -8,7 +8,7 @@ import org.springframework.stereotype.Component;
/** /**
* 初始化站点统计 * 初始化站点统计
* @author jie * @author Zheng Jie
*/ */
@Component @Component
public class VisitsInitialization implements ApplicationRunner { public class VisitsInitialization implements ApplicationRunner {
......
...@@ -9,7 +9,7 @@ import java.sql.Timestamp; ...@@ -9,7 +9,7 @@ import java.sql.Timestamp;
/** /**
* pv 与 ip 统计 * pv 与 ip 统计
* *
* @author jie * @author Zheng Jie
* @date 2018-12-13 * @date 2018-12-13
*/ */
@Entity @Entity
......
...@@ -8,7 +8,7 @@ import javax.validation.constraints.NotBlank; ...@@ -8,7 +8,7 @@ import javax.validation.constraints.NotBlank;
import java.io.Serializable; import java.io.Serializable;
/** /**
* @author jie * @author Zheng Jie
* @date 2018-12-10 * @date 2018-12-10
*/ */
@Data @Data
......
...@@ -8,7 +8,7 @@ import org.springframework.stereotype.Repository; ...@@ -8,7 +8,7 @@ import org.springframework.stereotype.Repository;
import java.util.List; import java.util.List;
/** /**
* @author jie * @author Zheng Jie
* @date 2018-12-13 * @date 2018-12-13
*/ */
@Repository @Repository
......
...@@ -12,7 +12,7 @@ import org.springframework.validation.annotation.Validated; ...@@ -12,7 +12,7 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
/** /**
* @author jie * @author Zheng Jie
* @date 2018-12-10 * @date 2018-12-10
*/ */
@RestController @RestController
......
...@@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
/** /**
* @author jie * @author Zheng Jie
* @date 2018-12-13 * @date 2018-12-13
*/ */
@RestController @RestController
......
...@@ -6,7 +6,7 @@ import org.springframework.data.domain.Pageable; ...@@ -6,7 +6,7 @@ import org.springframework.data.domain.Pageable;
/** /**
* 可自行扩展 * 可自行扩展
* @author jie * @author Zheng Jie
* @date 2018-12-10 * @date 2018-12-10
*/ */
public interface RedisService { public interface RedisService {
...@@ -16,16 +16,30 @@ public interface RedisService { ...@@ -16,16 +16,30 @@ public interface RedisService {
* @param key * @param key
* @return * @return
*/ */
public Page findByKey(String key, Pageable pageable); Page findByKey(String key, Pageable pageable);
/**
* 查询验证码的值
* @param key
* @return
*/
String getCodeVal(String key);
/**
* 保存验证码
* @param key
* @param val
*/
void saveCode(String key, Object val);
/** /**
* delete * delete
* @param key * @param key
*/ */
public void delete(String key); void delete(String key);
/** /**
* 清空所有缓存 * 清空所有缓存
*/ */
public void flushdb(); void flushdb();
} }
...@@ -5,7 +5,7 @@ import org.springframework.scheduling.annotation.Async; ...@@ -5,7 +5,7 @@ import org.springframework.scheduling.annotation.Async;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
/** /**
* @author jie * @author Zheng Jie
* @date 2018-12-13 * @date 2018-12-13
*/ */
public interface VisitsService { public interface VisitsService {
......
...@@ -13,7 +13,7 @@ import java.util.ArrayList; ...@@ -13,7 +13,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
* @author jie * @author Zheng Jie
* @date 2018-12-10 * @date 2018-12-10
*/ */
@Service @Service
...@@ -23,7 +23,7 @@ public class RedisServiceImpl implements RedisService { ...@@ -23,7 +23,7 @@ public class RedisServiceImpl implements RedisService {
RedisTemplate redisTemplate; RedisTemplate redisTemplate;
@Override @Override
public Page findByKey(String key, Pageable pageable){ public Page<RedisVo> findByKey(String key, Pageable pageable){
List<RedisVo> redisVos = new ArrayList<>(); List<RedisVo> redisVos = new ArrayList<>();
if(!key.equals("*")){ if(!key.equals("*")){
key = "*" + key + "*"; key = "*" + key + "*";
...@@ -43,6 +43,8 @@ public class RedisServiceImpl implements RedisService { ...@@ -43,6 +43,8 @@ public class RedisServiceImpl implements RedisService {
return page; return page;
} }
@Override @Override
public void delete(String key) { public void delete(String key) {
redisTemplate.delete(key); redisTemplate.delete(key);
...@@ -51,6 +53,20 @@ public class RedisServiceImpl implements RedisService { ...@@ -51,6 +53,20 @@ public class RedisServiceImpl implements RedisService {
@Override @Override
public void flushdb() { public void flushdb() {
redisTemplate.getConnectionFactory().getConnection().flushDb(); redisTemplate.getConnectionFactory().getConnection().flushDb();
}
@Override
public String getCodeVal(String key) {
try {
String value = redisTemplate.opsForValue().get(key).toString();
return value;
}catch (Exception e){
return "";
}
}
@Override
public void saveCode(String key, Object val) {
redisTemplate.opsForValue().set(key,val,2000);
} }
} }
...@@ -18,7 +18,7 @@ import java.util.Map; ...@@ -18,7 +18,7 @@ import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
* @author jie * @author Zheng Jie
* @date 2018-12-13 * @date 2018-12-13
*/ */
@Slf4j @Slf4j
......
...@@ -11,7 +11,7 @@ import org.springframework.stereotype.Component; ...@@ -11,7 +11,7 @@ import org.springframework.stereotype.Component;
import java.util.List; import java.util.List;
/** /**
* @author jie * @author Zheng Jie
* @date 2019-01-07 * @date 2019-01-07
*/ */
@Component @Component
......
...@@ -10,7 +10,7 @@ import java.io.Serializable; ...@@ -10,7 +10,7 @@ import java.io.Serializable;
import java.sql.Timestamp; import java.sql.Timestamp;
/** /**
* @author jie * @author Zheng Jie
* @date 2019-01-07 * @date 2019-01-07
*/ */
@Data @Data
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment