mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-21 18:24:26 +08:00
modify name
This commit is contained in:
+2
-2
@@ -15,7 +15,7 @@ const (
|
|||||||
NORMAL_SUBCATEGORY_TOKEN = 2
|
NORMAL_SUBCATEGORY_TOKEN = 2
|
||||||
NORMAL_SUBCATEGORY_TWOFACTOR = 3
|
NORMAL_SUBCATEGORY_TWOFACTOR = 3
|
||||||
NORMAL_SUBCATEGORY_ACCOUNT = 4
|
NORMAL_SUBCATEGORY_ACCOUNT = 4
|
||||||
NORMAL_SUBCATEGORY_JOURNAL = 5
|
NORMAL_SUBCATEGORY_TRANSACTION = 5
|
||||||
NORMAL_SUBCATEGORY_CATEGORY = 6
|
NORMAL_SUBCATEGORY_CATEGORY = 6
|
||||||
NORMAL_SUBCATEGORY_TAG = 7
|
NORMAL_SUBCATEGORY_TAG = 7
|
||||||
)
|
)
|
||||||
@@ -73,6 +73,6 @@ func Or(err error, defaultErr *Error) *Error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func IsCustomError(err error) bool {
|
func IsCustomError(err error) bool {
|
||||||
_, ok := err.(*Error);
|
_, ok := err.(*Error)
|
||||||
return ok
|
return ok
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import (
|
|||||||
func TestGenerateUuid(t *testing.T) {
|
func TestGenerateUuid(t *testing.T) {
|
||||||
expectedUnixTime := time.Now().Unix()
|
expectedUnixTime := time.Now().Unix()
|
||||||
expectedUuidServerId := uint8(90)
|
expectedUuidServerId := uint8(90)
|
||||||
expectedUuidType := UUID_TYPE_JOURNAL
|
expectedUuidType := UUID_TYPE_TRANSACTION
|
||||||
|
|
||||||
generator, _ := NewInternalUuidGenerator(&settings.Config{UuidServerId: expectedUuidServerId})
|
generator, _ := NewInternalUuidGenerator(&settings.Config{UuidServerId: expectedUuidServerId})
|
||||||
uuid := generator.GenerateUuid(expectedUuidType)
|
uuid := generator.GenerateUuid(expectedUuidType)
|
||||||
@@ -48,7 +48,7 @@ func TestGenerateUuid_MultiType(t *testing.T) {
|
|||||||
actualSeqId = uuidInfo.SequentialId
|
actualSeqId = uuidInfo.SequentialId
|
||||||
assert.Equal(t, uint32(expectedSeqId), actualSeqId)
|
assert.Equal(t, uint32(expectedSeqId), actualSeqId)
|
||||||
|
|
||||||
uuid = generator.GenerateUuid(UUID_TYPE_JOURNAL)
|
uuid = generator.GenerateUuid(UUID_TYPE_TRANSACTION)
|
||||||
uuidInfo = generator.ParseUuidInfo(uuid)
|
uuidInfo = generator.ParseUuidInfo(uuid)
|
||||||
actualSeqId = uuidInfo.SequentialId
|
actualSeqId = uuidInfo.SequentialId
|
||||||
assert.Equal(t, uint32(expectedSeqId), actualSeqId)
|
assert.Equal(t, uint32(expectedSeqId), actualSeqId)
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ const (
|
|||||||
UUID_TYPE_DEFAULT UuidType = 0
|
UUID_TYPE_DEFAULT UuidType = 0
|
||||||
UUID_TYPE_USER UuidType = 1
|
UUID_TYPE_USER UuidType = 1
|
||||||
UUID_TYPE_ACCOUNT UuidType = 2
|
UUID_TYPE_ACCOUNT UuidType = 2
|
||||||
UUID_TYPE_JOURNAL UuidType = 3
|
UUID_TYPE_TRANSACTION UuidType = 3
|
||||||
UUID_TYPE_CATEGORY UuidType = 4
|
UUID_TYPE_CATEGORY UuidType = 4
|
||||||
UUID_TYPE_TAG UuidType = 5
|
UUID_TYPE_TAG UuidType = 5
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user