diff --git a/src/main/kotlin/com/mnnit/moticlubs/controller/ClubController.kt b/src/main/kotlin/com/mnnit/moticlubs/controller/ClubController.kt index 0901db8..56ceb2c 100644 --- a/src/main/kotlin/com/mnnit/moticlubs/controller/ClubController.kt +++ b/src/main/kotlin/com/mnnit/moticlubs/controller/ClubController.kt @@ -10,6 +10,7 @@ import com.mnnit.moticlubs.utils.Constants import com.mnnit.moticlubs.utils.Constants.BASE_PATH import com.mnnit.moticlubs.utils.Constants.CLUBS_ROUTE import com.mnnit.moticlubs.utils.Constants.CLUB_ID_CLAIM +import com.mnnit.moticlubs.utils.Constants.URL_ROUTE import com.mnnit.moticlubs.utils.ResponseStamp import com.mnnit.moticlubs.utils.ServiceLogger import com.mnnit.moticlubs.utils.apiWrapper @@ -71,7 +72,7 @@ class ClubController( .invalidateStamp { ResponseStamp.CLUB } .wrapError() - @GetMapping("/url") + @GetMapping("/$URL_ROUTE") @Operation(summary = "Returns list of urls for the club") fun getUrls( @RequestParam clubId: Long, @@ -86,7 +87,7 @@ class ClubController( }, ) - @PostMapping("/url") + @PostMapping("/$URL_ROUTE") @Operation(summary = "Updates the list of urls for the club") fun updateUrls( @RequestBody dto: SaveUrlsDTO, diff --git a/src/main/kotlin/com/mnnit/moticlubs/controller/PostController.kt b/src/main/kotlin/com/mnnit/moticlubs/controller/PostController.kt index c3cd6f2..511429a 100644 --- a/src/main/kotlin/com/mnnit/moticlubs/controller/PostController.kt +++ b/src/main/kotlin/com/mnnit/moticlubs/controller/PostController.kt @@ -9,6 +9,7 @@ import com.mnnit.moticlubs.utils.Constants import com.mnnit.moticlubs.utils.Constants.BASE_PATH import com.mnnit.moticlubs.utils.Constants.POSTS_ROUTE import com.mnnit.moticlubs.utils.Constants.POST_ID_CLAIM +import com.mnnit.moticlubs.utils.Constants.VIEWS_ROUTE import com.mnnit.moticlubs.utils.ResponseStamp import com.mnnit.moticlubs.utils.ServiceLogger import com.mnnit.moticlubs.utils.apiWrapper @@ -104,7 +105,7 @@ class PostController( .invalidateStamp { ResponseStamp.POST } .wrapError() - @GetMapping("/views") + @GetMapping("/$VIEWS_ROUTE") @Operation(summary = "Get number of views of a post") fun getViews(@RequestParam postId: Long): Mono> = pathAuthorization .userAuthorization() @@ -114,7 +115,7 @@ class PostController( } .wrapError() - @PostMapping("/views") + @PostMapping("/$VIEWS_ROUTE") @Operation(summary = "Add views of a post") fun addView(@RequestBody view: View): Mono = pathAuthorization .userAuthorization() diff --git a/src/main/kotlin/com/mnnit/moticlubs/utils/Constants.kt b/src/main/kotlin/com/mnnit/moticlubs/utils/Constants.kt index ea1fb78..3122c8f 100644 --- a/src/main/kotlin/com/mnnit/moticlubs/utils/Constants.kt +++ b/src/main/kotlin/com/mnnit/moticlubs/utils/Constants.kt @@ -12,6 +12,7 @@ object Constants { const val POSTS_ROUTE = "posts" const val SUPER_ADMIN_ROUTE = "admin" const val CHANNEL_ROUTE = "channel" + const val URL_ROUTE = "url" const val VIEWS_ROUTE = "views" const val REPLY_ROUTE = "reply"