DeleteByID delete a userExample by id
(ctx context.Context, req *serverNameExampleV1.DeleteUserExampleByIDRequest)
| 73 | |
| 74 | // DeleteByID delete a userExample by id |
| 75 | func (s *userExample) DeleteByID(ctx context.Context, req *serverNameExampleV1.DeleteUserExampleByIDRequest) (*serverNameExampleV1.DeleteUserExampleByIDReply, error) { |
| 76 | err := req.Validate() |
| 77 | if err != nil { |
| 78 | logger.Warn("req.Validate error", logger.Err(err), logger.Any("req", req), interceptor.ServerCtxRequestIDField(ctx)) |
| 79 | return nil, ecode.StatusInvalidParams.Err() |
| 80 | } |
| 81 | ctx = interceptor.WrapServerCtx(ctx) |
| 82 | |
| 83 | err = s.iDao.DeleteByID(ctx, req.Id) |
| 84 | if err != nil { |
| 85 | logger.Error("DeleteByID error", logger.Err(err), logger.Any("id", req.Id), interceptor.ServerCtxRequestIDField(ctx)) |
| 86 | return nil, ecode.StatusInternalServerError.ToRPCErr() |
| 87 | } |
| 88 | |
| 89 | return &serverNameExampleV1.DeleteUserExampleByIDReply{}, nil |
| 90 | } |
| 91 | |
| 92 | // UpdateByID update a userExample by id |
| 93 | func (s *userExample) UpdateByID(ctx context.Context, req *serverNameExampleV1.UpdateUserExampleByIDRequest) (*serverNameExampleV1.UpdateUserExampleByIDReply, error) { |
nothing calls this directly
no test coverage detected