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

Method CreatePlate

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

Source from the content-addressed store, hash-verified

34}
35
36func (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
55func (h *PlateHandler) UpdatePlate(ctx *gin.Context) {
56 var req req.UpdatePlateReq

Callers

nothing calls this directly

Calls 3

ErrorWithMessageFunction · 0.92
SuccessFunction · 0.92
CreatePlateMethod · 0.65

Tested by

no test coverage detected