Here are the examples of the java api org.springframework.util.StopWatch taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
229 Examples
19
View Source File : AspectJAutoProxyCreatorTests.java
License : MIT License
Project Creator : Vip-Augus
License : MIT License
Project Creator : Vip-Augus
private void replacedertStopWatchTimeLimit(final StopWatch sw, final long maxTimeMillis) {
long totalTimeMillis = sw.getTotalTimeMillis();
replacedertTrue("'" + sw.getLastTaskName() + "' took too long: expected less than<" + maxTimeMillis + "> ms, actual<" + totalTimeMillis + "> ms.", totalTimeMillis < maxTimeMillis);
}
19
View Source File : AspectJAutoProxyCreatorTests.java
License : Apache License 2.0
Project Creator : SourceHot
License : Apache License 2.0
Project Creator : SourceHot
private void replacedertStopWatchTimeLimit(final StopWatch sw, final long maxTimeMillis) {
long totalTimeMillis = sw.getTotalTimeMillis();
replacedertThat(totalTimeMillis < maxTimeMillis).as("'" + sw.getLastTaskName() + "' took too long: expected less than<" + maxTimeMillis + "> ms, actual<" + totalTimeMillis + "> ms.").isTrue();
}
19
View Source File : StopWatchPrettyPrint.java
License : Apache License 2.0
Project Creator : picturesafe
License : Apache License 2.0
Project Creator : picturesafe
public clreplaced StopWatchPrettyPrint {
private final StopWatch stopWatch;
public StopWatchPrettyPrint(StopWatch stopWatch) {
this.stopWatch = stopWatch;
}
@Override
public String toString() {
return (stopWatch != null) ? stopWatch.prettyPrint() : null;
}
}
19
View Source File : ElasticsearchServiceImpl.java
License : Apache License 2.0
Project Creator : picturesafe
License : Apache License 2.0
Project Creator : picturesafe
protected SearchResultDto getElasticsearchResult(InternalSearchContext context) {
final StopWatch sw = new StopWatch();
try {
return getElasticsearchResult(context, sw);
} finally {
LOGGER.debug("Performed search on index '{}':\n{}", context.indexPresetConfiguration.getIndexAlias(), new StopWatchPrettyPrint(sw));
}
}
19
View Source File : AspectJAutoProxyCreatorTests.java
License : Apache License 2.0
Project Creator : langtianya
License : Apache License 2.0
Project Creator : langtianya
private static void replacedertStopWatchTimeLimit(final StopWatch sw, final long maxTimeMillis) {
final long totalTimeMillis = sw.getTotalTimeMillis();
replacedertTrue("'" + sw.getLastTaskName() + "' took too long: expected less than<" + maxTimeMillis + "> ms, actual<" + totalTimeMillis + "> ms.", totalTimeMillis < maxTimeMillis);
}
19
View Source File : LoggingAspect.java
License : Apache License 2.0
Project Creator : jakubnabrdalik
License : Apache License 2.0
Project Creator : jakubnabrdalik
private String createTimerString(StopWatch stopWatch) {
long millis = stopWatch.getTotalTimeMillis();
return format(" [%d ms]", millis);
}
19
View Source File : JobThreadAspect.java
License : Apache License 2.0
Project Creator : 734839030
License : Apache License 2.0
Project Creator : 734839030
// 定义一个切入点
@Before("anyMethod()")
public void before() {
NDCUtils.push();
StopWatch watch = new StopWatch();
watch.start();
threadLocal.set(watch);
}
19
View Source File : JobInvokeMonitorAspect.java
License : Apache License 2.0
Project Creator : 360jinrong
License : Apache License 2.0
Project Creator : 360jinrong
protected StopWatch getStopWatchAndStart() {
StopWatch clock = new StopWatch();
clock.start();
return clock;
}
18
View Source File : StartupInfoLogger.java
License : Apache License 2.0
Project Creator : yuanmabiji
License : Apache License 2.0
Project Creator : yuanmabiji
private StringBuilder getStartedMessage(StopWatch stopWatch) {
StringBuilder message = new StringBuilder();
message.append("Started ");
message.append(getApplicationName());
message.append(" in ");
message.append(stopWatch.getTotalTimeSeconds());
try {
double uptime = ManagementFactory.getRuntimeMXBean().getUptime() / 1000.0;
message.append(" seconds (JVM running for " + uptime + ")");
} catch (Throwable ex) {
// No JVM time available
}
return message;
}
18
View Source File : BenchmarkTests.java
License : MIT License
Project Creator : Vip-Augus
License : MIT License
Project Creator : Vip-Augus
private long testRepeatedAroundAdviceInvocations(String file, int howmany, String technology) {
ClreplacedPathXmlApplicationContext bf = new ClreplacedPathXmlApplicationContext(file, CLreplaced);
StopWatch sw = new StopWatch();
sw.start(howmany + " repeated around advice invocations with " + technology);
ITestBean adrian = (ITestBean) bf.getBean("adrian");
replacedertTrue(AopUtils.isAopProxy(adrian));
replacedertEquals(68, adrian.getAge());
for (int i = 0; i < howmany; i++) {
adrian.getAge();
}
sw.stop();
System.out.println(sw.prettyPrint());
return sw.getLastTaskTimeMillis();
}
18
View Source File : BenchmarkTests.java
License : Apache License 2.0
Project Creator : SourceHot
License : Apache License 2.0
Project Creator : SourceHot
private long testRepeatedAroundAdviceInvocations(String file, int howmany, String technology) {
ClreplacedPathXmlApplicationContext bf = new ClreplacedPathXmlApplicationContext(file, CLreplaced);
StopWatch sw = new StopWatch();
sw.start(howmany + " repeated around advice invocations with " + technology);
ITestBean adrian = (ITestBean) bf.getBean("adrian");
replacedertThat(AopUtils.isAopProxy(adrian)).isTrue();
replacedertThat(adrian.getAge()).isEqualTo(68);
for (int i = 0; i < howmany; i++) {
adrian.getAge();
}
sw.stop();
System.out.println(sw.prettyPrint());
return sw.getLastTaskTimeMillis();
}
18
View Source File : MailService.java
License : GNU General Public License v3.0
Project Creator : JThink
License : GNU General Public License v3.0
Project Creator : JThink
/**
* 发送邮件
* @param mailDto
*/
public void sendMail(MailDto mailDto) {
LOGGER.info("send mail start...");
StopWatch sw = new StopWatch();
sw.start();
this.init(mailDto);
try {
Transport transport = session.getTransport("smtp");
InternetAddress from = new InternetAddress(this.mailProperties.getFrom().trim());
message.setFrom(from);
if (null != mailDto.getTo() && mailDto.getTo().size() > 0) {
message.addRecipients(Message.RecipientType.TO, InternetAddress.parse(this.changeListToString(mailDto.getTo())));
}
if (null != this.mailProperties.getCcs() && this.mailProperties.getCcs().size() > 0) {
message.addRecipients(Message.RecipientType.CC, InternetAddress.parse(this.changeListToString(this.mailProperties.getCcs())));
}
message.setSubject(mailDto.getSubject());
Multipart multipart = new MimeMultipart("mixed");
// 设置邮件的文本内容
BodyPart contentPart = new MimeBodyPart();
contentPart.setText(mailDto.getContent());
multipart.addBodyPart(contentPart);
// 添加附件
if (null != mailDto.getFiles() && mailDto.getFiles().size() > 0) {
this.addTach(mailDto.getFiles(), multipart);
}
message.setContent(multipart);
message.saveChanges();
// 连接服务器的邮箱
transport.connect(this.mailProperties.getSmtphost().trim(), this.mailProperties.getFrom().trim(), this.mailProperties.getPreplacedword().trim());
transport.sendMessage(message, message.getAllRecipients());
LOGGER.info("邮件发送成功");
sw.stop();
LOGGER.info("send mail end, and it takes " + sw.getTotalTimeMillis() + " ms");
} catch (NoSuchProviderException e) {
sw.stop();
LOGGER.info("send mail end, and it takes " + sw.getTotalTimeMillis() + " ms");
LOGGER.error("邮件发送失败", e);
} catch (AddressException e) {
sw.stop();
LOGGER.info("send mail end, and it takes " + sw.getTotalTimeMillis() + " ms");
LOGGER.error("邮件发送失败", e);
} catch (MessagingException e) {
sw.stop();
LOGGER.info("send mail end, and it takes " + sw.getTotalTimeMillis() + " ms");
LOGGER.error("邮件发送失败", e);
} catch (IOException e) {
sw.stop();
LOGGER.info("send mail end, and it takes " + sw.getTotalTimeMillis() + " ms");
LOGGER.error("附件添加失败", e);
}
}
18
View Source File : GeneratorService.java
License : Apache License 2.0
Project Creator : jhipster
License : Apache License 2.0
Project Creator : jhipster
public String generateZippedApplication(String applicationId, String applicationConfiguration) throws IOException {
StopWatch watch = new StopWatch();
watch.start();
File workingDir = generateApplication(applicationId, applicationConfiguration);
this.zipResult(workingDir);
watch.stop();
log.info("Zipped application generated in {} ms", watch.getTotalTimeMillis());
return workingDir + ".zip";
}
18
View Source File : LoggingAspect.java
License : Apache License 2.0
Project Creator : jakubnabrdalik
License : Apache License 2.0
Project Creator : jakubnabrdalik
private void log(ProceedingJoinPoint joinPoint, StopWatch stopWatch, Object result) {
String operationName = getOperationName(joinPoint);
String timerString = createTimerString(stopWatch);
String resultString = createResultString(result);
if (!timerString.isEmpty() || !resultString.isEmpty()) {
Logger logger = getLogger(joinPoint);
logger.info("{}{} {}", operationName, timerString, resultString);
}
}
17
View Source File : StartupInfoLogger.java
License : Apache License 2.0
Project Creator : yuanmabiji
License : Apache License 2.0
Project Creator : yuanmabiji
public void logStarted(Log log, StopWatch stopWatch) {
if (log.isInfoEnabled()) {
log.info(getStartedMessage(stopWatch));
}
}
17
View Source File : BenchmarkTests.java
License : MIT License
Project Creator : Vip-Augus
License : MIT License
Project Creator : Vip-Augus
private long testAfterReturningAdviceWithoutJoinPoint(String file, int howmany, String technology) {
ClreplacedPathXmlApplicationContext bf = new ClreplacedPathXmlApplicationContext(file, CLreplaced);
StopWatch sw = new StopWatch();
sw.start(howmany + " repeated after returning advice invocations with " + technology);
ITestBean adrian = (ITestBean) bf.getBean("adrian");
replacedertTrue(AopUtils.isAopProxy(adrian));
Advised a = (Advised) adrian;
replacedertTrue(a.getAdvisors().length >= 3);
// Hits joinpoint
adrian.setAge(25);
for (int i = 0; i < howmany; i++) {
adrian.setAge(i);
}
sw.stop();
System.out.println(sw.prettyPrint());
return sw.getLastTaskTimeMillis();
}
17
View Source File : BenchmarkTests.java
License : MIT License
Project Creator : Vip-Augus
License : MIT License
Project Creator : Vip-Augus
private long testBeforeAdviceWithoutJoinPoint(String file, int howmany, String technology) {
ClreplacedPathXmlApplicationContext bf = new ClreplacedPathXmlApplicationContext(file, CLreplaced);
StopWatch sw = new StopWatch();
sw.start(howmany + " repeated before advice invocations with " + technology);
ITestBean adrian = (ITestBean) bf.getBean("adrian");
replacedertTrue(AopUtils.isAopProxy(adrian));
Advised a = (Advised) adrian;
replacedertTrue(a.getAdvisors().length >= 3);
replacedertEquals("adrian", adrian.getName());
for (int i = 0; i < howmany; i++) {
adrian.getName();
}
sw.stop();
System.out.println(sw.prettyPrint());
return sw.getLastTaskTimeMillis();
}
17
View Source File : ShellCommandLineRunner.java
License : Apache License 2.0
Project Creator : spring-cloud
License : Apache License 2.0
Project Creator : spring-cloud
/**
* This does basically the same thing as {@link org.springframework.shell.Bootstrap} in Spring Shell,
* but using Spring Boot's {@link CommandLineRunner} as a callback hook for initialization, instead
* of squatting on the application's one {@code main(String[] args)} method.
*
* This configuration also uses Spring Boot to parse command line arguments instead of
* {@link org.springframework.shell.SimpleShellCommandLineOptions#parseCommandLine(String[])}. This means that
* command line arguments use a different syntax than in Spring Shell. Key value pairs for arguments need to be
* preplaceded with an equal sign as the separator rather than a space.
*
* @author Josh Long
* @author Mark Pollack
*/
public clreplaced ShellCommandLineRunner implements CommandLineRunner, ApplicationContextAware {
private StopWatch stopWatch = new StopWatch("Spring Shell");
private Logger logger = Logger.getLogger(getClreplaced().getName());
private ApplicationContext applicationContext;
@Autowired
private JLineShellComponent lineShellComponent;
@Autowired
private CommandLine commandLine;
@Autowired
private ApplicationArguments applicationArguments;
private static clreplaced ShellExitCodeGenerator implements ExitCodeGenerator {
private final ExitShellRequest exitShellRequest;
public ShellExitCodeGenerator(ExitShellRequest exitShellRequest) {
this.exitShellRequest = exitShellRequest;
}
@Override
public int getExitCode() {
return this.exitShellRequest.getExitCode();
}
}
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
this.applicationContext = applicationContext;
}
@Override
public void run(String... args) throws Exception {
SpringApplication.exit(this.applicationContext, new ShellExitCodeGenerator(this.doRun()));
}
private ExitShellRequest doRun() {
this.stopWatch.start();
try {
String[] commandsToExecuteAndThenQuit = this.commandLine.getShellCommandsToExecute();
ExitShellRequest exitShellRequest;
if (null != commandsToExecuteAndThenQuit) {
boolean successful = false;
exitShellRequest = ExitShellRequest.FATAL_EXIT;
for (String cmd : commandsToExecuteAndThenQuit) {
if (!(successful = this.lineShellComponent.executeCommand(cmd).isSuccess()))
break;
}
if (successful) {
exitShellRequest = ExitShellRequest.NORMAL_EXIT;
}
} else if (this.applicationArguments.containsOption("help")) {
System.out.println(FileUtils.readBanner(ShellCommandLineRunner.clreplaced, "/usage.txt"));
exitShellRequest = ExitShellRequest.NORMAL_EXIT;
} else {
this.lineShellComponent.start();
this.lineShellComponent.promptLoop();
exitShellRequest = this.lineShellComponent.getExitShellRequest();
if (exitShellRequest == null) {
exitShellRequest = ExitShellRequest.NORMAL_EXIT;
}
this.lineShellComponent.waitForComplete();
}
if (this.lineShellComponent.isDevelopmentMode()) {
System.out.println("Total execution time: " + this.stopWatch.getLastTaskTimeMillis() + " ms");
}
return exitShellRequest;
} catch (Exception ex) {
throw new ShellException(ex.getMessage(), ex);
} finally {
HandlerUtils.flushAllHandlers(this.logger);
this.stopWatch.stop();
}
}
}
17
View Source File : ServletRequestUtilsTests.java
License : Apache License 2.0
Project Creator : SourceHot
License : Apache License 2.0
Project Creator : SourceHot
@Test
@EnabledForTestGroups(PERFORMANCE)
public void testGetFloatParameterWithDefaultValueHandlingIsFastEnough() {
MockHttpServletRequest request = new MockHttpServletRequest();
StopWatch sw = new StopWatch();
sw.start();
for (int i = 0; i < 1000000; i++) {
ServletRequestUtils.getFloatParameter(request, "nonExistingParam", 0f);
}
sw.stop();
System.out.println(sw.getTotalTimeMillis());
replacedertThat(sw.getTotalTimeMillis() < 250).as("getStringParameter took too long: " + sw.getTotalTimeMillis()).isTrue();
}
17
View Source File : ServletRequestUtilsTests.java
License : Apache License 2.0
Project Creator : SourceHot
License : Apache License 2.0
Project Creator : SourceHot
@Test
@EnabledForTestGroups(PERFORMANCE)
public void testGetStringParameterWithDefaultValueHandlingIsFastEnough() {
MockHttpServletRequest request = new MockHttpServletRequest();
StopWatch sw = new StopWatch();
sw.start();
for (int i = 0; i < 1000000; i++) {
ServletRequestUtils.getStringParameter(request, "nonExistingParam", "defaultValue");
}
sw.stop();
System.out.println(sw.getTotalTimeMillis());
replacedertThat(sw.getTotalTimeMillis() < 250).as("getStringParameter took too long: " + sw.getTotalTimeMillis()).isTrue();
}
17
View Source File : ServletRequestUtilsTests.java
License : Apache License 2.0
Project Creator : SourceHot
License : Apache License 2.0
Project Creator : SourceHot
@Test
@EnabledForTestGroups(PERFORMANCE)
public void testGetBooleanParameterWithDefaultValueHandlingIsFastEnough() {
MockHttpServletRequest request = new MockHttpServletRequest();
StopWatch sw = new StopWatch();
sw.start();
for (int i = 0; i < 1000000; i++) {
ServletRequestUtils.getBooleanParameter(request, "nonExistingParam", false);
}
sw.stop();
System.out.println(sw.getTotalTimeMillis());
replacedertThat(sw.getTotalTimeMillis() < 250).as("getStringParameter took too long: " + sw.getTotalTimeMillis()).isTrue();
}
17
View Source File : ServletRequestUtilsTests.java
License : Apache License 2.0
Project Creator : SourceHot
License : Apache License 2.0
Project Creator : SourceHot
@Test
@EnabledForTestGroups(PERFORMANCE)
public void testGetLongParameterWithDefaultValueHandlingIsFastEnough() {
MockHttpServletRequest request = new MockHttpServletRequest();
StopWatch sw = new StopWatch();
sw.start();
for (int i = 0; i < 1000000; i++) {
ServletRequestUtils.getLongParameter(request, "nonExistingParam", 0);
}
sw.stop();
System.out.println(sw.getTotalTimeMillis());
replacedertThat(sw.getTotalTimeMillis() < 250).as("getStringParameter took too long: " + sw.getTotalTimeMillis()).isTrue();
}
17
View Source File : ServletRequestUtilsTests.java
License : Apache License 2.0
Project Creator : SourceHot
License : Apache License 2.0
Project Creator : SourceHot
@Test
@EnabledForTestGroups(PERFORMANCE)
public void testGetDoubleParameterWithDefaultValueHandlingIsFastEnough() {
MockHttpServletRequest request = new MockHttpServletRequest();
StopWatch sw = new StopWatch();
sw.start();
for (int i = 0; i < 1000000; i++) {
ServletRequestUtils.getDoubleParameter(request, "nonExistingParam", 0d);
}
sw.stop();
System.out.println(sw.getTotalTimeMillis());
replacedertThat(sw.getTotalTimeMillis() < 250).as("getStringParameter took too long: " + sw.getTotalTimeMillis()).isTrue();
}
17
View Source File : ServletRequestUtilsTests.java
License : Apache License 2.0
Project Creator : SourceHot
License : Apache License 2.0
Project Creator : SourceHot
@Test
@EnabledForTestGroups(PERFORMANCE)
public void testGetIntParameterWithDefaultValueHandlingIsFastEnough() {
MockHttpServletRequest request = new MockHttpServletRequest();
StopWatch sw = new StopWatch();
sw.start();
for (int i = 0; i < 1000000; i++) {
ServletRequestUtils.getIntParameter(request, "nonExistingParam", 0);
}
sw.stop();
System.out.println(sw.getTotalTimeMillis());
replacedertThat(sw.getTotalTimeMillis() < 250).as("getStringParameter took too long: " + sw.getTotalTimeMillis()).isTrue();
}
17
View Source File : DefaultConversionServiceTests.java
License : Apache License 2.0
Project Creator : SourceHot
License : Apache License 2.0
Project Creator : SourceHot
@Test
@EnabledForTestGroups(PERFORMANCE)
void testPerformance1() {
StopWatch watch = new StopWatch("integer->string conversionPerformance");
watch.start("convert 4,000,000 with conversion service");
for (int i = 0; i < 4000000; i++) {
conversionService.convert(3, String.clreplaced);
}
watch.stop();
watch.start("convert 4,000,000 manually");
for (int i = 0; i < 4000000; i++) {
Integer.valueOf(3).toString();
}
watch.stop();
// System.out.println(watch.prettyPrint());
}
17
View Source File : BenchmarkTests.java
License : Apache License 2.0
Project Creator : SourceHot
License : Apache License 2.0
Project Creator : SourceHot
private long testAfterReturningAdviceWithoutJoinPoint(String file, int howmany, String technology) {
ClreplacedPathXmlApplicationContext bf = new ClreplacedPathXmlApplicationContext(file, CLreplaced);
StopWatch sw = new StopWatch();
sw.start(howmany + " repeated after returning advice invocations with " + technology);
ITestBean adrian = (ITestBean) bf.getBean("adrian");
replacedertThat(AopUtils.isAopProxy(adrian)).isTrue();
Advised a = (Advised) adrian;
replacedertThat(a.getAdvisors().length >= 3).isTrue();
// Hits joinpoint
adrian.setAge(25);
for (int i = 0; i < howmany; i++) {
adrian.setAge(i);
}
sw.stop();
System.out.println(sw.prettyPrint());
return sw.getLastTaskTimeMillis();
}
17
View Source File : GracefulShutdownHookTest.java
License : Apache License 2.0
Project Creator : SchweizerischeBundesbahnen
License : Apache License 2.0
Project Creator : SchweizerischeBundesbahnen
@Test
public void testShutdown() throws Exception {
// Prepare
final StopWatch stopWatch = new StopWatch();
stopWatch.start();
GracefulShutdownHook testee = new GracefulShutdownHook(appContext);
healthCheck.setReady(true);
// Modify
testee.run();
// Test
asyncSpringContextShutdownDelayedreplacedert();
replacedertEquals(Status.DOWN, healthCheck.health().getStatus());
verify(appContext, times(1)).close();
stopWatch.stop();
replacedertTrue(stopWatch.getTotalTimeSeconds() >= SHUTDOWN_WAIT_S);
}
17
View Source File : RegisterController.java
License : GNU General Public License v2.0
Project Creator : quhailong
License : GNU General Public License v2.0
Project Creator : quhailong
/**
* 用户注册
*
* @author: quhailong
* @date: 2019/9/25
*/
@RequestMapping(value = "regphone", method = RequestMethod.POST)
public RestAPIResult<String> userRegist(@RequestBody UserRegistRequest request) throws Exception {
logger.info("用户注册请求URL:{}", httpServletRequest.getRequestURL());
StopWatch stopWatch = new StopWatch();
stopWatch.start();
logger.info("用户注册数据处理开始,request:{}", request);
RestAPIResult<String> result = registerService.userRegistHandle(request);
logger.info("用户注册数据处理结束,result:{}", result);
stopWatch.stop();
logger.info("用户注册调用时间,millies:{}", stopWatch.getTotalTimeMillis());
return result;
}
17
View Source File : RegisterController.java
License : GNU General Public License v2.0
Project Creator : quhailong
License : GNU General Public License v2.0
Project Creator : quhailong
/**
* 注册发送短信
*
* @author: quhailong
* @date: 2019/9/26
*/
@RequestMapping(value = "regphonesend", method = RequestMethod.POST)
public RestAPIResult<String> regPhoneSend(@RequestBody RegPhoneSendRequest request) {
logger.info("注册发送短信请求URL:{}", httpServletRequest.getRequestURL());
StopWatch stopWatch = new StopWatch();
stopWatch.start();
logger.info("注册发送短信数据处理开始,request:{}", request);
RestAPIResult<String> result = registerService.regPhoneSendHandle(request);
logger.info("注册发送短信数据处理结束,result:{}", result);
stopWatch.stop();
logger.info("注册发送短信调用时间,millies:{}", stopWatch.getTotalTimeMillis());
return result;
}
17
View Source File : RegisterController.java
License : GNU General Public License v2.0
Project Creator : quhailong
License : GNU General Public License v2.0
Project Creator : quhailong
/**
* 修改密码
*
* @author: quhailong
* @date: 2019/9/26
*/
@RequestMapping(value = "changepwd", method = RequestMethod.POST)
public RestAPIResult<String> changePwd(@RequestBody ChangePwdRequest request) {
logger.info("修改密码请求URL:{}", httpServletRequest.getRequestURL());
StopWatch stopWatch = new StopWatch();
stopWatch.start();
logger.info("修改密码数据处理开始,request:{}", request);
RestAPIResult<String> result = registerService.changePwdHandle(request);
logger.info("修改密码数据处理结束,result:{}", result);
stopWatch.stop();
logger.info("修改密码调用时间,millies:{}", stopWatch.getTotalTimeMillis());
return result;
}
17
View Source File : RegisterController.java
License : GNU General Public License v2.0
Project Creator : quhailong
License : GNU General Public License v2.0
Project Creator : quhailong
/**
* 手机号查重
*
* @author: quhailong
* @date: 2019/9/25
*/
@RequestMapping(value = "regcheckphone", method = RequestMethod.GET)
public RestAPIResult<String> checkPhone(@RequestParam("phoneNum") String phoneNum) {
logger.info("手机号查重请求URL:{}", httpServletRequest.getRequestURL());
StopWatch stopWatch = new StopWatch();
stopWatch.start();
logger.info("手机号查重数据处理开始,phoneNum:{}", phoneNum);
RestAPIResult<String> result = registerService.checkPhoneHandle(phoneNum);
logger.info("手机号查重数据处理结束,result:{}", result);
stopWatch.stop();
logger.info("手机号查重调用时间,millies:{}", stopWatch.getTotalTimeMillis());
return result;
}
17
View Source File : PassportController.java
License : GNU General Public License v2.0
Project Creator : quhailong
License : GNU General Public License v2.0
Project Creator : quhailong
/**
* 登录请求
*
* @author: quhailong
* @date: 2019/9/25
*/
@RequestMapping(value = "login", method = RequestMethod.POST)
public RestAPIResult<String> login(@RequestParam("username") String username, @RequestParam("preplacedword") String preplacedword, @RequestParam("RSAKey") String RSAKey) throws Exception {
logger.info("登录请求URL:{}", httpServletRequest.getRequestURL());
StopWatch stopWatch = new StopWatch();
stopWatch.start();
logger.info("登录数据处理开始,username:{}", username);
RestAPIResult<String> result = preplacedportService.loginHandle(username, preplacedword, RSAKey);
logger.info("登录数据处理结束,result:{}", result);
stopWatch.stop();
logger.info("登录调用时间,millies:{}", stopWatch.getTotalTimeMillis());
return result;
}
17
View Source File : PassportController.java
License : GNU General Public License v2.0
Project Creator : quhailong
License : GNU General Public License v2.0
Project Creator : quhailong
/**
* 根据用户ID获取用户信息
*
* @author: quhailong
* @date: 2019/9/26
*/
@RequestMapping(value = "getuserinfo", method = RequestMethod.POST)
public RestAPIResult<UserInfoDTO> getUserInfo(@RequestParam("userId") String userId) {
logger.info("根据用户ID获取用户信息请求URL:{}", httpServletRequest.getRequestURL());
StopWatch stopWatch = new StopWatch();
stopWatch.start();
logger.info("根据用户ID获取用户信息数据处理开始,userId:{}", userId);
RestAPIResult<UserInfoDTO> result = preplacedportService.getUserInfoHandle(userId);
logger.info("根据用户ID获取用户信息数据处理结束,result:{}", result);
stopWatch.stop();
logger.info("根据用户ID获取用户信息调用时间,millies:{}", stopWatch.getTotalTimeMillis());
return result;
}
17
View Source File : ShareController.java
License : GNU General Public License v2.0
Project Creator : quhailong
License : GNU General Public License v2.0
Project Creator : quhailong
/**
* 取消分享
*
* @author: quhailong
* @date: 2019/9/26
*/
// @RequestMapping(value = "unShare", method = {RequestMethod.POST})
@RequestMapping(value = "unshare", method = RequestMethod.GET)
public RestAPIResult<String> unShare(String uid, String vids) {
logger.info("取消分享请求URL:{}", httpServletRequest.getRequestURL());
StopWatch stopWatch = new StopWatch();
stopWatch.start();
logger.info("取消分享数据处理开始,vids:{}", vids);
RestAPIResult<String> result = shareProvider.unShareHandle(uid, vids);
logger.info("取消分享数据处理结束,result:{}", result);
stopWatch.stop();
logger.info("取消分享调用时间,millies:{}", stopWatch.getTotalTimeMillis());
return result;
}
17
View Source File : ShareController.java
License : GNU General Public License v2.0
Project Creator : quhailong
License : GNU General Public License v2.0
Project Creator : quhailong
/**
* 查询分享是否带密码
*
* @author: quhailong
* @date: 2019/9/26
*/
// @RequestMapping(value = "checkLock", method = {RequestMethod.POST})
@RequestMapping(value = "checklock", method = RequestMethod.GET)
public RestAPIResult<String> checkLock(@RequestParam("shareId") String shareId) {
logger.info("查询分享是否带密码请求URL:{}", httpServletRequest.getRequestURL());
StopWatch stopWatch = new StopWatch();
stopWatch.start();
logger.info("查询分享是否带密码数据处理开始,shareId:{}", shareId);
RestAPIResult<String> result = shareProvider.checkLockHandle(shareId);
logger.info("查询分享是否带密码数据处理结束,result:{}", result);
stopWatch.stop();
logger.info("查询分享是否带密码调用时间,millies:{}", stopWatch.getTotalTimeMillis());
return result;
}
17
View Source File : ShareController.java
License : GNU General Public License v2.0
Project Creator : quhailong
License : GNU General Public License v2.0
Project Creator : quhailong
/**
* 增加分享访问量
*
* @author: quhailong
* @date: 2019/9/26
*/
// @RequestMapping(value = "addShareView", method = {RequestMethod.POST})
@RequestMapping(value = "addshareview", method = RequestMethod.POST)
public void addShareView(@RequestBody AddShareViewCountRequest request) {
logger.info("增加分享访问量请求URL:{}", httpServletRequest.getRequestURL());
StopWatch stopWatch = new StopWatch();
stopWatch.start();
logger.info("增加分享访问量数据处理开始,request:{}", request);
shareProvider.addShareViewCountHandle(request);
logger.info("增加分享访问量数据处理结束");
stopWatch.stop();
logger.info("增加分享访问量调用时间,millies:{}", stopWatch.getTotalTimeMillis());
}
17
View Source File : ShareController.java
License : GNU General Public License v2.0
Project Creator : quhailong
License : GNU General Public License v2.0
Project Creator : quhailong
/**
* 保存分享
*
* @author: quhailong
* @date: 2019/9/26
*/
// @RequestMapping(value = "saveShare", method = {RequestMethod.POST})
@RequestMapping(value = "saveshare", method = RequestMethod.POST)
public RestAPIResult<String> saveShare(@RequestBody SaveShareRequest request) {
logger.info("保存分享请求URL:{}", httpServletRequest.getRequestURL());
StopWatch stopWatch = new StopWatch();
stopWatch.start();
logger.info("保存分享数据处理开始,request:{}", request);
RestAPIResult<String> result = shareProvider.saveShareHandle(request);
logger.info("保存分享数据处理结束,result:{}", result);
stopWatch.stop();
logger.info("保存分享调用时间,millies:{}", stopWatch.getTotalTimeMillis());
return result;
}
17
View Source File : ShareController.java
License : GNU General Public License v2.0
Project Creator : quhailong
License : GNU General Public License v2.0
Project Creator : quhailong
/**
* 增加分享下载量
*
* @author: quhailong
* @date: 2019/9/26
*/
// @RequestMapping(value = "addShareDownload", method = {RequestMethod.POST})
@RequestMapping(value = "addsharedownload", method = { RequestMethod.POST })
public void addShareDownload(@RequestParam("shareId") String shareId) {
logger.info("增加分享下载量请求URL:{}", httpServletRequest.getRequestURL());
StopWatch stopWatch = new StopWatch();
stopWatch.start();
logger.info("增加分享下载量数据处理开始,shareId:{}", shareId);
shareProvider.addShareDownloadCountHandle(shareId);
logger.info("增加分享下载量数据处理结束");
stopWatch.stop();
logger.info("增加分享下载量调用时间,millies:{}", stopWatch.getTotalTimeMillis());
}
17
View Source File : ShareController.java
License : GNU General Public License v2.0
Project Creator : quhailong
License : GNU General Public License v2.0
Project Creator : quhailong
/**
* 验证分享密码
*
* @author: quhailong
* @date: 2019/9/26
*/
// @RequestMapping(value = "verifykLock", method = {RequestMethod.POST})
@RequestMapping(value = "verifyklock", method = RequestMethod.GET)
public RestAPIResult<String> verifykLock(@RequestParam("lockPreplacedword") String lockPreplacedword, @RequestParam("shareId") String shareId) {
logger.info("验证分享密码请求URL:{}", httpServletRequest.getRequestURL());
StopWatch stopWatch = new StopWatch();
stopWatch.start();
logger.info("验证分享密码数据处理开始,shareId:{}", shareId);
RestAPIResult<String> result = shareProvider.verifykLockHandle(lockPreplacedword, shareId);
logger.info("验证分享密码数据处理结束,result:{}", result);
stopWatch.stop();
logger.info("验证分享密码调用时间,millies:{}", stopWatch.getTotalTimeMillis());
return result;
}
17
View Source File : ShareController.java
License : GNU General Public License v2.0
Project Creator : quhailong
License : GNU General Public License v2.0
Project Creator : quhailong
/**
* 获取分享虚拟地址信息
*
* @author: quhailong
* @date: 2019/9/26
*/
// @RequestMapping(value = "getVinfo", method = {RequestMethod.POST})
@RequestMapping(value = "getvinfo", method = RequestMethod.GET)
public RestAPIResult<String> getUid(@RequestParam("shareId") String shareId, @RequestParam("lockPreplacedword") String lockPreplacedword) {
logger.info("获取分享虚拟地址信息请求URL:{}", httpServletRequest.getRequestURL());
StopWatch stopWatch = new StopWatch();
stopWatch.start();
logger.info("获取分享虚拟地址信息数据处理开始,shareId:{}", shareId);
RestAPIResult<String> result = shareProvider.getVinfoHandle(shareId, lockPreplacedword);
logger.info("获取分享虚拟地址信息数据处理结束,result:{}", result);
stopWatch.stop();
logger.info("获取分享虚拟地址信息调用时间,millies:{}", stopWatch.getTotalTimeMillis());
return result;
}
17
View Source File : UploadFileController.java
License : GNU General Public License v2.0
Project Creator : quhailong
License : GNU General Public License v2.0
Project Creator : quhailong
/**
* 上传文件
*
* @author: quhailong
* @date: 2019/9/25
*/
// @RequestMapping("/uploadFile") // new annotation since 4.3
@RequestMapping(value = "uploadfile", method = RequestMethod.POST)
public RestAPIResult<String> uploadFile(UploadFileRequest request) throws IOException {
logger.info("上传文件请求URL:{}", httpServletRequest.getRequestURL());
StopWatch stopWatch = new StopWatch();
stopWatch.start();
logger.info("上传文件数据处理开始,request:{}", request);
RestAPIResult<String> result = uploadFileProvider.uploadFileHandle(request);
logger.info("上传文件数据处理结束,result:{}", result);
stopWatch.stop();
logger.info("上传文件调用时间,millies:{}", stopWatch.getTotalTimeMillis());
return result;
}
17
View Source File : EdgeServiceController.java
License : GNU General Public License v2.0
Project Creator : quhailong
License : GNU General Public License v2.0
Project Creator : quhailong
/**
* 生成公钥
*
* @author: quhailong
* @date: 2019/9/26
*/
// @RequestMapping(value = "getPublickKey", method = {RequestMethod.GET})
@RequestMapping(value = "getpublickey", method = RequestMethod.GET)
public RestAPIResult<String> getPublicKey() throws Exception {
logger.info("生成公钥请求URL:{}", httpServletRequest.getRequestURL());
StopWatch stopWatch = new StopWatch();
stopWatch.start();
logger.info("生成公钥数据处理开始");
RestAPIResult<String> result = edgeServiceProvider.getPublicKeyHandle();
logger.info("生成公钥数据处理结束,result:{}", result);
stopWatch.stop();
logger.info("生成公钥调用时间,millies:{}", stopWatch.getTotalTimeMillis());
return result;
}
17
View Source File : UpdateContentController.java
License : GNU General Public License v2.0
Project Creator : quhailong
License : GNU General Public License v2.0
Project Creator : quhailong
/**
* 文件或文件夹重命名
*
* @author: quhailong
* @date: 2019/9/24
*/
// @RequestMapping(value = "rename", method = { RequestMethod.POST })
@RequestMapping(value = "renamefileordir", method = RequestMethod.PUT)
public RestAPIResult<String> renameFileOrDir(@RequestBody RenameFileOrDirRequest request) {
logger.info("文件或文件夹重命名请求URL:{}", httpServletRequest.getRequestURL());
StopWatch stopWatch = new StopWatch();
stopWatch.start();
logger.info("文件或文件夹重命名数据处理开始,request:{}", request);
RestAPIResult<String> result = updateContentProvider.renameFileOrDirHandle(request);
logger.info("文件或文件夹重命名数据处理结束,result:{}", result);
stopWatch.stop();
logger.info("文件或文件夹重命名调用时间,millies:{}", stopWatch.getTotalTimeMillis());
return result;
}
17
View Source File : UpdateContentController.java
License : GNU General Public License v2.0
Project Creator : quhailong
License : GNU General Public License v2.0
Project Creator : quhailong
/**
* 删除文件
*
* @author: quhailong
* @date: 2019/9/24
*/
// @RequestMapping(value = "del", method = { RequestMethod.POST })
@RequestMapping(value = "deletefile", method = RequestMethod.DELETE)
public RestAPIResult<String> deleteFile(String uid, String vids) throws Exception {
logger.info("删除文件请求URL:{}", httpServletRequest.getRequestURL());
StopWatch stopWatch = new StopWatch();
stopWatch.start();
logger.info("删除文件数据处理开始,vids:{}", vids);
RestAPIResult<String> result = updateContentProvider.deleteFileHandle(vids);
logger.info("删除文件数据处理结束,result:{}", result);
stopWatch.stop();
logger.info("删除文件调用时间,millies:{}", stopWatch.getTotalTimeMillis());
return result;
}
17
View Source File : QueryContentController.java
License : GNU General Public License v2.0
Project Creator : quhailong
License : GNU General Public License v2.0
Project Creator : quhailong
/**
* 查询文件夹是否存在(调用)
*
* @author: quhailong
* @date: 2019/9/25
*/
@RequestMapping(value = "checkdirwhether", method = RequestMethod.GET)
public RestAPIResult<Integer> checkDirWhether(CheckDirWhetherRequest request) {
logger.info("查询文件夹是否存在请求URL:{}", httpServletRequest.getRequestURL());
StopWatch stopWatch = new StopWatch();
stopWatch.start();
logger.info("查询文件夹是否存在数据处理开始,request:{}", request);
RestAPIResult<Integer> result = queryContentProvider.checkDirWhetherHandle(request);
logger.info("查询文件夹是否存在数据处理结束,result:{}", result);
stopWatch.stop();
logger.info("查询文件夹是否存在调用时间,millies:{}", stopWatch.getTotalTimeMillis());
return result;
}
17
View Source File : QueryContentController.java
License : GNU General Public License v2.0
Project Creator : quhailong
License : GNU General Public License v2.0
Project Creator : quhailong
/**
* 根据虚拟地址ID获取文件名称(调用)
*
* @author: quhailong
* @date: 2019/9/25
*/
@RequestMapping(value = "getfilenamebyvid", method = RequestMethod.GET)
public RestAPIResult<String> getFileNameByVid(String vid, String uid) {
logger.info("根据虚拟地址ID获取文件名称请求URL:{}", httpServletRequest.getRequestURL());
StopWatch stopWatch = new StopWatch();
stopWatch.start();
logger.info("根据虚拟地址ID获取文件名称数据处理开始,vid:{}", vid);
RestAPIResult<String> result = queryContentProvider.getFileNameByVidHandle(vid, uid);
logger.info("根据虚拟地址ID获取文件名称数据处理结束,result:{}", result);
stopWatch.stop();
logger.info("根据虚拟地址ID获取文件名称调用时间,millies:{}", stopWatch.getTotalTimeMillis());
return result;
}
17
View Source File : QueryContentController.java
License : GNU General Public License v2.0
Project Creator : quhailong
License : GNU General Public License v2.0
Project Creator : quhailong
/**
* 搜索文件
*
* @author: quhailong
* @date: 2019/9/24
*/
// @RequestMapping(value = "search", method = {RequestMethod.POST})
@RequestMapping(value = "searchfile", method = RequestMethod.GET)
public RestAPIResult<String> searchFile(SearchFileRequest request) {
logger.info("搜索文件请求URL:{}", httpServletRequest.getRequestURL());
StopWatch stopWatch = new StopWatch();
stopWatch.start();
logger.info("搜索文件数据处理开始,request:{}", request);
RestAPIResult<String> result = queryContentProvider.searchFileHandle(request);
logger.info("搜索文件数据处理结束,result:{}", result);
stopWatch.stop();
logger.info("搜索文件调用时间,millies:{}", stopWatch.getTotalTimeMillis());
return result;
}
17
View Source File : PageController.java
License : GNU General Public License v2.0
Project Creator : quhailong
License : GNU General Public License v2.0
Project Creator : quhailong
/**
* 首页跳转
*
* @author: quhailong
* @date: 2019/9/27
*/
@RequestMapping("/")
public String index() {
logger.info("首页跳转请求URL:{}", httpServletRequest.getRequestURL());
StopWatch stopWatch = new StopWatch();
stopWatch.start();
logger.info("首页跳转数据处理开始");
String resultUrl = pageProvider.indexHandle();
logger.info("首页跳转数据处理结束,resultUrl:{}", resultUrl);
stopWatch.stop();
logger.info("首页跳转调用时间,millies:{}", stopWatch.getTotalTimeMillis());
return resultUrl;
}
17
View Source File : PageController.java
License : GNU General Public License v2.0
Project Creator : quhailong
License : GNU General Public License v2.0
Project Creator : quhailong
/**
* 跳转到主页面
*
* @author: quhailong
* @date: 2019/9/27
*/
@RequestMapping("/disk/home")
public String home(Model model) {
logger.info("跳转到主页面请求URL:{}", httpServletRequest.getRequestURL());
StopWatch stopWatch = new StopWatch();
stopWatch.start();
logger.info("跳转到主页面数据处理开始");
String resultUrl = pageProvider.homeHandle(model);
logger.info("跳转到主页面数据处理结束,resultUrl:{}", resultUrl);
stopWatch.stop();
logger.info("跳转到主页面调用时间,millies:{}", stopWatch.getTotalTimeMillis());
return resultUrl;
}
17
View Source File : PageController.java
License : GNU General Public License v2.0
Project Creator : quhailong
License : GNU General Public License v2.0
Project Creator : quhailong
/**
* 跳转到分享管理页面
*
* @author: quhailong
* @date: 2019/9/27
*/
@RequestMapping("/share/manage")
public String share(Model model) {
logger.info("跳转到分享管理页面请求URL:{}", httpServletRequest.getRequestURL());
StopWatch stopWatch = new StopWatch();
stopWatch.start();
logger.info("跳转到分享管理页面数据处理开始");
String resultUrl = pageProvider.shareHandle(model);
logger.info("跳转到分享管理页面数据处理结束,resultUrl:{}", resultUrl);
stopWatch.stop();
logger.info("跳转到分享管理页面调用时间,millies:{}", stopWatch.getTotalTimeMillis());
return resultUrl;
}
See More Examples