Skip to content

Commit

Permalink
Merge pull request #10 from 0-wook/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
0-wook authored Feb 28, 2024
2 parents 0128115 + e466d73 commit dbd7aa9
Show file tree
Hide file tree
Showing 18 changed files with 348 additions and 142 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ public class S3Config {
@Value("${cloud.aws.s3.bucketName}")
private String bucketName;

@Value("${cloud.aws.s3.secondBucketName:}")
private String secondBucketName;

@Value("${cloud.aws.credentials.accessKey}")
private String accessKey;

Expand All @@ -30,6 +33,11 @@ public String bucketName() {
return bucketName;
}

@Bean
public String secondBucketName() {
return secondBucketName;
}

@Bean
public AmazonS3Client amazonS3Client() {
AWSCredentials credentials = new BasicAWSCredentials(accessKey, secretKey);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
public class S3Service {

private final AmazonS3Client amazonS3Client;
private final String bucketName;
private final String secondBucketName;

public void deleteFile(String key) {
try {
amazonS3Client.deleteObject(bucketName, key);
amazonS3Client.deleteObject(secondBucketName, key);
} catch (AmazonServiceException e) {
// The call was transmitted successfully, but Amazon S3 couldn't process
// it and returned an error response.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {

@Override
protected void configure(HttpSecurity http) throws Exception {
http
.headers()
.cacheControl()
.and()
.frameOptions()
.and()
.contentTypeOptions()
.and()
.httpStrictTransportSecurity()
.maxAgeInSeconds(31536000)
.includeSubDomains(true);
http
.csrf().ignoringAntMatchers("/h2-console/**").disable()
.headers().frameOptions().disable()
Expand All @@ -32,7 +43,7 @@ protected void configure(HttpSecurity http) throws Exception {
.userInfoEndpoint()
.userService(customOAuth2UserService)
.and()
.defaultSuccessUrl("/");
.defaultSuccessUrl("/"); // prod settings
// .defaultSuccessUrl("http://localhost:3000"); // local settings
}
}
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
package kr.co.automl.global.config.web;

import kr.co.automl.domain.user.dto.SessionUser;
import lombok.RequiredArgsConstructor;
import javax.servlet.http.HttpSession;

import org.springframework.core.MethodParameter;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.support.WebDataBinderFactory;
import org.springframework.web.context.request.NativeWebRequest;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.method.support.ModelAndViewContainer;

import javax.servlet.http.HttpSession;
import kr.co.automl.domain.user.dto.SessionUser;
import lombok.RequiredArgsConstructor;

@RequiredArgsConstructor
@Component
public class LoginUserArgumentResolver implements HandlerMethodArgumentResolver {

private final HttpSession httpSession;


/**
* 현재 파라미터를 resolver가 지원할지에 대해 판단
* 현재 파라미터를 resolver가 지원할지에 대해 판단
*/
@Override
public boolean supportsParameter(MethodParameter parameter) {
Expand All @@ -33,7 +33,8 @@ public boolean supportsParameter(MethodParameter parameter) {
* 실제 바인딩할 객체 리턴
*/
@Override
public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer, NativeWebRequest webRequest, WebDataBinderFactory binderFactory) {
public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer,
NativeWebRequest webRequest, WebDataBinderFactory binderFactory) {
return httpSession.getAttribute("user");
}
}
4 changes: 3 additions & 1 deletion app/user-server/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ cloud:
static: ap-northeast-2
s3:
bucketName: ${S3_BUCKET_NAME}
secondBucketName: ${S3_SECOND_BUCKET_NAME}
stack:
auto: false
credentials:
Expand Down Expand Up @@ -54,6 +55,7 @@ spring:
scope: profile, email
client-id: ${GOOGLE_OAUTH2_CLIENT_ID}
client-secret: ${GOOGLE_OAUTH2_CLIENT_SECRET}
# redirect-uri: "https://wsautoml.com/login/oauth2/code/google" # prod settings // local settings에서는 주석 처리 할 것

logging:
level:
Expand All @@ -70,7 +72,7 @@ spring:
config:
activate:
# on-profile: local # local settings
on-profile: prod
on-profile: prod # prod settings

datasource:
url: jdbc:mariadb://${DATABASE_URL}:3306/automl
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
cloud:
aws:
credentials:
accessKey: # 여기에 입력
secretKey: # 여기에 입력
s3:
bucketName: # 여기에 입력
secondBucketName: # 여기에 입력
spring:
datasource:
url: # 여기에 입력
username: # 여기에 입력
password: # 여기에 입력
security:
oauth2:
client:
registration:
google:
scope: profile, email
client-id: # 여기에 입력
client-secret: # 여기에 입력
7 changes: 7 additions & 0 deletions app/user-web/src/api/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ function getModelLearningResult() {
});
}

function getModelOperationStatus() {
return axios
.get("/mlResultById")
.then((response) => response.data.data[0].result);
}

// 사용자 세션 정보
function getUserInfo() {
return axios
Expand Down Expand Up @@ -78,6 +84,7 @@ export {
getMetadatas,
getModelLearningResult,
getUserInfo,
getModelOperationStatus,
deleteModelLearningResult,
getConzonRowNames,
getConzonRowDatesById,
Expand Down
9 changes: 6 additions & 3 deletions app/user-web/src/components/presentational/LoginCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,13 @@ export default function LoginCard() {
<GoogleButton
type='light'
label='Google로 로그인'
// onClick={() =>
// (window.location.href =
// "http://localhost:8080/oauth2/authorization/google")
// } // local settings
onClick={() =>
(window.location.href =
"http://automl-user-load-balancer-366843044.ap-northeast-2.elb.amazonaws.com/oauth2/authorization/google")
}
(window.location.href = "/oauth2/authorization/google")
} // prod settings
/>
</Box>
</CardContent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,16 @@ const linkBoxInfo = [
{ name: "메인페이지", href: "/" },
{
name: "데이터 검색",
href:
"http://automl-user-load-balancer-366843044.ap-northeast-2.elb.amazonaws.com/search",
href: "https://wsautoml.com/search",
},
{ name: "데이터 활용" },
{
name: "- 모델 학습",
href:
"http://automl-user-load-balancer-366843044.ap-northeast-2.elb.amazonaws.com/model-learning",
href: "https://wsautoml.com/model-learning",
},
{
name: "- 모델 운영",
href:
"http://automl-user-load-balancer-366843044.ap-northeast-2.elb.amazonaws.com/model-operation",
href: "https://wsautoml.com/model-operation",
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ export default function AdminUsageListItems() {
textAlign: "right",
}}
>
<Link href='http://automl-main-web-load-balancer-213875655.ap-northeast-2.elb.amazonaws.com/home'>
관리자 페이지
</Link>
<Link href='https://admin.wsautoml.com/home'>관리자 페이지</Link>
</Typography>
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default function IntroduceCommentBox() {
color: "white",
}}
>
<Typography variant='h4'>Welcome to WS-AutoML.co.kr</Typography>
<Typography variant='h4'>Welcome to WS-AutoML</Typography>
<Divider
sx={{
my: "10px",
Expand All @@ -25,7 +25,7 @@ export default function IntroduceCommentBox() {
통합 데이터 관리 플랫폼으로서 공공기관과 CLUST Consortium에서
</Typography>
<Typography variant='h5'>
구축된 데이터를 활용한 분석 서비스를 제공한다.
구축된 데이터를 활용한 분석 서비스를 제공합니다.
{/* 구축된 데이터를 활용한 분석 및 시각화 서비스를 제공한다. */}
</Typography>
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,17 @@ const cardInfo = [
{
name: "검색",
image: "/static/images/cards/search.jpg",
link:
"http://automl-user-load-balancer-366843044.ap-northeast-2.elb.amazonaws.com/search",
link: "https://wsautoml.com/search",
},
{
name: "모델 학습",
image: "/static/images/cards/ai.jpeg",
link:
"http://automl-user-load-balancer-366843044.ap-northeast-2.elb.amazonaws.com/model-learning",
link: "https://wsautoml.com/model-learning",
},
{
name: "모델 운영",
image: "/static/images/cards/visualization.png",
link:
"http://automl-user-load-balancer-366843044.ap-northeast-2.elb.amazonaws.com/model-operation",
link: "https://wsautoml.com/model-operation",
},
// {
// name: "시각화(예정)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const CONTENT_NAME_HEIGHT = "50px";
export const CONTENT_BACKGROUND_COLOR = "#F4F8F9";

const STEP_COUNT_AND_NAME_MAP = {
1: "메타데이터 선택",
1: "데이터 선택",
2: "데이터 탐색",
3: "특징 선택",
4: "알고리즘 선택",
Expand Down
Loading

0 comments on commit dbd7aa9

Please sign in to comment.