|
@@ -1,11 +1,10 @@
|
|
|
-
|
|
|
|
|
package gen
|
|
package gen
|
|
|
|
|
|
|
|
import (
|
|
import (
|
|
|
- "git.qianqiusoft.com/qianqiusoft/light-apiengine/entitys"
|
|
|
|
|
- "github.com/gin-gonic/gin"
|
|
|
|
|
"git.qianqiusoft.com/qianqiusoft/light-apiengine/controllers/partial"
|
|
"git.qianqiusoft.com/qianqiusoft/light-apiengine/controllers/partial"
|
|
|
"git.qianqiusoft.com/qianqiusoft/light-apiengine/engine"
|
|
"git.qianqiusoft.com/qianqiusoft/light-apiengine/engine"
|
|
|
|
|
+ "git.qianqiusoft.com/qianqiusoft/light-apiengine/entitys"
|
|
|
|
|
+ "github.com/gin-gonic/gin"
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
// SysAttachmentController operations for SysAttachment
|
|
// SysAttachmentController operations for SysAttachment
|
|
@@ -18,43 +17,53 @@ func NewSysAttachmentController(e *engine.ApiEngine) *SysAttachmentController {
|
|
|
return controller
|
|
return controller
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+// Get
|
|
|
|
|
+// @Title Get
|
|
|
|
|
+// @Description 获取附件信息
|
|
|
|
|
+// @Param id string false "附件id"
|
|
|
|
|
+// @Success 200 {object} sysReturn
|
|
|
|
|
+// @Failure 403 :id is empty
|
|
|
|
|
+// @router /get [get]
|
|
|
|
|
+func (c *SysAttachmentController) Get(ctx *gin.Context) {
|
|
|
|
|
+ //
|
|
|
|
|
+ db := c.apiengine.BusinessOrmEngine[ctx.GetString("domain")]
|
|
|
|
|
+ partial.SysAttachment_Get(&entitys.CtrlContext{c.apiengine, ctx, db, c.apiengine.PlatformOrmEngine})
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
// Upload
|
|
// Upload
|
|
|
// @Title Upload
|
|
// @Title Upload
|
|
|
-// @Description 上传文件
|
|
|
|
|
|
|
+// @Description 上传文件
|
|
|
// @Success 200 {object} sysReturn
|
|
// @Success 200 {object} sysReturn
|
|
|
// @Failure 403 :id is empty
|
|
// @Failure 403 :id is empty
|
|
|
// @router /upload [post]
|
|
// @router /upload [post]
|
|
|
func (c *SysAttachmentController) Upload(ctx *gin.Context) {
|
|
func (c *SysAttachmentController) Upload(ctx *gin.Context) {
|
|
|
//
|
|
//
|
|
|
- db:=c.apiengine.BusinessOrmEngine[ctx.GetString("domain")]
|
|
|
|
|
|
|
+ db := c.apiengine.BusinessOrmEngine[ctx.GetString("domain")]
|
|
|
partial.SysAttachment_Upload(&entitys.CtrlContext{c.apiengine, ctx, db, c.apiengine.PlatformOrmEngine})
|
|
partial.SysAttachment_Upload(&entitys.CtrlContext{c.apiengine, ctx, db, c.apiengine.PlatformOrmEngine})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Download
|
|
// Download
|
|
|
// @Title Download
|
|
// @Title Download
|
|
|
-// @Description 下载文件
|
|
|
|
|
-// @Param id string false "文件ID"
|
|
|
|
|
|
|
+// @Description 下载文件
|
|
|
|
|
+// @Param id string false "文件ID"
|
|
|
// @Success 200 {object} sysReturn
|
|
// @Success 200 {object} sysReturn
|
|
|
// @Failure 403 :id is empty
|
|
// @Failure 403 :id is empty
|
|
|
// @router /download [get]
|
|
// @router /download [get]
|
|
|
func (c *SysAttachmentController) Download(ctx *gin.Context) {
|
|
func (c *SysAttachmentController) Download(ctx *gin.Context) {
|
|
|
//
|
|
//
|
|
|
- db:=c.apiengine.BusinessOrmEngine[ctx.GetString("domain")]
|
|
|
|
|
|
|
+ db := c.apiengine.BusinessOrmEngine[ctx.GetString("domain")]
|
|
|
partial.SysAttachment_Download(&entitys.CtrlContext{c.apiengine, ctx, db, c.apiengine.PlatformOrmEngine})
|
|
partial.SysAttachment_Download(&entitys.CtrlContext{c.apiengine, ctx, db, c.apiengine.PlatformOrmEngine})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Delete
|
|
// Delete
|
|
|
// @Title Delete
|
|
// @Title Delete
|
|
|
-// @Description 删除文件
|
|
|
|
|
-// @Param id string false "文件ID"
|
|
|
|
|
|
|
+// @Description 删除文件
|
|
|
|
|
+// @Param id string false "文件ID"
|
|
|
// @Success 200 {object} sysReturn
|
|
// @Success 200 {object} sysReturn
|
|
|
// @Failure 403 :id is empty
|
|
// @Failure 403 :id is empty
|
|
|
// @router /delete [get]
|
|
// @router /delete [get]
|
|
|
func (c *SysAttachmentController) Delete(ctx *gin.Context) {
|
|
func (c *SysAttachmentController) Delete(ctx *gin.Context) {
|
|
|
//
|
|
//
|
|
|
- db:=c.apiengine.BusinessOrmEngine[ctx.GetString("domain")]
|
|
|
|
|
|
|
+ db := c.apiengine.BusinessOrmEngine[ctx.GetString("domain")]
|
|
|
partial.SysAttachment_Delete(&entitys.CtrlContext{c.apiengine, ctx, db, c.apiengine.PlatformOrmEngine})
|
|
partial.SysAttachment_Delete(&entitys.CtrlContext{c.apiengine, ctx, db, c.apiengine.PlatformOrmEngine})
|
|
|
}
|
|
}
|
|
|
-
|
|
|