ci / verify (push) Canceled after 0s
Add customer and operator login, BLE provisioning, device fleet controls, call memory, memoir generation, and refreshed family and maintenance portals. Include API contracts, migrations, firmware sources, tests, assets, and deployment documentation.
27 lines
724 B
Go
27 lines
724 B
Go
package httpapi
|
|
|
|
import (
|
|
"data-terminal-cloud/internal/saas"
|
|
"net/http"
|
|
)
|
|
|
|
func SubjectHomeOverviewHandler(service *saas.Service) http.Handler {
|
|
return http.HandlerFunc(func(writer http.ResponseWriter, request *http.Request) {
|
|
principal, ok := resourcePrincipal(writer, request, "id")
|
|
if !ok {
|
|
return
|
|
}
|
|
if request.URL.RawQuery != "" {
|
|
writeValidation(writer, request, "首页概览不接受列表筛选参数")
|
|
return
|
|
}
|
|
result, err := service.SubjectHomeOverview(request.Context(), principal, request.PathValue("id"))
|
|
if err != nil {
|
|
writeSaaSError(writer, request, err)
|
|
return
|
|
}
|
|
writer.Header().Set("Cache-Control", "no-store")
|
|
WriteJSON(writer, request, http.StatusOK, result)
|
|
})
|
|
}
|