update
This commit is contained in:
parent
8f4f2c78e8
commit
94f625f47b
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "xzs-admin",
|
||||
"version": "3.0.7",
|
||||
"author": "武汉思维跳跃科技",
|
||||
"author": "武汉思维跳跃科技有限公司",
|
||||
"description": "学之思管理系统",
|
||||
"license": "AGPL-3.0",
|
||||
"private": true,
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "xzs-student",
|
||||
"version": "3.0.7",
|
||||
"author": "武汉思维跳跃科技",
|
||||
"author": "武汉思维跳跃科技有限公司",
|
||||
"description": "学之思考试系统",
|
||||
"license": "AGPL-3.0",
|
||||
"private": true,
|
||||
|
@ -9,7 +9,7 @@
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>xzs</name>
|
||||
<description>武汉思维跳跃科技-学之思考试系统</description>
|
||||
<description>学之思考试系统 - 武汉思维跳跃科技有限公司</description>
|
||||
|
||||
|
||||
<properties>
|
||||
|
@ -8,7 +8,7 @@ import org.springframework.cache.annotation.EnableCaching;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
|
||||
/**
|
||||
* @author alvis
|
||||
* @author 武汉思维跳跃科技有限公司
|
||||
*/
|
||||
@SpringBootApplication
|
||||
@EnableTransactionManagement
|
||||
|
@ -8,7 +8,7 @@ import org.modelmapper.ModelMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
/**
|
||||
* @author alvis
|
||||
* @author 武汉思维跳跃科技有限公司
|
||||
*/
|
||||
public class BaseApiController {
|
||||
protected final static String DEFAULT_PAGE_SIZE = "10";
|
||||
|
@ -2,7 +2,7 @@ package com.mindskip.xzs.base;
|
||||
|
||||
|
||||
/**
|
||||
* @author alvis
|
||||
* @author 武汉思维跳跃科技有限公司
|
||||
*/
|
||||
public abstract class BaseEntity {
|
||||
|
||||
|
@ -3,7 +3,7 @@ package com.mindskip.xzs.base;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author alvis
|
||||
* @author 武汉思维跳跃科技有限公司
|
||||
*/
|
||||
|
||||
@Data
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.mindskip.xzs.base;
|
||||
|
||||
/**
|
||||
* @author alvis
|
||||
* @author 武汉思维跳跃科技有限公司
|
||||
*/
|
||||
public class RestResponse<T> {
|
||||
private int code;
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.mindskip.xzs.base;
|
||||
|
||||
/**
|
||||
* @author alvis
|
||||
* @author 武汉思维跳跃科技有限公司
|
||||
*/
|
||||
public enum SystemCode {
|
||||
/**
|
||||
|
@ -6,7 +6,7 @@ import org.springframework.context.ApplicationContextAware;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author alvis
|
||||
* @author 武汉思维跳跃科技有限公司
|
||||
*/
|
||||
@Component
|
||||
public class ApplicationContextProvider implements ApplicationContextAware {
|
||||
|
@ -7,7 +7,7 @@ import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @author alvis
|
||||
* @author 武汉思维跳跃科技有限公司
|
||||
*/
|
||||
@ConfigurationProperties(prefix = "system")
|
||||
@Data
|
||||
|
@ -10,7 +10,7 @@ import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @author alvis
|
||||
* @author 武汉思维跳跃科技有限公司
|
||||
*/
|
||||
|
||||
@Configuration
|
||||
|
@ -3,7 +3,7 @@ package com.mindskip.xzs.configuration.spring.security;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author alvis
|
||||
* @author 武汉思维跳跃科技有限公司
|
||||
*/
|
||||
|
||||
@Data
|
||||
|
@ -12,7 +12,7 @@ import java.io.IOException;
|
||||
|
||||
/**
|
||||
* 未登录
|
||||
* @author alvis
|
||||
* @author 武汉思维跳跃科技有限公司
|
||||
*/
|
||||
@Component
|
||||
public final class LoginAuthenticationEntryPoint extends LoginUrlAuthenticationEntryPoint {
|
||||
|
@ -12,7 +12,7 @@ import java.io.IOException;
|
||||
|
||||
/**
|
||||
* 账号验证异常
|
||||
* @author alvis
|
||||
* @author 武汉思维跳跃科技有限公司
|
||||
*/
|
||||
@Component
|
||||
public class RestAuthenticationFailureHandler extends SimpleUrlAuthenticationFailureHandler {
|
||||
|
@ -24,9 +24,8 @@ import java.util.ArrayList;
|
||||
/**
|
||||
* 登录用户名密码验证
|
||||
*
|
||||
* @author : Alvis
|
||||
* @author : 武汉思维跳跃科技有限公司
|
||||
* Description : 身份验证
|
||||
* Creation Date: 2018-05-02 5:00 PM
|
||||
*/
|
||||
|
||||
@Component
|
||||
|
@ -20,7 +20,7 @@ import java.util.Date;
|
||||
/**
|
||||
* 登录成功返回
|
||||
*
|
||||
* @author alvis
|
||||
* @author 武汉思维跳跃科技有限公司
|
||||
*/
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
|
@ -14,9 +14,8 @@ import org.springframework.stereotype.Component;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* @author : Alvis
|
||||
* @author : 武汉思维跳跃科技有限公司
|
||||
* Description : 验证通过之后,第二、三...请求,会调用此类
|
||||
* Creation Date: 2018-05-02 4:32 PM
|
||||
*/
|
||||
|
||||
@Component
|
||||
|
@ -19,7 +19,7 @@ import java.io.InputStream;
|
||||
|
||||
/**
|
||||
* 登录参数序列化
|
||||
* @author alvis
|
||||
* @author 武汉思维跳跃科技有限公司
|
||||
*/
|
||||
|
||||
public class RestLoginAuthenticationFilter extends AbstractAuthenticationProcessingFilter {
|
||||
|
@ -18,7 +18,7 @@ import java.util.Date;
|
||||
/**
|
||||
* 用户登出
|
||||
*
|
||||
* @author alvis
|
||||
* @author 武汉思维跳跃科技有限公司
|
||||
*/
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
|
@ -7,7 +7,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* 记住我,Cookie
|
||||
* @author alvis
|
||||
* @author 武汉思维跳跃科技有限公司
|
||||
*/
|
||||
public class RestTokenBasedRememberMeServices extends TokenBasedRememberMeServices {
|
||||
public RestTokenBasedRememberMeServices(String key, UserDetailsService userDetailsService) {
|
||||
|
@ -10,7 +10,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* @author alvis
|
||||
* @author 武汉思维跳跃科技有限公司
|
||||
*/
|
||||
public class RestUtil {
|
||||
private static final Logger logger = LoggerFactory.getLogger(RestUtil.class);
|
||||
|
@ -19,7 +19,7 @@ import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @author alvis
|
||||
* @author 武汉思维跳跃科技有限公司
|
||||
*/
|
||||
|
||||
@Configuration
|
||||
|
@ -26,7 +26,7 @@ import java.util.UUID;
|
||||
|
||||
|
||||
/**
|
||||
* @author alvis
|
||||
* @author 武汉思维跳跃科技有限公司
|
||||
*/
|
||||
@RestController("AdminUserController")
|
||||
@RequestMapping(value = "/api/admin/user")
|
||||
|
@ -31,7 +31,7 @@ import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
* @author alvis
|
||||
* @author 武汉思维跳跃科技有限公司
|
||||
*/
|
||||
@RestController("StudentUserController")
|
||||
@RequestMapping(value = "/api/student/user")
|
||||
|
@ -32,7 +32,7 @@ import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
* @author alvis
|
||||
* @author 武汉思维跳跃科技有限公司
|
||||
*/
|
||||
@Controller("WXStudentUserController")
|
||||
@RequestMapping(value = "/api/wx/student/user")
|
||||
|
@ -4,7 +4,7 @@ import com.mindskip.xzs.domain.ExamPaperAnswerInfo;
|
||||
import org.springframework.context.ApplicationEvent;
|
||||
|
||||
/**
|
||||
* @author alvis
|
||||
* @author 武汉思维跳跃科技有限公司
|
||||
*/
|
||||
public class CalculateExamPaperAnswerCompleteEvent extends ApplicationEvent {
|
||||
|
||||
|
@ -4,7 +4,7 @@ import com.mindskip.xzs.domain.User;
|
||||
import org.springframework.context.ApplicationEvent;
|
||||
|
||||
/**
|
||||
* @author alvis
|
||||
* @author 武汉思维跳跃科技有限公司
|
||||
*/
|
||||
public class OnRegistrationCompleteEvent extends ApplicationEvent {
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.mindskip.xzs.exception;
|
||||
|
||||
/**
|
||||
* @author alvis
|
||||
* @author 武汉思维跳跃科技有限公司
|
||||
*/
|
||||
public class BusinessException extends RuntimeException {
|
||||
|
||||
|
@ -19,7 +19,7 @@ import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @author alvis
|
||||
* @author 武汉思维跳跃科技有限公司
|
||||
*/
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
|
@ -8,7 +8,7 @@ import org.springframework.stereotype.Component;
|
||||
|
||||
|
||||
/**
|
||||
* @author alvis
|
||||
* @author 武汉思维跳跃科技有限公司
|
||||
*/
|
||||
@Component
|
||||
public class EmailSendListener implements ApplicationListener<OnRegistrationCompleteEvent> {
|
||||
|
@ -10,7 +10,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author alvis
|
||||
* @author 武汉思维跳跃科技有限公司
|
||||
*/
|
||||
|
||||
@Mapper
|
||||
|
@ -3,7 +3,7 @@ package com.mindskip.xzs.service;
|
||||
import com.mindskip.xzs.domain.User;
|
||||
|
||||
/**
|
||||
* @author alvis
|
||||
* @author 武汉思维跳跃科技有限公司
|
||||
*/
|
||||
public interface AuthenticationService {
|
||||
|
||||
|
@ -8,7 +8,7 @@ import com.github.pagehelper.PageInfo;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author alvis
|
||||
* @author 武汉思维跳跃科技有限公司
|
||||
*/
|
||||
public interface UserService extends BaseService<User> {
|
||||
|
||||
|
@ -9,7 +9,7 @@ import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author alvis
|
||||
* @author 武汉思维跳跃科技有限公司
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
|
@ -21,7 +21,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author alvis
|
||||
* @author 武汉思维跳跃科技有限公司
|
||||
*/
|
||||
@Service
|
||||
public class UserServiceImpl extends BaseServiceImpl<User> implements UserService {
|
||||
|
@ -10,7 +10,7 @@ import java.time.Duration;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author alvis
|
||||
* @author 武汉思维跳跃科技有限公司
|
||||
*/
|
||||
public class DateTimeUtil {
|
||||
|
||||
|
@ -11,7 +11,7 @@ import java.security.NoSuchAlgorithmException;
|
||||
|
||||
|
||||
/**
|
||||
* @author alvis
|
||||
* @author 武汉思维跳跃科技有限公司
|
||||
*/
|
||||
public class Md5Util {
|
||||
|
||||
|
@ -6,7 +6,7 @@ import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author alvis
|
||||
* @author 武汉思维跳跃科技有限公司
|
||||
*/
|
||||
public class PageInfoHelper {
|
||||
|
||||
|
@ -13,7 +13,7 @@ import java.util.Base64;
|
||||
|
||||
|
||||
/**
|
||||
* @author alvis
|
||||
* @author 武汉思维跳跃科技有限公司
|
||||
*/
|
||||
public class RsaUtil {
|
||||
/**
|
||||
|
@ -5,7 +5,7 @@ import lombok.Data;
|
||||
import org.modelmapper.ModelMapper;
|
||||
|
||||
/**
|
||||
* @author alvis
|
||||
* @author 武汉思维跳跃科技有限公司
|
||||
*/
|
||||
|
||||
@Data
|
||||
|
@ -4,7 +4,7 @@ import com.mindskip.xzs.base.BasePage;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author alvis
|
||||
* @author 武汉思维跳跃科技有限公司
|
||||
*/
|
||||
|
||||
@Data
|
||||
|
@ -4,7 +4,7 @@ import com.mindskip.xzs.base.BasePage;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author alvis
|
||||
* @author 武汉思维跳跃科技有限公司
|
||||
*/
|
||||
|
||||
@Data
|
||||
|
@ -6,7 +6,7 @@ import com.mindskip.xzs.viewmodel.BaseVM;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author alvis
|
||||
* @author 武汉思维跳跃科技有限公司
|
||||
*/
|
||||
|
||||
@Data
|
||||
|
@ -6,7 +6,7 @@ import com.mindskip.xzs.viewmodel.BaseVM;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author alvis
|
||||
* @author 武汉思维跳跃科技有限公司
|
||||
*/
|
||||
|
||||
@Data
|
||||
|
@ -1,17 +0,0 @@
|
||||
package com.mindskip.xzs;
|
||||
|
||||
import com.mindskip.xzs.configuration.property.SystemConfig;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableTransactionManagement
|
||||
@EnableConfigurationProperties(value = { SystemConfig.class})
|
||||
public class XzsApplicationTests {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(XzsApplicationTests.class, args);
|
||||
}
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
package com.mindskip.xzs.module;
|
||||
|
||||
import com.mindskip.xzs.XzsApplicationTests;
|
||||
import com.mindskip.xzs.service.ExamPaperService;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = XzsApplicationTests.class)
|
||||
public class IndexTests {
|
||||
|
||||
@Autowired
|
||||
private ExamPaperService examPaperService;
|
||||
|
||||
@Test
|
||||
public void sumTest() {
|
||||
Integer count = examPaperService.selectAllCount();
|
||||
List<Integer> kv = examPaperService.selectMothCount();
|
||||
System.out.print(kv);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
package com.mindskip.xzs.module;
|
||||
|
||||
import com.mindskip.xzs.XzsApplicationTests;
|
||||
import com.mindskip.xzs.domain.User;
|
||||
import com.mindskip.xzs.service.UserService;
|
||||
import com.mindskip.xzs.viewmodel.admin.user.UserPageRequestVM;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = XzsApplicationTests.class)
|
||||
public class UserTests {
|
||||
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
|
||||
@Test
|
||||
public void userPageListTest() {
|
||||
User user = userService.getUserById(2);
|
||||
UserPageRequestVM requestVM = new UserPageRequestVM();
|
||||
requestVM.setUserName("李");
|
||||
requestVM.setPageIndex(0);
|
||||
requestVM.setPageSize(2);
|
||||
PageInfo<User> pageInfo = userService.userPage(requestVM);
|
||||
Assert.assertNotEquals(0, pageInfo.getTotal());
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
package com.mindskip.xzs.utility;
|
||||
|
||||
import com.mindskip.xzs.XzsApplicationTests;
|
||||
import com.mindskip.xzs.configuration.property.SystemConfig;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = XzsApplicationTests.class)
|
||||
public class RSATests {
|
||||
|
||||
@Autowired
|
||||
private SystemConfig systemConfig;
|
||||
|
||||
@Test
|
||||
public void rsaTest() {
|
||||
String pwd = "123456";
|
||||
String encodeStr = RsaUtil.rsaEncode(systemConfig.getPwdKey().getPublicKey(), pwd);
|
||||
String decodeStr = RsaUtil.rsaDecode(systemConfig.getPwdKey().getPrivateKey(), encodeStr);
|
||||
Assert.assertEquals(pwd, decodeStr);
|
||||
}
|
||||
|
||||
}
|
@ -1,80 +0,0 @@
|
||||
package com.mindskip.xzs.utility;
|
||||
|
||||
import com.mindskip.xzs.XzsApplicationTests;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.data.redis.core.script.DefaultRedisScript;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = XzsApplicationTests.class)
|
||||
public class RedisTests {
|
||||
|
||||
private final Logger logger = LoggerFactory.getLogger(RedisTests.class);
|
||||
|
||||
@Autowired
|
||||
private StringRedisTemplate stringRedisTemplate;
|
||||
|
||||
@Test
|
||||
public void redisAddTest() {
|
||||
stringRedisTemplate.opsForValue().set("apple", "0");
|
||||
stringRedisTemplate.opsForValue().set("100000:apple", "0");
|
||||
stringRedisTemplate.opsForValue().set("100000:apple:red", "0");
|
||||
stringRedisTemplate.opsForHash().put("100000:people","name","alvis");
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void redisListTest() {
|
||||
stringRedisTemplate.opsForList().rightPush("alvis_list", "apple");
|
||||
stringRedisTemplate.opsForList().rightPush("alvis_list", "oragene");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void redisLuaTest() {
|
||||
String script = "return redis.call('set',KEYS[1],ARGV[1])";
|
||||
DefaultRedisScript<String> redisScript = new DefaultRedisScript<>(script);
|
||||
redisScript.setResultType(String.class);
|
||||
List<String> keys = Arrays.asList("apple");
|
||||
String result = stringRedisTemplate.execute(redisScript, keys, "1");
|
||||
Assert.assertEquals("OK", result);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void redisAtomicTest() {
|
||||
IntStream.rangeClosed(1, 1000).forEach(i -> {
|
||||
Random rand = new Random(i);
|
||||
new Thread(() -> {
|
||||
stringRedisTemplate.opsForValue().increment("apple", 2);
|
||||
threadSleep(rand.nextInt(i));
|
||||
}).start();
|
||||
new Thread(() -> {
|
||||
stringRedisTemplate.opsForValue().decrement("apple", 2);
|
||||
threadSleep(rand.nextInt(i));
|
||||
}).start();
|
||||
});
|
||||
|
||||
threadSleep(Integer.MAX_VALUE);
|
||||
}
|
||||
|
||||
private void threadSleep(Integer i) {
|
||||
try {
|
||||
TimeUnit.MILLISECONDS.sleep(i);
|
||||
} catch (InterruptedException e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user