-
Notifications
You must be signed in to change notification settings - Fork 14
/
translation_text_entity.go
50 lines (38 loc) · 1.13 KB
/
translation_text_entity.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package entity
import (
"github.com/latolukasz/beeorm"
)
type TranslationTextLang string
func (u TranslationTextLang) String() string {
return string(u)
}
type TranslationTextKey string
func (u TranslationTextKey) String() string {
return string(u)
}
type TranslationStatus string
func (u TranslationStatus) String() string {
return string(u)
}
const (
TranslationStatusNew TranslationStatus = "new"
TranslationStatusTranslated TranslationStatus = "translated"
)
type translationStatus struct {
New string
Translated string
}
var TranslationStatusAll = translationStatus{
New: TranslationStatusNew.String(),
Translated: TranslationStatusTranslated.String(),
}
type TranslationTextEntity struct {
beeorm.ORM `orm:"table=translation_texts;log=log_db_pool;localCache;redisCache"`
ID uint64
Lang string `orm:"required;unique=Lang_Key:1"`
Key string `orm:"required;unique=Lang_Key:2"`
Status string `orm:"required;enum=entity.TranslationStatusAll"`
Text string `orm:"length=max"`
Vars []string
CachedQueryLangKey *beeorm.CachedQuery `queryOne:":Lang = ? AND :Key = ?"`
}