Skip to content

Commit

Permalink
Merge branch 'main' into BE/release
Browse files Browse the repository at this point in the history
  • Loading branch information
twoo1999 authored Jan 29, 2024
2 parents 5ccdf6d + 8cf2494 commit 5049270
Show file tree
Hide file tree
Showing 380 changed files with 20,054 additions and 53 deletions.
10 changes: 0 additions & 10 deletions .github/ISSUE_TEMPLATE.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: 이슈 템플릿
name: ISSUE_TEMPLATE
about: 공통적으로 사용되는 이슈 템플릿
title: ''
labels: ''
Expand Down
18 changes: 0 additions & 18 deletions .github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

136 changes: 136 additions & 0 deletions .github/workflows/Xcode_build_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
name: Xcode_build_test

env:
WORKSPACE: iOS/MusicSpot.xcworkspace

on:
pull_request:
branches:
- 'iOS/release'
- 'iOS/epic/**'
types: [assigned, labeled, opened, synchronize, reopened]

jobs:
prepare-matrix:
runs-on: macos-13
outputs:
matrix: ${{ steps.generate-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4

- name: Setup Xcode
if: ${{ !env.ACT }}
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.0.1'

- name: Generate matrix
id: generate-matrix
run: |
matrix="{\"include\":["
first_entry=true
for scheme in $(xcodebuild -workspace ${{ env.WORKSPACE }} -list | grep -A 100 "Schemes:" | grep -v "Schemes:" | sed '/^$/d' | sed 's/^[ \t]*//'); do
if [[ $scheme != *"-Package" ]] && [[ $scheme != *"Tests" ]]; then
if [ "$first_entry" = true ]; then
first_entry=false
else
matrix+=","
fi
matrix+="{\"scheme\":\"$scheme\"}"
fi
done
matrix+="]}"
echo "matrix=$matrix" >> $GITHUB_OUTPUT
xcode-build:
needs: prepare-matrix
runs-on: macos-13
strategy:
fail-fast: false
matrix: ${{fromJson(needs.prepare-matrix.outputs.matrix)}}
steps:
- uses: actions/checkout@v4

- name: Create secret file
env:
API_SECRET: ${{ secrets.API_SECRET }}
run: |
echo $API_SECRET | base64 -D -o iOS/MSData/Sources/MSData/Resources/APIInfo.plist
- name: Setup Xcode
if: ${{ !env.ACT }}
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.0.1'

- name: 🛠️ Build ${{ matrix.scheme }}
run: |
echo "🛠️ Building ${{ matrix.scheme }}"
xcodebuild \
-workspace ${{ env.WORKSPACE }} \
-scheme ${{ matrix.scheme }} \
-sdk 'iphonesimulator' \
-destination 'platform=iOS Simulator,OS=17.0.1,name=iPhone 15 Pro' \
clean build
prepare-test-matrix:
runs-on: macos-13
outputs:
matrix: ${{ steps.generate-test-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4

- name: Setup Xcode
if: ${{ !env.ACT }}
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.0.1'

- name: Generate test matrix
id: generate-test-matrix
run: |
matrix="{\"include\":["
first_entry=true
for scheme in $(xcodebuild -workspace ${{ env.WORKSPACE }} -list | grep -A 100 "Schemes:" | grep -v "Schemes:" | sed '/^$/d' | sed 's/^[ \t]*//'); do
if [[ $scheme == *"Tests" ]]; then
if [ "$first_entry" = true ]; then
first_entry=false
else
matrix+=","
fi
matrix+="{\"scheme\":\"$scheme\"}"
fi
done
matrix+="]}"
echo "matrix=$matrix" >> $GITHUB_OUTPUT
xcode-test:
needs: prepare-test-matrix
runs-on: macos-13
strategy:
fail-fast: false
matrix: ${{fromJson(needs.prepare-test-matrix.outputs.matrix)}}
steps:
- uses: actions/checkout@v4

- name: Create secret file
env:
API_SECRET: ${{ secrets.API_SECRET }}
run: |
echo $API_SECRET | base64 -D -o iOS/MSData/Sources/MSData/Resources/APIInfo.plist
- name: Setup Xcode
if: ${{ !env.ACT }}
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.0.1'

- name: 🧪 Test ${{ matrix.scheme }}
run: |
echo "🧪 Testing ${{ matrix.scheme }}"
xcodebuild \
-workspace ${{ env.WORKSPACE }} \
-scheme ${{ matrix.scheme }} \
-sdk 'iphonesimulator' \
-destination 'platform=iOS Simulator,OS=17.0.1,name=iPhone 15 Pro' \
test
8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Created by https://www.toptal.com/developers/gitignore/api/macos,windows,xcode,swift,swiftpackagemanager
# Edit at https://www.toptal.com/developers/gitignore?templates=macos,windows,xcode,swift,swiftpackagemanager
# Created by https://www.toptal.com/developers/gitignore/api/macos
# Edit at https://www.toptal.com/developers/gitignore?templates=macos

### macOS ###
# General
Expand Down Expand Up @@ -167,6 +167,7 @@ $RECYCLE.BIN/
node_modules



# compiled output
dist
node_modules
Expand Down Expand Up @@ -203,4 +204,5 @@ lerna-debug.log*
!.vscode/launch.json
!.vscode/extensions.json

.env
.env

26 changes: 21 additions & 5 deletions BE/musicspot/public/release.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,26 @@
<title>배포 페이지</title>
</head>
<body>
<a
href="itms-services://?action=download-manifest&url=https://github.com/SwiftyJunnos/ipa/raw/main/manifest.plist"
>0.1.1</a
>
<span>배포 2023.12.08</span>
<div>
<a
href="itms-services://?action=download-manifest&url=https://github.com/SwiftyJunnos/ipa/raw/main/manifest.plist"
>0.1.1</a
>
<span>배포 2023.12.08</span>
</div>
<div>
<a
href="itms-services://?action=download-manifest&url=https://github.com/SwiftyJunnos/ipa/raw/main/0.5.0/manifest.plist"
>0.5.0</a
>
<span>배포 2023.12.11</span>
</div>
<div>
<a
href="itms-services://?action=download-manifest&url=https://github.com/SwiftyJunnos/ipa/raw/main/1.0.0/manifest.plist"
>1.0.0</a
>
<span>배포 2023.12.14(최신)</span>
</div>
</body>
</html>
5 changes: 4 additions & 1 deletion BE/musicspot/src/journey/controller/journey.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ import {
} from '../dto/journeyRecord/journeyRecord.dto';
import { StartJourneyResDTO } from '../dto/journeyStart/journeyStart.dto';
import { DeleteJourneyReqDTO } from '../dto/journeyDelete.dto';

import { Journey } from '../entities/journey.entity';


@Controller('journey')
@ApiTags('journey 관련 API')
export class JourneyController {
Expand Down Expand Up @@ -133,11 +135,12 @@ export class JourneyController {
})
@ApiCreatedResponse({
description: '사용자가 진행중이었던 여정 정보',
type: Journey,
type: LastJourneyResDTO,
})
@Get('last')
async loadLastData(@Body('userId') userId) {
return await this.journeyService.getLastJourneyByUserId(userId);

}

@ApiOperation({
Expand Down
86 changes: 86 additions & 0 deletions BE/musicspot/src/journey/dto/journeyLast.dto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import { ApiProperty } from '@nestjs/swagger';
import { IsString, IsDateString } from 'class-validator';
import { UUID } from 'crypto';

export class SpotDTO {
@ApiProperty({ description: '여정 ID', example: '65649c91380cafcab8869ed2' })
readonly journeyId: string;

@ApiProperty({ description: 'spot 위치', example: [37.555913, 126.972313] })
readonly coordinate: number[];

@ApiProperty({ description: '기록 시간', example: '2023-11-22T12:00:00Z' })
readonly timestamp: string;

@ApiProperty({
description: 'presigned url',
example:
'https://music-spot-storage.kr.object.ncloudstorage.com/path/name?AWSAccessKeyId=key&Expires=sec&Signature=signature',
})
readonly photoUrl: string;
}

class journeyMetadataDto {
@ApiProperty({
description: '여정 시작 시간',
example: '2023-11-22T15:30:00.000+09:00',
})
readonly startTimestamp: string;

@ApiProperty({
description: '여정 종료 시간',
example: '2023-11-22T15:30:00.000+09:00',
})
readonly endTimestamp: string;
}

export class JourneyDTO {
@ApiProperty({ description: '여정 ID', example: '65649c91380cafcab8869ed2' })
readonly _id: string;

@ApiProperty({ description: '여정 제목', example: '여정 제목' })
readonly title: string;

@ApiProperty({ type: [SpotDTO], description: 'spot 배열' })
readonly spots: SpotDTO[];

@ApiProperty({
description: '위치 좌표 배열',
example: [
[37.775, 122.4195],
[37.7752, 122.4197],
[37.7754, 122.4199],
],
})
readonly coordinates: number[][];

@ApiProperty({ description: '여정 메타데이터', type: journeyMetadataDto })
readonly journeyMetadata: journeyMetadataDto;
}

export class LastJourneyResDTO {
@ApiProperty({ description: '여정 ID', example: '65649c91380cafcab8869ed2' })
readonly _id: string;

@ApiProperty({ description: '여정 제목', example: '여정 제목' })
readonly title: string;

@ApiProperty({ type: [SpotDTO], description: 'spot 배열' })
readonly spots: SpotDTO[];

@ApiProperty({
description: '위치 좌표 배열',
example: [
[37.775, 122.4195],
[37.7752, 122.4197],
[37.7754, 122.4199],
],
})
readonly coordinates: number[][];

@ApiProperty({ description: '여정 메타데이터', type: journeyMetadataDto })
readonly journeyMetadata: journeyMetadataDto;

@ApiProperty({ description: '여정 마무리 여부' })
readonly isRecording: boolean;
}
3 changes: 2 additions & 1 deletion BE/musicspot/src/journey/service/journey.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export class JourneyService{

async insertJourneyData(startJourneyDTO:StartJourneyReqDTO){
const startPoint = startJourneyDTO.coordinate.join(' ');

const lineStringOfCoordinates = `LINESTRING(${startPoint}, ${startPoint})`

const returnedData = await this.journeyRepository.save({...startJourneyDTO, coordinates: lineStringOfCoordinates})
Expand All @@ -45,6 +44,7 @@ export class JourneyService{
throw new JourneyNotFoundException();
}


const originCoordinates =originData.coordinates;
const newCoordinates = originData.coordinates = originCoordinates.slice(0, -1) + ',' +endJourneyDTO.coordinates.map((item)=> `${item[0]} ${item[1]}`).join(',') + ')'
const newJourneyData = {...originData, ...endJourneyDTO, song : JSON.stringify(song), coordinates: newCoordinates};
Expand Down Expand Up @@ -87,6 +87,7 @@ export class JourneyService{
}



async getJourneyByCoordinationRange(checkJourneyDTO) {
let { userId, minCoordinate, maxCoordinate } = checkJourneyDTO;
if (!(Array.isArray(minCoordinate) && Array.isArray(maxCoordinate))) {
Expand Down
5 changes: 3 additions & 2 deletions BE/musicspot/src/spot/service/spot.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ import {
bucketName,
makePresignedUrl,
} from '../../common/s3/objectStorage';

import { JourneyNotFoundException, coordinateNotCorrectException } from 'src/filters/journey.exception';
import { is1DArray, parseCoordinateFromDtoToGeo } from 'src/common/util/coordinate.util';
import { SpotRepository } from '../repository/spot.repository';
import { RecordSpotResDTO } from '../dto/recordSpot.dto';
import { JourneyRepository } from 'src/journey/repository/journey.repository';



@Injectable()
export class SpotService {
constructor(
Expand All @@ -37,6 +36,7 @@ export class SpotService {
throw new SpotRecordFail();
}
}


async insertToSpot(spotData){
const point = `POINT(${parseCoordinateFromDtoToGeo(spotData.coordinate)})`;
Expand Down Expand Up @@ -101,6 +101,7 @@ export class SpotService {
}

return spot.photoKey;

}
}

Expand Down
Loading

0 comments on commit 5049270

Please sign in to comment.