Skip to content

Commit

Permalink
Merge pull request #26 from MarketPlace-O2O-Platform/refactor/#25
Browse files Browse the repository at this point in the history
[Refactor/#25] Swagger 서버 URL 프로퍼티 파일 분리
  • Loading branch information
82everywin authored Oct 14, 2024
2 parents cf8b48e + 4d39127 commit eb27159
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,8 @@ public MemberLoginResDto login(MemberLoginReqDto memberLoginReqDto) {
// 학번 로그인 검증 및 형변환
private Long validateAndParseStudentId(MemberLoginReqDto memberLoginReqDto) {
// 로그인 검증
if(!inuLoginRepository.loginCheck(memberLoginReqDto.getStudentId(), memberLoginReqDto.getPassword())) {
throw new CustomException(UNAUTHORIZED_LOGIN_ERROR);
}
try {
// 형변환
if(inuLoginRepository.loginCheck(memberLoginReqDto.getStudentId(), memberLoginReqDto.getPassword()))
return Long.valueOf(memberLoginReqDto.getStudentId());
}catch (Exception e){
throw new CustomException(INVALID_STUDENT_ID);
}
else throw new CustomException(UNAUTHORIZED_LOGIN_ERROR);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import javax.sql.DataSource;

@Configuration
@EnableJpaRepositories
public class OracleConfig {

@Bean(name = "oracleDataSource")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,26 @@
import io.swagger.v3.oas.models.Components;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.servers.Server;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


@Configuration
public class SwaggerConfig {

@Value("${swagger.server-url}")
private String serverUrl;

@Bean
public OpenAPI openAPI() {
Server server = new Server();
server.setUrl(serverUrl);
return new OpenAPI()
.components(new Components())
.addServersItem(server)
.info(apiInfo());
}

Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/application-dev.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
swagger.server-url=http://localhost:8080

# ???? ?? ?? ??
spring.jpa.properties.hibernate.show_sql=true

Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/application-prod.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
server.port=8088

swagger.server-url=https://marketplace.inuappcenter.kr

# ???? ?? ?? ??
spring.jpa.properties.hibernate.show_sql=true

Expand Down

0 comments on commit eb27159

Please sign in to comment.