#70 added ping notification
parent
0e8752e460
commit
9edcf35338
@ -1,7 +1,13 @@
|
|||||||
package ru.ulstu.ping.repository;
|
package ru.ulstu.ping.repository;
|
||||||
|
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.Query;
|
||||||
|
import org.springframework.data.repository.query.Param;
|
||||||
|
import ru.ulstu.conference.model.Conference;
|
||||||
import ru.ulstu.ping.model.Ping;
|
import ru.ulstu.ping.model.Ping;
|
||||||
|
|
||||||
public interface PingRepository extends JpaRepository<Ping, Integer> {
|
public interface PingRepository extends JpaRepository<Ping, Integer> {
|
||||||
|
|
||||||
|
@Query("SELECT count(*) FROM Ping p WHERE (DAY(p.date) = :day) AND (MONTH(p.date) = :month) AND (p.conference = :conference)")
|
||||||
|
long countByConferenceAndDate(@Param("conference") Conference conference, @Param("day") Integer day, @Param("month") Integer month);
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,25 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html xmlns:th="http://www.thymeleaf.org">
|
||||||
|
<head>
|
||||||
|
<title>Обратите внимание на конференциию</title>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||||
|
<link rel="shortcut icon" th:href="@{|${baseUrl}/favicon.ico|}"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<p>
|
||||||
|
Уважаемый(ая) <span th:text="${user.firstName + ' ' + user.lastName}">Ivan Ivanov</span>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Конференция "<a th:href="@{|${baseUrl}/conferences/conference?id=${conference.id}|}">
|
||||||
|
<span th:text="${conference.title}">Title</span></a>" была пропингована
|
||||||
|
<b><span th:text="${conference.ping}"></span></b> раз.
|
||||||
|
<br/>
|
||||||
|
Обратите внимание.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Regards,
|
||||||
|
<br/>
|
||||||
|
<em>NG-tracker.</em>
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in New Issue