| | package org.ntlab.acanthus_server.resources.accounts; |
---|
| | |
---|
| | import org.ntlab.acanthus_server.entities.Account; |
---|
| | import org.ntlab.acanthus_server.entities.Animation; |
---|
| | import org.ntlab.acanthus_server.models.Accounts; |
---|
| | import org.springframework.stereotype.Component; |
---|
| | import javax.ws.rs.*; |
---|
| | import javax.ws.rs.core.MediaType; |
---|
| | import java.util.Collection; |
---|
| | import java.util.Collections; |
---|
| | |
---|
| | @Component |
---|
| | @Path("/accounts/invites") |
---|
| | @Path("/accounts") |
---|
| | public class InvitesRest { |
---|
| | |
---|
| | public class InvitesRest{ |
---|
| | private Accounts accounts = Accounts.getInstance(); |
---|
| | |
---|
| | /** |
---|
| | *accountごとの招待されている作品の表示 |
---|
| | *トークン認証 |
---|
| | * |
---|
| | */ |
---|
| | @GET |
---|
| | @Produces(MediaType.APPLICATION_JSON) |
---|
| | public boolean hasLoginToken(@QueryParam("uid") int uid, @QueryParam("token") String token) { |
---|
| | |
---|
| | var searchAccount = accounts.getAccountByUid(uid); |
---|
| | |
---|
| | if (searchAccount == null) throw new WebApplicationException(404); |
---|
| | if (!searchAccount.getToken().equals(token)) throw new WebApplicationException(400); |
---|
| | |
---|
| | return true; |
---|
| | } |
---|
| | } |
---|
| | |
---|
| | |
マージお願いします。
InvitesRestのメソッドの追加 トークン認証を行うメソッドを追加しました。
1a44c51
intomaster
fromAcccountInvitesRest
on 18 May 2021