You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
697 B

package api
import (
"github.com/gin-gonic/gin"
"net/http"
"zggsong.cn/sandstone/server/dao"
"zggsong.cn/sandstone/server/response"
"zggsong.cn/sandstone/server/util"
)
func ListAttachments(ctx *gin.Context) {
var datas []response.Data
var data response.Data
var arrayData = dao.ListAttach()
for _, i := range arrayData {
data.CreateTime = i.CreateTime
data.UploadTime = i.UploadTime
data.Line = i.Line
data.Machine = i.Machine
data.KeyName = i.KeyName
data.Url = util.GetUrl(i.KeyName)
data.Tags = util.GetTags(i.KeyName)
datas = append(datas, data)
}
ctx.JSON(http.StatusOK, response.Response{
Code: http.StatusOK,
Message: "success",
Data: datas,
})
}