(ctx *gin.Context)
| 34 | } |
| 35 | |
| 36 | func (h *PlateHandler) CreatePlate(ctx *gin.Context) { |
| 37 | var req req.CreatePlateReq |
| 38 | if err := ctx.ShouldBindJSON(&req); err != nil { |
| 39 | apiresponse.ErrorWithMessage(ctx, "无效的请求参数") |
| 40 | return |
| 41 | } |
| 42 | |
| 43 | uc := ctx.MustGet("user").(ijwt.UserClaims) |
| 44 | if err := h.svc.CreatePlate(ctx, domain.Plate{ |
| 45 | Name: req.Name, |
| 46 | Description: req.Description, |
| 47 | Uid: uc.Uid, |
| 48 | }); err != nil { |
| 49 | apiresponse.ErrorWithMessage(ctx, err.Error()) |
| 50 | return |
| 51 | } |
| 52 | apiresponse.Success(ctx) |
| 53 | } |
| 54 | |
| 55 | func (h *PlateHandler) UpdatePlate(ctx *gin.Context) { |
| 56 | var req req.UpdatePlateReq |
nothing calls this directly
no test coverage detected