|
|
@@ -160,6 +160,27 @@ func SysAttachment_Delete(c *entitys.CtrlContext) {
|
|
|
c.Ctx.JSON(200, sysmodel.SysReturn{200, "", attrId})
|
|
|
}
|
|
|
|
|
|
+// _Get
|
|
|
+// @Title _Get
|
|
|
+// @Description 获取附件信息
|
|
|
+// @Param id string false "附件id"
|
|
|
+// @Success 200 {object} Account
|
|
|
+// @Failure 403 :id is empty
|
|
|
+func SysAttachment_Get(c *entitys.CtrlContext) {
|
|
|
+ var id = c.Ctx.Query("id")
|
|
|
+ attach := sysmodel.SysAttachment{Id:id}
|
|
|
+ has, err := c.PlatformDbEngine.Get(&attach)
|
|
|
+ if err == nil {
|
|
|
+ if has {
|
|
|
+ c.Ctx.JSON(200, sysmodel.SysReturn{200, "", attach})
|
|
|
+ } else {
|
|
|
+ c.Ctx.JSON(200, sysmodel.SysReturn{500, "附件不存在", nil})
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ c.Ctx.JSON(200, sysmodel.SysReturn{500, err.Error(), nil})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
func doUpload(c *entitys.CtrlContext) (*sysmodel.SysAttachment, error) {
|
|
|
file, fInfo, err := c.Ctx.Request.FormFile("file")
|
|
|
if err != nil {
|