✨ Init
This commit is contained in:
		
							
								
								
									
										6
									
								
								router/example/enter.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								router/example/enter.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,6 @@ | ||||
| package example | ||||
|  | ||||
| type RouterGroup struct { | ||||
| 	CustomerRouter | ||||
| 	FileUploadAndDownloadRouter | ||||
| } | ||||
							
								
								
									
										24
									
								
								router/example/exa_customer.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								router/example/exa_customer.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,24 @@ | ||||
| package example | ||||
|  | ||||
| import ( | ||||
| 	"github.com/gin-gonic/gin" | ||||
| 	v1 "miniapp/api/v1" | ||||
| 	"miniapp/middleware" | ||||
| ) | ||||
|  | ||||
| type CustomerRouter struct{} | ||||
|  | ||||
| func (e *CustomerRouter) InitCustomerRouter(Router *gin.RouterGroup) { | ||||
| 	customerRouter := Router.Group("customer").Use(middleware.OperationRecord()) | ||||
| 	customerRouterWithoutRecord := Router.Group("customer") | ||||
| 	exaCustomerApi := v1.ApiGroupApp.ExampleApiGroup.CustomerApi | ||||
| 	{ | ||||
| 		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) // 获取客户列表 | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										23
									
								
								router/example/exa_file_upload_and_download.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								router/example/exa_file_upload_and_download.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,23 @@ | ||||
| package example | ||||
|  | ||||
| import ( | ||||
| 	"github.com/gin-gonic/gin" | ||||
| 	v1 "miniapp/api/v1" | ||||
| ) | ||||
|  | ||||
| type FileUploadAndDownloadRouter struct{} | ||||
|  | ||||
| func (e *FileUploadAndDownloadRouter) InitFileUploadAndDownloadRouter(Router *gin.RouterGroup) { | ||||
| 	fileUploadAndDownloadRouter := Router.Group("fileUploadAndDownload") | ||||
| 	exaFileUploadAndDownloadApi := v1.ApiGroupApp.ExampleApiGroup.FileUploadAndDownloadApi | ||||
| 	{ | ||||
| 		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)                           // 删除切片 | ||||
| 	} | ||||
| } | ||||
		Reference in New Issue
	
	Block a user