-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into SCRUM-15-social-login
- Loading branch information
Showing
75 changed files
with
3,036 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
name: Create Jira issue | ||
on: | ||
issues: | ||
types: | ||
- opened | ||
jobs: | ||
create-issue: | ||
name: Create Jira issue | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Login | ||
uses: atlassian/gajira-login@v3 | ||
env: | ||
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }} | ||
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }} | ||
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }} | ||
|
||
- name: Checkout main code | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: main | ||
|
||
- name: Issue Parser | ||
uses: stefanbuck/github-issue-praser@v3 | ||
id: issue-parser | ||
with: | ||
template-path: .github/workflows/issue_form.yml | ||
|
||
- name: Log Issue Parser | ||
run: | | ||
echo '${{ steps.issue-parser.outputs.jsonString }}' | ||
- name: Convert markdown to Jira Syntax | ||
uses: peter-evans/jira2md@v1 | ||
id: md2jira | ||
with: | ||
input-text: | | ||
### Github Issue Link | ||
- ${{ github.event.issue.html_url }} | ||
${{ github.event.issue.body }} | ||
mode: md2jira | ||
|
||
- name: Create Issue | ||
id: create | ||
uses: atlassian/gajira-create@v3 | ||
with: | ||
project: DIAR | ||
issuetype: Subtask | ||
summary: "${{ github.event.issue.title }}" | ||
description: "${{ steps.md2jira.outputs.output-text }}" | ||
fields: | | ||
{ | ||
"parent": { | ||
"key": "${{ steps.issue-parser.outputs.issueparser_parentKey }}" | ||
} | ||
} | ||
- name: Log created issue | ||
run: echo "Jira Issue ${{ steps.issue-parser.outputs.parentKey }}/${{ steps.create.outputs.issue }} was created" | ||
|
||
- name: Checkout develop code | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: develop | ||
|
||
- name: Create branch with Ticket number | ||
run: | | ||
git checkout -b ${{ steps.create.outputs.issue }} | ||
git push origin ${{ steps.create.outputs.issue }} | ||
- name: Update issue title | ||
uses: actions-cool/issues-helper@v3 | ||
with: | ||
actions: "update-issue" | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
title: "${{ steps.create.outputs.issue }} ${{ github.event.issue.title }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: 'SSDA Front 이슈 생성' | ||
description: 'SSDA Front Repo에 이슈를 생성하며, 생성된 이슈는 Jira와 연동됩니다.' | ||
labels: [order] | ||
title: '이슈 이름을 작성해주세요' | ||
on: push | ||
body: | ||
- type: input | ||
id: parentKey | ||
attributes: | ||
label: '상위 작업 Ticket Number' | ||
description: '상위 작업의 Ticket Number를 기입해주세요' | ||
placeholder: 'DIAR-00' | ||
validations: | ||
required: true | ||
|
||
- type: input | ||
id: description | ||
attributes: | ||
label: '이슈 내용(Description)' | ||
description: '이슈에 대해서 간략히 설명해주세요' | ||
validations: | ||
required: true | ||
|
||
- type: textarea | ||
id: details | ||
attributes: | ||
label: '상세 내용(Details)' | ||
description: '이슈에 대해서 자세히 설명해주세요' | ||
value: | | ||
- About Details | ||
validations: | ||
required: true | ||
|
||
- type: textarea | ||
id: tasks | ||
attributes: | ||
label: '체크리스트(Tasks)' | ||
description: '해당 이슈에 대해 필요한 작업목록을 작성해주세요' | ||
value: | | ||
- [ ] Task1 | ||
- [ ] Task2 | ||
validations: | ||
required: true | ||
|
||
- type: textarea | ||
id: references | ||
attributes: | ||
label: '참조(References)' | ||
description: '해당 이슈과 관련된 레퍼런스를 참조해주세요' | ||
value: | | ||
- Reference1 | ||
validations: | ||
required: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
rootProject.name = 'golagola' | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
src/main/java/com/kakaoteck/golagola/config/ApplicationConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
package com.kakaoteck.golagola.config; | ||
|
||
import com.kakaoteck.golagola.domain.buyer.entity.Buyer; | ||
import com.kakaoteck.golagola.domain.buyer.repository.BuyerRepository; | ||
import com.kakaoteck.golagola.domain.seller.entity.Seller; | ||
import com.kakaoteck.golagola.domain.seller.repository.SellerRepository; | ||
import com.kakaoteck.golagola.security.ApplicationAuditAware; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.data.domain.AuditorAware; | ||
import org.springframework.security.authentication.AuthenticationManager; | ||
import org.springframework.security.authentication.AuthenticationProvider; | ||
import org.springframework.security.authentication.dao.DaoAuthenticationProvider; | ||
import org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration; | ||
import org.springframework.security.core.authority.SimpleGrantedAuthority; | ||
import org.springframework.security.core.userdetails.UserDetailsService; | ||
import org.springframework.security.core.userdetails.UsernameNotFoundException; | ||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; | ||
import org.springframework.security.crypto.password.PasswordEncoder; | ||
|
||
import java.util.Collections; | ||
|
||
@Configuration | ||
@RequiredArgsConstructor | ||
public class ApplicationConfig { | ||
|
||
private final BuyerRepository buyerRepository; | ||
private final SellerRepository sellerRepository; | ||
|
||
@Bean | ||
public UserDetailsService userDetailsService() { | ||
return username -> { | ||
// Try to find the user as a Buyer | ||
Buyer buyer = buyerRepository.findByEmail(username).orElse(null); | ||
|
||
if (buyer != null) { | ||
System.out.println("Buyer found: " + username); | ||
return buyer; // Buyer 객체를 반환 | ||
} | ||
|
||
// Try to find the user as a Seller | ||
Seller seller = sellerRepository.findByEmail(username).orElse(null); | ||
|
||
if (seller != null) { | ||
System.out.println("Seller loaded: " + seller.getEmail()); | ||
return seller; // Seller 객체를 반환 | ||
} | ||
|
||
throw new UsernameNotFoundException("User not found with username: " + username); | ||
}; | ||
} | ||
|
||
|
||
|
||
@Bean | ||
public AuthenticationProvider authenticationProvider() { | ||
DaoAuthenticationProvider authProvider = new DaoAuthenticationProvider(); | ||
authProvider.setUserDetailsService(userDetailsService()); | ||
authProvider.setPasswordEncoder(passwordEncoder()); | ||
return authProvider; | ||
} | ||
|
||
@Bean | ||
public AuditorAware<Long> auditorAware() { | ||
return new ApplicationAuditAware(); | ||
} | ||
|
||
@Bean | ||
public AuthenticationManager authenticationManager(AuthenticationConfiguration config) throws Exception { | ||
return config.getAuthenticationManager(); | ||
} | ||
|
||
@Bean | ||
public PasswordEncoder passwordEncoder() { | ||
return new BCryptPasswordEncoder(); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/main/java/com/kakaoteck/golagola/config/QueryDslConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.kakaoteck.golagola.config; | ||
|
||
import com.querydsl.jpa.impl.JPAQueryFactory; | ||
import jakarta.persistence.EntityManager; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
@RequiredArgsConstructor | ||
public class QueryDslConfig { | ||
|
||
private final EntityManager em; | ||
|
||
@Bean | ||
public JPAQueryFactory jpaQueryFactory() { | ||
return new JPAQueryFactory(em); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
src/main/java/com/kakaoteck/golagola/config/RedisConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.kakaoteck.golagola.config; | ||
|
||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.data.redis.connection.RedisConnectionFactory; | ||
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory; | ||
import org.springframework.data.redis.core.RedisTemplate; | ||
import org.springframework.data.redis.serializer.StringRedisSerializer; | ||
|
||
@Configuration | ||
public class RedisConfig { | ||
|
||
@Value("${spring.data.redis.host}") | ||
private String redisHost; | ||
|
||
@Value("${spring.data.redis.port}") | ||
private int redisPort; | ||
|
||
@Bean | ||
public RedisConnectionFactory redisConnectionFactory() { | ||
return new LettuceConnectionFactory(redisHost, redisPort); | ||
} | ||
|
||
@Bean | ||
public RedisTemplate<String, Object> redisTemplate() { | ||
RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>(); | ||
redisTemplate.setConnectionFactory(redisConnectionFactory()); | ||
redisTemplate.setKeySerializer(new StringRedisSerializer()); | ||
redisTemplate.setValueSerializer(new StringRedisSerializer()); | ||
return redisTemplate; | ||
} | ||
} |
Oops, something went wrong.