Skip to content

Commit be2c698

Browse files
committed
fix: archived
1 parent bf1b5b6 commit be2c698

5 files changed

Lines changed: 26 additions & 45 deletions

File tree

backend/plugins/q_dev/Q_DEV版本部署流程.md

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
1-
> **Think:**
2-
> 我需要将这个DevLake开发环境部署文档翻译成中文。我将保持原文档的结构,但翻译所有内容到中文。
3-
>
4-
> 文档主要包括以下部分:
5-
> 1. 环境要求
6-
> 2. 如何设置开发环境
7-
> 3. 克隆仓库
8-
> 4. 安装插件依赖
9-
> 5. 配置环境变量
10-
> 6. 启动MySQL和Grafana容器
11-
> 7. 运行devlake和config-ui
12-
>
13-
> 我会逐部分翻译,保持专有名词如Docker、Golang、MySQL、Grafana等不变,同时保持命令行和代码部分不变。
1+
/*
2+
Licensed to the Apache Software Foundation (ASF) under one or more
3+
contributor license agreements. See the NOTICE file distributed with
4+
this work for additional information regarding copyright ownership.
5+
The ASF licenses this file to You under the Apache License, Version 2.0
6+
(the "License"); you may not use this file except in compliance with
7+
the License. You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
*/
17+
1418

1519
# DevLake开发环境部署指南
1620

backend/plugins/q_dev/models/migrationscripts/archived/connection.go

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ limitations under the License.
1818
package archived
1919

2020
import (
21-
"github.com/apache/incubator-devlake/core/utils"
22-
helper "github.com/apache/incubator-devlake/helpers/pluginhelper/api"
21+
commonArchived "github.com/apache/incubator-devlake/core/models/migrationscripts/archived"
2322
)
2423

2524
// QDevConn holds the essential information to connect to AWS S3
@@ -36,34 +35,12 @@ type QDevConn struct {
3635
RateLimitPerHour int `mapstructure:"rateLimitPerHour" json:"rateLimitPerHour"`
3736
}
3837

39-
func (conn *QDevConn) Sanitize() QDevConn {
40-
conn.SecretAccessKey = utils.SanitizeString(conn.SecretAccessKey)
41-
return *conn
42-
}
43-
4438
// QDevConnection holds QDevConn plus ID/Name for database storage
4539
type QDevConnection struct {
46-
helper.BaseConnection `mapstructure:",squash"`
47-
QDevConn `mapstructure:",squash"`
40+
commonArchived.BaseConnection `mapstructure:",squash"`
41+
QDevConn `mapstructure:",squash"`
4842
}
4943

5044
func (QDevConnection) TableName() string {
5145
return "_tool_q_dev_connections"
5246
}
53-
54-
func (connection QDevConnection) Sanitize() QDevConnection {
55-
connection.QDevConn = connection.QDevConn.Sanitize()
56-
return connection
57-
}
58-
59-
func (connection *QDevConnection) MergeFromRequest(target *QDevConnection, body map[string]interface{}) error {
60-
secretKey := target.SecretAccessKey
61-
if err := helper.DecodeMapStruct(body, target, true); err != nil {
62-
return err
63-
}
64-
modifiedSecretKey := target.SecretAccessKey
65-
if modifiedSecretKey == "" || modifiedSecretKey == utils.SanitizeString(secretKey) {
66-
target.SecretAccessKey = secretKey
67-
}
68-
return nil
69-
}

backend/plugins/q_dev/models/migrationscripts/archived/s3_file_meta.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ package archived
2020
import (
2121
"time"
2222

23-
"github.com/apache/incubator-devlake/core/models/common"
23+
"github.com/apache/incubator-devlake/core/models/migrationscripts/archived"
2424
)
2525

2626
// QDevS3FileMeta 存储S3文件的元数据信息
2727
type QDevS3FileMeta struct {
28-
common.NoPKModel
28+
archived.NoPKModel
2929
ConnectionId uint64 `gorm:"primaryKey"`
3030
FileName string `gorm:"primaryKey;type:varchar(255)"`
3131
S3Path string `gorm:"type:varchar(512)" json:"s3Path"`

backend/plugins/q_dev/models/migrationscripts/archived/user_data.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ package archived
2020
import (
2121
"time"
2222

23-
"github.com/apache/incubator-devlake/core/models/common"
23+
"github.com/apache/incubator-devlake/core/models/migrationscripts/archived"
2424
)
2525

2626
// QDevUserData 存储从CSV中提取的原始数据
2727
type QDevUserData struct {
28-
common.Model
28+
archived.Model
2929
ConnectionId uint64 `gorm:"primaryKey"`
3030
UserId string `gorm:"index" json:"userId"`
3131
Date time.Time `gorm:"index" json:"date"`

backend/plugins/q_dev/models/migrationscripts/archived/user_metrics.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ limitations under the License.
1818
package archived
1919

2020
import (
21-
"github.com/apache/incubator-devlake/core/models/common"
21+
"github.com/apache/incubator-devlake/core/models/migrationscripts/archived"
2222
"time"
2323
)
2424

2525
// QDevUserMetrics 存储按用户聚合的指标数据
2626
type QDevUserMetrics struct {
27-
common.NoPKModel
27+
archived.NoPKModel
2828
ConnectionId uint64 `gorm:"primaryKey"`
2929
UserId string `gorm:"primaryKey"`
3030
FirstDate time.Time

0 commit comments

Comments
 (0)