params list
This commit is contained in:
		
							
								
								
									
										1
									
								
								main.go
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								main.go
									
									
									
									
									
								
							@@ -103,6 +103,7 @@ func main() {
 | 
				
			|||||||
	r.HandleFunc("/api/datasets/{id}", routers.DatasetsItemPatch).Methods("PATCH")
 | 
						r.HandleFunc("/api/datasets/{id}", routers.DatasetsItemPatch).Methods("PATCH")
 | 
				
			||||||
	r.HandleFunc("/api/datasets/{id}", routers.DatasetsItemDelete).Methods("DELETE")
 | 
						r.HandleFunc("/api/datasets/{id}", routers.DatasetsItemDelete).Methods("DELETE")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						r.HandleFunc("/api/params", routers.ParamsListGet).Methods("GET")
 | 
				
			||||||
	r.HandleFunc("/api/params/model", routers.ParamsModelsGet).Methods("GET")
 | 
						r.HandleFunc("/api/params/model", routers.ParamsModelsGet).Methods("GET")
 | 
				
			||||||
	r.HandleFunc("/api/account", routers.AccountGet).Methods("GET")
 | 
						r.HandleFunc("/api/account", routers.AccountGet).Methods("GET")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,10 +1,28 @@
 | 
				
			|||||||
package routers
 | 
					package routers
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
 | 
						"main/models"
 | 
				
			||||||
	"main/utils"
 | 
						"main/utils"
 | 
				
			||||||
	"net/http"
 | 
						"net/http"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func ParamsListGet(w http.ResponseWriter, r *http.Request) {
 | 
				
			||||||
 | 
						var listview models.ListView
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						var item = make(map[string]interface{})
 | 
				
			||||||
 | 
						item["id"] = "model"
 | 
				
			||||||
 | 
						item["name"] = "模型"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						listview.List = append(listview.List, item)
 | 
				
			||||||
 | 
						listview.Total = 1
 | 
				
			||||||
 | 
						listview.Page = 1
 | 
				
			||||||
 | 
						listview.PageSize = 10
 | 
				
			||||||
 | 
						listview.Next = false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						w.Header().Set("Content-Type", "application/json; charset=utf-8")
 | 
				
			||||||
 | 
						w.Write(utils.ToJSON(listview))
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func ParamsModelsGet(w http.ResponseWriter, r *http.Request) {
 | 
					func ParamsModelsGet(w http.ResponseWriter, r *http.Request) {
 | 
				
			||||||
	params := make(map[string]interface{})
 | 
						params := make(map[string]interface{})
 | 
				
			||||||
	params["type"] = []string{"lora", "ckp", "hyper", "ti"}
 | 
						params["type"] = []string{"lora", "ckp", "hyper", "ti"}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user