-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUniField.go
More file actions
36 lines (28 loc) · 960 Bytes
/
UniField.go
File metadata and controls
36 lines (28 loc) · 960 Bytes
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
// UniField
package UniEngine
import "strings"
type TUniField struct {
TableName string `db:"table_name" json:"tableName"` //table in database
FieldName string `db:"field_name" json:"fieldName"` //field in database
AttriName string `db:"attri_name" json:"attriName"` //field in class(attribute)
//@FieldType reflect.Type
ReadOnly bool //#是否只读
PkeyOnly bool //#是否主键#数据同步时用到,其他地方不要用,未初始化;
}
func (self *TUniField) initialize(aValue string) {
cArguments := strings.Split(aValue, ",")
self.FieldName = cArguments[0]
if self.FieldName == "-" {
self.ReadOnly = true
}
for _, item := range cArguments[1:] {
item := strings.TrimSpace(item)
//@fmt.Println("UniField:Initialzie:", item)
switch item {
case "readonly":
self.ReadOnly = true
default:
//@panic(fmt.Sprintf("Unrecognized tag option for field %v: %v", self.FieldName, item))
}
}
}