(c *gin.Context)
| 1173 | } |
| 1174 | |
| 1175 | func (s *Server) handleHomeGeminiModel(c *gin.Context) { |
| 1176 | entries, ok := s.loadHomeModelEntries(c) |
| 1177 | if !ok { |
| 1178 | return |
| 1179 | } |
| 1180 | |
| 1181 | action := strings.TrimPrefix(c.Param("action"), "/") |
| 1182 | action = strings.TrimSpace(action) |
| 1183 | for _, entry := range entries { |
| 1184 | if homeGeminiModelMatches(entry, action) { |
| 1185 | c.JSON(http.StatusOK, formatHomeGeminiModel(entry)) |
| 1186 | return |
| 1187 | } |
| 1188 | } |
| 1189 | |
| 1190 | c.JSON(http.StatusNotFound, handlers.ErrorResponse{ |
| 1191 | Error: handlers.ErrorDetail{ |
| 1192 | Message: "Not Found", |
| 1193 | Type: "not_found", |
| 1194 | }, |
| 1195 | }) |
| 1196 | } |
| 1197 | |
| 1198 | func (s *Server) loadHomeModelEntries(c *gin.Context) ([]homeModelEntry, bool) { |
| 1199 | if s == nil || c == nil || c.Request == nil { |
no test coverage detected