Skip to content

Commit

Permalink
Merge pull request #260 from bankidz/dev
Browse files Browse the repository at this point in the history
v1.1.3 버전 배포
  • Loading branch information
ozzing authored Nov 2, 2022
2 parents f41ad97 + 86b4747 commit 0fdde5d
Show file tree
Hide file tree
Showing 10 changed files with 180 additions and 51 deletions.
88 changes: 55 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,40 @@
# BANKIDZ-SERVER


![image](https://user-images.githubusercontent.com/63996052/180037052-29f57dd5-ef81-4062-8326-472c7c2b27be.png)


<div align="center">

💰 실전 금융 경험을 통해 어린이 금융 리터러시를 향상시키다, <b>BANKIDZ</b> 🐷
</div>
<br>

![image](https://user-images.githubusercontent.com/63996052/195283994-7e35ab95-dd6a-411f-bea0-dc5d7da35170.png)

---
| AD | Instagram | Web | iOS App | Android App |
| :--: | :-------: | :---------------------------------: | :----------------------------------------------------------: | :----------------------------------------------------------: |
| - | - | [bankidz.com](https://bankidz.com/) | <a href="https://play.google.com/store/apps/details?id="><img src="https://tools.applemediaservices.com/api/badges/download-on-the-app-store/black/ko-kr?size=250x83&amp;releaseDate=1654300800&h=dd4ccd7fb22c609cf9132f37bf23c390" alt="Download on the App Store" style="border-radius: 13px; width: 250px; height: 83px;"></a> | <a href='https://play.google.com/store/apps/details?id='><img alt='다운로드하기 Google Play' width='285px' src='https://play.google.com/intl/en_us/badges/static/images/badges/ko_badge_web_generic.png'/></a> |
</div>

## 🍭 Main Service

**돈길 생성**: 자신의 목표를 기반으로 저축 계획과 방법(이자율, 절반보상, 형제와 경쟁 등)을 생성할 수 있습니다.
* 뱅키즈는 웹뷰 환경에 최적화 되어 있습니다. 기타 웹 브라우저 환경에서는 일부 기능이 작동하지 않습니다.
* 뱅키즈 앱은 현재 App Store, Google Play 출시를 위해 심사중입니다.

**돈길 수락/거절**: 부모는 자녀가 생성한 돈길에 대하여 한 줄 코멘트와 함께 수락 및 거절을 할 수 있습니다.

**마이페이지**: 돈길 관련 통합 데이터(총 돈길, 성공률 등)를 확인할 수 있으며, 가족 코드 공유를 통해 가족을 초대할 수 있습니다.
## Main Feature
#### 자녀
![image](https://user-images.githubusercontent.com/63996052/195284727-16bcb0a5-d8e4-4cb2-9610-bdab1ee28369.png)
![image](https://user-images.githubusercontent.com/63996052/195285361-22d6a507-e426-41cb-8390-e17507e2878e.png)
#### 부모
![image](https://user-images.githubusercontent.com/63996052/195285132-86c4d1f5-a201-4259-b575-c15d66694430.png)
![image](https://user-images.githubusercontent.com/63996052/195285410-12eb2e3a-7356-49c7-b8f1-cd7d7aacfc9c.png)

<!--
---

## 🎠 WorkFlow
## WorkFlow

![image](https://user-images.githubusercontent.com/63996052/195284780-45cff104-98ba-475e-b90f-158d4f503fec.png)

-->
---

## 💻 Back-End Developers
## Back-End Developers

<div align="center">

Expand All @@ -37,25 +44,23 @@
| [ozzing](https://github.com/ozzing) | [sanbonai06](https://github.com/sanbonai06) |
</div>


## Skills
<img src="https://img.shields.io/badge/java-007396?style=for-the-badge&logo=java&logoColor=white"> <img src="https://img.shields.io/badge/spring%20boot-6DB33F?style=for-the-badge&logo=springboot&logoColor=white"> <img src="https://img.shields.io/badge/junit5-25A162?style=for-the-badge&logo=junit5&logoColor=white"> <img src="https://img.shields.io/badge/mysql-4479A1?style=for-the-badge&logo=mysql&logoColor=white"> <img src="https://img.shields.io/badge/gradle-02303A?style=for-the-badge&logo=gradle&logoColor=white">

---
<img src="https://img.shields.io/badge/ec2-FF9900?style=for-the-badge&logo=amazonec2&logoColor=white"> <img src="https://img.shields.io/badge/rds-527FFF?style=for-the-badge&logo=amazonrds&logoColor=white"> <img src="https://img.shields.io/badge/swagger-85EA2D?style=for-the-badge&logo=swagger&logoColor=white"> <img src="https://img.shields.io/badge/docker-2496ED?style=for-the-badge&logo=docker&logoColor=white"> <img src="https://img.shields.io/badge/github%20actions-2088FF?style=for-the-badge&logo=githubactions&logoColor=white">

## Git Branch Strategy
## Git Branch Strategy

![image](https://user-images.githubusercontent.com/63996052/180049335-1c101dd3-6d1c-415b-85c3-e3264a28c797.png)

---

## 📑 Convention
## Convention

![image](https://user-images.githubusercontent.com/63996052/180043284-95b8e582-a270-4b59-8528-2bd9c8011d2a.png)
![image](https://user-images.githubusercontent.com/63996052/180049517-c1b506ac-9c37-4ee0-9375-0f9c07355637.png)

---

## 📁 Project Foldering
## Project Foldering

```
.idea
Expand All @@ -79,7 +84,9 @@ src
│ │
│ │────config
│ │ └─security
│ │
│ │
│ │────constant
│ │
│ │────controller
│ │ └─request
│ │
Expand All @@ -89,6 +96,8 @@ src
│ │ └─oauth
│ │
│ │────exception
│ │
│ │────mapper
│ │
│ │────repository
│ │
Expand All @@ -106,9 +115,7 @@ src
└─BankidsApplicationTests
```

---

## 🛠️ Dependencies
## Dependencies

```gradle
dependencies {
Expand All @@ -123,6 +130,12 @@ dependencies {
implementation 'io.springfox:springfox-boot-starter:3.0.0'
implementation 'io.springfox:springfox-swagger-ui:3.0.0'
implementation 'com.github.maricn:logback-slack-appender:1.4.0'
implementation 'org.springframework.cloud:spring-cloud-starter-aws:2.0.1.RELEASE'
implementation 'com.nimbusds:nimbus-jose-jwt:9.24.2'
implementation 'org.bouncycastle:bcprov-ext-jdk15to18:1.64'
implementation group: 'com.google.firebase', name: 'firebase-admin', version: '6.8.1'
implementation group: 'com.squareup.okhttp3', name: 'okhttp', version: '4.2.2'
implementation 'io.github.jav:expo-server-sdk:1.1.0'
compileOnly 'org.projectlombok:lombok'
runtimeOnly 'mysql:mysql-connector-java'
annotationProcessor 'org.projectlombok:lombok'
Expand All @@ -136,24 +149,33 @@ dependencies {
testImplementation 'net.bytebuddy:byte-buddy:1.12.9'
}
```
---

## 🚧 ERD

![image](https://user-images.githubusercontent.com/63996052/180050308-788f7b04-e599-48d0-b039-7d7d3cbe2b7f.png)
## ERD

---
![image](https://user-images.githubusercontent.com/63996052/195288741-af936de7-a23a-49a0-986c-6fa51ba12008.png)

## 🏛 Architecture
## Architecture

![KakaoTalk_Photo_2022-07-11-20-35-48](https://user-images.githubusercontent.com/59060780/178255707-814eb2ac-be3a-4350-940c-f060890c2420.jpeg)

---

## 🌈 Test Coverage
## Test Coverage

![image](https://user-images.githubusercontent.com/63996052/180591843-3344c378-bd7f-4487-bc08-ce44e0da3fb9.png)


## Awards

| 수상 일자 | 대회명 | 최종실적 | 상금 (만원) |
| :-------- | :----------------------------------- | :------------------------------------------ | :---------- |
| 22.07.14 | SC제일은행 ‘Women in Fintech’ | 최종선정, Creator상 수상 (2위) | 500 |
| 22.08.05 | 신촌 연합 IT 창업 학회 CEOS 데모데이 | 우수상 수상 | 10 |
| 22.08.16 | 신한은행 ‘퓨쳐스랩 8기 뱅크플러스’ | 1차 서류 합격, 2차 면접 탈락 | - |
| 22.08.19 | 오렌지 플래닛 ‘오렌지 가든’ 6기 | 1차 서류 합격, 2차 인터뷰 합격, 3차 PT 탈락 | - |
| 22.08.28 | 전국 대학생 창업컨퍼런스 ‘시도’ | 결승진출 | - |
| 22.08.31 | 예비창업패키지 프리스쿨 | 최종선정 | 460 |


---

###### 2022 Bankidz Server
4 changes: 4 additions & 0 deletions src/main/java/com/ceos/bankids/BankidsApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
@SpringBootApplication
public class BankidsApplication {

static {
System.setProperty("com.amazonaws.sdk.disableEc2Metadata", "true");
}

public static void main(String[] args) {
SpringApplication.run(BankidsApplication.class, args);
System.out.println("LocalDateTime.now() = " + LocalDateTime.now());
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/com/ceos/bankids/domain/Challenge.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

import com.ceos.bankids.constant.ChallengeStatus;
import com.ceos.bankids.exception.BadRequestException;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import java.sql.Timestamp;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
Expand All @@ -27,6 +29,8 @@
import org.hibernate.annotations.ColumnDefault;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;

@Getter
@Setter
Expand All @@ -37,6 +41,8 @@
@DynamicInsert
@DynamicUpdate
@ToString(exclude = {"progressList", "challengeUserList"})
@Where(clause = "deleted_at is Null")
@SQLDelete(sql = "UPDATE challenge SET deleted_at = CURRENT_TIMESTAMP where id = ?")
public class Challenge extends AbstractTimestamp {

@Id
Expand Down Expand Up @@ -76,6 +82,10 @@ public class Challenge extends AbstractTimestamp {
@Column(nullable = false)
private String fileName;

@Column()
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd hh:mm:ss", timezone = "Asia/Seoul")
private Timestamp deleted_at;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "targetItemId", nullable = false)
private TargetItem targetItem;
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/com/ceos/bankids/domain/ChallengeUser.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.ceos.bankids.domain;

import com.ceos.bankids.exception.BadRequestException;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.sql.Timestamp;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
Expand All @@ -16,13 +18,17 @@
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;

@Entity
@Getter
@Setter
@Table(name = "ChallengeUser")
@NoArgsConstructor
@EqualsAndHashCode(of = "id")
@Where(clause = "deleted_at is Null")
@SQLDelete(sql = "UPDATE challenge_user SET deleted_at = CURRENT_TIMESTAMP where id = ?")
public class ChallengeUser extends AbstractTimestamp {

@Id
Expand All @@ -32,6 +38,10 @@ public class ChallengeUser extends AbstractTimestamp {
@Column(nullable = false)
private String member;

@Column()
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd hh:mm:ss", timezone = "Asia/Seoul")
private Timestamp deleted_at;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "user_id", nullable = false)
private User user;
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/com/ceos/bankids/domain/Comment.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.ceos.bankids.domain;

import com.ceos.bankids.exception.BadRequestException;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import java.sql.Timestamp;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
Expand All @@ -18,6 +20,8 @@
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;

@Getter
@Setter
Expand All @@ -26,6 +30,8 @@
@NoArgsConstructor
@DynamicUpdate
@EqualsAndHashCode(of = "id")
@Where(clause = "deleted_at is Null")
@SQLDelete(sql = "UPDATE comment SET deleted_at = CURRENT_TIMESTAMP where id = ?")
public class Comment {

@Id
Expand All @@ -35,6 +41,10 @@ public class Comment {
@Column(nullable = false)
private String content;

@Column()
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd hh:mm:ss", timezone = "Asia/Seoul")
private Timestamp deleted_at;

@OneToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "challengeId", nullable = false)
@JsonIgnore
Expand Down
12 changes: 11 additions & 1 deletion src/main/java/com/ceos/bankids/domain/Progress.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.ceos.bankids.domain;

import com.ceos.bankids.exception.BadRequestException;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.sql.Timestamp;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
Expand All @@ -17,6 +19,8 @@
import lombok.Setter;
import org.hibernate.annotations.ColumnDefault;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;

@Entity
@Getter
Expand All @@ -25,6 +29,8 @@
@NoArgsConstructor
@DynamicInsert
@EqualsAndHashCode(of = "id")
@Where(clause = "deleted_at is Null")
@SQLDelete(sql = "UPDATE progress SET deleted_at = CURRENT_TIMESTAMP where id = ?")
public class Progress extends AbstractTimestamp {

@Id
Expand All @@ -33,11 +39,15 @@ public class Progress extends AbstractTimestamp {

@Column(nullable = false)
private Long weeks;

@Column()
@ColumnDefault("false") //default value: false
private Boolean isAchieved;

@Column()
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd hh:mm:ss", timezone = "Asia/Seoul")
private Timestamp deleted_at;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "challengeId", nullable = false)
private Challenge challenge;
Expand Down
30 changes: 16 additions & 14 deletions src/main/java/com/ceos/bankids/mapper/UserMapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,21 +67,23 @@ public UserDTO updateUserType(User user, UserTypeRequest userTypeRequest) {
throw new BadRequestException(ErrorCode.USER_ALREADY_HAS_TYPE.getErrorCode());
}

// 날짜 자체가 유효한지 검사
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
dateFormat.setLenient(false);
try {
dateFormat.parse(userTypeRequest.getBirthday());
} catch (ParseException e) {
throw new BadRequestException(ErrorCode.INVALID_BIRTHDAY.getErrorCode());
}
// 날짜가 입력됐다면 유효한지 검사
if (userTypeRequest.getBirthday() != "") {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
dateFormat.setLenient(false);
try {
dateFormat.parse(userTypeRequest.getBirthday());
} catch (ParseException e) {
throw new BadRequestException(ErrorCode.INVALID_BIRTHDAY.getErrorCode());
}

// 가입이 유효한 범위의 날짜인지 검사
Calendar cal = Calendar.getInstance();
Integer currYear = cal.get(Calendar.YEAR);
Integer birthYear = Integer.parseInt(userTypeRequest.getBirthday()) / 10000;
if (birthYear >= currYear || birthYear <= currYear - 100) {
throw new BadRequestException(ErrorCode.INVALID_BIRTHDAY.getErrorCode());
// 가입이 유효한 범위의 날짜인지 검사
Calendar cal = Calendar.getInstance();
Integer currYear = cal.get(Calendar.YEAR);
Integer birthYear = Integer.parseInt(userTypeRequest.getBirthday()) / 10000;
if (birthYear >= currYear || birthYear <= currYear - 100) {
throw new BadRequestException(ErrorCode.INVALID_BIRTHDAY.getErrorCode());
}
}

UserDTO userDTO = userService.updateUserType(user, userTypeRequest);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public class ExpoNotificationServiceImpl implements ExpoNotificationService {

private final NotificationRepository notificationRepository;

// Pagenation
@Transactional
@Override
public NotificationListDTO readNotificationList(User user, Long lastId) {
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ apple.client.id=${APPLE_CLIENT_ID}
apple.key.id=${APPLE_KEY}
apple.key.path=apple-auth-key.p8
apple.nonce=${APPLE_NONCE}
withdrawal.slack.webhook-uri=${SLACK_WITHDRAWAL_URI}
withdrawal.slack.webhook-uri=${SLACK_WITHDRAWAL_URI}
logging.level.com.amazonaws.util.EC2MetadataUtils=ERROR
Loading

0 comments on commit 0fdde5d

Please sign in to comment.