forked from JointCloud/pcm-modelarts
27 lines
689 B
Go
27 lines
689 B
Go
package modelartsservicelogic
|
|
|
|
// FileRequest
|
|
type FileRequest struct {
|
|
FileName string `json:"file,omitempty"`
|
|
Content byte `json:"content,omitempty"`
|
|
Kind string `json:"kind,omitempty"`
|
|
}
|
|
|
|
type FileResponse struct {
|
|
FilePath string `json:"filePath,omitempty"`
|
|
}
|
|
|
|
// 图片上传
|
|
/*func UploadFile(in FileRequest) (FileResponse, error) {
|
|
// 在这里实现文件上传逻辑,例如将文件保存到指定位置或进行其他处理
|
|
/* log.Printf("Uploading file: %s", in.FileName)
|
|
// 将请求中的文件内容写入文件
|
|
filePath := "./uploads/" + in.FileName
|
|
err := os.WriteFile(filePath, in.Content, 0644)
|
|
if err != nil {
|
|
}
|
|
FileResponse, nil
|
|
return , nil
|
|
}
|
|
*/
|