* feat: support product yarn batches * feat: improve product yarn ratio workflow * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
27 lines
667 B
Go
27 lines
667 B
Go
// Code scaffolded by goctl. Safe to edit.
|
|
|
|
package yarn
|
|
|
|
import (
|
|
"context"
|
|
"net/http"
|
|
|
|
"github.com/zeromicro/go-zero/rest/httpx"
|
|
"github.com/zeromicro/go-zero/rest/pathvar"
|
|
"muyu-apiserver/gateway/internal/logic/inventory/yarn"
|
|
"muyu-apiserver/gateway/internal/svc"
|
|
)
|
|
|
|
func DeleteYarnHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|
return func(w http.ResponseWriter, r *http.Request) {
|
|
ctx := context.WithValue(r.Context(), "pathId", pathvar.Vars(r)["id"])
|
|
l := yarn.NewDeleteYarnLogic(ctx, svcCtx)
|
|
resp, err := l.DeleteYarn()
|
|
if err != nil {
|
|
httpx.ErrorCtx(r.Context(), w, err)
|
|
} else {
|
|
httpx.OkJsonCtx(r.Context(), w, resp)
|
|
}
|
|
}
|
|
}
|