feat: update
This commit is contained in:
@@ -3,10 +3,10 @@ package model
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"quyun/app/service/testx"
|
||||
"quyun/database"
|
||||
"quyun/database/table"
|
||||
"quyun/database/fields"
|
||||
|
||||
. "github.com/smartystreets/goconvey/convey"
|
||||
"go.ipao.vip/atom/contracts"
|
||||
@@ -36,8 +36,24 @@ func Test_Users(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
func (s *UsersTestSuite) Test_Demo() {
|
||||
Convey("Test_Demo", s.T(), func() {
|
||||
database.Truncate(context.Background(), db, table.Users.TableName())
|
||||
func (s *UsersTestSuite) Test_Create() {
|
||||
Convey("Test_Create", s.T(), func() {
|
||||
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
|
||||
|
||||
[Database]
|
||||
Host = "localhost"
|
||||
Database = "postgres"
|
||||
Host = "10.1.1.2"
|
||||
Database = "quyun"
|
||||
Password = "xixi0202"
|
||||
|
||||
[JWT]
|
||||
|
||||
Reference in New Issue
Block a user