Skip to content

Commit 4457058

Browse files
author
QM303176530
committed
Merge remote-tracking branch 'origin/gva_gormv2_dev' into gva_gormv2_dev
2 parents ef5c664 + 9b8148c commit 4457058

23 files changed

+501
-515
lines changed

server/api/v1/exa_simple_uploader.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
// @Security ApiKeyAuth
1616
// @accept multipart/form-data
1717
// @Produce application/json
18-
// TODO @Param file formData file true "断点续传插件版示例"
18+
// @Param file formData file true "断点续传插件版示例"
1919
// @Success 200 {string} string "{"success":true,"data":{},"msg":"切片创建成功"}"
2020
// @Router /simpleUploader/upload [post]
2121
func SimpleUploaderUpload(c *gin.Context) {

server/api/v1/sys_auto_code.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
// @Security ApiKeyAuth
2020
// @accept application/json
2121
// @Produce application/json
22-
// TODO @Param data body model.AutoCodeStruct true "创建自动代码"
22+
// @Param data body model.AutoCodeStruct true "创建自动代码"
2323
// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
2424
// @Router /autoCode/createTemp [post]
2525
func CreateTemp(c *gin.Context) {

server/api/v1/sys_operation_record.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ func DeleteSysOperationRecordByIds(c *gin.Context) {
6262
_ = c.ShouldBindJSON(&IDS)
6363
if err := service.DeleteSysOperationRecordByIds(IDS); err != nil {
6464
global.GVA_LOG.Error("批量删除失败!", zap.Any("err", err))
65-
6665
response.FailWithMessage("批量删除失败", c)
6766
} else {
6867
response.OkWithMessage("批量删除成功", c)

server/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ require (
3333
github.com/onsi/ginkgo v1.7.0 // indirect
3434
github.com/onsi/gomega v1.4.3 // indirect
3535
github.com/pelletier/go-toml v1.6.0 // indirect
36-
github.com/pkg/errors v0.9.1
36+
github.com/pkg/errors v0.9.1 // indirect
3737
github.com/qiniu/api.v7/v7 v7.4.1
3838
github.com/satori/go.uuid v1.2.0
3939
github.com/shirou/gopsutil v2.20.8+incompatible

server/resource/template/server/service.go.tpl

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,67 +6,66 @@ import (
66
"gin-vue-admin/model/request"
77
)
88

9-
// @title Create{{.StructName}}
10-
// @description create a {{.StructName}}
11-
// @param {{.Abbreviation}} model.{{.StructName}}
12-
// @auth (2020/04/05 20:22)
13-
// @return err error
9+
//@author: [piexlmax](https://github.com/piexlmax)
10+
//@function: Create{{.StructName}}
11+
//@description: 创建{{.StructName}}记录
12+
//@param: {{.Abbreviation}} model.{{.StructName}}
13+
//@return: err error
1414

1515
func Create{{.StructName}}({{.Abbreviation}} model.{{.StructName}}) (err error) {
1616
err = global.GVA_DB.Create(&{{.Abbreviation}}).Error
1717
return err
1818
}
1919

20-
// @title Delete{{.StructName}}
21-
// @description delete a {{.StructName}}
22-
// @auth (2020/04/05 20:22)
23-
// @param {{.Abbreviation}} model.{{.StructName}}
24-
// @return error
20+
//@author: [piexlmax](https://github.com/piexlmax)
21+
//@function: Delete{{.StructName}}
22+
//@description: 删除{{.StructName}}记录
23+
//@param: {{.Abbreviation}} model.{{.StructName}}
24+
//@return: err error
2525

2626
func Delete{{.StructName}}({{.Abbreviation}} model.{{.StructName}}) (err error) {
2727
err = global.GVA_DB.Delete({{.Abbreviation}}).Error
2828
return err
2929
}
3030

31-
// @title Delete{{.StructName}}ByIds
32-
// @description delete {{.StructName}}s
33-
// @auth (2020/04/05 20:22)
34-
// @param {{.Abbreviation}} model.{{.StructName}}
35-
// @return error
31+
//@author: [piexlmax](https://github.com/piexlmax)
32+
//@function: Delete{{.StructName}}ByIds
33+
//@description: 批量删除{{.StructName}}记录
34+
//@param: ids request.IdsReq
35+
//@return: err error
3636

3737
func Delete{{.StructName}}ByIds(ids request.IdsReq) (err error) {
3838
err = global.GVA_DB.Delete(&[]model.{{.StructName}}{},"id in ?",ids.Ids).Error
3939
return err
4040
}
4141

42-
// @title Update{{.StructName}}
43-
// @description update a {{.StructName}}
44-
// @param {{.Abbreviation}} *model.{{.StructName}}
45-
// @auth (2020/04/05 20:22)
46-
// @return error
42+
//@author: [piexlmax](https://github.com/piexlmax)
43+
//@function: Update{{.StructName}}
44+
//@description: 更新{{.StructName}}记录
45+
//@param: {{.Abbreviation}} *model.{{.StructName}}
46+
//@return: err error
4747

4848
func Update{{.StructName}}({{.Abbreviation}} *model.{{.StructName}}) (err error) {
4949
err = global.GVA_DB.Save({{.Abbreviation}}).Error
5050
return err
5151
}
5252

53-
// @title Get{{.StructName}}
54-
// @description get the info of a {{.StructName}}
55-
// @auth (2020/04/05 20:22)
56-
// @param id uint
57-
// @return error
58-
// @return {{.StructName}} {{.StructName}}
53+
//@author: [piexlmax](https://github.com/piexlmax)
54+
//@function: Get{{.StructName}}
55+
//@description: 根据id获取{{.StructName}}记录
56+
//@param: id uint
57+
//@return: err error, {{.Abbreviation}} model.{{.StructName}}
5958

6059
func Get{{.StructName}}(id uint) (err error, {{.Abbreviation}} model.{{.StructName}}) {
6160
err = global.GVA_DB.Where("id = ?", id).First(&{{.Abbreviation}}).Error
6261
return
6362
}
6463

65-
// @title Get{{.StructName}}InfoList
66-
// @description get {{.StructName}} list by pagination, 分页获取{{.StructName}}
67-
// @auth (2020/04/05 20:22)
68-
// @param info PageInfo
69-
// @return error
64+
//@author: [piexlmax](https://github.com/piexlmax)
65+
//@function: Get{{.StructName}}InfoList
66+
//@description: 分页获取{{.StructName}}记录
67+
//@param: info request.{{.StructName}}Search
68+
//@return: err error, list interface{}, total int64
7069

7170
func Get{{.StructName}}InfoList(info request.{{.StructName}}Search) (err error, list interface{}, total int64) {
7271
limit := info.PageSize

server/service/exa_breakpoint_continue.go

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,11 @@ import (
77
"gorm.io/gorm"
88
)
99

10-
// @title FindOrCreateFile
11-
// @description Check your file if it does not exist, or return current slice of the file
12-
// 上传文件时检测当前文件属性,如果没有文件则创建,有则返回文件的当前切片
13-
// @auth (2020/04/05 20:22)
14-
// @param fileMd5 string
15-
// @param fileName string
16-
// @param chunkTotal int
17-
// @return err error
18-
// @return file ExaFile
10+
//@author: [piexlmax](https://github.com/piexlmax)
11+
//@function: FindOrCreateFile
12+
//@description: 上传文件时检测当前文件属性,如果没有文件则创建,有则返回文件的当前切片
13+
//@param: fileMd5 string, fileName string, chunkTotal int
14+
//@return: err error, file model.ExaFile
1915

2016
func FindOrCreateFile(fileMd5 string, fileName string, chunkTotal int) (err error, file model.ExaFile) {
2117
var cfile model.ExaFile
@@ -33,13 +29,11 @@ func FindOrCreateFile(fileMd5 string, fileName string, chunkTotal int) (err erro
3329
return err, cfile
3430
}
3531

36-
// @title CreateFileChunk
37-
// @description create a chunk of the file, 创建文件切片记录
38-
// @auth (2020/04/05 20:22)
39-
// @param id unit
40-
// @param fileChunkPath string
41-
// @param fileChunkNumber int
42-
// @return error
32+
//@author: [piexlmax](https://github.com/piexlmax)
33+
//@function: CreateFileChunk
34+
//@description: 创建文件切片记录
35+
//@param: id uint, fileChunkPath string, fileChunkNumber int
36+
//@return: error
4337

4438
func CreateFileChunk(id uint, fileChunkPath string, fileChunkNumber int) error {
4539
var chunk model.ExaFileChunk
@@ -50,13 +44,11 @@ func CreateFileChunk(id uint, fileChunkPath string, fileChunkNumber int) error {
5044
return err
5145
}
5246

53-
// @title DeleteFileChunk
54-
// @description delete a chuck of the file, 删除文件切片记录
55-
// @auth (2020/04/05 20:22)
56-
// @param FileMd5 string
57-
// @param FileName string
58-
// @param FilePath string
59-
// @return error
47+
//@author: [piexlmax](https://github.com/piexlmax)
48+
//@function: DeleteFileChunk
49+
//@description: 删除文件切片记录
50+
//@param: fileMd5 string, fileName string, filePath string
51+
//@return: error
6052

6153
func DeleteFileChunk(fileMd5 string, fileName string, filePath string) error {
6254
var chunks []model.ExaFileChunk

server/service/exa_customer.go

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,57 +6,55 @@ import (
66
"gin-vue-admin/model/request"
77
)
88

9-
// @title CreateExaCustomer
10-
// @description create a customer, 创建用户
11-
// @param e model.ExaCustomer
12-
// @auth (2020/04/05 20:22)
13-
// @return err error
9+
//@author: [piexlmax](https://github.com/piexlmax)
10+
//@function: CreateExaCustomer
11+
//@description: 创建客户
12+
//@param: e model.ExaCustomer
13+
//@return: err error
1414

1515
func CreateExaCustomer(e model.ExaCustomer) (err error) {
1616
err = global.GVA_DB.Create(&e).Error
1717
return err
1818
}
1919

20-
// @title DeleteFileChunk
21-
// @description delete a customer, 删除用户
22-
// @auth (2020/04/05 20:22)
23-
// @param e model.ExaCustomer
24-
// @return error
20+
//@author: [piexlmax](https://github.com/piexlmax)
21+
//@function: DeleteFileChunk
22+
//@description: 删除客户
23+
//@param: e model.ExaCustomer
24+
//@return: err error
2525

2626
func DeleteExaCustomer(e model.ExaCustomer) (err error) {
2727
err = global.GVA_DB.Delete(e).Error
2828
return err
2929
}
3030

31-
// @title UpdateExaCustomer
32-
// @description update a customer, 更新用户
33-
// @param e *model.ExaCustomer
34-
// @auth (2020/04/05 20:22)
35-
// @return error
31+
//@author: [piexlmax](https://github.com/piexlmax)
32+
//@function: UpdateExaCustomer
33+
//@description: 更新客户
34+
//@param: e *model.ExaCustomer
35+
//@return: err error
3636

3737
func UpdateExaCustomer(e *model.ExaCustomer) (err error) {
3838
err = global.GVA_DB.Save(e).Error
3939
return err
4040
}
4141

42-
// @title GetExaCustomer
43-
// @description get the info of a costumer , 获取用户信息
44-
// @auth (2020/04/05 20:22)
45-
// @param id uint
46-
// @return error
47-
// @return customer ExaCustomer
42+
//@author: [piexlmax](https://github.com/piexlmax)
43+
//@function: GetExaCustomer
44+
//@description: 获取客户信息
45+
//@param: id uint
46+
//@return: err error, customer model.ExaCustomer
4847

4948
func GetExaCustomer(id uint) (err error, customer model.ExaCustomer) {
5049
err = global.GVA_DB.Where("id = ?", id).First(&customer).Error
5150
return
5251
}
5352

54-
// @title GetCustomerInfoList
55-
// @description get customer list by pagination, 分页获取用户列表
56-
// @auth (2020/04/05 20:22)
57-
// @param sysUserAuthorityID string
58-
// @param info PageInfo
59-
// @return error
53+
//@author: [piexlmax](https://github.com/piexlmax)
54+
//@function: GetCustomerInfoList
55+
//@description: 分页获取客户列表
56+
//@param: sysUserAuthorityID string, info request.PageInfo
57+
//@return: err error, list interface{}, total int64
6058

6159
func GetCustomerInfoList(sysUserAuthorityID string, info request.PageInfo) (err error, list interface{}, total int64) {
6260
limit := info.PageSize

server/service/exa_file_upload_download.go

Lines changed: 26 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -10,34 +10,33 @@ import (
1010
"strings"
1111
)
1212

13-
// @title Upload
14-
// @description 创建文件上传记录
15-
// @param file model.ExaFileUploadAndDownload
16-
// @auth (2020/04/05 20:22)
17-
// @return error
13+
//@author: [piexlmax](https://github.com/piexlmax)
14+
//@function: Upload
15+
//@description: 创建文件上传记录
16+
//@param: file model.ExaFileUploadAndDownload
17+
//@return: error
1818

1919
func Upload(file model.ExaFileUploadAndDownload) error {
20-
err := global.GVA_DB.Create(&file).Error
21-
return err
20+
return global.GVA_DB.Create(&file).Error
2221
}
2322

24-
// @title FindFile
25-
// @description 删除文件切片记录
26-
// @auth (2020/04/05 20:22)
27-
// @param id uint
28-
// @return error
23+
//@author: [piexlmax](https://github.com/piexlmax)
24+
//@function: FindFile
25+
//@description: 删除文件切片记录
26+
//@param: id uint
27+
//@return: error, model.ExaFileUploadAndDownload
2928

3029
func FindFile(id uint) (error, model.ExaFileUploadAndDownload) {
3130
var file model.ExaFileUploadAndDownload
3231
err := global.GVA_DB.Where("id = ?", id).First(&file).Error
3332
return err, file
3433
}
3534

36-
// @title DeleteFile
37-
// @description 删除文件记录
38-
// @auth (2020/04/05 20:22)
39-
// @param file model.ExaFileUploadAndDownload
40-
// @return error
35+
//@author: [piexlmax](https://github.com/piexlmax)
36+
//@function: DeleteFile
37+
//@description: 删除文件记录
38+
//@param: file model.ExaFileUploadAndDownload
39+
//@return: err error
4140

4241
func DeleteFile(file model.ExaFileUploadAndDownload) (err error) {
4342
var fileFromDb model.ExaFileUploadAndDownload
@@ -50,13 +49,11 @@ func DeleteFile(file model.ExaFileUploadAndDownload) (err error) {
5049
return err
5150
}
5251

53-
// @title GetFileRecordInfoList
54-
// @description 分页获取数据
55-
// @auth (2020/04/05 20:22)
56-
// @param info PageInfo
57-
// @return err error
58-
// @return list error
59-
// @return total error
52+
//@author: [piexlmax](https://github.com/piexlmax)
53+
//@function: GetFileRecordInfoList
54+
//@description: 分页获取数据
55+
//@param: info request.PageInfo
56+
//@return: err error, list interface{}, total int64
6057

6158
func GetFileRecordInfoList(info request.PageInfo) (err error, list interface{}, total int64) {
6259
limit := info.PageSize
@@ -68,13 +65,11 @@ func GetFileRecordInfoList(info request.PageInfo) (err error, list interface{},
6865
return err, fileLists, total
6966
}
7067

71-
// @title UploadFile
72-
// @description 根据配置文件判断是文件上传到本地或者七牛云
73-
// @auth (2020/04/05 20:22)
74-
// @param header *multipart.FileHeader
75-
// @param noSave string
76-
// @return err error
77-
// @return file file model.ExaFileUploadAndDownload
68+
//@author: [piexlmax](https://github.com/piexlmax)
69+
//@function: UploadFile
70+
//@description: 根据配置文件判断是文件上传到本地或者七牛云
71+
//@param: header *multipart.FileHeader, noSave string
72+
//@return: err error, file model.ExaFileUploadAndDownload
7873

7974
func UploadFile(header *multipart.FileHeader, noSave string) (err error, file model.ExaFileUploadAndDownload) {
8075
oss := upload.NewOss()

0 commit comments

Comments
 (0)