forked from tcp.direct/tcp.ac
yung RETARD
This commit is contained in:
parent
31919efcf0
commit
8995640a95
33
img.go
33
img.go
@ -25,26 +25,25 @@ type Post struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func postUpload(c *gin.Context, id string, key string) {
|
func postUpload(c *gin.Context, id string, key string) {
|
||||||
imgurl := baseUrl + "i/" + string(id)
|
imgurl := baseUrl + "i/" + string(id)
|
||||||
keyurl := "image_is_duplicate"
|
keyurl := "duplicate"
|
||||||
if key != "nil" { keyurl = baseUrl + "d/i/" + string(key) }
|
if key != "nil" { keyurl = baseUrl + "d/i/" + string(key) }
|
||||||
|
|
||||||
d := Post{
|
d := Post{
|
||||||
Imgurl: imgurl,
|
Imgurl: imgurl,
|
||||||
Delkey: keyurl,
|
Delkey: keyurl,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var p []byte
|
||||||
|
p, err := json.Marshal(d)
|
||||||
|
if err != nil {
|
||||||
|
errThrow(c, http.StatusInternalServerError, err.Error(), "internal error")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
var p []byte
|
fmt.Println("[imgPost]["+id+"] Success: " + imgurl + " " + keyurl)
|
||||||
p, err := json.Marshal(d)
|
c.JSON(201, string(p))
|
||||||
if err != nil {
|
return
|
||||||
errThrow(c, http.StatusInternalServerError, err.Error(), "internal error")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
fmt.Println("[imgPost]["+id+"] Success: " + imgurl + " " + keyurl)
|
|
||||||
c.JSON(200, string(p))
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func imgDel(c *gin.Context) {
|
func imgDel(c *gin.Context) {
|
||||||
|
Loading…
Reference in New Issue
Block a user