fix: add exeptions handler and add quick signup

This commit is contained in:
TakahashiNg
2026-04-19 08:13:58 +00:00
parent b7f3a0e7d0
commit 059a265e16
3 changed files with 22 additions and 3 deletions
@@ -0,0 +1,16 @@
package com.drinkool.mapper;
import jakarta.ws.rs.core.Response;
import jakarta.ws.rs.BadRequestException;
import org.jboss.resteasy.reactive.server.ServerExceptionMapper;
public class ExceptionHandlersMapper {
@ServerExceptionMapper
public Response mapBadRequestException(BadRequestException x) {
return Response.status(Response.Status.BAD_REQUEST)
.entity(x.getMessage())
.type("text/plain")
.build();
}
}
@@ -42,9 +42,6 @@ public class CustomerService extends BaseService<CustomerEntity> {
newCustomer.signup(input.phone);
return Response.status(Response.Status.CREATED)
.header(InternalValue.userId, newCustomer.id.toString())
.header(InternalValue.role, Role.Customer)
.entity(newCustomer)
.build();
}
@@ -29,6 +29,12 @@ public class CustomerController extends BaseController {
return accountService.login(input);
}
@POST
@Path(Url.QuickSignup)
public Uni<Response> proxyQuickSignup(QuickSignup input) {
return accountService.quickSignup(input);
}
@GET
public Uni<Response> me(@HeaderParam(InternalValue.userId) UUID id) {
return accountService.me(id);