fix: gofmt 格式化 5 个文件 - 修复 golangci-lint 错误

This commit is contained in:
2026-04-20 07:40:06 +08:00
parent 1f8f839a1b
commit 93958adeff
5 changed files with 15 additions and 21 deletions
+3 -3
View File
@@ -176,9 +176,9 @@ func (api PortalApi) CreateSessionEndpoint(c echo.Context) error {
} }
return Success(c, maps.Map{ return Success(c, maps.Map{
"id": s.ID, "id": s.ID,
"protocol": s.Protocol, "protocol": s.Protocol,
"assetName": assetName, "assetName": assetName,
"strategy": maps.Map{ "strategy": maps.Map{
"upload": s.Upload == "1", "upload": s.Upload == "1",
"download": s.Download == "1", "download": s.Download == "1",
-2
View File
@@ -385,5 +385,3 @@ func (api AccessLogApi) GetWebsiteHourlyStatsEndpoint(c echo.Context) error {
func (api AccessLogApi) GetWebsiteStatusCodeStatsEndpoint(c echo.Context) error { func (api AccessLogApi) GetWebsiteStatusCodeStatsEndpoint(c echo.Context) error {
return Success(c, []interface{}{}) return Success(c, []interface{}{})
} }
+12 -12
View File
@@ -5,18 +5,18 @@ import (
) )
type DatabaseSQLLog struct { type DatabaseSQLLog struct {
ID string `gorm:"primary_key,type:varchar(36)" json:"id"` ID string `gorm:"primary_key,type:varchar(36)" json:"id"`
AssetId string `gorm:"index,type:varchar(36)" json:"assetId"` AssetId string `gorm:"index,type:varchar(36)" json:"assetId"`
Database string `gorm:"type:varchar(200)" json:"database"` Database string `gorm:"type:varchar(200)" json:"database"`
UserId string `gorm:"index,type:varchar(36)" json:"userId"` UserId string `gorm:"index,type:varchar(36)" json:"userId"`
ClientIP string `gorm:"type:varchar(50);index" json:"clientIp"` ClientIP string `gorm:"type:varchar(50);index" json:"clientIp"`
SQL string `gorm:"type:text" json:"sql"` SQL string `gorm:"type:text" json:"sql"`
DurationMs int `json:"durationMs"` DurationMs int `json:"durationMs"`
RowsAffected int `json:"rowsAffected"` RowsAffected int `json:"rowsAffected"`
Status string `gorm:"type:varchar(20);index" json:"status"` Status string `gorm:"type:varchar(20);index" json:"status"`
ErrorMessage string `gorm:"type:text" json:"errorMessage"` ErrorMessage string `gorm:"type:text" json:"errorMessage"`
Source string `gorm:"type:varchar(50);index" json:"source"` Source string `gorm:"type:varchar(50);index" json:"source"`
Created common.JsonTime `gorm:"type:datetime;index" json:"createdAt"` Created common.JsonTime `gorm:"type:datetime;index" json:"createdAt"`
} }
func (r *DatabaseSQLLog) TableName() string { func (r *DatabaseSQLLog) TableName() string {
-2
View File
@@ -382,5 +382,3 @@ func (r authorisedWebsiteRepository) FindWithDetails(c context.Context, pageInde
err = db.Order("authorised_websites.created desc").Offset((pageIndex - 1) * pageSize).Limit(pageSize).Find(&o).Error err = db.Order("authorised_websites.created desc").Offset((pageIndex - 1) * pageSize).Limit(pageSize).Find(&o).Error
return return
} }
-2
View File
@@ -140,5 +140,3 @@ func (r databaseAssetRepository) GetDBPort(dbType string) int {
func (r databaseAssetRepository) UpdateOwner(c context.Context, ownerId string, newOwnerId string) error { func (r databaseAssetRepository) UpdateOwner(c context.Context, ownerId string, newOwnerId string) error {
return r.GetDB(c).Model(&model.DatabaseAsset{}).Where("owner = ?", ownerId).Update("owner", newOwnerId).Error return r.GetDB(c).Model(&model.DatabaseAsset{}).Where("owner = ?", ownerId).Update("owner", newOwnerId).Error
} }