DeleteByID delete a userExample by id
(ctx context.Context, req *serverNameExampleV1.DeleteUserExampleByIDRequest)
| 62 | |
| 63 | // DeleteByID delete a userExample by id |
| 64 | func (h *userExamplePbHandler) DeleteByID(ctx context.Context, req *serverNameExampleV1.DeleteUserExampleByIDRequest) (*serverNameExampleV1.DeleteUserExampleByIDReply, error) { |
| 65 | err := req.Validate() |
| 66 | if err != nil { |
| 67 | logger.Warn("req.Validate error", logger.Err(err), logger.Any("req", req), middleware.CtxRequestIDField(ctx)) |
| 68 | return nil, ecode.InvalidParams.Err() |
| 69 | } |
| 70 | |
| 71 | err = h.userExampleDao.DeleteByID(ctx, req.Id) |
| 72 | if err != nil { |
| 73 | logger.Warn("DeleteByID error", logger.Err(err), middleware.CtxRequestIDField(ctx)) |
| 74 | return nil, ecode.InternalServerError.Err() |
| 75 | } |
| 76 | |
| 77 | return &serverNameExampleV1.DeleteUserExampleByIDReply{}, nil |
| 78 | } |
| 79 | |
| 80 | // UpdateByID update a userExample by id |
| 81 | func (h *userExamplePbHandler) UpdateByID(ctx context.Context, req *serverNameExampleV1.UpdateUserExampleByIDRequest) (*serverNameExampleV1.UpdateUserExampleByIDReply, error) { |
nothing calls this directly
no test coverage detected