Documentation
¶
Index ¶
- func AnyToDecimal(num string, n int) int64
- func Crc32IEEE(str string) uint32
- func DecimalToAny(num int64, n int) string
- func EncodeMD5(value string) string
- func FileExists(path string) bool
- func FirstDayOfISOWeek(year int, week int, timezone *time.Location) time.Time
- func GenerateToken(username, password string) (string, error)
- func GetMobileOfToken(token string) string
- func GetPage(c *gin.Context) int
- func GetUniversalCode() string
- func HttpGet(getUrl string) (string, error)
- func HttpPost(postUrl string, postData map[string]string) (string, error)
- func HttpPost2(my_url string, postData string) (string, error)
- func RandKey() int
- func RandMobileCode() int
- func RandPassword() int
- func Round(f float64, n int) float64
- func ToPostDate(model interface{}) (map[string]string, error)
- type AesEncrypt
- type ApiCode
- type ApiStudent
- type ApiStudentData
- type ApiStudentSlice
- type ApiToken
- type Claims
- type ConfigData
- type ConfigInfo
- type RegisterStudent
- type TokenData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FirstDayOfISOWeek ¶
得到每周第一天的日期
func GenerateToken ¶
func GetMobileOfToken ¶
func ToPostDate ¶
结构体所有字段必须为string类型,model不能是指针类型
Types ¶
type AesEncrypt ¶
type AesEncrypt struct {
}
type ApiStudent ¶
type ApiStudent struct {
Code int `json:"code"`
Data ApiStudentData `json:"data"`
}
token换取用户信息josn
func CreateStudentFromUserCenter ¶
func CreateStudentFromUserCenter(registerStudent RegisterStudent) (ApiStudent, error)
func GetApiStudentByUnionId ¶
func GetApiStudentByUnionId(unionId string) (ApiStudent, error)
func GetStudentFromUserCenter ¶
func GetStudentFromUserCenter(token string) (ApiStudent, error)
type ApiStudentData ¶
type ApiStudentSlice ¶
type ApiStudentSlice struct {
Code int `json:"code"`
Data []ApiStudentData `json:"data"`
}
type Claims ¶
type Claims struct {
Username string `json:"username"`
Password string `json:"password"`
jwt.StandardClaims
}
func ParseToken ¶
type ConfigData ¶
type ConfigInfo ¶
type ConfigInfo struct {
Code int `json:"code"`
Data ConfigData `json:"data"`
}
获取配置json
type RegisterStudent ¶
type RegisterStudent struct {
UnionId string `json:"unionid"`
Nickname string `json:"nickname"`
HeadPhoto string `json:"headPhoto"`
Sex string `json:"sex"`
Province string `json:"province"`
City string `json:"city"`
Country string `json:"country"`
ClientSource string `json:"clientSource"`
Version string `json:"version"`
Channel string `json:"channel"`
}
用户中心注册实体
Click to show internal directories.
Click to hide internal directories.