Skip to content

Commit

Permalink
Merge pull request #77 from Team-UniVoice/fix/#76-slack-token
Browse files Browse the repository at this point in the history
Fix/#76 slack token
  • Loading branch information
softmoca authored Jul 18, 2024
2 parents ca829c3 + bff1afc commit 3496de5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@
@RequiredArgsConstructor
public class AuthService {

final String WEBHOOK_URL = "https://hooks.slack.com/services/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";
final String WEBHOOK_URL = "https://hooks.slack.com/services/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g3";


private static final String S3_BUCKET_URL = "https://uni-voice-bucket.s3.ap-northeast-2.amazonaws.com/";


Expand Down Expand Up @@ -170,7 +172,7 @@ public void signUp(MemberCreateRequest memberCreateRequest) {
member.getStudentNumber(),
member.getEmail(),
member.getPassword(),
member.getStudentCardImage(),
S3_BUCKET_URL + member.getStudentCardImage(),
member.getUniversityName(),
member.getCollegeDepartmentName(),
member.getDepartmentName()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
import jakarta.persistence.EntityListeners;
import jakarta.persistence.MappedSuperclass;
import jakarta.persistence.PrePersist;
import jakarta.persistence.PreUpdate;
import lombok.Getter;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.temporal.ChronoUnit;

@Getter
Expand All @@ -19,9 +22,17 @@ public abstract class BaseTimeEntity {
@CreatedDate
private LocalDateTime createdAt;

@LastModifiedDate
private LocalDateTime updatedAt;

@PrePersist
public void prePersist() {
this.createdAt = truncateToSeconds(this.createdAt);
this.createdAt = truncateToSeconds(ZonedDateTime.now(ZoneId.of("Asia/Seoul")).toLocalDateTime());
}

@PreUpdate
public void preUpdate() {
this.updatedAt = truncateToSeconds(ZonedDateTime.now(ZoneId.of("Asia/Seoul")).toLocalDateTime());
}

private LocalDateTime truncateToSeconds(LocalDateTime dateTime) {
Expand Down

0 comments on commit 3496de5

Please sign in to comment.