模块化变更
This commit is contained in:
18
server/router/example/exa_customer.go
Normal file
18
server/router/example/exa_customer.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package example
|
||||
|
||||
import (
|
||||
"gin-vue-admin/api/v1"
|
||||
"gin-vue-admin/middleware"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func (e *Router) InitCustomerRouter(Router *gin.RouterGroup) {
|
||||
CustomerRouter := Router.Group("customer").Use(middleware.OperationRecord())
|
||||
{
|
||||
CustomerRouter.POST("customer", v1.CreateExaCustomer) // 创建客户
|
||||
CustomerRouter.PUT("customer", v1.UpdateExaCustomer) // 更新客户
|
||||
CustomerRouter.DELETE("customer", v1.DeleteExaCustomer) // 删除客户
|
||||
CustomerRouter.GET("customer", v1.GetExaCustomer) // 获取单一客户信息
|
||||
CustomerRouter.GET("customerList", v1.GetExaCustomerList) // 获取客户列表
|
||||
}
|
||||
}
|
16
server/router/example/exa_excel.go
Normal file
16
server/router/example/exa_excel.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package example
|
||||
|
||||
import (
|
||||
"gin-vue-admin/api/v1"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func (e *Router) InitExcelRouter(Router *gin.RouterGroup) {
|
||||
ExcelRouter := Router.Group("excel")
|
||||
{
|
||||
ExcelRouter.POST("/importExcel", v1.ImportExcel) // 导入Excel
|
||||
ExcelRouter.GET("/loadExcel", v1.LoadExcel) // 加载Excel数据
|
||||
ExcelRouter.POST("/exportExcel", v1.ExportExcel) // 导出Excel
|
||||
ExcelRouter.GET("/downloadTemplate", v1.DownloadTemplate) // 下载模板文件
|
||||
}
|
||||
}
|
19
server/router/example/exa_file_upload_and_download.go
Normal file
19
server/router/example/exa_file_upload_and_download.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package example
|
||||
|
||||
import (
|
||||
"gin-vue-admin/api/v1"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func (e *Router) InitFileUploadAndDownloadRouter(Router *gin.RouterGroup) {
|
||||
FileUploadAndDownloadRouter := Router.Group("fileUploadAndDownload")
|
||||
{
|
||||
FileUploadAndDownloadRouter.POST("/upload", v1.UploadFile) // 上传文件
|
||||
FileUploadAndDownloadRouter.POST("/getFileList", v1.GetFileList) // 获取上传文件列表
|
||||
FileUploadAndDownloadRouter.POST("/deleteFile", v1.DeleteFile) // 删除指定文件
|
||||
FileUploadAndDownloadRouter.POST("/breakpointContinue", v1.BreakpointContinue) // 断点续传
|
||||
FileUploadAndDownloadRouter.GET("/findFile", v1.FindFile) // 查询当前文件成功的切片
|
||||
FileUploadAndDownloadRouter.POST("/breakpointContinueFinish", v1.BreakpointContinueFinish) // 查询当前文件成功的切片
|
||||
FileUploadAndDownloadRouter.POST("/removeChunk", v1.RemoveChunk) // 查询当前文件成功的切片
|
||||
}
|
||||
}
|
15
server/router/example/exa_simple_uploader.go
Normal file
15
server/router/example/exa_simple_uploader.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package example
|
||||
|
||||
import (
|
||||
"gin-vue-admin/api/v1"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func (e *Router) InitSimpleUploaderRouter(Router *gin.RouterGroup) {
|
||||
SimpleUploaderRouter := Router.Group("simpleUploader")
|
||||
{
|
||||
SimpleUploaderRouter.POST("upload", v1.SimpleUploaderUpload) // 上传功能
|
||||
SimpleUploaderRouter.GET("checkFileMd5", v1.CheckFileMd5) // 文件完整度验证
|
||||
SimpleUploaderRouter.GET("mergeFileMd5", v1.MergeFileMd5) // 合并文件
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user