package road

import (
	"context"

	"kami/api/commonApi"
	"kami/api/road/v1"
	"kami/internal/service"
)

func (c *ControllerV1) SimpleAllGetRoad(ctx context.Context, req *v1.SimpleAllGetRoadReq) (res *v1.SimpleAllGetRoadRes, err error) {
	s := service.Road()
	list, err := s.GetSimpleAll(ctx)

	resList := make([]v1.RoadSimpleInfo, 0)
	for _, v := range list {
		resList = append(resList, v.RoadSimpleInfo)
	}

	res = &v1.SimpleAllGetRoadRes{
		CommonDataRes: commonApi.CommonDataRes[v1.RoadSimpleInfo]{
			List: resList,
		},
	}
	return
}
