Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/Ag-crane/Team-ED into de…
Browse files Browse the repository at this point in the history
…velop
  • Loading branch information
Ag-crane committed Aug 22, 2023
2 parents d98b74a + 5293945 commit a7f48db
Show file tree
Hide file tree
Showing 32 changed files with 784 additions and 57 deletions.
Binary file not shown.
Binary file not shown.
Binary file modified API_SERVER/satellite/.gradle/8.1.1/fileHashes/fileHashes.bin
Binary file not shown.
Binary file modified API_SERVER/satellite/.gradle/8.1.1/fileHashes/fileHashes.lock
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified API_SERVER/satellite/.gradle/file-system.probe
Binary file not shown.
8 changes: 8 additions & 0 deletions API_SERVER/satellite/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions API_SERVER/satellite/.idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

420 changes: 420 additions & 0 deletions API_SERVER/satellite/.idea/dbnavigator.xml

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions API_SERVER/satellite/.idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions API_SERVER/satellite/.idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions API_SERVER/satellite/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions API_SERVER/satellite/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
41 changes: 41 additions & 0 deletions API_SERVER/satellite/build/resources/main/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
tle:
api-key: FZVfJwO7l89rRRJg67NE56mG0iat9wPEztjLkXJd

server:
# address: localhost
address: 0.0.0.0
port: 8080

spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://14.52.137.81:3306/team_ed_user3?allowPublicKeyRetrieval=true&useSSL=false&serverTimezone=UTC
# username: satellite
# password: Abcd123!
username: team_ed
password: team_ed!@#123
jpa:
database: mysql
show-sql: true
hibernate:
ddl-auto: update
properties:
hibernate:
show_sql: true
format_sql: true
jwt:
issuer: [email protected]
secret_key: satellite-project

#app:
# datasource2:
# driver-class-name: com.mysql.cj.jdbc.Driver
# url: jdbc:mysql://localhost:3306/root?useSSL=false&serverTimezone=UTC
# username: satellite
# password: Abcd123!

#logging:
# level:
# org:
# springframework:
# security: DEBUG
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
41 changes: 41 additions & 0 deletions API_SERVER/satellite/out/production/resources/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
tle:
api-key: FZVfJwO7l89rRRJg67NE56mG0iat9wPEztjLkXJd

server:
# address: localhost
address: 0.0.0.0
port: 8080

spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://14.52.137.81:3306/team_ed_user3?allowPublicKeyRetrieval=true&useSSL=false&serverTimezone=UTC
# username: satellite
# password: Abcd123!
username: team_ed
password: team_ed!@#123
jpa:
database: mysql
show-sql: true
hibernate:
ddl-auto: update
properties:
hibernate:
show_sql: true
format_sql: true
jwt:
issuer: [email protected]
secret_key: satellite-project

#app:
# datasource2:
# driver-class-name: com.mysql.cj.jdbc.Driver
# url: jdbc:mysql://localhost:3306/root?useSSL=false&serverTimezone=UTC
# username: satellite
# password: Abcd123!

#logging:
# level:
# org:
# springframework:
# security: DEBUG
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ public List<TleData> getTleDataBySatelliteId(@RequestParam String satelliteId) {
}

@PutMapping("/{satelliteId}")
public TleData updateTleData(@PathVariable int id, @RequestBody UpdateTleDataDto tleData) {
return service.updateTleData(id, tleData);
public TleData updateTleData(@PathVariable String satelliteId, @RequestBody UpdateTleDataDto tleData) {
return service.updateTleData(satelliteId, tleData);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,5 @@
@Getter
@Setter
public class UpdateTleDataDto { // tle_data 수정할때 쓸 dto
private String satelliteNumber;
private String name;
private String classification;
private String firstLaunch;
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ public interface TleDataRepository extends JpaRepository<TleData, Long> {
List<TleData> findByNameContaining(String satelliteName);

Optional<TleData> findBySatelliteId(String satelliteId);

Optional<TleData> findById(Integer id);
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import java.util.Optional;
import java.util.stream.Collectors;


@Service
public class TleDataService {

Expand Down Expand Up @@ -73,19 +74,15 @@ public List<TleData> getSearchedTleData(String satelliteName) {
return repository.findByNameContaining(satelliteName);
}

public TleData updateTleData(int id, UpdateTleDataDto updateTleDataDto) {
if(repository.existsById((long) id)){
TleData tleData = repository.findById((long) id).get();
tleData.setSatelliteNumber(updateTleDataDto.getSatelliteNumber());
tleData.setName(updateTleDataDto.getName());
tleData.setClassification(updateTleDataDto.getClassification());
tleData.setFirstLaunch(updateTleDataDto.getFirstLaunch());
return repository.save(tleData);
} else {
throw new ResponseStatusException(HttpStatus.NOT_FOUND, "TleData not found");
}

public TleData updateTleData(String id, UpdateTleDataDto updateTleDataDto) {
TleData tleData = repository.findBySatelliteId(id)
.orElseThrow(() -> new ResponseStatusException(HttpStatus.NOT_FOUND, "TleData not found"));
tleData.setName(updateTleDataDto.getName());
return repository.save(tleData);
}


public List<TleData> getSearchedTleDataBySatelliteId(String satelliteId) {
Optional<TleData> optionalTleData = repository.findBySatelliteId(satelliteId);
return optionalTleData.map(Collections::singletonList).orElse(Collections.emptyList());
Expand Down
41 changes: 41 additions & 0 deletions API_SERVER/satellite/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
tle:
api-key: FZVfJwO7l89rRRJg67NE56mG0iat9wPEztjLkXJd

server:
# address: localhost
address: 0.0.0.0
port: 8080

spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://14.52.137.81:3306/team_ed_user3?allowPublicKeyRetrieval=true&useSSL=false&serverTimezone=UTC
# username: satellite
# password: Abcd123!
username: team_ed
password: team_ed!@#123
jpa:
database: mysql
show-sql: true
hibernate:
ddl-auto: update
properties:
hibernate:
show_sql: true
format_sql: true
jwt:
issuer: [email protected]
secret_key: satellite-project

#app:
# datasource2:
# driver-class-name: com.mysql.cj.jdbc.Driver
# url: jdbc:mysql://localhost:3306/root?useSSL=false&serverTimezone=UTC
# username: satellite
# password: Abcd123!

#logging:
# level:
# org:
# springframework:
# security: DEBUG
Loading

0 comments on commit a7f48db

Please sign in to comment.