Reference to class method from map

0 votes
asked May 16, 2021 in Question / help by Andrii

I want to reference class method in map.
I'm trying to connect this map values with UserController method, but unfortunately I'm receiving error that said that: No such entity UserController:refreshToken. 

@startuml
hide private members
hide empty members
!include ../controllers/class/UserController.puml
map UserRouting {
    1 *-> UserController::refreshToken ----------------------> THIS ONE CAUSING PROBLEM                    
    2 => <font color=green><b>GET</b></font> api/v1/user
    3 => <font color=green><b>GET</b></font> api/v1/user/all
    4 => <font color=green><b>GET</b></font> api/v1/user/{uuid}
    5 => <font color=green><b>GET</b></font> api/v1/user/{uuid}/subscribers
    6 => <font color=green><b>GET</b></font> api/v1/user/{uuid}/subscribedTo
    7 => <font color=green><b>GET</b></font> api/v1/user/{uuid}/schedule
    8 => <font color=green><b>GET</b></font> api/v1/user/{uuid}/courses
    9 => <font color=green><b>GET</b></font> api/v1/user/{uuid}/groups
    10 => <font color=green><b>GET</b></font> api/v1/user/subscription/{subscriptionUuid}
    11 => <font color=blue><b>POST</b></font> api/v1/user/refresh
    12 => <font color=blue><b>POST</b></font> api/v1/user/sign_up
    13 => <font color=blue><b>POST</b></font> api/v1/user/sign_in
    14 => <font color=blue><b>POST</b></font> api/v1/user/subscription/{subscriptionUuid}/accept
    15 => <font color=blue><b>POST</b></font> api/v1/user/subscription/{subscriptionUuid}/reject
    16 => <font color=blue><b>POST</b></font> api/v1/user/upload_photo
    17 => <font color=blue><b>POST</b></font> api/v1/user/subscribe?uuid
    18 => <font color=blue><b>POST</b></font> api/v1/user/unsubscribe?uuid
    19 => <font color=blue><b>POST</b></font> api/v1/user/token?token
    20 => <font color=red><b>DELETE</b></font> api/v1/user/token
}
@enduml

But I can reference to whole UserController diagram: https://imgur.com/a/VzEWoaJ
BTW, if i'm trying to reference UserController ::refreshToken from object all working well.

1 Answer

+1 vote
answered May 16, 2021 by The-Lu (37,880 points)

Hello A.,

A proposal is:

UserRouting::1 -> UserController::refreshToken
@startuml
hide empty members

Class UserController {
    + suspend signIn(AppliCall): Unit
    + ...()
    + suspend refreshToken(AppliCall): Unit
    + ...()
    + suspend authGetAllUser(AppliCall): Unit
}

map UserRouting {
    1 => <font color=gold><b>PUT</b></font> api/v1/user
    2 => <font color=green><b>GET</b></font> api/v1/user
    3 => <font color=green><b>GET</b></font> api/v1/user/all
    4 => ...
}

UserRouting::1 -> UserController::refreshToken
@enduml

See also on the doc.:

If that can help,
Regards,
Th.

commented May 16, 2021 by Andrii
Thanks, this is actually what I'm need.
...