| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- 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
- }
- // 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
- // @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{c.apiengine, 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{c.apiengine, 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{c.apiengine, ctx, db, c.apiengine.PlatformOrmEngine})
- }
|