Skip to content

Commit

Permalink
Merge pull request #275 from effectivemade/backendApp/fix/kdoc
Browse files Browse the repository at this point in the history
[-] remove author param from kdoc
  • Loading branch information
kiselev-danil authored Jun 10, 2024
2 parents 0766e20 + c43f8c9 commit c2bd51c
Show file tree
Hide file tree
Showing 40 changed files with 2 additions and 221 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ class FcmNotificationSender(private val fcm: FirebaseMessaging): INotificationSe

/**
* Sends empty FCM message on topic
*
* @author Daniil Zavyalov
*/
override fun sendEmptyMessage(topic: String) {
logger.info("Sending an FCM message on $topic topic")
Expand All @@ -35,8 +33,6 @@ class FcmNotificationSender(private val fcm: FirebaseMessaging): INotificationSe
*
* @param action will be put as "action" in message data
* @param modifiedWorkspace will be put as "object" in message data
*
* @author Daniil Zavyalov
*/
override fun sendContentMessage(action: HttpMethod, modifiedWorkspace: WorkspaceDTO) {
logger.info("Sending an FCM message on workspace topic")
Expand All @@ -54,8 +50,6 @@ class FcmNotificationSender(private val fcm: FirebaseMessaging): INotificationSe
*
* @param action will be put as "action" in message data
* @param modifiedUser will be put as "object" in message data
*
* @author Daniil Zavyalov
*/
override fun sendContentMessage(action: HttpMethod, modifiedUser: UserDTO) {
logger.info("Sending an FCM message on user topic")
Expand All @@ -73,8 +67,6 @@ class FcmNotificationSender(private val fcm: FirebaseMessaging): INotificationSe
*
* @param action will be put as "action" in message data
* @param modifiedBooking will be put as "object" in message data
*
* @author Daniil Zavyalov
*/
override fun sendContentMessage(action: HttpMethod, modifiedBooking: BookingDTO) {
logger.info("Sending an FCM message on booking topic")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ interface INotificationSender {

/**
* Sends message about topic modification
*
* @author Daniil Zavyalov
*/
fun sendEmptyMessage(topic: String)

Expand All @@ -22,8 +20,6 @@ interface INotificationSender {
*
* @param action will be put as "action" in message data
* @param modifiedWorkspace will be put as "object" in message data
*
* @author Daniil Zavyalov
*/
fun sendContentMessage(action: HttpMethod, modifiedWorkspace: WorkspaceDTO)

Expand All @@ -32,8 +28,6 @@ interface INotificationSender {
*
* @param action will be put as "action" in message data
* @param modifiedUser will be put as "object" in message data
*
* @author Daniil Zavyalov
*/
fun sendContentMessage(action: HttpMethod, modifiedUser: UserDTO)

Expand All @@ -42,8 +36,6 @@ interface INotificationSender {
*
* @param action will be put as "action" in message data
* @param modifiedBooking will be put as "object" in message data
*
* @author Daniil Zavyalov
*/
fun sendContentMessage(action: HttpMethod, modifiedBooking: BookingDTO)
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ class AuthRepository(private val db: Database) {
* @return encrypted api key [String]
* @param keyEncrypted encrypted input [String]
* @throws InstanceNotFoundException(ApiKeyEntity::class, "No such key found")
*
* @author Kiselev Danil
* */
fun findApiKey(keyEncrypted: String): String? {
return db.apikeys.find { it.value.eq(keyEncrypted) }?.keyValue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ class ApiKeyAuthorizer(private val extractor: TokenExtractor = TokenExtractor())
* Check api key from input line. String encrypting by SHA-256 and comparing with encrypted keys from database. If it cannot find one, throw [InstanceNotFoundException]
* @param call [ApplicationCall] which contains token to verify
* @return random String
* @author Kiselev Danil
*/
override suspend fun authorize(call: ApplicationCall): Boolean {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class AuthorizationPipeline : Authorizer {
* Allow you to add authorizer to pipeline
* @param authorizer [Authorizer]
* @return [AuthorizationPipeline] - instance of pipeline
* @author Danil Kiselev
* */
fun addAuthorizer(authorizer: Authorizer): AuthorizationPipeline {
authorizers.add(authorizer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import io.ktor.server.application.*
interface Authorizer {
/**
* @param call [ApplicationCall] incoming call to authorize
* @author Kiselev Danil
* */
suspend fun authorize(call: ApplicationCall): Boolean
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import org.slf4j.LoggerFactory
/**
* Authorizer to permit routes. Permit all child routes, if parent permitted.
* Example: "/workspaces" permission allow access to "/workspaces/zones" routes.
* @author Danil Kiselev
* */
class PermitAuthorizer(private val permittedPaths: Iterable<String>) : Authorizer {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ class RequestAuthorizer(private val extractor: TokenExtractor = TokenExtractor()
*
* @param call [ApplicationCall] which contains token to verify
* @return is token correct
*
* @author Kiselev Danil
* */
override suspend fun authorize(call: ApplicationCall): Boolean {
val tokenString = extractor.extractToken(call) ?: run {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,8 @@ class TokenAuthorizer(private val extractor: TokenExtractor = TokenExtractor())
* Check Google ID Token using google library
*
* @param call [String] which contains token to verify
* @author Kiselev Danil
* @throws Exception("Token wasn't verified by Google") if token does not contain payload
* @return is token correct
*
* @author Kiselev Danil
* */
override suspend fun authorize(call: ApplicationCall): Boolean {
var userMail: String? = null
Expand Down Expand Up @@ -67,8 +64,6 @@ class TokenAuthorizer(private val extractor: TokenExtractor = TokenExtractor())
* @param email - [String] from Bearer auth header, which must contains email
* @throws Exception("Email is empty") if input line is null
* @return [String], which contains email address
*
* @author Kiselev Danil
* */
private fun extractDomain(email: String?): String {
email ?: throw Exception("Email is empty")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class TokenExtractor {
/**
* @param call [ApplicationCall] incoming call
* @return token from Bearer Auth header or null, if
* @author Danil Kiselev
* */
fun extractToken(call: ApplicationCall): String? {
val logger = LoggerFactory.getLogger(this::class.java)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class BookingDtoModelConverter(
*
* @param booking [Booking] to be converted
* @return The resulting [BookingDTO] object
* @author Daniil Zavyalov, Danil Kiselev
*/
@Deprecated(
message = "Deprecated since 1.0 api version",
Expand Down Expand Up @@ -65,7 +64,6 @@ class BookingDtoModelConverter(
* @throws [MissingIdException] if [booking] doesn't contain an id
* @param booking [Booking] to be converted
* @return The resulting [BookingResponseDTO] object
* @author Daniil Zavyalov, Danil Kiselev
*/
fun modelToResponseDto(booking: Booking): BookingResponseDTO {
logger.trace("Converting booking model to response dto")
Expand Down Expand Up @@ -96,7 +94,6 @@ class BookingDtoModelConverter(
*
* @param bookingDTO [BookingDTO] to be converted
* @return The resulting [Booking] object
* @author Daniil Zavyalov, Danil Kiselev
*/
@Deprecated(
message = "Deprecated since 1.0 api version",
Expand Down Expand Up @@ -127,7 +124,6 @@ class BookingDtoModelConverter(
* @return The resulting [Booking] object
* @throws [InstanceNotFoundException] if user with the given email or
* workspace with the given id doesn't exist in database
* @author Daniil Zavyalov, Danil Kiselev
*/
fun requestDtoToModel(bookingDto: BookingRequestDTO, id: String? = null): Booking {
logger.trace("Converting booking response dto to model")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ class BookingRepositoryConverter(private val database: Database,
* @param bookingEntity [WorkspaceBookingEntity] to be converted
* @param participants users who participate in the booking
* @return The resulting [Booking] object
* @author Daniil Zavyalov
*/
fun entityToModel(bookingEntity: WorkspaceBookingEntity,
participants: List<UserEntity>): Booking {
Expand All @@ -71,7 +70,6 @@ class BookingRepositoryConverter(private val database: Database,
* @return The resulting [WorkspaceBookingEntity] object
* @throws MissingIdException if the booking, owner or workspace id is null
* @throws InstanceNotFoundException if the given user or workspace don't exist
* @author Daniil Zavyalov
*/
fun modelToEntity(bookingModel: Booking): WorkspaceBookingEntity {
logger.trace("Converting booking model to entity")
Expand Down Expand Up @@ -101,7 +99,6 @@ class BookingRepositoryConverter(private val database: Database,
* @return the [UserEntity] for the given booking model
* @throws MissingIdException if the user id is null
* @throws InstanceNotFoundException if the given user don't exist
* @author Daniil Zavyalov
*/
private fun findOwnerEntity(ownerModel: UserModel): UserEntity {
val ownerId: UUID = ownerModel.id
Expand All @@ -118,7 +115,6 @@ class BookingRepositoryConverter(private val database: Database,
* @return the [WorkspaceEntity] for the given booking model
* @throws MissingIdException if the workspace id is null
* @throws InstanceNotFoundException if the given workspace don't exist
* @author Daniil Zavyalov
*/
private fun findWorkspaceEntity(workspaceModel: Workspace): WorkspaceEntity {
val workspaceId: UUID = workspaceModel.id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ class GoogleCalendarConverter(
*
* @param event
* @return [UserModel] with data from database or [UserModel] placeholder
* @author Danil Kiselev, Max Mishenko, Daniil Zavyalov
*/
private fun getUserModel(event: Event): UserModel {
val userId: UUID = try {
Expand Down Expand Up @@ -145,7 +144,6 @@ class GoogleCalendarConverter(
* @param workspace specify this parameter to reduce the number
* of database queries if workspace have already been retrieved
* @return The resulting [BookingDTO] object
* @author Danil Kiselev, Max Mishenko
*/
fun toMeetingWorkspaceBooking(
event: Event,
Expand Down Expand Up @@ -187,7 +185,6 @@ class GoogleCalendarConverter(
*
* @param email
* @return [UserModel] with data from database or [UserModel] placeholder with the given [email]
* @author Danil Kiselev, Max Mishenko, Daniil Zavyalov
*/
private fun getUserModel(email: String?): UserModel? {
if (email == null) {
Expand Down Expand Up @@ -241,7 +238,6 @@ class GoogleCalendarConverter(
*
* @param calendarId Google id of calendar of workspace
* @return [WorkspaceDTO]
* @author Danil Kiselev, Max Mishenko
*/
private fun getWorkspaceModel(calendarId: String?): Workspace {
if (calendarId == null) {
Expand All @@ -258,7 +254,6 @@ class GoogleCalendarConverter(
*
* @param model [Booking] to be converted
* @return The resulting [Event] object
* @author Daniil Zavyalov
*/
fun toGoogleWorkspaceRegularEvent(model: Booking): Event {
logger.debug("[toGoogleWorkspaceRegularEvent] converting regular workspace booking to calendar event")
Expand Down Expand Up @@ -294,7 +289,6 @@ class GoogleCalendarConverter(
*
* @param model [Booking] to be converted
* @return The resulting [Event] object
* @author Daniil Zavyalov
*/
fun toGoogleWorkspaceMeetingEvent(model: Booking): Event {
logger.debug("[toGoogleWorkspaceMeetingEvent] converting meeting room booking to calendar event")
Expand Down Expand Up @@ -388,7 +382,6 @@ class GoogleCalendarConverter(
* Converts [UserModel] of owner to [Organizer]
*
* @return [Organizer]
* @author Danil Kiselev
*/
private fun userModelToGoogleOrganizer(model: UserModel?): Organizer {
if (model == null) {
Expand All @@ -404,7 +397,6 @@ class GoogleCalendarConverter(
*
* @param id workspace id. Should be valid UUID
* @return calendar id by workspace id in database
* @author Danil Kiselev, Max Mishenko
*/
private fun getCalendarIdByWorkspaceId(id: String): String {
return calendarIdsRepository.findByWorkspace(verifier.uuidFromString(id))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ object RecurrenceConverter {
*
* @param model [RecurrenceModel] to be converted
* @return The resulting [RecurrenceDTO] object
* @author Max Mishenko
*/
fun modelToDto(model: RecurrenceModel): RecurrenceDTO {
return RecurrenceDTO(
Expand All @@ -39,7 +38,6 @@ object RecurrenceConverter {
*
* @param dto [RecurrenceDTO] to be converted
* @return The resulting [RecurrenceModel] object
* @author Max Mishenko
*/
fun dtoToModel(dto: RecurrenceDTO): RecurrenceModel {
if (dto.count != null && dto.until != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,9 @@ import office.effective.model.Recurrence

/**
* Object for creating Google calendar recurrence rule
*
* @author Max Mishenko
*/
object RecurrenceRuleFactory {

/**
* @author Max Mishenko
*/
fun String.getRecurrence(): Recurrence = trim('[', ']').substringAfter(":").split(";").fold(
Recurrence(
interval = 0,
Expand Down Expand Up @@ -44,9 +39,6 @@ object RecurrenceRuleFactory {
}
}

/**
* @author Max Mishenko
*/
fun Recurrence.rule() =
"RRULE:".let { it + "FREQ=${freq.name};" }.let { if (interval != 0) it + "INTERVAL=${interval};" else it }.let {
it + when (ending) {
Expand All @@ -68,9 +60,7 @@ object RecurrenceRuleFactory {
.trim(',') + ";" else it
}

/**
* @author Max Mishenko
*/

private fun Int.toName(): String = when (this) {
1 -> "MO"
2 -> "TU"
Expand All @@ -82,9 +72,7 @@ object RecurrenceRuleFactory {
else -> ""
}

/**
* @author Max Mishenko
*/

private fun String.toDayNum(): Int = when (this) {
"MO" -> 1
"TU" -> 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class BookingFacade(
* Deletes the booking with the given id
*
* @param id booking id
* @author Daniil Zavyalov
*/
fun deleteById(id: String) {
transactionManager.useTransaction({
Expand All @@ -49,7 +48,6 @@ class BookingFacade(
* @param id id of requested booking
* @return [BookingDTO] with the given id
* @throws InstanceNotFoundException if booking with the given id doesn't exist in database
* @author Daniil Zavyalov
*/
fun findById(id: String): BookingDTO {
val dto: BookingDTO = transactionManager.useTransaction({
Expand All @@ -70,7 +68,6 @@ class BookingFacade(
* @param bookingRangeFrom lower bound (exclusive) for a endBooking to filter by.
* Should be lover than [bookingRangeFrom]. Default value: [BookingConstants.MIN_SEARCH_START_TIME]
* @return [BookingDTO] list
* @author Daniil Zavyalov
*/
fun findAll(
userId: String?,
Expand Down Expand Up @@ -100,7 +97,6 @@ class BookingFacade(
*
* @param bookingDTO [BookingDTO] to be saved
* @return saved [BookingDTO]
* @author Daniil Zavyalov
*/
fun post(bookingDTO: BookingDTO): BookingDTO {
val model = bookingConverter.dtoToModel(bookingDTO)
Expand All @@ -117,7 +113,6 @@ class BookingFacade(
* @param bookingDTO changed booking
* @return [BookingDTO] after change saving
* @throws BadRequestException if booking id is null
* @author Daniil Zavyalov
*/
fun put(bookingDTO: BookingDTO): BookingDTO {
if (bookingDTO.id == null) throw BadRequestException("Missing booking id")
Expand Down
Loading

0 comments on commit c2bd51c

Please sign in to comment.