2 Star 0 Fork 0

hero/momo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
datasource.go 3.62 KB
一键复制 编辑 原始数据 按行查看 历史
hero 提交于 2024-11-20 09:18 . upd:import,export
package schema
import (
"gitee.com/linqwen/momo/base"
)
type DataSourceCreateDTO struct {
Alias string `gorm:"column:alias;not null" json:"Alias" form:"Alias" comment:"Alias"`
UserName string `gorm:"column:user_name" json:"UserName" form:"UserName" comment:"用户名"`
Password string `gorm:"column:password" json:"Password" form:"Password" comment:"密码"`
Host string `gorm:"column:host;not null" json:"Host" form:"Host" comment:"主机地址"`
Port int `gorm:"column:port" json:"Port" form:"Port" comment:"端口"`
DriverClass string `gorm:"column:driver_class" json:"DriverClass" form:"DriverClass" comment:"驱动类别"`
DbName string `gorm:"column:db_name" json:"DbName" form:"DbName" comment:"数据库名"`
Status int `gorm:"column:status" json:"Status" form:"Status" comment:"状态"`
}
type DataSourceQueryDTO struct {
Id int64 `gorm:"primaryKey;autoIncrement:false" json:"Id,string"`
Alias string `gorm:"column:alias;not null" json:"Alias" form:"Alias" comment:"Alias"`
UserName string `gorm:"column:user_name" json:"UserName" form:"UserName" comment:"用户名"`
Password string `gorm:"column:password" json:"Password" form:"Password" comment:"密码"`
Host string `gorm:"column:host;not null" json:"Host" form:"Host" comment:"主机地址"`
Port int `gorm:"column:port" json:"Port" form:"Port" comment:"端口"`
DriverClass string `gorm:"column:driver_class" json:"DriverClass" form:"DriverClass" comment:"驱动类别"`
DbName string `gorm:"column:db_name" json:"DbName" form:"DbName" comment:"数据库名"`
Status int `gorm:"column:status" json:"Status" form:"Status" comment:"状态"`
}
type DataSourceVO struct {
Id int64 `gorm:"primaryKey;autoIncrement:false" json:"Id,string"`
Alias string `gorm:"column:alias;not null" json:"Alias" form:"Alias" comment:"Alias"`
UserName string `gorm:"column:user_name" json:"UserName" form:"UserName" comment:"用户名"`
Password string `gorm:"column:password" json:"Password" form:"Password" comment:"密码"`
Host string `gorm:"column:host;not null" json:"Host" form:"Host" comment:"主机地址"`
Port int `gorm:"column:port" json:"Port" form:"Port" comment:"端口"`
DriverClass string `gorm:"column:driver_class" json:"DriverClass" form:"DriverClass" comment:"驱动类别"`
DbName string `gorm:"column:db_name" json:"DbName" form:"DbName" comment:"数据库名"`
Status int `gorm:"column:status" json:"Status" form:"Status" comment:"状态"`
CreatedAt base.ISO8601Time
UpdatedAt base.ISO8601Time
}
func (c DataSourceVO) GetDetailVO() interface{} { return c }
func (c DataSourceVO) GetListVO() interface{} {
return struct {
Id int64 `gorm:"primaryKey;autoIncrement:false" json:"Id,string"`
Alias string `gorm:"column:alias;not null" json:"Alias" form:"Alias" comment:"Alias"`
UserName string `gorm:"column:user_name" json:"UserName" form:"UserName" comment:"用户名"`
Host string `gorm:"column:host;not null" json:"Host" form:"Host" comment:"主机地址"`
Port int `gorm:"column:port" json:"Port" form:"Port" comment:"端口"`
DriverClass string `gorm:"column:driver_class" json:"DriverClass" form:"DriverClass" comment:"驱动类别"`
DbName string `gorm:"column:db_name" json:"DbName" form:"DbName" comment:"数据库名"`
Status int `gorm:"column:status" json:"Status" form:"Status" comment:"状态"`
}{
Id: c.Id,
Alias: c.Alias,
UserName: c.UserName,
Host: c.Host,
Port: c.Port,
DriverClass: c.DriverClass,
DbName: c.DbName,
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/linqwen/momo.git
git@gitee.com:linqwen/momo.git
linqwen
momo
momo
v1.1.17

搜索帮助

0d507c66 1850385 C8b1a773 1850385