feat: update
This commit is contained in:
@@ -3,10 +3,10 @@ package model
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"testing"
|
"testing"
|
||||||
|
"time"
|
||||||
|
|
||||||
"quyun/app/service/testx"
|
"quyun/app/service/testx"
|
||||||
"quyun/database"
|
"quyun/database/fields"
|
||||||
"quyun/database/table"
|
|
||||||
|
|
||||||
. "github.com/smartystreets/goconvey/convey"
|
. "github.com/smartystreets/goconvey/convey"
|
||||||
"go.ipao.vip/atom/contracts"
|
"go.ipao.vip/atom/contracts"
|
||||||
@@ -36,8 +36,24 @@ func Test_Users(t *testing.T) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *UsersTestSuite) Test_Demo() {
|
func (s *UsersTestSuite) Test_Create() {
|
||||||
Convey("Test_Demo", s.T(), func() {
|
Convey("Test_Create", s.T(), func() {
|
||||||
database.Truncate(context.Background(), db, table.Users.TableName())
|
user := &Users{
|
||||||
|
CreatedAt: time.Now(),
|
||||||
|
UpdatedAt: time.Now(),
|
||||||
|
DeletedAt: nil,
|
||||||
|
Status: 1,
|
||||||
|
OpenID: "test_openid_123",
|
||||||
|
Username: "testuser",
|
||||||
|
Avatar: &[]string{"https://example.com/avatar.jpg"}[0],
|
||||||
|
Metas: fields.ToJson(fields.UserMetas{}),
|
||||||
|
AuthToken: fields.ToJson(fields.UserAuthToken{}),
|
||||||
|
Balance: 1000,
|
||||||
|
}
|
||||||
|
|
||||||
|
u, err := user.Create(context.TODO())
|
||||||
|
So(err, ShouldBeNil)
|
||||||
|
So(u, ShouldNotBeNil)
|
||||||
|
So(u.ID, ShouldNotBeZeroValue)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ StoragePath = "/Users/rogee/Projects/self/quyun/fixtures"
|
|||||||
Port = 8088
|
Port = 8088
|
||||||
|
|
||||||
[Database]
|
[Database]
|
||||||
Host = "localhost"
|
Host = "10.1.1.2"
|
||||||
Database = "postgres"
|
Database = "quyun"
|
||||||
Password = "xixi0202"
|
Password = "xixi0202"
|
||||||
|
|
||||||
[JWT]
|
[JWT]
|
||||||
|
|||||||
Reference in New Issue
Block a user