Skip to content

Commit

Permalink
feat: store core module
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeongh00 committed Jul 21, 2024
1 parent 5d3c099 commit 94aa73e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ public class AuthConsts {
public static final String AUTHORIZATION = "Authorization";
public static final String EMPTY_HEADER = null;
public static final String REFRESH_TOKEN_HEADER = "RefreshToken";
public static final String ACCESS_TOKEN_HEADER = "AccessToken";
public static final String AUTHENTICATION_TYPE_PREFIX = AUTHENTICATION_TYPE+" ";
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.likelion.coremodule.VisitList.domain;

import com.likelion.coremodule.market.domain.Market;
import com.likelion.coremodule.store.domain.Store;
import com.likelion.coremodule.user.domain.User;
import jakarta.persistence.*;
Expand All @@ -18,11 +17,11 @@ public class VisitList {
@Column(name = "visit_id")
private Long id;

@OneToOne(fetch = FetchType.LAZY)
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "store_id")
private Store store;

@OneToOne(fetch = FetchType.LAZY)
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "user_id")
private User user;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import com.likelion.coremodule.store.service.StoreQueryService;
import com.likelion.coremodule.user.application.UserQueryService;
import com.likelion.coremodule.user.domain.User;
import com.likelion.coremodule.user.util.UserUtils;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

Expand All @@ -28,11 +27,9 @@ public Market findMarket(Long id) {
return marketRepository.findById(id).orElseThrow(() -> new MarketException(MarketErrorCode.NO_MARKET_INFO));
}

public void saveVisitList(Long storeId) {
public void saveVisitList(Long storeId, String email) {

String email = UserUtils.getEmailFromAccessUser();
User user = userQueryService.findByEmail(email);

Store store = storeQueryService.findStoreById(storeId);

final VisitList visitList = VisitList.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

@Builder
@Getter
@Setter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor
@Entity
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.likelion.coremodule.user.dto;

import io.swagger.v3.oas.annotations.media.Schema;

public record LoginAddResponse(
String nickname,
@Schema(description = "액세스 토큰", example = "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0QGdtYWlsLmNvbSIs", defaultValue = "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0QGdtYWlsLmNvbSIs")
String accessToken,
@Schema(description = "리프레시 토큰", example = "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0QGdtYWlsLmNvbSIs", defaultValue = "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0QGdtYWlsLmNvbSIs")
String refreshToken
) {
}

0 comments on commit 94aa73e

Please sign in to comment.