Documentation
¶
Index ¶
- Constants
- Variables
- func ArrayToString(array []interface{}) string
- func AutoClearCode(filepath string, codeData string) error
- func AutoInjectionCode(filepath string, funcName string, codeData string) error
- func BcryptCheck(password, hash string) bool
- func BcryptHash(password string) string
- func BlankStringArrayToString(arr []string) (result string)
- func BreakPointContinue(content []byte, fileName string, contentNumber int, contentTotal int, ...) (string, error)
- func Check(item []examManage.PaperTemplateItem) bool
- func CheckMd5(content []byte, chunkMd5 string) (CanUpload bool)
- func ClearTable(db *gorm.DB, tableName string, compareField string, interval string) error
- func CreateDir(dirs ...string) (err error)
- func CreateExamScore(PlanDetail teachplan.ExamPlan, sum float64, studentId uint) (examScore examManage.ExamScore, err error)
- func Crypto(str string) string
- func DeLFile(filePath string) error
- func Decryption(str string) string
- func DiffArray(a []int64, b []int64) []int64
- func Eq(mark string) string
- func ExecPapers(examPaperCommit examManage.CommitExamPaper) (err error)
- func ExecProgram(program examManage.CommitProgram, score uint) (err error)
- func FileExist(path string) bool
- func FileMove(src string, dst string) (err error)
- func GaSStudentsOfTeachClass(ids []uint) (students []uint, err error)
- func Ge(mark string) string
- func GenerateQRCode(data string) string
- func GetClaims(c *gin.Context) (*systemReq.CustomClaims, error)
- func GetCurrentAbPath() string
- func GetDictionaryName(Type string, value int) (name string)
- func GetLessonName(id int) string
- func GetStudentClaims(c *gin.Context) (*systemReq.StudentCustomClaims, error)
- func GetStudentId(c *gin.Context) uint
- func GetStudentName(c *gin.Context) string
- func GetTeachPlanName(id uint) string
- func GetTermName(id uint) string
- func GetUserAuthorityID(c *gin.Context) uint
- func GetUserAuthorityId(c *gin.Context) uint
- func GetUserID(c *gin.Context) uint
- func GetUserInfo(c *gin.Context) *systemReq.CustomClaims
- func GetUserUuid(c *gin.Context) uuid.UUID
- func GetUuid() string
- func Gt(mark string) string
- func IntArrayToString(array []int) (result string)
- func IsExistInRedis(studentId uint) bool
- func Le(mark string) string
- func Lt(mark string) string
- func MD5V(str []byte, b ...byte) string
- func MakeFile(fileName string, FileMd5 string) (string, error)
- func Ne(mark string) string
- func NotEmpty() string
- func PathExists(path string) (bool, error)
- func ReExecPapers(sp teachplan.CoverRq) (err error)
- func RegexpMatch(rule string) string
- func RegisterRule(key string, rule Rules) (err error)
- func Reload() error
- func RemoveChunk(FileMd5 string) error
- func SetStudentToRedis(students []uint) error
- func StringArrayToString(arr []string) (result string)
- func StringToStringArray(strArr string, sep string) []string
- func StringToTime(string2 string) time.Time
- func StructToMap(obj interface{}) map[string]interface{}
- func TimeToString(t time.Time) string
- func TrimSpace(target interface{})
- func Unzip(zipFile string, destDir string) ([]string, error)
- func Verify(st interface{}, roleMap Rules) (err error)
- func ZipFiles(filename string, files []string, oldForm, newForm string) error
- type Cpu
- type Disk
- type JWT
- func (j *JWT) CreateClaims(baseClaims request.BaseClaims) request.CustomClaims
- func (j *JWT) CreateStudentClaims(baseClaims request.StudentBaseClaims) request.StudentCustomClaims
- func (j *JWT) CreateStudentToken(claims request.StudentCustomClaims) (string, error)
- func (j *JWT) CreateStudentTokenByOldToken(oldToken string, claims request.StudentCustomClaims) (string, error)
- func (j *JWT) CreateToken(claims request.CustomClaims) (string, error)
- func (j *JWT) CreateTokenByOldToken(oldToken string, claims request.CustomClaims) (string, error)
- func (j *JWT) ParseToken(tokenString string) (*request.CustomClaims, error)
- func (j *JWT) StudentParseToken(tokenString string) (*request.StudentCustomClaims, error)
- type Os
- type Ram
- type Rules
- type RulesMap
- type Server
Constants ¶
View Source
const ( B = 1 KB = 1024 * B MB = 1024 * KB GB = 1024 * MB )
Variables ¶
View Source
var ( TokenExpired = errors.New("Token is expired") TokenNotValidYet = errors.New("Token not active yet") TokenMalformed = errors.New("That's not even a token") TokenInvalid = errors.New("Couldn't handle this token:") )
View Source
var ( IdVerify = Rules{"ID": []string{NotEmpty()}} ApiVerify = Rules{"Path": {NotEmpty()}, "Description": {NotEmpty()}, "ApiGroup": {NotEmpty()}, "Method": {NotEmpty()}} MenuVerify = Rules{"Path": {NotEmpty()}, "ParentId": {NotEmpty()}, "Name": {NotEmpty()}, "Component": {NotEmpty()}, "Sort": {Ge("0")}} MenuMetaVerify = Rules{"Title": {NotEmpty()}} LoginVerify = Rules{"CaptchaId": {NotEmpty()}, "Captcha": {NotEmpty()}, "Username": {NotEmpty()}, "Password": {NotEmpty()}} RegisterVerify = Rules{"Username": {NotEmpty()}, "NickName": {NotEmpty()}, "Password": {NotEmpty()}, "AuthorityId": {NotEmpty()}} PageInfoVerify = Rules{"Page": {NotEmpty()}, "PageSize": {NotEmpty()}} CustomerVerify = Rules{"CustomerName": {NotEmpty()}, "CustomerPhoneData": {NotEmpty()}} AutoCodeVerify = Rules{"Abbreviation": {NotEmpty()}, "StructName": {NotEmpty()}, "PackageName": {NotEmpty()}, "Fields": {NotEmpty()}} AutoPackageVerify = Rules{"PackageName": {NotEmpty()}} AuthorityVerify = Rules{"AuthorityId": {NotEmpty()}, "AuthorityName": {NotEmpty()}} AuthorityIdVerify = Rules{"AuthorityId": {NotEmpty()}} OldAuthorityVerify = Rules{"OldAuthorityId": {NotEmpty()}} ChangePasswordVerify = Rules{"Password": {NotEmpty()}, "NewPassword": {NotEmpty()}} SetUserAuthorityVerify = Rules{"AuthorityId": {NotEmpty()}} )
View Source
var CustomizeMap = make(map[string]Rules)
Functions ¶
func ArrayToString ¶
func ArrayToString(array []interface{}) string
func AutoClearCode ¶
func AutoInjectionCode ¶
func BreakPointContinue ¶
func Check ¶
func Check(item []examManage.PaperTemplateItem) bool
func ClearTable ¶
func CreateExamScore ¶
func Decryption ¶
func ExecPapers ¶
func ExecPapers(examPaperCommit examManage.CommitExamPaper) (err error)
func ExecProgram ¶
func ExecProgram(program examManage.CommitProgram, score uint) (err error)
func GaSStudentsOfTeachClass ¶
通过班级id查找将要考试或正在考试的同学,并将其记录在redis黑名单中
func GenerateQRCode ¶
func GetDictionaryName ¶
func GetLessonName ¶
func GetStudentClaims ¶
func GetStudentClaims(c *gin.Context) (*systemReq.StudentCustomClaims, error)
func GetStudentId ¶
func GetStudentName ¶
func GetTeachPlanName ¶
func GetTermName ¶
func GetUserAuthorityID ¶
func GetUserAuthorityId ¶
GetUserAuthorityId 从Gin的Context中获取从jwt解析出来的用户角色id
func GetUserInfo ¶
func GetUserInfo(c *gin.Context) *systemReq.CustomClaims
GetUserInfo 从Gin的Context中获取从jwt解析出来的用户角色id
func GetUserUuid ¶
GetUserUuid 从Gin的Context中获取从jwt解析出来的用户UUID
func IntArrayToString ¶
func PathExists ¶
func RegexpMatch ¶
@author: [zooqkl](https://github.com/zooqkl) @function: RegexpMatch @description: 正则校验 校验输入项是否满足正则表达式 @param: rule string @return: string
func RegisterRule ¶
func RemoveChunk ¶
func SetStudentToRedis ¶
func StringArrayToString ¶
func StringToTime ¶
func StructToMap ¶
func StructToMap(obj interface{}) map[string]interface{}
func TimeToString ¶
Types ¶
type Disk ¶
type JWT ¶
type JWT struct {
SigningKey []byte
}
func (*JWT) CreateClaims ¶
func (j *JWT) CreateClaims(baseClaims request.BaseClaims) request.CustomClaims
func (*JWT) CreateStudentClaims ¶
func (j *JWT) CreateStudentClaims(baseClaims request.StudentBaseClaims) request.StudentCustomClaims
func (*JWT) CreateStudentToken ¶
func (j *JWT) CreateStudentToken(claims request.StudentCustomClaims) (string, error)
func (*JWT) CreateStudentTokenByOldToken ¶
func (*JWT) CreateToken ¶
func (j *JWT) CreateToken(claims request.CustomClaims) (string, error)
创建一个token
func (*JWT) CreateTokenByOldToken ¶
CreateTokenByOldToken 旧token 换新token 使用归并回源避免并发问题
func (*JWT) ParseToken ¶
func (j *JWT) ParseToken(tokenString string) (*request.CustomClaims, error)
解析 token
func (*JWT) StudentParseToken ¶
func (j *JWT) StudentParseToken(tokenString string) (*request.StudentCustomClaims, error)
type Os ¶
Source Files
¶
- breakpoint_continue.go
- clamis.go
- crypto.go
- db_automation.go
- dictionary.go
- directory.go
- exam.go
- execPaper.go
- file_operations.go
- fmt_plus.go
- getItemName.go
- hash.go
- injection_code.go
- judgeStatus.go
- jwt.go
- md5.go
- path.go
- qrCode.go
- reload.go
- server.go
- stringToTime.go
- student_teachClass.go
- target.go
- uuid.go
- validator.go
- verify.go
- zip.go
- zipfiles.go
Click to show internal directories.
Click to hide internal directories.