Documentation
¶
Index ¶
- Constants
- func FindChildrenIdList(items []TreeOption, itemId int64) []int64
- func FormatDate(t time.Time, f string) string
- func FormatDefaultDate(t time.Time) string
- func IndexOf[T comparable](source []T, search T) int
- func Int64(data interface{}) (int64, bool)
- func ParseQueryString(queryString string) map[string]string
- func PasswordHash(pwd string) (string, error)
- func PasswordVerify(hashedPwd string, pwd string) bool
- func Reverse[T any](source []T)
- type ITreeNode
- type SelectOption
- type TreeNode
- type TreeNodeV2
- type TreeOption
Constants ¶
View Source
const DateFormatDefault = "2006-01-02 15:04:05"
View Source
const EmptyId = 0
Variables ¶
This section is empty.
Functions ¶
func FindChildrenIdList ¶
func FindChildrenIdList(items []TreeOption, itemId int64) []int64
func FormatDefaultDate ¶
func IndexOf ¶
func IndexOf[T comparable](source []T, search T) int
func ParseQueryString ¶
ParseQueryString 解析Query字符串
func PasswordHash ¶
func PasswordVerify ¶
Types ¶
type ITreeNode ¶
type SelectOption ¶
type TreeNode ¶
type TreeNode struct { TreeOption Children []TreeNode `json:"children"` }
func ToTree ¶
func ToTree(items []TreeOption) []TreeNode
type TreeNodeV2 ¶
type TreeNodeV2 struct { Id int64 `json:"id"` Pid int64 `json:"pid"` Label string `json:"label"` Children []ITreeNode `json:"children"` }
func (*TreeNodeV2) Append ¶
func (node *TreeNodeV2) Append(child ITreeNode)
func (*TreeNodeV2) Get ¶
func (node *TreeNodeV2) Get(field string) interface{}
func (*TreeNodeV2) GetChildren ¶
func (node *TreeNodeV2) GetChildren() []ITreeNode
func (*TreeNodeV2) GetId ¶
func (node *TreeNodeV2) GetId() int64
func (*TreeNodeV2) GetLabel ¶
func (node *TreeNodeV2) GetLabel() string
func (*TreeNodeV2) GetPid ¶
func (node *TreeNodeV2) GetPid() int64
type TreeOption ¶
func FindChildren ¶
func FindChildren(items []TreeOption, itemId int64) []TreeOption
func ToParentLevels ¶
func ToParentLevels(items []TreeOption, itemId int64) []TreeOption
Click to show internal directories.
Click to hide internal directories.