MCPcopy Create free account
hub / github.com/GoSimplicity/LinkMe / UpdatePlate

Method UpdatePlate

internal/api/plate.go:55–73  ·  view source on GitHub ↗
(ctx *gin.Context)

Source from the content-addressed store, hash-verified

53}
54
55func (h *PlateHandler) UpdatePlate(ctx *gin.Context) {
56 var req req.UpdatePlateReq
57 if err := ctx.ShouldBindJSON(&req); err != nil {
58 apiresponse.ErrorWithMessage(ctx, "无效的请求参数")
59 return
60 }
61
62 uc := ctx.MustGet("user").(ijwt.UserClaims)
63 if err := h.svc.UpdatePlate(ctx, domain.Plate{
64 ID: req.ID,
65 Name: req.Name,
66 Description: req.Description,
67 Uid: uc.Uid,
68 }); err != nil {
69 apiresponse.ErrorWithMessage(ctx, err.Error())
70 return
71 }
72 apiresponse.Success(ctx)
73}
74
75func (h *PlateHandler) DeletePlate(ctx *gin.Context) {
76 var req req.DeletePlateReq

Callers

nothing calls this directly

Calls 3

ErrorWithMessageFunction · 0.92
SuccessFunction · 0.92
UpdatePlateMethod · 0.65

Tested by

no test coverage detected