✨ init project
This commit is contained in:
17
router/example/enter.go
Normal file
17
router/example/enter.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package example
|
||||
|
||||
import (
|
||||
api "git.echol.cn/loser/xiecheng_server/api/v1"
|
||||
)
|
||||
|
||||
type RouterGroup struct {
|
||||
CustomerRouter
|
||||
FileUploadAndDownloadRouter
|
||||
AttachmentCategoryRouter
|
||||
}
|
||||
|
||||
var (
|
||||
exaCustomerApi = api.ApiGroupApp.ExampleApiGroup.CustomerApi
|
||||
exaFileUploadAndDownloadApi = api.ApiGroupApp.ExampleApiGroup.FileUploadAndDownloadApi
|
||||
attachmentCategoryApi = api.ApiGroupApp.ExampleApiGroup.AttachmentCategoryApi
|
||||
)
|
16
router/example/exa_attachment_category.go
Normal file
16
router/example/exa_attachment_category.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package example
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type AttachmentCategoryRouter struct{}
|
||||
|
||||
func (r *AttachmentCategoryRouter) InitAttachmentCategoryRouterRouter(Router *gin.RouterGroup) {
|
||||
router := Router.Group("attachmentCategory")
|
||||
{
|
||||
router.GET("getCategoryList", attachmentCategoryApi.GetCategoryList) // 分类列表
|
||||
router.POST("addCategory", attachmentCategoryApi.AddCategory) // 添加/编辑分类
|
||||
router.POST("deleteCategory", attachmentCategoryApi.DeleteCategory) // 删除分类
|
||||
}
|
||||
}
|
22
router/example/exa_customer.go
Normal file
22
router/example/exa_customer.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package example
|
||||
|
||||
import (
|
||||
"git.echol.cn/loser/xiecheng_server/middleware"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type CustomerRouter struct{}
|
||||
|
||||
func (e *CustomerRouter) InitCustomerRouter(Router *gin.RouterGroup) {
|
||||
customerRouter := Router.Group("customer").Use(middleware.OperationRecord())
|
||||
customerRouterWithoutRecord := Router.Group("customer")
|
||||
{
|
||||
customerRouter.POST("customer", exaCustomerApi.CreateExaCustomer) // 创建客户
|
||||
customerRouter.PUT("customer", exaCustomerApi.UpdateExaCustomer) // 更新客户
|
||||
customerRouter.DELETE("customer", exaCustomerApi.DeleteExaCustomer) // 删除客户
|
||||
}
|
||||
{
|
||||
customerRouterWithoutRecord.GET("customer", exaCustomerApi.GetExaCustomer) // 获取单一客户信息
|
||||
customerRouterWithoutRecord.GET("customerList", exaCustomerApi.GetExaCustomerList) // 获取客户列表
|
||||
}
|
||||
}
|
22
router/example/exa_file_upload_and_download.go
Normal file
22
router/example/exa_file_upload_and_download.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package example
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type FileUploadAndDownloadRouter struct{}
|
||||
|
||||
func (e *FileUploadAndDownloadRouter) InitFileUploadAndDownloadRouter(Router *gin.RouterGroup) {
|
||||
fileUploadAndDownloadRouter := Router.Group("fileUploadAndDownload")
|
||||
{
|
||||
fileUploadAndDownloadRouter.POST("upload", exaFileUploadAndDownloadApi.UploadFile) // 上传文件
|
||||
fileUploadAndDownloadRouter.POST("getFileList", exaFileUploadAndDownloadApi.GetFileList) // 获取上传文件列表
|
||||
fileUploadAndDownloadRouter.POST("deleteFile", exaFileUploadAndDownloadApi.DeleteFile) // 删除指定文件
|
||||
fileUploadAndDownloadRouter.POST("editFileName", exaFileUploadAndDownloadApi.EditFileName) // 编辑文件名或者备注
|
||||
fileUploadAndDownloadRouter.POST("breakpointContinue", exaFileUploadAndDownloadApi.BreakpointContinue) // 断点续传
|
||||
fileUploadAndDownloadRouter.GET("findFile", exaFileUploadAndDownloadApi.FindFile) // 查询当前文件成功的切片
|
||||
fileUploadAndDownloadRouter.POST("breakpointContinueFinish", exaFileUploadAndDownloadApi.BreakpointContinueFinish) // 切片传输完成
|
||||
fileUploadAndDownloadRouter.POST("removeChunk", exaFileUploadAndDownloadApi.RemoveChunk) // 删除切片
|
||||
fileUploadAndDownloadRouter.POST("importURL", exaFileUploadAndDownloadApi.ImportURL) // 导入URL
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user