Your ROOT_URL in app.ini is http://git.slaventius.ru/ but you are visiting http://37.143.12.169/test3k/authDB/blame/commit/4b45c68251a98116fbae1e37e55581f6fec132c2/internal/customer/amodel.go
You should set ROOT_URL correctly, otherwise the web may not work correctly.
package customer
import (
"context"
"strconv"
"time"
driver "github.com/arangodb/go-driver"
)
const (
DateTemplate string = "2006-01-02" // Шаблон даты
TimeTemplate string = "15:04:05" // Шаблон времени
StampTemplate string = DateTemplate + " " + TimeTemplate // Шаблон метки времени
DateTemplatePast string = "1900-01-01" + " " + TimeTemplate // Далекое прошлое
)
type Row struct {
ctx context . Context
collection driver . Collection
database driver . Database
key string
}
// Базовые поля
type SimpleRow struct {
Row
ID string ` json:"id" `
CreatedAt time . Time ` json:"created_at" `
UpdatedAt time . Time ` json:"updated_at" `
}
func NewSimpleRow ( ctx context . Context , database driver . Database , collection driver . Collection ) * SimpleRow {
now := time . Now ( )
// nowStr := now.Format(StampTemplate)
key := strconv . Itoa ( now . Nanosecond ( ) * - 1 )
return & SimpleRow {
Row : Row {
ctx : ctx ,
collection : collection ,
database : database ,
key : key ,
} ,
ID : key ,
CreatedAt : now ,
UpdatedAt : now ,
}
}
// Удаление
func ( r * SimpleRow ) Delete ( ) error {
_ , err := r . collection . RemoveDocument ( r . ctx , r . key )
return err
}