Files
OpenList/server/handles/driver.go
MadDogOwner 874dc292ae fix(gomod): go modules with tagged versions (#499)
fix: go modules with tagged versions
2025-07-01 09:54:50 +08:00

29 lines
614 B
Go

package handles
import (
"fmt"
"github.com/OpenListTeam/OpenList/v4/internal/op"
"github.com/OpenListTeam/OpenList/v4/server/common"
"github.com/gin-gonic/gin"
)
func ListDriverInfo(c *gin.Context) {
common.SuccessResp(c, op.GetDriverInfoMap())
}
func ListDriverNames(c *gin.Context) {
common.SuccessResp(c, op.GetDriverNames())
}
func GetDriverInfo(c *gin.Context) {
driverName := c.Query("driver")
infoMap := op.GetDriverInfoMap()
items, ok := infoMap[driverName]
if !ok {
common.ErrorStrResp(c, fmt.Sprintf("driver [%s] not found", driverName), 404)
return
}
common.SuccessResp(c, items)
}