Skip to content

Commit

Permalink
[10983][refactor] ResourcesController add pojo
Browse files Browse the repository at this point in the history
  • Loading branch information
liguotian committed Jul 20, 2022
1 parent d49fcc0 commit 37e749c
Show file tree
Hide file tree
Showing 15 changed files with 579 additions and 222 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@

import org.apache.dolphinscheduler.spi.enums.ResourceType;

import java.io.Serializable;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
Expand All @@ -30,9 +28,7 @@
*/
@Data
@ApiModel(value = "CREATE_RESOURCE_NOTES")
public class CreateDirectoryRequest implements Serializable {

private static final long serialVersionUID = 2158023425391177729L;
public class CreateDirectoryRequest {

@ApiModelProperty(name = "type", value = "RESOURCE_TYPE", required = true, example = "FILE")
private ResourceType type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,14 @@

import org.apache.dolphinscheduler.spi.enums.ResourceType;

import java.io.Serializable;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
* create resource request
* create resource request
*/
@Data
public class CreateResourceRequest implements Serializable {

private static final long serialVersionUID = -4751002150934450475L;
public class CreateResourceRequest {

@ApiModelProperty(name = "type", value = "RESOURCE_TYPE", notes = "FILE , UDF", required = true, example = "FILE")
private ResourceType type;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.dolphinscheduler.api.dto.resources;

import org.apache.dolphinscheduler.api.utils.Result;
import org.apache.dolphinscheduler.dao.entity.Resource;

/**
* create resource response
*/
public class CreateResourceResponse extends Result {

private Resource data;

public CreateResourceResponse(Result<Resource> result) {
super();
this.setCode(result.getCode());
this.setMsg(result.getMsg());
this.setData(result.getData());
}

@Override
public Resource getData() {
return data;
}

public void setData(Resource data) {
this.data = data;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,14 @@

import org.apache.dolphinscheduler.common.enums.UdfType;

import java.io.Serializable;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
* create udf request
*/
@Data
public class CreateUdfRequest implements Serializable {

private static final long serialVersionUID = 808084395565216909L;
public class CreateUdfRequest {

@ApiModelProperty(name = "type", value = "UDF_TYPE", required = true, dataType = "UdfType", example = "HIVE,SPARK")
private UdfType type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,13 @@

package org.apache.dolphinscheduler.api.dto.resources;

import java.io.Serializable;

import lombok.Data;

/**
* resource content
*/
@Data
public class ResourceContent implements Serializable {

private static final long serialVersionUID = 7030124374980790556L;
public class ResourceContent {

private String content;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.dolphinscheduler.api.dto.resources;

import org.apache.dolphinscheduler.api.utils.Result;

/**
* resource response
*/
public class ResourceContentResponse extends Result {

private ResourceContent data;

public ResourceContentResponse(Result<ResourceContent> result) {
super();
this.setCode(result.getCode());
this.setMsg(result.getMsg());
this.setData(result.getData());
}

@Override
public ResourceContent getData() {
return data;
}

public void setData(ResourceContent data) {
this.data = data;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.dolphinscheduler.api.dto.resources;

import org.apache.dolphinscheduler.api.utils.Result;

import java.util.List;

/**
* resource list response
*/
public class ResourceListResponse extends Result {

private List<ResourceComponent> data;

public ResourceListResponse(Result<List<ResourceComponent>> result) {
super();
this.setCode(result.getCode());
this.setMsg(result.getMsg());
this.setData(result.getData());
}

@Override
public List<ResourceComponent> getData() {
return data;
}

public void setData(List<ResourceComponent> data) {
this.data = data;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.dolphinscheduler.api.dto.resources;

import org.apache.dolphinscheduler.api.utils.PageInfo;
import org.apache.dolphinscheduler.api.utils.Result;
import org.apache.dolphinscheduler.dao.entity.Resource;

/**
* resource page response
*/
public class ResourcePageResponse extends Result {

private PageInfo<Resource> data;

public ResourcePageResponse(Result<PageInfo<Resource>> result) {
super();
this.setCode(result.getCode());
this.setMsg(result.getMsg());
this.setData(result.getData());
}

@Override
public PageInfo<Resource> getData() {
return data;
}

public void setData(PageInfo<Resource> data) {
this.data = data;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.dolphinscheduler.api.dto.resources;

import org.apache.dolphinscheduler.api.utils.Result;
import org.apache.dolphinscheduler.dao.entity.Resource;

/**
* resource response
*/
public class ResourceResponse extends Result {

private Resource data;

public ResourceResponse(Result<Resource> result) {
super();
this.setCode(result.getCode());
this.setMsg(result.getMsg());
this.setData(result.getData());
}

@Override
public Resource getData() {
return data;
}

public void setData(Resource data) {
this.data = data;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.dolphinscheduler.api.dto.resources;

import org.apache.dolphinscheduler.api.utils.Result;
import org.apache.dolphinscheduler.dao.entity.UdfFunc;

import java.util.List;

/**
* resource list response
*/
public class UdfFuncListResponse extends Result {

private List<UdfFunc> data;

public UdfFuncListResponse(Result<List<UdfFunc>> result) {
super();
this.setCode(result.getCode());
this.setMsg(result.getMsg());
this.setData(result.getData());
}

@Override
public List<UdfFunc> getData() {
return data;
}

public void setData(List<UdfFunc> data) {
this.data = data;
}
}
Loading

0 comments on commit 37e749c

Please sign in to comment.