| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- package gen
- 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/engine"
- )
- // SysAttachmentController operations for SysAttachment
- type SysAttachmentController struct {
- apiengine *engine.ApiEngine
- }
- func NewSysAttachmentController(e *engine.ApiEngine) *SysAttachmentController {
- controller := &SysAttachmentController{e}
- return controller
- }
- // Upload
- // @Title Upload
- // @Description 上传文件
- // @Success 200 {object} sysReturn
- // @Failure 403 :id is empty
- // @router /upload [post]
- func (c *SysAttachmentController) Upload(ctx *gin.Context) {
- //
- db:=c.apiengine.BusinessOrmEngine[ctx.GetString("domain")]
- partial.SysAttachment_Upload(&entitys.CtrlContext{ctx, db, c.apiengine.PlatformOrmEngine})
- }
- // Download
- // @Title Download
- // @Description 下载文件
- // @Param id string false "文件ID"
- // @Success 200 {object} sysReturn
- // @Failure 403 :id is empty
- // @router /download [get]
- func (c *SysAttachmentController) Download(ctx *gin.Context) {
- //
- db:=c.apiengine.BusinessOrmEngine[ctx.GetString("domain")]
- partial.SysAttachment_Download(&entitys.CtrlContext{ctx, db, c.apiengine.PlatformOrmEngine})
- }
- // Delete
- // @Title Delete
- // @Description 删除文件
- // @Param id string false "文件ID"
- // @Success 200 {object} sysReturn
- // @Failure 403 :id is empty
- // @router /delete [get]
- func (c *SysAttachmentController) Delete(ctx *gin.Context) {
- //
- db:=c.apiengine.BusinessOrmEngine[ctx.GetString("domain")]
- partial.SysAttachment_Delete(&entitys.CtrlContext{ctx, db, c.apiengine.PlatformOrmEngine})
- }
|