-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature][scaleph-ui-react] add doris template web under project (#648)
* feature: add doris template mapper * feature: add doris template service * feature: add doris template service * feature: add doris template web route * feature: add doris template web
- Loading branch information
Showing
24 changed files
with
1,159 additions
and
27 deletions.
There are no files selected for viewing
96 changes: 96 additions & 0 deletions
96
scaleph-api/src/main/java/cn/sliew/scaleph/api/controller/ws/WsDorisTemplateController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
/* | ||
* 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 cn.sliew.scaleph.api.controller.ws; | ||
|
||
import cn.sliew.scaleph.api.annotation.Logging; | ||
import cn.sliew.scaleph.engine.doris.service.WsDorisTemplateService; | ||
import cn.sliew.scaleph.engine.doris.service.dto.WsDorisTemplateDTO; | ||
import cn.sliew.scaleph.engine.doris.service.param.WsDorisTemplateAddParam; | ||
import cn.sliew.scaleph.engine.doris.service.param.WsDorisTemplateListParam; | ||
import cn.sliew.scaleph.engine.doris.service.param.WsDorisTemplateUpdateParam; | ||
import cn.sliew.scaleph.system.model.ResponseVO; | ||
import cn.sliew.scaleph.system.snowflake.exception.UidGenerateException; | ||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
import javax.validation.Valid; | ||
import java.util.List; | ||
|
||
@Tag(name = "Doris管理-模板管理") | ||
@RestController | ||
@RequestMapping(path = "/api/doris/template") | ||
public class WsDorisTemplateController { | ||
|
||
@Autowired | ||
private WsDorisTemplateService wsDorisTemplateService; | ||
|
||
@Logging | ||
@GetMapping | ||
@Operation(summary = "查询模板列表", description = "分页查询模板列表") | ||
public ResponseEntity<Page<WsDorisTemplateDTO>> list(@Valid WsDorisTemplateListParam param) { | ||
Page<WsDorisTemplateDTO> page = wsDorisTemplateService.list(param); | ||
return new ResponseEntity<>(page, HttpStatus.OK); | ||
} | ||
|
||
@Logging | ||
@GetMapping("/{id}") | ||
@Operation(summary = "查询模板信息", description = "查询模板信息") | ||
public ResponseEntity<ResponseVO<WsDorisTemplateDTO>> selectOne(@PathVariable("id") Long id) { | ||
WsDorisTemplateDTO dto = wsDorisTemplateService.selectOne(id); | ||
return new ResponseEntity(ResponseVO.success(dto), HttpStatus.OK); | ||
} | ||
|
||
@Logging | ||
@PutMapping | ||
@Operation(summary = "新增模板", description = "新增模板") | ||
public ResponseEntity<ResponseVO> insert(@Valid @RequestBody WsDorisTemplateAddParam param) throws UidGenerateException { | ||
wsDorisTemplateService.insert(param); | ||
return new ResponseEntity<>(ResponseVO.success(), HttpStatus.OK); | ||
} | ||
|
||
@Logging | ||
@PostMapping | ||
@Operation(summary = "修改模板", description = "修改模板") | ||
public ResponseEntity<ResponseVO> update(@Valid @RequestBody WsDorisTemplateUpdateParam param) { | ||
wsDorisTemplateService.update(param); | ||
return new ResponseEntity<>(ResponseVO.success(), HttpStatus.OK); | ||
} | ||
|
||
@Logging | ||
@DeleteMapping("/{id}") | ||
@Operation(summary = "删除模板", description = "删除模板") | ||
public ResponseEntity<ResponseVO> delete(@PathVariable("id") Long id) { | ||
wsDorisTemplateService.deleteById(id); | ||
return new ResponseEntity<>(ResponseVO.success(), HttpStatus.OK); | ||
} | ||
|
||
@Logging | ||
@DeleteMapping("/batch") | ||
@Operation(summary = "批量删除模板", description = "批量删除模板") | ||
public ResponseEntity<ResponseVO> deleteBatch(@RequestBody List<Long> ids) { | ||
wsDorisTemplateService.deleteBatch(ids); | ||
return new ResponseEntity<>(ResponseVO.success(), HttpStatus.OK); | ||
} | ||
|
||
} |
72 changes: 72 additions & 0 deletions
72
scaleph-dao/src/main/java/cn/sliew/scaleph/dao/entity/master/ws/WsDorisTemplate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* | ||
* 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 cn.sliew.scaleph.dao.entity.master.ws; | ||
|
||
import cn.sliew.scaleph.dao.entity.BaseDO; | ||
import com.baomidou.mybatisplus.annotation.TableField; | ||
import com.baomidou.mybatisplus.annotation.TableName; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import lombok.Data; | ||
|
||
/** | ||
* doris template | ||
*/ | ||
@Data | ||
@TableName("ws_doris_template") | ||
@Schema(name = "WsDorisTemplate对象", description = "doris template") | ||
public class WsDorisTemplate extends BaseDO { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
@Schema(description = "项目id") | ||
@TableField("project_id") | ||
private Long projectId; | ||
|
||
@TableField("`name`") | ||
private String name; | ||
|
||
@TableField("template_id") | ||
private String templateId; | ||
|
||
@TableField("namespace") | ||
private String namespace; | ||
|
||
@Schema(description = "session handler") | ||
@TableField("`admin`") | ||
private String admin; | ||
|
||
@Schema(description = "fe spec") | ||
@TableField("fe_spec") | ||
private String feSpec; | ||
|
||
@Schema(description = "be spec") | ||
@TableField("be_spec") | ||
private String beSpec; | ||
|
||
@Schema(description = "cn spec") | ||
@TableField("cn_spec") | ||
private String cnSpec; | ||
|
||
@Schema(description = "broker spec") | ||
@TableField("broker_spec") | ||
private String brokerSpec; | ||
|
||
@TableField("remark") | ||
private String remark; | ||
} |
31 changes: 31 additions & 0 deletions
31
scaleph-dao/src/main/java/cn/sliew/scaleph/dao/mapper/master/ws/WsDorisTemplateMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* 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 cn.sliew.scaleph.dao.mapper.master.ws; | ||
|
||
import cn.sliew.scaleph.dao.entity.master.ws.WsDorisTemplate; | ||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
import org.springframework.stereotype.Repository; | ||
|
||
/** | ||
* doris template Mapper 接口 | ||
*/ | ||
@Repository | ||
public interface WsDorisTemplateMapper extends BaseMapper<WsDorisTemplate> { | ||
|
||
} |
51 changes: 51 additions & 0 deletions
51
...ph-dao/src/main/resources/cn/sliew/scaleph/dao/mapper/master/ws/WsDorisTemplateMapper.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ 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. | ||
--> | ||
|
||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
<mapper namespace="cn.sliew.scaleph.dao.mapper.master.ws.WsDorisTemplateMapper"> | ||
|
||
<!-- 通用查询映射结果 --> | ||
<resultMap id="BaseResultMap" type="cn.sliew.scaleph.dao.entity.master.ws.WsDorisTemplate"> | ||
<result column="id" property="id" /> | ||
<result column="creator" property="creator" /> | ||
<result column="create_time" property="createTime" /> | ||
<result column="editor" property="editor" /> | ||
<result column="update_time" property="updateTime" /> | ||
<result column="project_id" property="projectId" /> | ||
<result column="name" property="name" /> | ||
<result column="template_id" property="templateId" /> | ||
<result column="namespace" property="namespace" /> | ||
<result column="admin" property="admin" /> | ||
<result column="fe_spec" property="feSpec" /> | ||
<result column="be_spec" property="beSpec" /> | ||
<result column="cn_spec" property="cnSpec" /> | ||
<result column="broker_spec" property="brokerSpec" /> | ||
<result column="remark" property="remark" /> | ||
</resultMap> | ||
|
||
<!-- 通用查询结果列 --> | ||
<sql id="Base_Column_List"> | ||
id, | ||
creator, | ||
create_time, | ||
editor, | ||
update_time, | ||
project_id, `name`, template_id, namespace, `admin`, fe_spec, be_spec, cn_spec, broker_spec, remark | ||
</sql> | ||
|
||
</mapper> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
...ine-doris/src/main/java/cn/sliew/scaleph/engine/doris/service/WsDorisTemplateService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 cn.sliew.scaleph.engine.doris.service; | ||
|
||
import cn.sliew.scaleph.engine.doris.service.dto.WsDorisTemplateDTO; | ||
import cn.sliew.scaleph.engine.doris.service.param.WsDorisTemplateAddParam; | ||
import cn.sliew.scaleph.engine.doris.service.param.WsDorisTemplateListParam; | ||
import cn.sliew.scaleph.engine.doris.service.param.WsDorisTemplateUpdateParam; | ||
import cn.sliew.scaleph.engine.doris.service.resource.DorisTemplate; | ||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
|
||
import java.util.List; | ||
|
||
public interface WsDorisTemplateService { | ||
|
||
Page<WsDorisTemplateDTO> list(WsDorisTemplateListParam param); | ||
|
||
WsDorisTemplateDTO selectOne(Long id); | ||
|
||
DorisTemplate asYaml(Long id); | ||
|
||
int insert(WsDorisTemplateAddParam param); | ||
|
||
int update(WsDorisTemplateUpdateParam param); | ||
|
||
int deleteById(Long id); | ||
|
||
int deleteBatch(List<Long> ids); | ||
} |
Oops, something went wrong.