2022-05-17 20:23:08 +08:00
|
|
|
package entity
|
|
|
|
|
|
2023-10-27 17:41:45 +08:00
|
|
|
import (
|
|
|
|
|
"mayfly-go/internal/mongo/mgm"
|
|
|
|
|
"mayfly-go/pkg/model"
|
|
|
|
|
"mayfly-go/pkg/utils/structx"
|
|
|
|
|
)
|
2022-05-17 20:23:08 +08:00
|
|
|
|
|
|
|
|
type Mongo struct {
|
|
|
|
|
model.Model
|
|
|
|
|
|
2023-12-05 23:03:51 +08:00
|
|
|
Code string `orm:"column(code)" json:"code"`
|
2022-07-20 23:25:52 +08:00
|
|
|
Name string `orm:"column(name)" json:"name"`
|
|
|
|
|
Uri string `orm:"column(uri)" json:"uri"`
|
2023-03-06 16:59:57 +08:00
|
|
|
SshTunnelMachineId int `orm:"column(ssh_tunnel_machine_id)" json:"sshTunnelMachineId"` // ssh隧道机器id
|
2022-05-17 20:23:08 +08:00
|
|
|
}
|
2023-10-27 17:41:45 +08:00
|
|
|
|
|
|
|
|
// 转换为mongoInfo进行连接
|
2023-12-05 23:03:51 +08:00
|
|
|
func (me *Mongo) ToMongoInfo(tagPath ...string) *mgm.MongoInfo {
|
2023-10-27 17:41:45 +08:00
|
|
|
mongoInfo := new(mgm.MongoInfo)
|
|
|
|
|
structx.Copy(mongoInfo, me)
|
2024-05-08 21:04:25 +08:00
|
|
|
mongoInfo.CodePath = tagPath
|
2023-10-27 17:41:45 +08:00
|
|
|
return mongoInfo
|
|
|
|
|
}
|