pre-dev: initial commit
This commit is contained in:
No files matched your search
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
DESCRIPTION:
|
||||
Sample of base-entity, results of the extraction of the attributes from the
|
||||
original entity.
|
||||
|
||||
NOTE:
|
||||
Make sure to use 'case-sensitive' option when searching
|
||||
|
||||
TODO:
|
||||
create several types according to the needs
|
||||
*/
|
||||
package base // adjust this
|
||||
|
||||
type Basic struct {
|
||||
Code string `json:"code" gorm:"uniqueIndex;not null;size:10"`
|
||||
Name string `json:"name" gorm:"not null;size:100"`
|
||||
}
|
||||
|
||||
type Default struct {
|
||||
Type_Code TypeCode `json:"type" gorm:"not null;size:10"`
|
||||
Status_Code StatusCode `json:"status" gorm:"not null;size:10"`
|
||||
}
|
||||
|
||||
type Extra struct {
|
||||
Description string `json:"description"`
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
DESCRIPTION:
|
||||
A sample, part of the package that contains functions.
|
||||
*/
|
||||
package base
|
||||
|
||||
import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
func (b *Basic) ExtractName() []string {
|
||||
return strings.Split(b.Name, " ")
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
DESCRIPTION:
|
||||
A sample, part of the package that contains type, constants, and/or variables.
|
||||
*/
|
||||
package base // adjust this
|
||||
|
||||
type StatusCode string
|
||||
type TypeCode string
|
||||
|
||||
const (
|
||||
SCActive StatusCode = "active" // prefixed with SC that stands for StatusCode
|
||||
SCInactive StatusCode = "inactive"
|
||||
|
||||
TCPrimary TypeCode = "prim" // prefixed with TC that stands for TypeCode
|
||||
TCScondary TypeCode = "seco"
|
||||
TCTertiary TypeCode = "tert"
|
||||
)
|
||||
Reference in New Issue
Block a user