-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Bug][docker] fix scaleph-seatunnel image error (#638)
* feature: add doris operator * feature: add web-resource and role relation table * feature: add web-resource and role relation mapper * feature: add web-resource and role relation mapper * fix: seatunnel base image
- Loading branch information
Showing
47 changed files
with
1,657 additions
and
20 deletions.
There are no files selected for viewing
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
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
42 changes: 42 additions & 0 deletions
42
...eph-dao/src/main/java/cn/sliew/scaleph/dao/entity/master/security/SecResourceWebRole.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,42 @@ | ||
/* | ||
* 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.security; | ||
|
||
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; | ||
|
||
/** | ||
* 资源-web与角色关联表 | ||
*/ | ||
@Data | ||
@TableName("sec_resource_web_role") | ||
@Schema(name = "SecResourceWebRole对象", description = "资源-web与角色关联表") | ||
public class SecResourceWebRole extends BaseDO { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
@TableField("resource_web_id") | ||
private Long resourceWebId; | ||
|
||
@TableField("role_id") | ||
private Long roleId; | ||
} |
53 changes: 53 additions & 0 deletions
53
...o/src/main/java/cn/sliew/scaleph/dao/mapper/master/security/SecResourceWebRoleMapper.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,53 @@ | ||
/* | ||
* 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.security; | ||
|
||
import cn.sliew.scaleph.common.dict.security.RoleStatus; | ||
import cn.sliew.scaleph.dao.entity.master.security.SecResourceWeb; | ||
import cn.sliew.scaleph.dao.entity.master.security.SecResourceWebRole; | ||
import cn.sliew.scaleph.dao.entity.master.security.SecRole; | ||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
import org.apache.ibatis.annotations.Param; | ||
import org.springframework.stereotype.Repository; | ||
|
||
/** | ||
* 资源-web与角色关联表 Mapper 接口 | ||
*/ | ||
@Repository | ||
public interface SecResourceWebRoleMapper extends BaseMapper<SecResourceWebRole> { | ||
|
||
/** | ||
* 查询 资源-web 关联的角色 | ||
*/ | ||
Page<SecRole> selectRelatedRolesByWebResource(Page page, | ||
@Param("resourceWebId") Long resourceWebId, | ||
@Param("status") RoleStatus status, | ||
@Param("name") String name); | ||
|
||
/** | ||
* 查询 资源-web 未关联的角色 | ||
*/ | ||
Page<SecRole> selectUnrelatedRolesByWebResource(Page page, | ||
@Param("resourceWebId") Long resourceWebId, | ||
@Param("status") RoleStatus status, | ||
@Param("name") String name); | ||
|
||
Page<SecResourceWeb> selectAllResourceWebWithAuthorizeStatus(@Param("roleId") Long roleId); | ||
} |
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
78 changes: 78 additions & 0 deletions
78
...c/main/resources/cn/sliew/scaleph/dao/mapper/master/security/SecResourceWebRoleMapper.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,78 @@ | ||
<?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.security.SecResourceWebRoleMapper"> | ||
|
||
<!-- 通用查询映射结果 --> | ||
<resultMap id="BaseResultMap" type="cn.sliew.scaleph.dao.entity.master.security.SecResourceWebRole"> | ||
<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="resource_web_id" property="resourceWebId" /> | ||
<result column="role_id" property="roleId" /> | ||
</resultMap> | ||
|
||
<!-- 通用查询结果列 --> | ||
<sql id="Base_Column_List"> | ||
id, | ||
creator, | ||
create_time, | ||
editor, | ||
update_time, | ||
resource_web_id, role_id | ||
</sql> | ||
|
||
<select id="selectRelatedRolesByWebResource" resultMap="cn.sliew.scaleph.dao.mapper.master.security.SecRoleMapper.SecRoleMap"> | ||
SELECT | ||
t1.* | ||
FROM | ||
sec_role t1 | ||
JOIN sec_resource_web_role t2 ON t1.id = t2.role_id | ||
WHERE | ||
t2.resource_web_id = #{resourceWebId} | ||
<if test="status != null"> | ||
AND t1.`status` = #{status} | ||
</if> | ||
<if test="name != null and name != ''"> | ||
AND t1.`name` like concat('%',#{name},'%') | ||
</if> | ||
ORDER BY | ||
t1.`code` | ||
</select> | ||
|
||
<select id="selectUnrelatedRolesByWebResource" resultMap="cn.sliew.scaleph.dao.mapper.master.security.SecRoleMapper.SecRoleMap"> | ||
SELECT | ||
t1.* | ||
FROM | ||
sec_role t1 | ||
WHERE | ||
<if test="status != null"> | ||
AND t1.`status` = #{status} | ||
</if> | ||
<if test="name != null and name != ''"> | ||
AND t1.`name` like concat('%',#{name},'%') | ||
</if> | ||
AND NOT EXISTS ( SELECT * FROM sec_resource_web_role t2 WHERE t1.id = t2.role_id AND t2.resource_web_id = #{resourceWebId} ) | ||
ORDER BY | ||
t1.`code` | ||
</select> | ||
|
||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,7 +86,6 @@ | |
</otherwise> | ||
</choose> | ||
</where> | ||
|
||
|
||
</select> | ||
|
||
</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
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,43 @@ | ||
<?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. | ||
--> | ||
|
||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>cn.sliew</groupId> | ||
<artifactId>scaleph</artifactId> | ||
<version>1.0.5-SNAPSHOT</version> | ||
<relativePath>../../pom.xml</relativePath> | ||
</parent> | ||
<artifactId>scaleph-engine-doris</artifactId> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>${project.parent.groupId}</groupId> | ||
<artifactId>scaleph-project</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>io.fabric8</groupId> | ||
<artifactId>kubernetes-client</artifactId> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
36 changes: 36 additions & 0 deletions
36
...aleph-engine-doris/src/main/java/cn/sliew/scaleph/engine/doris/operator/DorisCluster.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,36 @@ | ||
/* | ||
* 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.operator; | ||
|
||
import cn.sliew.scaleph.engine.doris.operator.spec.DorisClusterSpec; | ||
import cn.sliew.scaleph.engine.doris.operator.status.DorisClusterStatus; | ||
import io.fabric8.kubernetes.api.model.Namespaced; | ||
import io.fabric8.kubernetes.client.CustomResource; | ||
import io.fabric8.kubernetes.model.annotation.Group; | ||
import io.fabric8.kubernetes.model.annotation.Kind; | ||
import io.fabric8.kubernetes.model.annotation.Version; | ||
|
||
@Version("v1") | ||
@Group("doris.selectdb.com") | ||
@Kind("DorisCluster") | ||
public class DorisCluster extends CustomResource<DorisClusterSpec, DorisClusterStatus> implements Namespaced { | ||
|
||
|
||
|
||
} |
28 changes: 28 additions & 0 deletions
28
...eph-engine-doris/src/main/java/cn/sliew/scaleph/engine/doris/operator/spec/AdminUser.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,28 @@ | ||
/* | ||
* 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.operator.spec; | ||
|
||
import lombok.Data; | ||
|
||
@Data | ||
public class AdminUser extends BaseSpec { | ||
|
||
private String name; | ||
private String password; | ||
} |
23 changes: 23 additions & 0 deletions
23
...ne-doris/src/main/java/cn/sliew/scaleph/engine/doris/operator/spec/AutoScalerVersion.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,23 @@ | ||
/* | ||
* 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.operator.spec; | ||
|
||
public enum AutoScalerVersion { | ||
v1, v2; | ||
} |
Oops, something went wrong.