Skip to content

Commit

Permalink
feat: multi costume upload, and first image display in list (goplus#105)
Browse files Browse the repository at this point in the history
* feat: multi costume upload UI

* feat: display first costume image in sprite list.

* feat: multiple costume post to backend to generate gif.

* fix: empty uploadSpriteName after submit

* feat: when user's mouse on the sprite in library, show its gif
  • Loading branch information
yuding-x authored Feb 22, 2024
1 parent 8b0e71f commit d4dfa14
Show file tree
Hide file tree
Showing 5 changed files with 401 additions and 279 deletions.
26 changes: 25 additions & 1 deletion spx-gui/src/api/asset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: Yao xinyue
* @Date: 2024-01-22 11:17:08
* @LastEditors: xuning [email protected]
* @LastEditTime: 2024-02-21 13:11:54
* @LastEditTime: 2024-02-21 21:01:22
* @FilePath: /builder/spx-gui/src/api/asset.ts
* @Description:
*/
Expand Down Expand Up @@ -151,3 +151,27 @@ export function addAssetClickCount(
method: 'get'
})
}

/**
* @description: Post multi costumes to generate sprite gif.
* @param {string} files
* @param {number} assetType
* @return { SearchAssetResponse }
*/
export function generateGifByCostumes(name:string, files: File[]): Promise<string> {
const url = `/spirits/upload`
const formData = new FormData()
formData.append('name',name)
files.forEach((file) => {
formData.append('files', file);
});

return service({
url: url,
method: 'post',
data: formData,
headers: {
'Content-Type': 'multipart/form-data'
}
})
}
Loading

0 comments on commit d4dfa14

Please sign in to comment.