modified 统一代码风格

This commit is contained in:
何秀钢
2021-06-01 16:20:46 +08:00
parent d3fee1bf3e
commit 3ffe0d89d8
34 changed files with 95 additions and 112 deletions
+2 -3
View File
@@ -40,9 +40,9 @@ func BreakPointContinue(content []byte, fileName string, contentNumber int, cont
func CheckMd5(content []byte, chunkMd5 string) (CanUpload bool) {
fileMd5 := MD5V(content)
if fileMd5 == chunkMd5 {
return true // "可以继续上传"
return true // 可以继续上传
} else {
return false // "切片不完整,废弃"
return false // 切片不完整,废弃
}
}
@@ -92,7 +92,6 @@ func MakeFile(fileName string, FileMd5 string) (error, string) {
return err, finishDir + fileName
}
}
return nil, finishDir + fileName
}
+2 -2
View File
@@ -11,8 +11,8 @@ import (
//@author: [songzhibin97](https://github.com/songzhibin97)
//@function: ClearTable
//@description: 清理数据库表数据
//@param: target db(数据库对象) *gorm.DB,tableName(表名) string,compareField(比较字段) string , interval string 间隔
//@return: err
//@param: db(数据库对象) *gorm.DB, tableName(表名) string, compareField(比较字段) string, interval(间隔) string
//@return: error
func ClearTable(db *gorm.DB, tableName string, compareField string, interval string) error {
if db == nil {
+1 -1
View File
@@ -46,7 +46,7 @@ Redirect:
//@function: TrimSpace
//@description: 去除结构体空格
//@param: target interface (target: 目标结构体,传入必须是指针类型)
//@return: err error
//@return: null
func TrimSpace(target interface{}) {
t := reflect.TypeOf(target)
+1 -1
View File
@@ -13,7 +13,7 @@ import (
//@function: AutoInjectionCode
//@description: 向文件中固定注释位置写入代码
//@param: filepath string, funcName string, codeData string
//@return: err error
//@return: error
func AutoInjectionCode(filepath string, funcName string, codeData string) error {
startComment := "Code generated by gin-vue-admin Begin; DO NOT EDIT."
+1 -1
View File
@@ -26,7 +26,7 @@ func (*AliyunOSS) UploadFile(file *multipart.FileHeader) (string, string, error)
return "", "", errors.New("function file.Open() Failed, err:" + openError.Error())
}
//上传阿里云路径 文件名格式 自己可以改 建议保证唯一性
// 上传阿里云路径 文件名格式 自己可以改 建议保证唯一性
yunFileTmpPath := filepath.Join("uploads", time.Now().Format("2006-01-02")) + "/" + file.Filename
// 上传文件流。
+1 -2
View File
@@ -71,8 +71,7 @@ func (*Qiniu) DeleteFile(key string) error {
//@object: *Qiniu
//@function: qiniuConfig
//@description: 根据配置文件进行返回七牛云的配置
//@param: key string
//@return: error
//@return: *storage.Config
func qiniuConfig() *storage.Config {
cfg := storage.Config{
+1 -2
View File
@@ -31,8 +31,7 @@ func RegisterRule(key string, rule Rules) (err error) {
//@author: [piexlmax](https://github.com/piexlmax)
//@function: NotEmpty
//@description: 非空 不能为其对应类型的0值
//@param: key string, rule Rules
//@return: err error
//@return: string
func NotEmpty() string {
return "notEmpty"
+1 -1
View File
@@ -10,7 +10,7 @@ import (
//@author: [piexlmax](https://github.com/piexlmax)
//@function: ZipFiles
//@description: 压缩文件
//@param: filename string, files []string, oldform, newform string
//@param: filename string, files []string, oldForm, newForm string
//@return: error
func ZipFiles(filename string, files []string, oldForm, newForm string) error {