SysAttachmentController_gen.go 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. package controllers
  2. import (
  3. "github.com/gin-gonic/gin"
  4. "github.com/xormplus/xorm"
  5. "git.qianqiusoft.com/qianqiusoft/light-apiengine/engine"
  6. )
  7. // SysAttachmentController operations for SysAttachment
  8. type SysAttachmentController struct {
  9. Ctx *gin.Context
  10. Db *xorm.Engine
  11. engine *engine.ApiEngine
  12. }
  13. func NewSysAttachmentController(c *gin.Context, e *engine.ApiEngine) *SysAttachmentController {
  14. controller := &SysAttachmentController{c,e.OrmEngine,e}
  15. return controller
  16. }
  17. // Upload
  18. // @Title Upload
  19. // @Description 上传文件
  20. // @Success 200 {object} models.Account
  21. // @Failure 403 :id is empty
  22. // @router /upload [post]
  23. func (c *SysAttachmentController) Upload() {
  24. //
  25. SysAttachment_Upload(c)
  26. }
  27. // Download
  28. // @Title Download
  29. // @Description 下载文件
  30. // @Param id string false "文件ID"
  31. // @Success 200 {object} models.Account
  32. // @Failure 403 :id is empty
  33. // @router /download [get]
  34. func (c *SysAttachmentController) Download() {
  35. //
  36. SysAttachment_Download(c)
  37. }
  38. // Delete
  39. // @Title Delete
  40. // @Description 删除文件
  41. // @Param id string false "文件ID"
  42. // @Success 200 {object} models.Account
  43. // @Failure 403 :id is empty
  44. // @router /delete [get]
  45. func (c *SysAttachmentController) Delete() {
  46. //
  47. SysAttachment_Delete(c)
  48. }