(ctx *gin.Context)
| 53 | } |
| 54 | |
| 55 | func (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 | |
| 75 | func (h *PlateHandler) DeletePlate(ctx *gin.Context) { |
| 76 | var req req.DeletePlateReq |
nothing calls this directly
no test coverage detected