Documentation ¶
Index ¶
- Constants
- Variables
- func CheckError(c *gin.Context, err error)
- func CloseAction(c io.Closer)
- func CreateDirIfNotExist(path string) error
- func DeleteFile(filePath string) error
- func GenerateBySourceStr(source string, length int) string
- func GeneratePassword(length int) string
- func GetBytesForInt64(t uint64) []byte
- func GetInt64FromBytes(cn []byte) int64
- func GetPostData(r *http.Request) ([]byte, error)
- func HasDuplicate(arr []*string) bool
- func IsContainInt64(resource int64, target ...int64) bool
- type CodeAndMsg
- type InfoResult
- type PageUtils
Constants ¶
View Source
const ( TimeFormat = "2006-01-02 15:04:05" Str1Base = "0123456789QWERTYUIOPASDFGHJKLZXCVBNM" Str2Base = "qwertyuiopasdfghjklzxcvbnm0123456789QWERTYUIOPASDFGHJKLZXCVBNM" )
Variables ¶
View Source
var ( Success = &CodeAndMsg{Code: 200, Message: "成功"} // 成功返回 Fail = &CodeAndMsg{Code: 40000, Message: "调用失败"} // 调用失败返回 ParamError = &CodeAndMsg{Code: 40001, Message: "请求参数错误"} // 调用失败返回 NotAuthed = &CodeAndMsg{Code: 40002, Message: "没有该操作权限"} // 调用失败返回 NotFoundEnterpriseID = &CodeAndMsg{Code: 40003, Message: "未携带EnterpriseID,无法确认所属企业"} // 调用失败返回 )
Functions ¶
func CloseAction ¶
func GenerateBySourceStr ¶
func GeneratePassword ¶
func IsContainInt64 ¶
Types ¶
type CodeAndMsg ¶
func (*CodeAndMsg) AddFormat ¶
func (c *CodeAndMsg) AddFormat(p ...any) *CodeAndMsg
AddFormat 重新赋值占位符
func (*CodeAndMsg) Error ¶
func (c *CodeAndMsg) Error() string
type InfoResult ¶
type InfoResult struct { Code int `json:"code"` Message string `json:"message"` Data any `json:"data"` }
func NewInfoResult ¶
func NewInfoResult(c *CodeAndMsg) *InfoResult
Click to show internal directories.
Click to hide internal directories.