-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: 使用go:linkname调用私有函数替代go mod replace
- Loading branch information
Showing
10 changed files
with
78 additions
and
101 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package schema | ||
|
||
import ( | ||
"entgo.io/ent" | ||
"entgo.io/ent/schema/field" | ||
) | ||
|
||
type Extra struct { | ||
Key string `json:"key"` | ||
Vals string `json:"vals"` | ||
} | ||
|
||
type User struct { | ||
ent.Schema | ||
} | ||
|
||
func (User) Fields() []ent.Field { | ||
return []ent.Field{ | ||
field.Int64("id").Unique().Immutable().Comment("用户ID"), | ||
field.String("username").Comment("用户名").MinLen(1), | ||
field.String("remark").Optional().Default("").Comment("备注").MaxLen(30), | ||
field.String("avatar").Comment("头像").Default(""), | ||
field.String("phone").Optional().Default("").Comment("手机号").MaxLen(20), | ||
field.Uint64("flags").Default(0).Comment("标记位"), | ||
field.JSON("extra", Extra{}).Optional().Comment("额外信息"), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters