Skip to content

Commit

Permalink
remove createAt & updateAt
Browse files Browse the repository at this point in the history
  • Loading branch information
yfsoftcom committed Jan 18, 2022
1 parent 282081b commit 88464e4
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 25 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.14
require (
github.com/google/uuid v1.1.2 // indirect
github.com/magiconair/properties v1.8.2 // indirect
github.com/stretchr/testify v1.6.1
github.com/stretchr/testify v1.7.0
github.com/team4yf/fpm-go-pkg v0.0.0-20200909075814-040cb22d0a7d
github.com/team4yf/yf-fpm-server-go v0.2.4
go.uber.org/zap v1.16.0 // indirect
Expand Down
3 changes: 3 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P
github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/team4yf/fpm-go-pkg v0.0.0-20200907232930-67704d580ed7 h1:Aj3aR0AJbtGMaaFopjtSD6etjFDDfOQKpa6kgI2Mg+g=
Expand Down Expand Up @@ -494,6 +496,7 @@ gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ=
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gorm.io/driver/postgres v1.0.0 h1:Yh4jyFQ0a7F+JPU0Gtiam/eKmpT/XFc1FKxotGqc6FM=
gorm.io/driver/postgres v1.0.0/go.mod h1:wtMFcOzmuA5QigNsgEIb7O5lhvH1tHAF1RbWmLWV4to=
Expand Down
3 changes: 3 additions & 0 deletions plugins/dbImpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,9 @@ func (p *ormImpl) Create(q *db.BaseData, entity interface{}) error {
keys := make([]string, 0)
vals := make([]string, 0)
for k, v := range e {
if k == "updateAt" || k == "createAt" || k == "createat" || k == "updateat" {
continue
}
keys = append(keys, "\""+k+"\"")
switch v.(type) {
case string:
Expand Down
6 changes: 4 additions & 2 deletions test/pg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"errors"
"fmt"
"testing"
"time"

"github.com/stretchr/testify/assert"
"github.com/team4yf/yf-fpm-server-go/fpm"
Expand Down Expand Up @@ -252,8 +253,9 @@ func TestUpdateBiz(t *testing.T) {
"condition": "name = 'ff'",
"id": 112,
"row": map[string]interface{}{
"name": "ff",
"value": 103,
"name": "ff",
"createAt": time.Now().Unix(),
"value": 103,
},
})

Expand Down
22 changes: 0 additions & 22 deletions test/test.js

This file was deleted.

0 comments on commit 88464e4

Please sign in to comment.