Skip to content

Commit

Permalink
Update SZOR to Falatozo
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerviba committed Feb 24, 2024
1 parent f05742d commit 8f7af24
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 54 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,5 @@ docker-volume-create:
docker volume create --name schpincer-lucene-cache

new-publish:
docker build -t schpincer/schpincer -f docker/standalone-Dockerfile .
docker push schpincer/schpincer
docker build -t harbor.sch.bme.hu/org-kir-dev/sch-pincer -f docker/standalone-Dockerfile .
docker push harbor.sch.bme.hu/org-kir-dev/sch-pincer
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ MAINTAINER [email protected]
COPY --from=build /usr/src/app/target/schpincer.jar /opt/schpincer/
COPY docker/application-docker.properties /opt/schpincer/application.properties
WORKDIR /opt/schpincer
ENTRYPOINT ["java", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseContainerSupport", "-XX:MaxRAMPercentage=98", "-jar", "/opt/schpincer/schpincer.jar"]
ENTRYPOINT ["java", "-Dspring.profiles.include=docker", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseContainerSupport", "-XX:+UseSerialGC", "-XX:MaxRAMPercentage=90", "-jar", "/opt/schpincer/schpincer.jar"]
EXPOSE 80
15 changes: 2 additions & 13 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.10.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
<relativePath/>
</parent>
<groupId>hu.gerviba</groupId>
<artifactId>schpincer</artifactId>
<packaging>jar</packaging>
<version>1.3.37</version>
<version>1.39.0</version>
<name>SCH-Pincer</name>

<properties>
Expand Down Expand Up @@ -112,23 +112,12 @@
<artifactId>google-api-services-calendar</artifactId>
<version>v3-rev370-1.25.0</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
<version>${kotlin.version}</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-reflect</artifactId>
<version>${kotlin.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-test-junit</artifactId>
<version>${kotlin.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
Expand Down
15 changes: 11 additions & 4 deletions src/main/kotlin/hu/kirdev/schpincer/config/ApplicationConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,30 @@ package hu.kirdev.schpincer.config
import hu.kirdev.schpincer.service.ItemPrecedenceService
import org.slf4j.LoggerFactory
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.beans.factory.annotation.Value
import org.springframework.context.annotation.Configuration
import org.springframework.scheduling.annotation.EnableScheduling
import org.springframework.scheduling.annotation.Scheduled
import javax.annotation.PostConstruct

@Configuration
@EnableScheduling
open class ApplicationConfig {
open class ApplicationConfig(
@Value("\${spring.datasource.url:}") private val datasourceUrl: String,
private val itemPrecedenceService: ItemPrecedenceService
) {

private val log = LoggerFactory.getLogger(javaClass)

@Autowired
private val itemPrecedenceService: ItemPrecedenceService? = null
@PostConstruct
fun init() {
log.info("datasourceUrl = {}", datasourceUrl)
}

@Scheduled(fixedRate = 1000 * 60 * 30L, initialDelay = 20000)
fun reorderItems() {
log.info("Executing reorder task")
itemPrecedenceService!!.reorder()
itemPrecedenceService.reorder()
log.info("Reorder finished...")
}

Expand Down
11 changes: 0 additions & 11 deletions src/main/kotlin/hu/kirdev/schpincer/dao/Repositories.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ interface CircleMemberRepository : JpaRepository<CircleMemberEntity, Long>

@Repository
interface CircleRepository : JpaRepository<CircleEntity, Long> {
fun findAllByOrderByHomePageOrder(): List<CircleEntity>
fun findByAlias(alias: String): CircleEntity
fun findAllByVisibleTrueOrderByHomePageOrder(): List<CircleEntity>
fun findAllByAlias(alias: String): List<CircleEntity>
fun findOneByVirGroupId(virGroupId: Long): CircleEntity?
Expand All @@ -26,17 +24,11 @@ interface CircleRepository : JpaRepository<CircleEntity, Long> {
@Repository
interface ItemRepository : JpaRepository<ItemEntity, Long> {
fun findAllByCircle_Id(circleId: Long): List<ItemEntity>
fun findAllByVisibleTrue(): List<ItemEntity>
fun findAllByVisibleTrueAndVisibleInAllTrue(): List<ItemEntity>
fun findAllByVisibleTrueAndVisibleInAllTrue(page: Pageable): Page<ItemEntity>
fun deleteByCircle_Id(circleId: Long)
fun findAllByCircle_IdIn(circles: List<Long>): List<ItemEntity>
fun findAllByVisibleTrueOrderByPrecedenceDesc(): List<ItemEntity>
fun findAllByVisibleTrueAndVisibleInAllTrueOrderByPrecedenceDesc(page: Pageable): Page<ItemEntity>
fun findAllByCircle_IdOrderByPrecedenceDesc(circleId: Long): List<ItemEntity>
fun findAllByCircle_IdInOrderByPrecedenceDesc(circles: List<Long>): List<ItemEntity>
fun findAllByCircle_IdOrderByManualPrecedenceDesc(circleId: Long): List<ItemEntity>
fun findAllByNameEquals(name: String): List<ItemEntity>
}

@SuppressWarnings("kotlin:S100" // ignore underscores in queries
Expand All @@ -46,7 +38,6 @@ interface OpeningRepository : JpaRepository<OpeningEntity, Long> {
fun findAllByOrderByDateStart(): List<OpeningEntity>
fun findAllByDateEndGreaterThanAndDateEndLessThanOrderByDateStart(now: Long, weekFromNow: Long): List<OpeningEntity>
fun findAllByOrderStartGreaterThanAndOrderStartLessThan(time1: Long, time2: Long): List<OpeningEntity>
fun findFirstByCircle_IdOrderByDateStart(circle: Long): Optional<OpeningEntity>
fun findFirstByCircle_IdAndDateEndGreaterThanOrderByDateStart(id: Long, time: Long): Optional<OpeningEntity>
fun findAllByOrderStartLessThanAndOrderEndGreaterThan(currentTime1: Long, currentTime2: Long): List<OpeningEntity>
fun findAllByOrderEndGreaterThanOrderByDateStart(currentTimeMillis: Long): List<OpeningEntity>
Expand All @@ -56,8 +47,6 @@ interface OpeningRepository : JpaRepository<OpeningEntity, Long> {
interface OrderRepository : JpaRepository<OrderEntity, Long> {
fun findAllByUserIdOrderByDateDesc(userId: String): List<OrderEntity>
fun findAllByOpeningId(openingId: Long): List<OrderEntity>
fun findAllByOpeningIdOrderByIntervalIdAscPriorityDescDateAsc(openingId: Long): List<OrderEntity>
fun findAllByOpeningIdOrderByPriorityDescDateAsc(openingId: Long): List<OrderEntity>
fun findAllByOpeningIdAndStatusNotOrderByPriorityDescDateAsc(openingId: Long, status: OrderStatus): List<OrderEntity>
fun findAllByOpeningIdAndStatusNotOrderByIntervalIdAscPriorityDescDateAsc(openingId: Long, status: OrderStatus): List<OrderEntity>
fun findAllByOpeningIdAndStatusNot(openingId: Long, status: OrderStatus): List<OrderEntity>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import org.springframework.web.servlet.HandlerMapping
import javax.servlet.http.HttpServletRequest

@Controller
open class SzorController {
open class FalatozoController {

@GetMapping(path = ["/americano", "/pizzasch", "/reggelisch", "/kakas", "/langosch", "/vodor", "/dzsajrosz"])
@GetMapping(path = ["/americano", "/pizzasch", "/reggelisch", "/kakas", "/langosch", "/vodor", "/dzsajrosz", "/schami", "/palacsintazo", "/paschta"])
fun providerRedirects(request: HttpServletRequest): String {
val providerName = request.getAttribute(HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE) as String
return "redirect:/p$providerName"
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/hu/kirdev/schpincer/web/MainController.kt
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ open class MainController {
return "items"
}

@GetMapping("/szor")
@GetMapping("/falatozo")
fun circle(model: Model): String {
model.addAttribute("circles", circles.findAllForMenu())
model.addAttribute("circlesWithOpening", circles.findAllForInfo())
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/config/application-docker.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
###
server.port=80
### SPECIFY DATABASE
spring.datasource.url=jdbc:mysql://${SCHPINCER_MYSQL_HOST}/${SCHPINCER_MYSQL_DATABASE}?useSSL=false&useUnicode=yes&characterEncoding=utf8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
spring.datasource.url=jdbc:mysql://${SCHPINCER_MYSQL_HOST}/${SCHPINCER_MYSQL_DATABASE}?allowPublicKeyRetrieval=true&useSSL=false&useUnicode=yes&characterEncoding=utf8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
spring.datasource.username=${SCHPINCER_MYSQL_USER}
spring.datasource.password=${SCHPINCER_MYSQL_PASSWORD}
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
Expand All @@ -20,4 +20,4 @@ spring.jpa.properties.hibernate.search.default.indexBase=/tmp/schpincer/search/
spring.servlet.multipart.max-file-size=2000KB
spring.servlet.multipart.max-request-size=2000KB
#spring.servlet.multipart.enabled=false
schpincer.api.base-url=https://schpincer.sch.bme.hu/
schpincer.api.base-url=https://schpincer.sch.bme.hu/
16 changes: 4 additions & 12 deletions src/main/resources/i18n/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ lang.head.description=Schönherz Szolgáltatói Reszortos köreinek rendelő alk
lang.header=SCH-PINCÉR
# NAVIGATION
lang.nav.home=SCH-Pincér
lang.nav.circle=SZOR
lang.nav.circle=Falatozó
lang.nav.items=Termékek
lang.nav.login=Bejelentkezés
lang.nav.account=Profil
Expand Down Expand Up @@ -59,20 +59,12 @@ lang.profile.about-us=Rólunk
lang.profile.members=Csapatunk
lang.profile.reviews=Értékelések
lang.profile.write-review=Értékelj te is
lang.circle.title=Szolgáltató Reszort
lang.circle.title=Falatozó
lang.circle.sub-title=A Schönherz szolgálatában 2004 óta
# Property `lang.circle.description` supports html tags
lang.circle.description=A 2004-ben alapított Szolgáltató Reszort azokat a köröket, csoportokat tömöríti magába, \
melyek valamilyen nem kulturális jellegű szolgáltatást nyújtanak a Schönherz Zoltán Kollégium lakóinak. \
Jelenleg 7 körünk szolgálja ki felváltva az éhesek kollégisták igényeit a hét szinte minden napján. \
Ők név szerint: Vödör Kör, Americano, PizzáSCH, Dzsájrosz, Palacsintázó, LángoSCH, Vörös Kakas Fogadó. \
A kollégisták által rendelt ételeket a FoodEx "házhoz" is szállítja. Ha valaki baráti társaságával szívesen \
vizipipázna egyet, akkor érdemes a WTF-t keresnie. A kollégiumban található egy szauna is, melynek működtetésével \
a Szauna Kör foglalkozik. Ha valaki sokadmagával szeretne egy nagyot főzni, \
akkor az Edénykölcsönzőnél mindent megtalál, ami egy nagy lakomához kell. \
A már szimbólummá vált különböző foltokkal és villanykari pulóverekkel pedig a Pulcsi és Foltmékört érdemes keresni.
lang.circle.description=A 2004-ben alapított Szolgáltató Reszort utóda, a 2023-ban átnevezett, Falatozó Reszort. Azokat a köröket foglalja magába, melyek a Ház éhes lakóinak készítenek és szállítanak finomabbnál finomabb ételeket. Jelenleg 7 körünk szolgálja ki felváltva az ínyenc kollégisták igényeit a hét szinte minden napján. Ők név szerint:, Americano, LángoSCH, Palacsintázó, PizzáSCH, ReggeliSCH, Vödörkör, Vörös Kakas Fogadó. A kollégisták által rendelt ételeket a FoodEx szállítja ki a szobákhoz.
lang.circle.next-openings=Következő nyitások
lang.circle.circles=Kajás köreink
lang.circle.circles=Körök
# REVIEW
lang.review.title=Értékelés
lang.review.order=Rendelésed értékelése
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/static/robots.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
User-Agent: *
Disallow:
Allow: /
Allow: /szor
Allow: /falatozo
Allow: /items
Disallow: /profile
Disallow: /login
6 changes: 2 additions & 4 deletions src/main/resources/templates/MainLayout.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ <h1 th:text="#{lang.mobile-menu.title}">Menu</h1>

<div class="nav">
<a href="index.html" th:href="@{/}" th:text="#{lang.nav.home}">Home</a>
<a href="circle.html" th:href="@{/szor}" th:text="#{lang.nav.circle}">Circles</a>
<a href="circle.html" th:href="@{/falatozo}" th:text="#{lang.nav.circle}">Circles</a>
<a href="items.html" th:href="@{/items}" th:text="#{lang.nav.items}">Items</a>

<a th:if="${session.user} neq null" th:href="@{/profile}"
Expand Down Expand Up @@ -89,7 +89,7 @@ <h3 th:text="#{lang.footer.about-us}">Rólunk</h3>
</div>
<div>
<h3 th:text="#{lang.footer.rights}">Jogi dolgok</h3>
<p>Copyright &copy; 2022 GNU/GPL 3.0</p>
<p>Copyright &copy; <span th:text="${#temporals.format(T(java.time.LocalDate).now(), 'yyyy')}" th:remove="tag">2024</span> (since 2018)</p>
<p th:text="#{lang.footer.rights-long}">
Az oldalon megjelenő képek szerzői joga minden esetben a forgalmazó kört illeti.
A képek esetenként csak illusztrációk. A termékek leírásának helyességéért az adott körök felelősek.
Expand All @@ -100,8 +100,6 @@ <h3 th:text="#{lang.footer.rights}">Jogi dolgok</h3>
<h3 th:text="#{lang.footer.partners}">Partnerek</h3>
<a href="https://foodex.sch.bme.hu/"><img src="../image/foodex.png" th:src="@{/image/foodex.png}"
class="white"/></a><br/>
<a href="https://szor.sch.bme.hu/"><i
class="material-icons">link</i><span>Szolgáltató Reszort</span></a><br/>
<ins th:text="#{lang.footer.app-by}">App by</ins>
: <a href="https://kir-dev.sch.bme.hu/"><i class="material-icons">link</i><span>KIR-DEV</span></a><br/>
<ins th:text="#{lang.footer.hosting}">Hosting</ins>
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/fragments/menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</object>

<a href="index.html" th:href="@{/}" th:text="#{lang.nav.home}" class="long">Home</a>
<a href="circle.html" th:href="@{/szor}" th:text="#{lang.nav.circle}" class="long">Circles</a>
<a href="circle.html" th:href="@{/falatozo}" th:text="#{lang.nav.circle}" class="long">Circles</a>
<a href="items.html" th:href="@{/items}" th:text="#{lang.nav.items}" class="long">Items</a>

<a th:if="${session.user} neq null" th:href="@{/profile}"
Expand Down

0 comments on commit 8f7af24

Please sign in to comment.