mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-19 01:04:25 +08:00
modify name
This commit is contained in:
@@ -14,7 +14,7 @@ import (
|
||||
func TestGenerateUuid(t *testing.T) {
|
||||
expectedUnixTime := time.Now().Unix()
|
||||
expectedUuidServerId := uint8(90)
|
||||
expectedUuidType := UUID_TYPE_JOURNAL
|
||||
expectedUuidType := UUID_TYPE_TRANSACTION
|
||||
|
||||
generator, _ := NewInternalUuidGenerator(&settings.Config{UuidServerId: expectedUuidServerId})
|
||||
uuid := generator.GenerateUuid(expectedUuidType)
|
||||
@@ -48,7 +48,7 @@ func TestGenerateUuid_MultiType(t *testing.T) {
|
||||
actualSeqId = uuidInfo.SequentialId
|
||||
assert.Equal(t, uint32(expectedSeqId), actualSeqId)
|
||||
|
||||
uuid = generator.GenerateUuid(UUID_TYPE_JOURNAL)
|
||||
uuid = generator.GenerateUuid(UUID_TYPE_TRANSACTION)
|
||||
uuidInfo = generator.ParseUuidInfo(uuid)
|
||||
actualSeqId = uuidInfo.SequentialId
|
||||
assert.Equal(t, uint32(expectedSeqId), actualSeqId)
|
||||
|
||||
@@ -3,10 +3,10 @@ package uuid
|
||||
type UuidType uint8
|
||||
|
||||
const (
|
||||
UUID_TYPE_DEFAULT UuidType = 0
|
||||
UUID_TYPE_USER UuidType = 1
|
||||
UUID_TYPE_ACCOUNT UuidType = 2
|
||||
UUID_TYPE_JOURNAL UuidType = 3
|
||||
UUID_TYPE_CATEGORY UuidType = 4
|
||||
UUID_TYPE_TAG UuidType = 5
|
||||
UUID_TYPE_DEFAULT UuidType = 0
|
||||
UUID_TYPE_USER UuidType = 1
|
||||
UUID_TYPE_ACCOUNT UuidType = 2
|
||||
UUID_TYPE_TRANSACTION UuidType = 3
|
||||
UUID_TYPE_CATEGORY UuidType = 4
|
||||
UUID_TYPE_TAG UuidType = 5
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user