mirror of
				https://github.com/usememos/memos.git
				synced 2025-10-31 08:46:39 +08:00 
			
		
		
		
	* feat: resource filename rename * update: resource filename rename * update: resource filename rename * update: validation about the filename Co-authored-by: boojack <stevenlgtm@gmail.com>
		
			
				
	
	
		
			57 lines
		
	
	
	
		
			1,008 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			57 lines
		
	
	
	
		
			1,008 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package api
 | |
| 
 | |
| type Resource struct {
 | |
| 	ID int `json:"id"`
 | |
| 
 | |
| 	// Standard fields
 | |
| 	CreatorID int   `json:"creatorId"`
 | |
| 	CreatedTs int64 `json:"createdTs"`
 | |
| 	UpdatedTs int64 `json:"updatedTs"`
 | |
| 
 | |
| 	// Domain specific fields
 | |
| 	Filename string `json:"filename"`
 | |
| 	Blob     []byte `json:"-"`
 | |
| 	Type     string `json:"type"`
 | |
| 	Size     int64  `json:"size"`
 | |
| 
 | |
| 	// Related fields
 | |
| 	LinkedMemoAmount int `json:"linkedMemoAmount"`
 | |
| }
 | |
| 
 | |
| type ResourceCreate struct {
 | |
| 	// Standard fields
 | |
| 	CreatorID int
 | |
| 
 | |
| 	// Domain specific fields
 | |
| 	Filename string `json:"filename"`
 | |
| 	Blob     []byte `json:"blob"`
 | |
| 	Type     string `json:"type"`
 | |
| 	Size     int64  `json:"size"`
 | |
| }
 | |
| 
 | |
| type ResourceFind struct {
 | |
| 	ID *int `json:"id"`
 | |
| 
 | |
| 	// Standard fields
 | |
| 	CreatorID *int `json:"creatorId"`
 | |
| 
 | |
| 	// Domain specific fields
 | |
| 	Filename *string `json:"filename"`
 | |
| 	MemoID   *int
 | |
| }
 | |
| 
 | |
| type ResourceDelete struct {
 | |
| 	ID int
 | |
| 
 | |
| 	// Standard fields
 | |
| 	CreatorID int
 | |
| }
 | |
| 
 | |
| type ResourcePatch struct {
 | |
| 	ID int
 | |
| 
 | |
| 	// Standard fields
 | |
| 	UpdatedTs *int64
 | |
| 
 | |
| 	Filename *string `json:"filename"`
 | |
| }
 |