Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
qlido committed Apr 10, 2024
2 parents 59131a7 + 9aaf1d4 commit 26e5586
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,26 @@

import java.util.List;

import org.springframework.http.ResponseEntity;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;

import com.project.bumawiki.domain.docs.domain.repository.DocsRepository;
import com.project.bumawiki.domain.docs.presentation.dto.response.DocsPopularResponseDto;
import com.project.bumawiki.domain.docs.service.DocsPopularInformationService;

import lombok.RequiredArgsConstructor;

@RestController
@RequestMapping("/api/docs")
@RequiredArgsConstructor
@RequestMapping("/api/docs")
public class DocsPopularInformationController {
private final DocsPopularInformationService docsPopularInformationService;
private final DocsRepository docsRepository;

@GetMapping("/popular")
public ResponseEntity<List<DocsPopularResponseDto>> docsPopular() {
return ResponseEntity.ok(docsPopularInformationService.getDocsByPopular());
@ResponseStatus(HttpStatus.OK)
public List<DocsPopularResponseDto> docsPopular() {
return docsRepository.findByThumbsUpsDesc();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import com.project.bumawiki.domain.docs.domain.Docs;
import com.project.bumawiki.domain.docs.domain.VersionDocs;
import com.project.bumawiki.domain.docs.domain.type.DocsType;
import com.project.bumawiki.domain.docs.service.DocsUtil;
import com.project.bumawiki.domain.docs.util.DocsUtil;

import lombok.Getter;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
package com.project.bumawiki.domain.docs.presentation.dto.response;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.project.bumawiki.domain.docs.domain.type.DocsType;

public class DocsPopularResponseDto {
@JsonProperty
private final String title;
@JsonProperty
private final int enroll;
@JsonProperty
private final DocsType docsType;
@JsonProperty
private final long thumbsUpsCounts;
public record DocsPopularResponseDto(
String title,
Integer enroll,
DocsType docsType,
Long thumbsUpsCounts
) {

public DocsPopularResponseDto(String title, int enroll, DocsType docsType, long thumbsUpsCounts) {
public DocsPopularResponseDto(String title, Integer enroll, DocsType docsType, Long thumbsUpsCounts) {
this.title = title;
this.enroll = enroll;
this.docsType = docsType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import com.project.bumawiki.domain.docs.domain.VersionDocs;
import com.project.bumawiki.domain.docs.domain.type.DocsType;
import com.project.bumawiki.domain.docs.domain.type.Status;
import com.project.bumawiki.domain.docs.service.DocsUtil;
import com.project.bumawiki.domain.docs.util.DocsUtil;
import com.project.bumawiki.domain.user.domain.User;
import com.project.bumawiki.domain.user.presentation.dto.SimpleUserDto;

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.project.bumawiki.domain.docs.service;
package com.project.bumawiki.domain.docs.util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;
Expand Down

0 comments on commit 26e5586

Please sign in to comment.