Skip to content

Commit

Permalink
Merge pull request #360 from TrandPick/development
Browse files Browse the repository at this point in the history
feat: 누적 접속자 파악을 위한 로직 추가 (#355)
  • Loading branch information
angelSuho authored Jul 10, 2023
2 parents 1709065 + 922bb4c commit 0ab14f4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -1,33 +1,23 @@
package project.trendpick_pro.domain.common.controller;

import jakarta.servlet.http.HttpSession;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.core.io.Resource;
import org.springframework.core.io.UrlResource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.util.UriComponentsBuilder;
import project.trendpick_pro.domain.common.base.filetranslator.FileTranslator;

import java.net.MalformedURLException;
import project.trendpick_pro.domain.common.view.service.ViewService;

@Slf4j
@Controller
@RequiredArgsConstructor
public class CommonController {

private final FileTranslator fileTranslator;

@ResponseBody
@GetMapping("/images/{filename}")
public Resource downloadImage(@PathVariable String filename) throws MalformedURLException {
return new UrlResource("file:" + fileTranslator.getFilePath(filename));
}
private final ViewService viewService;

@GetMapping("/")
public String index() {
public String index(HttpSession session) {
viewService.requestIncrementViewCount(session);
String mainCategory = "전체";
String redirectUrl = UriComponentsBuilder
.fromPath("/trendpick/products/list")
Expand All @@ -36,11 +26,4 @@ public String index() {

return "redirect:" + redirectUrl;
}

@GetMapping("/test")
public String test() {
return "trendpick/orders/standByOrder";
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

@Slf4j
@Configuration
@Profile({"dev", "test", "prod"})
@Profile({"dev", "test"})
public class BaseData {

@Value("${tag}")
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spring:
password: ${custom.dataSource.password}
jpa:
hibernate:
ddl-auto: create
ddl-auto: update
data:
redis:
host: ${redis.host}
Expand Down

0 comments on commit 0ab14f4

Please sign in to comment.