content
stringlengths 0
3.9M
| path
stringlengths 4
242
| contentHash
stringlengths 1
10
|
---|---|---|
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)
package com.cmoney.fanciapi.fanci.model
import com.squareup.moshi.Json
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
/**
* 包含投票數據的投票選項資料
*
* @param optionId 選項ID
* @param voteCount 得票數
* @param text 選項描述
*/
@Parcelize
data class IVotingOptionStatistics (
/* 選項ID */
@Json(name = "optionId")
val optionId: kotlin.Int? = null,
/* 得票數 */
@Json(name = "voteCount")
val voteCount: kotlin.Int? = null,
/* 選項描述 */
@Json(name = "text")
val text: kotlin.String? = null
) : Parcelable
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/model/IVotingOptionStatistics.kt | 3186787688 |
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)
package com.cmoney.fanciapi.fanci.model
import com.squareup.moshi.Json
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
/**
*
*
* @param userId
* @param emoji
*/
@Parcelize
data class IUserMessageReaction (
@Json(name = "userId")
val userId: kotlin.String? = null,
@Json(name = "emoji")
val emoji: kotlin.String? = null
) : Parcelable
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/model/IUserMessageReaction.kt | 1754990756 |
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)
package com.cmoney.fanciapi.fanci.model
import com.cmoney.fanciapi.fanci.model.GroupMember
import com.squareup.moshi.Json
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
/**
* 分頁
*
* @param haveNextPage 是否有下一頁
* @param nextWeight 下一個詢問權重
* @param items 結果清單
*/
@Parcelize
data class GroupMemberPaging (
/* 是否有下一頁 */
@Json(name = "haveNextPage")
val haveNextPage: kotlin.Boolean? = null,
/* 下一個詢問權重 */
@Json(name = "nextWeight")
val nextWeight: kotlin.Long? = null,
/* 結果清單 */
@Json(name = "items")
val items: kotlin.collections.List<GroupMember>? = null
) : Parcelable
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/model/GroupMemberPaging.kt | 153926564 |
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)
package com.cmoney.fanciapi.fanci.model
import com.cmoney.fanciapi.fanci.model.Group
import com.squareup.moshi.Json
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
/**
* 分頁
*
* @param haveNextPage 是否有下一頁
* @param nextWeight 下一個詢問權重
* @param items 結果清單
*/
@Parcelize
data class GroupPaging (
/* 是否有下一頁 */
@Json(name = "haveNextPage")
val haveNextPage: kotlin.Boolean? = null,
/* 下一個詢問權重 */
@Json(name = "nextWeight")
val nextWeight: kotlin.Long? = null,
/* 結果清單 */
@Json(name = "items")
val items: kotlin.collections.List<Group>? = null
) : Parcelable
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/model/GroupPaging.kt | 1786083231 |
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)
package com.cmoney.fanciapi.fanci.model
import com.squareup.moshi.Json
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
/**
* 語音訊息物件
*
* @param fileName
* @param fileSize
* @param duration
*/
@Parcelize
data class VoiceMessageContent (
@Json(name = "fileName")
val fileName: kotlin.String? = null,
@Json(name = "fileSize")
val fileSize: kotlin.Long? = null,
@Json(name = "duration")
val duration: kotlin.Long? = null
) : Parcelable
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/model/VoiceMessageContent.kt | 10044084 |
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)
package com.cmoney.fanciapi.fanci.model
import com.cmoney.fanciapi.fanci.model.Emojis
import com.squareup.moshi.Json
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
/**
*
*
* @param emoji
*/
@Parcelize
data class EmojiParam (
@Json(name = "emoji")
val emoji: Emojis? = null
) : Parcelable
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/model/EmojiParam.kt | 448240783 |
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)
package com.cmoney.fanciapi.fanci.model
import com.squareup.moshi.Json
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
/**
* 回復訊息包含的投票活動
*
* @param id 投票活動Id
* @param title 標題
*/
@Parcelize
data class IReplyVoting (
/* 投票活動Id */
@Json(name = "id")
val id: kotlin.String? = null,
/* 標題 */
@Json(name = "title")
val title: kotlin.String? = null
) : Parcelable
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/model/IReplyVoting.kt | 743411408 |
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)
package com.cmoney.fanciapi.fanci.model
import com.squareup.moshi.Json
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
/**
*
*
* @param categoryId
* @param channelIds
*/
@Parcelize
data class CategoryOrder (
@Json(name = "categoryId")
val categoryId: kotlin.String? = null,
@Json(name = "channelIds")
val channelIds: kotlin.collections.List<kotlin.String>? = null
) : Parcelable
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/model/CategoryOrder.kt | 2223294979 |
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)
package com.cmoney.fanciapi.fanci.model
import com.cmoney.fanciapi.fanci.model.VotingOption
import com.squareup.moshi.Json
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
/**
* 創建投票參數
*
* @param title 標題
* @param votingOptions 選項
* @param isMultipleChoice 是否能多選
* @param isAnonymous 是否匿名投票 (不記名投票)
*/
@Parcelize
data class VotingParam (
/* 標題 */
@Json(name = "title")
val title: kotlin.String? = null,
/* 選項 */
@Json(name = "votingOptions")
val votingOptions: kotlin.collections.List<VotingOption>? = null,
/* 是否能多選 */
@Json(name = "isMultipleChoice")
val isMultipleChoice: kotlin.Boolean? = null,
/* 是否匿名投票 (不記名投票) */
@Json(name = "isAnonymous")
val isAnonymous: kotlin.Boolean? = null
) : Parcelable
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/model/VotingParam.kt | 3305696888 |
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)
package com.cmoney.fanciapi.fanci.model
import com.cmoney.fanciapi.fanci.model.AuthorizationEntry
import com.squareup.moshi.Json
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
/**
*
*
* @param vipSaleId
* @param vipSaleName
* @param vipRoles
*/
@Parcelize
data class VipSale (
@Json(name = "vipSaleId")
val vipSaleId: kotlin.Long? = null,
@Json(name = "vipSaleName")
val vipSaleName: kotlin.String? = null,
@Json(name = "vipRoles")
val vipRoles: kotlin.collections.List<AuthorizationEntry>? = null
) : Parcelable
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/model/VipSale.kt | 2234074805 |
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)
package com.cmoney.fanciapi.fanci.model
import com.cmoney.fanciapi.fanci.model.ChatMessage
import com.squareup.moshi.Json
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
/**
* 分頁
*
* @param haveNextPage 是否有下一頁
* @param nextWeight 下一個詢問權重
* @param items 結果清單
*/
@Parcelize
data class ChatMessagePaging (
/* 是否有下一頁 */
@Json(name = "haveNextPage")
val haveNextPage: kotlin.Boolean? = null,
/* 下一個詢問權重 */
@Json(name = "nextWeight")
val nextWeight: kotlin.Long? = null,
/* 結果清單 */
@Json(name = "items")
val items: kotlin.collections.List<ChatMessage>? = null
) : Parcelable
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/model/ChatMessagePaging.kt | 1662400800 |
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)
package com.cmoney.fanciapi.fanci.model
import com.squareup.moshi.Json
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
/**
* 更新 社團 公開或非公開
*
* @param isNeedApproval true: 非公開(需審核) false: 公開(不用審核)
*/
@Parcelize
data class UpdateIsNeedApprovalParam (
/* true: 非公開(需審核) false: 公開(不用審核) */
@Json(name = "isNeedApproval")
val isNeedApproval: kotlin.Boolean? = null
) : Parcelable
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/model/UpdateIsNeedApprovalParam.kt | 3285369353 |
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)
package com.cmoney.fanciapi.fanci.model
import com.cmoney.fanciapi.fanci.model.AudioContent
import com.cmoney.fanciapi.fanci.model.ImageContent
import com.cmoney.fanciapi.fanci.model.PdfContent
import com.cmoney.fanciapi.fanci.model.TxtContent
import com.cmoney.fanciapi.fanci.model.VideoContent
import com.cmoney.fanciapi.fanci.model.VoiceMessageContent
import com.squareup.moshi.Json
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
/**
* 媒體
*
* @param resourceLink 連結
* @param type 媒體類型 (原本是Enum 但因為新增前端就要做強更 所以改成string彈性較高)<br></br> 圖片 (Image), 影片 (Video), 音檔 (Audio), 文檔 (Txt), PDF檔 (Pdf), VoiceMessage(語音訊息)
* @param isNeedAuthenticate 媒體是否需要內部驗證
* @param image
* @param audio
* @param video
* @param txt
* @param pdf
* @param voiceMessage
*/
@Parcelize
data class Media (
/* 連結 */
@Json(name = "resourceLink")
val resourceLink: kotlin.String? = null,
/* 媒體類型 (原本是Enum 但因為新增前端就要做強更 所以改成string彈性較高)<br></br> 圖片 (Image), 影片 (Video), 音檔 (Audio), 文檔 (Txt), PDF檔 (Pdf), VoiceMessage(語音訊息) */
@Json(name = "type")
val type: kotlin.String? = null,
/* 媒體是否需要內部驗證 */
@Json(name = "isNeedAuthenticate")
val isNeedAuthenticate: kotlin.Boolean? = null,
@Json(name = "image")
val image: ImageContent? = null,
@Json(name = "audio")
val audio: AudioContent? = null,
@Json(name = "video")
val video: VideoContent? = null,
@Json(name = "txt")
val txt: TxtContent? = null,
@Json(name = "pdf")
val pdf: PdfContent? = null,
@Json(name = "voiceMessage")
val voiceMessage: VoiceMessageContent? = null
) : Parcelable
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/model/Media.kt | 3812231125 |
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)
package com.cmoney.fanciapi.fanci.model
import com.squareup.moshi.Json
/**
*
*
* Values: blocking,blocker
*/
enum class Relation(val value: kotlin.String) {
@Json(name = "Blocking")
blocking("Blocking"),
@Json(name = "Blocker")
blocker("Blocker");
/**
* Override toString() to avoid using the enum variable name as the value, and instead use
* the actual value defined in the API spec file.
*
* This solves a problem when the variable name and its value are different, and ensures that
* the client sends the correct enum values to the server always.
*/
override fun toString(): String = value
companion object {
/**
* Converts the provided [data] to a [String] on success, null otherwise.
*/
fun encode(data: kotlin.Any?): kotlin.String? = if (data is Relation) "$data" else null
/**
* Returns a valid [Relation] for [data], null otherwise.
*/
fun decode(data: kotlin.Any?): Relation? = data?.let {
val normalizedData = "$it".lowercase()
values().firstOrNull { value ->
it == value || normalizedData == "$value".lowercase()
}
}
}
}
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/model/Relation.kt | 2025166408 |
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)
package com.cmoney.fanciapi.fanci.model
import com.squareup.moshi.Json
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
/**
* 使用者個人化關聯資訊 (若未帶使用者資訊則為null)
*
* @param unreadCount 使用者當前未讀數
*/
@Parcelize
data class IUserContext (
/* 使用者當前未讀數 */
@Json(name = "unreadCount")
val unreadCount: kotlin.Long? = null
) : Parcelable
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/model/IUserContext.kt | 3057720487 |
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)
package com.cmoney.fanciapi.fanci.model
import com.squareup.moshi.Json
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
/**
* 使用者
*
* @param id 使用者id
* @param cmoneyMemberId CMoney 會員編號
* @param name 使用者名稱
* @param thumbNail 使用者頭像
* @param serialNumber 使用者序列號
* @param createUnixTime 使用者創建時間
* @param updateUnixTime 使用者更新時間
*/
@Parcelize
data class User (
/* 使用者id */
@Json(name = "id")
val id: kotlin.String? = null,
/* CMoney 會員編號 */
@Json(name = "cmoneyMemberId")
val cmoneyMemberId: kotlin.Int? = null,
/* 使用者名稱 */
@Json(name = "name")
val name: kotlin.String? = null,
/* 使用者頭像 */
@Json(name = "thumbNail")
val thumbNail: kotlin.String? = null,
/* 使用者序列號 */
@Json(name = "serialNumber")
val serialNumber: kotlin.Long? = null,
/* 使用者創建時間 */
@Json(name = "createUnixTime")
val createUnixTime: kotlin.Long? = null,
/* 使用者更新時間 */
@Json(name = "updateUnixTime")
val updateUnixTime: kotlin.Long? = null
) : Parcelable
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/model/User.kt | 1318303264 |
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)
package com.cmoney.fanciapi.fanci.model
import com.squareup.moshi.Json
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
/**
* 時間區段
*
* @param start 開始時間
* @param end 結束時間
*/
@Parcelize
data class IntervalDateRangeParam (
/* 開始時間 */
@Json(name = "start")
val start: java.time.OffsetDateTime? = null,
/* 結束時間 */
@Json(name = "end")
val end: java.time.OffsetDateTime? = null
) : Parcelable
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/model/IntervalDateRangeParam.kt | 3271705322 |
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)
package com.cmoney.fanciapi.fanci.model
import com.cmoney.fanciapi.fanci.model.Channel
import com.cmoney.fanciapi.fanci.model.ChannelTabType
import com.cmoney.fanciapi.fanci.model.GroupMember
import com.cmoney.fanciapi.fanci.model.IMedia
import com.cmoney.fanciapi.fanci.model.ReportProcessStatus
import com.cmoney.fanciapi.fanci.model.ReportReason
import com.squareup.moshi.Json
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
/**
*
*
* @param id
* @param reportee
* @param tabType
* @param channel
* @param contentId
* @param contentSnapshot
* @param mediasSnapshot
* @param votingIds
* @param processStatus
* @param mostReason
* @param reporters
* @param createUnixTime
* @param updateUnixTime
*/
@Parcelize
data class ReportInformation (
@Json(name = "id")
val id: kotlin.String? = null,
@Json(name = "reportee")
val reportee: GroupMember? = null,
@Json(name = "tabType")
val tabType: ChannelTabType? = null,
@Json(name = "channel")
val channel: Channel? = null,
@Json(name = "contentId")
val contentId: kotlin.String? = null,
@Json(name = "contentSnapshot")
val contentSnapshot: kotlin.String? = null,
@Json(name = "mediasSnapshot")
val mediasSnapshot: kotlin.collections.List<IMedia>? = null,
@Json(name = "votingIds")
val votingIds: kotlin.collections.List<kotlin.String>? = null,
@Json(name = "processStatus")
val processStatus: ReportProcessStatus? = null,
@Json(name = "mostReason")
val mostReason: ReportReason? = null,
@Json(name = "reporters")
val reporters: kotlin.collections.List<GroupMember>? = null,
@Json(name = "createUnixTime")
val createUnixTime: kotlin.Long? = null,
@Json(name = "updateUnixTime")
val updateUnixTime: kotlin.Long? = null
) : Parcelable
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/model/ReportInformation.kt | 2338373166 |
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)
package com.cmoney.fanciapi.fanci.model
import com.cmoney.fanciapi.fanci.model.IGroupRequirementQuestion
import com.squareup.moshi.Json
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
/**
* 加入社團的要求項目
*
* @param createUnixTime 創建時間
* @param updateUnixTime 更新時間
* @param questions 題目
*/
@Parcelize
data class GroupRequirement (
/* 創建時間 */
@Json(name = "createUnixTime")
val createUnixTime: kotlin.Long? = null,
/* 更新時間 */
@Json(name = "updateUnixTime")
val updateUnixTime: kotlin.Long? = null,
/* 題目 */
@Json(name = "questions")
val questions: kotlin.collections.List<IGroupRequirementQuestion>? = null
) : Parcelable
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/model/GroupRequirement.kt | 442081575 |
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)
package com.cmoney.fanciapi.fanci.model
import com.squareup.moshi.Json
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
/**
*
*
* @param defaultImages
*/
@Parcelize
data class DefaultImageResource (
@Json(name = "defaultImages")
val defaultImages: kotlin.collections.Map<kotlin.String, kotlin.collections.List<kotlin.String>>? = null
) : Parcelable
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/model/DefaultImageResource.kt | 878676854 |
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)
package com.cmoney.fanciapi.fanci.model
import com.cmoney.fanciapi.fanci.model.ChannelPrivacy
import com.squareup.moshi.Json
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
/**
* 編輯頻道參數
*
* @param name 頻道名稱
* @param privacy
*/
@Parcelize
data class EditChannelParam (
/* 頻道名稱 */
@Json(name = "name")
val name: kotlin.String? = null,
@Json(name = "privacy")
val privacy: ChannelPrivacy? = null
) : Parcelable
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/model/EditChannelParam.kt | 2635226410 |
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)
package com.cmoney.fanciapi.fanci.model
import com.cmoney.fanciapi.fanci.model.ApplyStatus
import com.cmoney.fanciapi.fanci.model.IGroupRequirementAnswer
import com.cmoney.fanciapi.fanci.model.User
import com.squareup.moshi.Json
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
/**
* 社團申請
*
* @param id Id
* @param groupId
* @param user
* @param hasVipRole 是否為社團VIP
* @param answers 回答
* @param status
* @param updateUnixTime 更新時間
* @param weight
* @param wasKicked
*/
@Parcelize
data class GroupRequirementApply (
/* Id */
@Json(name = "id")
val id: kotlin.String? = null,
@Json(name = "groupId")
val groupId: kotlin.String? = null,
@Json(name = "user")
val user: User? = null,
/* 是否為社團VIP */
@Json(name = "hasVipRole")
val hasVipRole: kotlin.Boolean? = null,
/* 回答 */
@Json(name = "answers")
val answers: kotlin.collections.List<IGroupRequirementAnswer>? = null,
@Json(name = "status")
val status: ApplyStatus? = null,
/* 更新時間 */
@Json(name = "updateUnixTime")
val updateUnixTime: kotlin.Long? = null,
@Json(name = "weight")
val weight: kotlin.Long? = null,
@Json(name = "wasKicked")
val wasKicked: kotlin.Boolean? = null
) : Parcelable
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/model/GroupRequirementApply.kt | 240126632 |
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)
package com.cmoney.fanciapi.fanci.model
import com.cmoney.fanciapi.fanci.model.PurchasedRole
import com.squareup.moshi.Json
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
/**
*
*
* @param vipSaleId
* @param vipSaleName
* @param purchasedRoles
*/
@Parcelize
data class PurchasedSale (
@Json(name = "vipSaleId")
val vipSaleId: kotlin.Long? = null,
@Json(name = "vipSaleName")
val vipSaleName: kotlin.String? = null,
@Json(name = "purchasedRoles")
val purchasedRoles: kotlin.collections.List<PurchasedRole>? = null
) : Parcelable
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/model/PurchasedSale.kt | 2036815869 |
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)
package com.cmoney.fanciapi.fanci.model
import com.squareup.moshi.Json
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
/**
*
*
* @param answer
* @param question
*/
@Parcelize
data class IGroupRequirementAnswer (
@Json(name = "answer")
val answer: kotlin.String? = null,
@Json(name = "question")
val question: kotlin.String? = null
) : Parcelable
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/model/IGroupRequirementAnswer.kt | 4259018644 |
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)
package com.cmoney.fanciapi.fanci.model
import com.squareup.moshi.Json
/**
*
*
* Values: `public`,`private`
*/
enum class ChannelPrivacy(val value: kotlin.String) {
@Json(name = "Public")
`public`("Public"),
@Json(name = "Private")
`private`("Private");
/**
* Override toString() to avoid using the enum variable name as the value, and instead use
* the actual value defined in the API spec file.
*
* This solves a problem when the variable name and its value are different, and ensures that
* the client sends the correct enum values to the server always.
*/
override fun toString(): String = value
companion object {
/**
* Converts the provided [data] to a [String] on success, null otherwise.
*/
fun encode(data: kotlin.Any?): kotlin.String? = if (data is ChannelPrivacy) "$data" else null
/**
* Returns a valid [ChannelPrivacy] for [data], null otherwise.
*/
fun decode(data: kotlin.Any?): ChannelPrivacy? = data?.let {
val normalizedData = "$it".lowercase()
values().firstOrNull { value ->
it == value || normalizedData == "$value".lowercase()
}
}
}
}
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/model/ChannelPrivacy.kt | 1921392152 |
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)
package com.cmoney.fanciapi.fanci.model
import com.cmoney.fanciapi.fanci.model.ColorTheme
import com.squareup.moshi.Json
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
/**
* 編輯社團參數
*
* @param name 社團命名
* @param description 社團簡介
* @param coverImageUrl 社團封面
* @param thumbnailImageUrl 社團縮圖
* @param logoImageUrl 社團logo
* @param colorSchemeGroupKey
*/
@Parcelize
data class EditGroupParam (
/* 社團命名 */
@Json(name = "name")
val name: kotlin.String? = null,
/* 社團簡介 */
@Json(name = "description")
val description: kotlin.String? = null,
/* 社團封面 */
@Json(name = "coverImageUrl")
val coverImageUrl: kotlin.String? = null,
/* 社團縮圖 */
@Json(name = "thumbnailImageUrl")
val thumbnailImageUrl: kotlin.String? = null,
/* 社團logo */
@Json(name = "logoImageUrl")
val logoImageUrl: kotlin.String? = null,
@Json(name = "colorSchemeGroupKey")
val colorSchemeGroupKey: ColorTheme? = null
) : Parcelable
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/model/EditGroupParam.kt | 2151492373 |
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)
package com.cmoney.fanciapi.fanci.model
import com.squareup.moshi.Json
/**
* Emoji列舉
*
* Values: like,dislike,laugh,money,shock,cry,think,angry
*/
enum class Emojis(val value: kotlin.String) {
@Json(name = "Like")
like("Like"),
@Json(name = "Dislike")
dislike("Dislike"),
@Json(name = "Laugh")
laugh("Laugh"),
@Json(name = "Money")
money("Money"),
@Json(name = "Shock")
shock("Shock"),
@Json(name = "Cry")
cry("Cry"),
@Json(name = "Think")
think("Think"),
@Json(name = "Angry")
angry("Angry");
/**
* Override toString() to avoid using the enum variable name as the value, and instead use
* the actual value defined in the API spec file.
*
* This solves a problem when the variable name and its value are different, and ensures that
* the client sends the correct enum values to the server always.
*/
override fun toString(): String = value
companion object {
/**
* Converts the provided [data] to a [String] on success, null otherwise.
*/
fun encode(data: kotlin.Any?): kotlin.String? = if (data is Emojis) "$data" else null
/**
* Returns a valid [Emojis] for [data], null otherwise.
*/
fun decode(data: kotlin.Any?): Emojis? = data?.let {
val normalizedData = "$it".lowercase()
values().firstOrNull { value ->
it == value || normalizedData == "$value".lowercase()
}
}
}
}
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/model/Emojis.kt | 2424092442 |
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)
package com.cmoney.fanciapi.fanci.model
import com.cmoney.fanciapi.fanci.model.ChannelTabType
import com.cmoney.fanciapi.fanci.model.ReportReason
import com.squareup.moshi.Json
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
/**
*
*
* @param tabType
* @param contentId
* @param reason
*/
@Parcelize
data class ReportParm (
@Json(name = "tabType")
val tabType: ChannelTabType? = null,
@Json(name = "contentId")
val contentId: kotlin.String? = null,
@Json(name = "reason")
val reason: ReportReason? = null
) : Parcelable
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/model/ReportParm.kt | 475564758 |
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)
package com.cmoney.fanciapi.fanci.model
import com.squareup.moshi.Json
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
/**
*
*
* @param selectedOptions
*/
@Parcelize
data class IUserVoteInfo (
@Json(name = "selectedOptions")
val selectedOptions: kotlin.collections.List<kotlin.String>? = null
) : Parcelable
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/model/IUserVoteInfo.kt | 3155469177 |
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)
package com.cmoney.fanciapi.fanci.model
import com.cmoney.fanciapi.fanci.model.GroupRequirementQuestionType
import com.squareup.moshi.Json
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
/**
*
*
* @param question
* @param type
*/
@Parcelize
data class IGroupRequirementQuestion (
@Json(name = "question")
val question: kotlin.String? = null,
@Json(name = "type")
val type: GroupRequirementQuestionType? = null
) : Parcelable
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/model/IGroupRequirementQuestion.kt | 960691394 |
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)
package com.cmoney.fanciapi.fanci.model
import com.cmoney.fanciapi.fanci.model.BanPeriodOption
import com.cmoney.fanciapi.fanci.model.GroupMember
import com.squareup.moshi.Json
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
/**
*
*
* @param user
* @param startDateTime
* @param endDateTime
* @param panaltySeconds
* @param periodOption
*/
@Parcelize
data class UserBanInformation (
@Json(name = "user")
val user: GroupMember? = null,
@Json(name = "startDateTime")
val startDateTime: kotlin.Long? = null,
@Json(name = "endDateTime")
val endDateTime: kotlin.Long? = null,
@Json(name = "panaltySeconds")
val panaltySeconds: kotlin.Long? = null,
@Json(name = "periodOption")
val periodOption: BanPeriodOption? = null
) : Parcelable
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/model/UserBanInformation.kt | 1344326127 |
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)
package com.cmoney.fanciapi.fanci.model
import com.cmoney.fanciapi.fanci.model.GroupRequirementQuestionType
import com.squareup.moshi.Json
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
/**
*
*
* @param question 題目
* @param type
*/
@Parcelize
data class GroupRequirementQuestion (
/* 題目 */
@Json(name = "question")
val question: kotlin.String? = null,
@Json(name = "type")
val type: GroupRequirementQuestionType? = null
) : Parcelable
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/model/GroupRequirementQuestion.kt | 1431218607 |
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)
package com.cmoney.fanciapi.fanci.model
import com.cmoney.fanciapi.fanci.model.Media
import com.squareup.moshi.Json
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
/**
* 聊天訊息內容
*
* @param text 訊息
* @param medias 媒體
*/
@Parcelize
data class MediaIChatContent (
/* 訊息 */
@Json(name = "text")
val text: kotlin.String? = null,
/* 媒體 */
@Json(name = "medias")
val medias: kotlin.collections.List<Media>? = null
) : Parcelable
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/model/MediaIChatContent.kt | 3208960648 |
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)
package com.cmoney.fanciapi.fanci.model
import com.squareup.moshi.Json
/**
* 排序類別
*
* Values: latest,oldest,popular
*/
enum class OrderType(val value: kotlin.String) {
@Json(name = "Latest")
latest("Latest"),
@Json(name = "Oldest")
oldest("Oldest"),
@Json(name = "Popular")
popular("Popular");
/**
* Override toString() to avoid using the enum variable name as the value, and instead use
* the actual value defined in the API spec file.
*
* This solves a problem when the variable name and its value are different, and ensures that
* the client sends the correct enum values to the server always.
*/
override fun toString(): String = value
companion object {
/**
* Converts the provided [data] to a [String] on success, null otherwise.
*/
fun encode(data: kotlin.Any?): kotlin.String? = if (data is OrderType) "$data" else null
/**
* Returns a valid [OrderType] for [data], null otherwise.
*/
fun decode(data: kotlin.Any?): OrderType? = data?.let {
val normalizedData = "$it".lowercase()
values().firstOrNull { value ->
it == value || normalizedData == "$value".lowercase()
}
}
}
}
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/model/OrderType.kt | 3258532209 |
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)
package com.cmoney.fanciapi.fanci.model
import com.squareup.moshi.Json
/**
* 加入社團的題目種類
*
* Values: written
*/
enum class GroupRequirementQuestionType(val value: kotlin.String) {
@Json(name = "Written")
written("Written");
/**
* Override toString() to avoid using the enum variable name as the value, and instead use
* the actual value defined in the API spec file.
*
* This solves a problem when the variable name and its value are different, and ensures that
* the client sends the correct enum values to the server always.
*/
override fun toString(): String = value
companion object {
/**
* Converts the provided [data] to a [String] on success, null otherwise.
*/
fun encode(data: kotlin.Any?): kotlin.String? = if (data is GroupRequirementQuestionType) "$data" else null
/**
* Returns a valid [GroupRequirementQuestionType] for [data], null otherwise.
*/
fun decode(data: kotlin.Any?): GroupRequirementQuestionType? = data?.let {
val normalizedData = "$it".lowercase()
values().firstOrNull { value ->
it == value || normalizedData == "$value".lowercase()
}
}
}
}
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/model/GroupRequirementQuestionType.kt | 2779890022 |
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)
package com.cmoney.fanciapi.fanci.model
import com.squareup.moshi.Json
/**
*
*
* Values: chatroom,bulletinboard
*/
enum class MessageServiceType(val value: kotlin.String) {
@Json(name = "Chatroom")
chatroom("Chatroom"),
@Json(name = "Bulletinboard")
bulletinboard("Bulletinboard");
/**
* Override toString() to avoid using the enum variable name as the value, and instead use
* the actual value defined in the API spec file.
*
* This solves a problem when the variable name and its value are different, and ensures that
* the client sends the correct enum values to the server always.
*/
override fun toString(): String = value
companion object {
/**
* Converts the provided [data] to a [String] on success, null otherwise.
*/
fun encode(data: kotlin.Any?): kotlin.String? = if (data is MessageServiceType) "$data" else null
/**
* Returns a valid [MessageServiceType] for [data], null otherwise.
*/
fun decode(data: kotlin.Any?): MessageServiceType? = data?.let {
val normalizedData = "$it".lowercase()
values().firstOrNull { value ->
it == value || normalizedData == "$value".lowercase()
}
}
}
}
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/model/MessageServiceType.kt | 709283034 |
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)
package com.cmoney.fanciapi.fanci.model
import com.cmoney.fanciapi.fanci.model.Category
import com.cmoney.fanciapi.fanci.model.ChannelPrivacy
import com.cmoney.fanciapi.fanci.model.ChannelTabType
import com.cmoney.fanciapi.fanci.model.IChannelTab
import com.squareup.moshi.Json
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
/**
* 頻道
*
* @param id 頻道Id
* @param creatorId 頻道創立者
* @param name 頻道命名
* @param createUnixTime 頻道建立時間
* @param updateUnixTime 頻道更新時間
* @param weight 排序權重
* @param groupId 頻道所屬社團Id
* @param category
* @param privacy
* @param tabs 頻道有啟用的聊天室版面
* @param channelType
*/
@Parcelize
data class Channel (
/* 頻道Id */
@Json(name = "id")
val id: kotlin.String? = null,
/* 頻道創立者 */
@Json(name = "creatorId")
val creatorId: kotlin.String? = null,
/* 頻道命名 */
@Json(name = "name")
val name: kotlin.String? = null,
/* 頻道建立時間 */
@Json(name = "createUnixTime")
val createUnixTime: kotlin.Long? = null,
/* 頻道更新時間 */
@Json(name = "updateUnixTime")
val updateUnixTime: kotlin.Long? = null,
/* 排序權重 */
@Json(name = "weight")
val weight: kotlin.Long? = null,
/* 頻道所屬社團Id */
@Json(name = "groupId")
val groupId: kotlin.String? = null,
@Json(name = "category")
val category: Category? = null,
@Json(name = "privacy")
val privacy: ChannelPrivacy? = null,
/* 頻道有啟用的聊天室版面 */
@Json(name = "tabs")
val tabs: kotlin.collections.List<IChannelTab>? = null,
@Json(name = "channelType")
val channelType: ChannelTabType? = null
) : Parcelable
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/model/Channel.kt | 2764388239 |
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)
package com.cmoney.fanciapi.fanci.model
import com.cmoney.fanciapi.fanci.model.GroupRequirementAnswer
import com.squareup.moshi.Json
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
/**
* 申請加入社團參數
*
* @param answers 回答
*/
@Parcelize
data class GroupApplyParam (
/* 回答 */
@Json(name = "answers")
val answers: kotlin.collections.List<GroupRequirementAnswer>? = null
) : Parcelable
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/model/GroupApplyParam.kt | 895976416 |
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)
package com.cmoney.fanciapi.fanci.model
import com.cmoney.fanciapi.fanci.model.ChannelAuthType
import com.squareup.moshi.Json
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
/**
*
*
* @param channelId 頻道Id
* @param channelName 頻道命名
* @param isPublic 是否為公開頻道
* @param authType
*/
@Parcelize
data class RoleChannelAuthType (
/* 頻道Id */
@Json(name = "channelId")
val channelId: kotlin.String? = null,
/* 頻道命名 */
@Json(name = "channelName")
val channelName: kotlin.String? = null,
/* 是否為公開頻道 */
@Json(name = "isPublic")
val isPublic: kotlin.Boolean? = null,
@Json(name = "authType")
val authType: ChannelAuthType? = null
) : Parcelable
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/model/RoleChannelAuthType.kt | 183239940 |
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)
package com.cmoney.fanciapi.fanci.model
import com.squareup.moshi.Json
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
/**
* Txt檔內容
*
* @param fileName
* @param fileSize
* @param thumbnailUrl
*/
@Parcelize
data class TxtContent (
@Json(name = "fileName")
val fileName: kotlin.String? = null,
@Json(name = "fileSize")
val fileSize: kotlin.Long? = null,
@Json(name = "thumbnailUrl")
val thumbnailUrl: kotlin.String? = null
) : Parcelable
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/model/TxtContent.kt | 1262352657 |
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)
package com.cmoney.fanciapi.fanci.model
import com.squareup.moshi.Json
/**
*
*
* Values: spamAds,adultContent,harass,notRelated,other
*/
enum class ReportReason(val value: kotlin.String) {
@Json(name = "SpamAds")
spamAds("SpamAds"),
@Json(name = "AdultContent")
adultContent("AdultContent"),
@Json(name = "Harass")
harass("Harass"),
@Json(name = "NotRelated")
notRelated("NotRelated"),
@Json(name = "Other")
other("Other");
/**
* Override toString() to avoid using the enum variable name as the value, and instead use
* the actual value defined in the API spec file.
*
* This solves a problem when the variable name and its value are different, and ensures that
* the client sends the correct enum values to the server always.
*/
override fun toString(): String = value
companion object {
/**
* Converts the provided [data] to a [String] on success, null otherwise.
*/
fun encode(data: kotlin.Any?): kotlin.String? = if (data is ReportReason) "$data" else null
/**
* Returns a valid [ReportReason] for [data], null otherwise.
*/
fun decode(data: kotlin.Any?): ReportReason? = data?.let {
val normalizedData = "$it".lowercase()
values().firstOrNull { value ->
it == value || normalizedData == "$value".lowercase()
}
}
}
}
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/model/ReportReason.kt | 1975988130 |
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)
package com.cmoney.fanciapi.fanci.model
import com.squareup.moshi.Json
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
/**
* 音檔內容
*
* @param fileName
* @param fileSize
* @param duration
*/
@Parcelize
data class AudioContent (
@Json(name = "fileName")
val fileName: kotlin.String? = null,
@Json(name = "fileSize")
val fileSize: kotlin.Long? = null,
@Json(name = "duration")
val duration: kotlin.Long? = null
) : Parcelable
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/model/AudioContent.kt | 2737553187 |
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)
package com.cmoney.fanciapi.fanci.model
import com.squareup.moshi.Json
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
/**
* 圖檔內容
*
* @param width
* @param height
*/
@Parcelize
data class ImageContent (
@Json(name = "width")
val width: kotlin.Int? = null,
@Json(name = "height")
val height: kotlin.Int? = null
) : Parcelable
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/model/ImageContent.kt | 218709025 |
package com.cmoney.fanciapi.fanci.api
import com.cmoney.fanciapi.infrastructure.CollectionFormats.*
import retrofit2.http.*
import retrofit2.Response
import okhttp3.RequestBody
import com.squareup.moshi.Json
interface InfoApi {
/**
* 輸入密碼 以取得環境參數
*
* Responses:
* - 200: Success
*
* @param passcode (optional, default to "1234")
* @return [Unit]
*/
@GET("api/v1/Info")
suspend fun apiV1InfoGet(@Query("passcode") passcode: kotlin.String? = "1234"): Response<Unit>
}
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/api/InfoApi.kt | 1587197652 |
package com.cmoney.fanciapi.fanci.api
import com.cmoney.fanciapi.infrastructure.CollectionFormats.*
import retrofit2.http.*
import retrofit2.Response
import okhttp3.RequestBody
import com.squareup.moshi.Json
import com.cmoney.fanciapi.fanci.model.OrderParam
import com.cmoney.fanciapi.fanci.model.RoleOrderParam
interface OrderApi {
/**
* 調整群組/頻道排序 __________🔒 重新排列
*
* Responses:
* - 200: Success
* - 401: 未驗證
* - 403: 沒有權限
* - 204: 成功
*
* @param groupId 社團Id
* @param orderParam 排序參數 (optional)
* @return [Unit]
*/
@PUT("api/v1/Order/Group/{groupId}")
suspend fun apiV1OrderGroupGroupIdPut(@Path("groupId") groupId: kotlin.String, @Body orderParam: OrderParam? = null): Response<Unit>
/**
* 編輯角色列表排序 __________🔒 管理角色層級
*
* Responses:
* - 200: Success
* - 401: 未驗證
* - 403: 沒有權限
* - 204: 成功
*
* @param groupId 社團Id
* @param roleOrderParam 參數 (optional)
* @return [Unit]
*/
@PUT("api/v1/Order/Group/{groupId}/Role/Order")
suspend fun apiV1OrderGroupGroupIdRoleOrderPut(@Path("groupId") groupId: kotlin.String, @Body roleOrderParam: RoleOrderParam? = null): Response<Unit>
}
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/api/OrderApi.kt | 2173979254 |
package com.cmoney.fanciapi.fanci.api
import com.cmoney.fanciapi.infrastructure.CollectionFormats.*
import retrofit2.http.*
import retrofit2.Response
import okhttp3.RequestBody
import com.squareup.moshi.Json
import com.cmoney.fanciapi.fanci.model.AccessorTypes
import com.cmoney.fanciapi.fanci.model.Channel
import com.cmoney.fanciapi.fanci.model.ChannelAccessOptionModel
import com.cmoney.fanciapi.fanci.model.ChannelAccessOptionV2
import com.cmoney.fanciapi.fanci.model.ChannelAuthType
import com.cmoney.fanciapi.fanci.model.ChannelWhiteList
import com.cmoney.fanciapi.fanci.model.EditChannelParam
import com.cmoney.fanciapi.fanci.model.FanciRole
import com.cmoney.fanciapi.fanci.model.GetWhiteListCountParam
import com.cmoney.fanciapi.fanci.model.PutAuthTypeRequest
import com.cmoney.fanciapi.fanci.model.PutWhiteListRequest
import com.cmoney.fanciapi.fanci.model.RoleIdsParam
import com.cmoney.fanciapi.fanci.model.WhiteListCount
interface ChannelApi {
/**
* 取得私密頻道權限設定文案 提供權限類型,以及權限描述的文案
*
* Responses:
* - 200: Success
* - 401: Unauthorized
* - 403: Forbidden
*
* @return [kotlin.collections.List<ChannelAccessOptionModel>]
*/
@Deprecated("This api was deprecated")
@GET("api/v1/Channel/AccessType")
suspend fun apiV1ChannelAccessTypeGet(): Response<kotlin.collections.List<ChannelAccessOptionModel>>
/**
* 刪除頻道 __________🔒 刪除頻道
*
* Responses:
* - 204: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到該頻道
*
* @param channelId 聊天室Id
* @return [Unit]
*/
@DELETE("api/v1/Channel/{channelId}")
suspend fun apiV1ChannelChannelIdDelete(@Path("channelId") channelId: kotlin.String): Response<Unit>
/**
* 取得特定頻道
*
* Responses:
* - 200: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到該頻道
*
* @param channelId 頻道Id
* @return [Channel]
*/
@GET("api/v1/Channel/{channelId}")
suspend fun apiV1ChannelChannelIdGet(@Path("channelId") channelId: kotlin.String): Response<Channel>
/**
* 編輯頻道 __________🔒 編輯頻道
*
* Responses:
* - 204: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到該頻道
*
* @param channelId 頻道Id
* @param editChannelParam 頻道參數 (optional)
* @return [Unit]
*/
@PUT("api/v1/Channel/{channelId}")
suspend fun apiV1ChannelChannelIdPut(@Path("channelId") channelId: kotlin.String, @Body editChannelParam: EditChannelParam? = null): Response<Unit>
/**
* 從頻道移除 多個 管理員角色 __________🔒 指派頻道管理員
*
* Responses:
* - 404: 找不到該頻道
* - 204: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 405: 要新增的角色不存在
*
* @param channelId 頻道Id
* @param roleIdsParam 角色Id (optional)
* @return [Unit]
*/
@HTTP(method = "DELETE", path = "api/v1/Channel/{channelId}/Role", hasBody = true)
suspend fun apiV1ChannelChannelIdRoleDelete(@Path("channelId") channelId: kotlin.String, @Body roleIdsParam: RoleIdsParam? = null): Response<Unit>
/**
* 取得頻道管理員(被設定為管理員權限的角色)清單
*
* Responses:
* - 200: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到該頻道
*
* @param channelId 頻道Id
* @return [kotlin.collections.List<FanciRole>]
*/
@GET("api/v1/Channel/{channelId}/Role")
suspend fun apiV1ChannelChannelIdRoleGet(@Path("channelId") channelId: kotlin.String): Response<kotlin.collections.List<FanciRole>>
/**
* 新增更新 多個管理員 到 頻道 __________🔒 指派頻道管理員
*
* Responses:
* - 204: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到該頻道
* - 405: 要新增的角色不存在
*
* @param channelId 頻道Id
* @param roleIdsParam 新增的 role id 清單 (optional)
* @return [Unit]
*/
@PUT("api/v1/Channel/{channelId}/Role")
suspend fun apiV1ChannelChannelIdRolePut(@Path("channelId") channelId: kotlin.String, @Body roleIdsParam: RoleIdsParam? = null): Response<Unit>
/**
* 編輯指定使用者/角色 於頻道中的權限AuthType 使用此方法移動該角色權限後 會將該角色從其他權限清單中移除 __________🔒 管理VIP方案
*
* Responses:
* - 204: No Content
* - 401: Unauthorized
* - 403: Forbidden
*
* @param channelId 頻道ID
* @param accessorType 異動的成員類型 使用者/角色/VIP角色
* @param accessorId 異動頻道成員ID
* @param putAuthTypeRequest 指定加入成員的權限類型) (optional)
* @return [Unit]
*/
@PUT("api/v1/Channel/{channelId}/WhiteList/{accessorType}/{accessorId}")
suspend fun apiV1ChannelChannelIdWhiteListAccessorTypeAccessorIdPut(@Path("channelId") channelId: kotlin.String, @Path("accessorType") accessorType: AccessorTypes, @Path("accessorId") accessorId: kotlin.String, @Body putAuthTypeRequest: PutAuthTypeRequest? = null): Response<Unit>
/**
* 取得私密頻道白名單
*
* Responses:
* - 200: Success
* - 401: Unauthorized
* - 403: Forbidden
*
* @param channelId
* @param authType
* @return [ChannelWhiteList]
*/
@GET("api/v1/Channel/{channelId}/WhiteList/{authType}")
suspend fun apiV1ChannelChannelIdWhiteListAuthTypeGet(@Path("channelId") channelId: kotlin.String, @Path("authType") authType: ChannelAuthType): Response<ChannelWhiteList>
/**
* 設定私密頻道白名單 (Role/VipRole/Users) 把channel底下 對應的authType清單用戶角色VIP全部替換 (若提供的清單用戶或角色已存在於其他authType,會保持同時存在於多個authType的狀態,所以異動已設定過的用戶或角色,記得到另一個authType將提供的清單一併異動) __________🔒 編輯頻道
*
* Responses:
* - 204: No Content
* - 401: Unauthorized
* - 403: Forbidden
*
* @param channelId 頻道ID
* @param authType 指定加入成員的權限類型)
* @param putWhiteListRequest (optional)
* @return [Unit]
*/
@PUT("api/v1/Channel/{channelId}/WhiteList/{authType}")
suspend fun apiV1ChannelChannelIdWhiteListAuthTypePut(@Path("channelId") channelId: kotlin.String, @Path("authType") authType: ChannelAuthType, @Body putWhiteListRequest: PutWhiteListRequest? = null): Response<Unit>
/**
* 取得私密頻道白名單
*
* Responses:
* - 200: Success
* - 401: Unauthorized
* - 403: Forbidden
*
* @param channelId
* @return [kotlin.collections.List<ChannelWhiteList>]
*/
@GET("api/v1/Channel/{channelId}/WhiteList")
suspend fun apiV1ChannelChannelIdWhiteListGet(@Path("channelId") channelId: kotlin.String): Response<kotlin.collections.List<ChannelWhiteList>>
/**
* 取得私密頻道白名單覆蓋人數
*
* Responses:
* - 200: Success
* - 401: Unauthorized
* - 403: Forbidden
*
* @param getWhiteListCountParam (optional)
* @return [WhiteListCount]
*/
@POST("api/v1/Channel/WhiteList/Users/Count")
suspend fun apiV1ChannelWhiteListUsersCountPost(@Body getWhiteListCountParam: GetWhiteListCountParam? = null): Response<WhiteListCount>
/**
* 取得私密頻道權限設定文案 提供權限類型,以及權限描述的文案
*
* Responses:
* - 200: Success
*
* @param isWithNoPermission 是否包含無權限文案 (optional)
* @return [kotlin.collections.List<ChannelAccessOptionV2>]
*/
@GET("api/v2/Channel/AccessType")
suspend fun apiV2ChannelAccessTypeGet(@Query("IsWithNoPermission") isWithNoPermission: kotlin.Boolean? = null): Response<kotlin.collections.List<ChannelAccessOptionV2>>
}
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/api/ChannelApi.kt | 4149971789 |
package com.cmoney.fanciapi.fanci.api
import com.cmoney.fanciapi.infrastructure.CollectionFormats.*
import retrofit2.http.*
import retrofit2.Response
import okhttp3.RequestBody
import com.squareup.moshi.Json
import com.cmoney.fanciapi.fanci.model.ChatMessage
import com.cmoney.fanciapi.fanci.model.ChatMessageParam
import com.cmoney.fanciapi.fanci.model.EmojiParam
import com.cmoney.fanciapi.fanci.model.MessageServiceType
import com.cmoney.fanciapi.fanci.model.OrderType
import com.cmoney.fanciapi.fanci.model.SearchMessageParam
import com.cmoney.fanciapi.fanci.model.User
interface MessageApi {
/**
* 收回我的訊息 __________🔒 已註冊的fanci使用者
*
* Responses:
* - 200: Success
* - 401: 未驗證
* - 403: 沒有權限(代表不是自己發的訊息)
* - 204: 成功
* - 404: 找不到訊息
*
* @param messageId 訊息Id
* @return [Unit]
*/
@DELETE("api/v2/Message/me/{messageType}/{messageId}")
suspend fun apiV2MessageMeMessageTypeMessageIdDelete(@Path("messageType") messageType: MessageServiceType, @Path("messageId") messageId: kotlin.String): Response<Unit>
/**
* 收回表情符號 __________🔒 已註冊的fanci使用者
*
* Responses:
* - 200: Success
* - 401: 未驗證
* - 403: 沒有權限
* - 204: 成功
* - 404: 找不到訊息
*
* @param messageType
* @param messageId
* @return [Unit]
*/
@DELETE("api/v2/Message/{messageType}/{messageId}/Emoji")
suspend fun apiV2MessageMessageTypeMessageIdEmojiDelete(@Path("messageType") messageType: MessageServiceType, @Path("messageId") messageId: kotlin.String): Response<Unit>
/**
* 取得訊息表情符號來自誰 __________🔒 已註冊的fanci使用者
*
* Responses:
* - 200: Success
* - 401: 未驗證
* - 403: 沒有權限
* - 204: 成功
* - 404: 找不到訊息
*
* @param messageType
* @param messageId 訊息Id
* @return [kotlin.collections.Map<kotlin.String, kotlin.collections.List<User>>]
*/
@GET("api/v2/Message/{messageType}/{messageId}/Emoji")
suspend fun apiV2MessageMessageTypeMessageIdEmojiGet(@Path("messageType") messageType: MessageServiceType, @Path("messageId") messageId: kotlin.String): Response<kotlin.collections.Map<kotlin.String, kotlin.collections.List<User>>>
/**
* 對訊息新增表情符號 __________🔒 已註冊的fanci使用者
*
* Responses:
* - 200: Success
* - 401: 未驗證
* - 403: 沒有權限
* - 204: 成功
* - 404: 找不到訊息
*
* @param messageType
* @param messageId 訊息Id
* @param emojiParam 表情符號參數 (optional)
* @return [Unit]
*/
@PUT("api/v2/Message/{messageType}/{messageId}/Emoji")
suspend fun apiV2MessageMessageTypeMessageIdEmojiPut(@Path("messageType") messageType: MessageServiceType, @Path("messageId") messageId: kotlin.String, @Body emojiParam: EmojiParam? = null): Response<Unit>
/**
* 取得單一訊息 __________🔒 已註冊的fanci使用者
*
* Responses:
* - 200: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到訊息
*
* @param messageType
* @param messageId 訊息id
* @return [ChatMessage]
*/
@GET("api/v2/Message/{messageType}/{messageId}")
suspend fun apiV2MessageMessageTypeMessageIdGet(@Path("messageType") messageType: MessageServiceType, @Path("messageId") messageId: kotlin.String): Response<ChatMessage>
/**
* 編輯訊息內容 __________🔒 已註冊的fanci使用者
*
* Responses:
* - 200: Success
* - 401: 未驗證
* - 403: 不是發文者
* - 204: 成功
* - 404: 找不到訊息
*
* @param messageType
* @param messageId 訊息Id
* @param chatMessageParam 異動訊息參數 (optional)
* @return [Unit]
*/
@PUT("api/v2/Message/{messageType}/{messageId}")
suspend fun apiV2MessageMessageTypeMessageIdPut(@Path("messageType") messageType: MessageServiceType, @Path("messageId") messageId: kotlin.String, @Body chatMessageParam: ChatMessageParam? = null): Response<Unit>
/**
* 角色刪除他人訊息 __________🔒 可管理
*
* Responses:
* - 200: Success
* - 401: 未驗證
* - 403: 沒有權限
* - 204: 成功
* - 404: 找不到訊息
*
* @param messageType
* @param messageId 訊息Id
* @return [Unit]
*/
@DELETE("api/v2/Message/role/{messageType}/{messageId}")
suspend fun apiV2MessageRoleMessageTypeMessageIdDelete(@Path("messageType") messageType: MessageServiceType, @Path("messageId") messageId: kotlin.String): Response<Unit>
/**
* 搜尋功能 代入自訂條件搜尋訊息 全部條件取\"交集\" 不需要的條件請移除 有範圍小的條件可以不用代範圍大的條件 (如 有Channel可以不用Group) TODO:貼文回覆先不要 等前端確定 (聊天回復不影響) __________🔒 已註冊的fanci使用者
*
* Responses:
* - 200: Success
* - 401: Unauthorized
* - 403: Forbidden
*
* @param order (optional)
* @param offset 從第幾筆搜尋結果開始取 (optional, default to 0)
* @param fetch 共取幾筆搜尋結果 (optional, default to 10)
* @param searchMessageParam (optional)
* @return [kotlin.collections.List<ChatMessage>]
*/
@POST("api/v2/Message/Search")
suspend fun apiV2MessageSearchPost(@Query("order") order: OrderType? = null, @Query("offset") offset: kotlin.Int? = 0, @Query("fetch") fetch: kotlin.Int? = 10, @Body searchMessageParam: SearchMessageParam? = null): Response<kotlin.collections.List<ChatMessage>>
}
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/api/MessageApi.kt | 393489972 |
package com.cmoney.fanciapi.fanci.api
import com.cmoney.fanciapi.infrastructure.CollectionFormats.*
import retrofit2.http.*
import retrofit2.Response
import okhttp3.RequestBody
import com.squareup.moshi.Json
import com.cmoney.fanciapi.fanci.model.PushNotificationSetting
import com.cmoney.fanciapi.fanci.model.PushNotificationSettingType
interface PushNotificationApi {
/**
* 取得推播開關設定種類
*
* Responses:
* - 200: Success
* - 401: Unauthorized
* - 403: Forbidden
*
* @return [kotlin.collections.List<PushNotificationSetting>]
*/
@GET("api/v1/PushNotification/SettingType/All")
suspend fun apiV1PushNotificationSettingTypeAllGet(): Response<kotlin.collections.List<PushNotificationSetting>>
/**
* 取得使用者社團推播設定
*
* Responses:
* - 200: Success
* - 401: Unauthorized
* - 403: Forbidden
*
* @param groupId 社團Id
* @return [PushNotificationSetting]
*/
@GET("api/v1/PushNotification/User/{groupId}/SettingType")
suspend fun apiV1PushNotificationUserGroupIdSettingTypeGet(@Path("groupId") groupId: kotlin.String): Response<PushNotificationSetting>
/**
* 設定使用者社團推播設定
*
* Responses:
* - 204: No Content
* - 401: Unauthorized
* - 403: Forbidden
*
* @param groupId 社團Id
* @param settingType 設定種類
* @return [Unit]
*/
@PUT("api/v1/PushNotification/User/{groupId}/SettingType/{settingType}")
suspend fun apiV1PushNotificationUserGroupIdSettingTypeSettingTypePut(@Path("groupId") groupId: kotlin.String, @Path("settingType") settingType: PushNotificationSettingType): Response<Unit>
}
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/api/PushNotificationApi.kt | 1691758767 |
package com.cmoney.fanciapi.fanci.api
import com.cmoney.fanciapi.fanci.model.FanciRole
import com.cmoney.fanciapi.fanci.model.GroupMember
import com.cmoney.fanciapi.fanci.model.GroupMemberRoleInfos
import com.cmoney.fanciapi.fanci.model.PurchasedRole
import com.cmoney.fanciapi.fanci.model.RoleIdsParam
import com.cmoney.fanciapi.fanci.model.UseridsParam
import com.cmoney.fanciapi.infrastructure.CollectionFormats.*
import retrofit2.Response
import retrofit2.http.*
interface RoleUserApi {
/**
* 取得頻道中具有Vip角色身分的用戶清單 (任一種VIP)
*
* Responses:
* - 200: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到社團
* - 409: 找不到指派的角色
*
* @param groupId
* @param channelId
* @return [kotlin.collections.List<GroupMember>]
*/
@GET("api/v1/RoleUser/Channel/{channelId}/VipRole")
suspend fun apiV1RoleUserChannelChannelIdVipRoleGet(@Path("groupId") groupId: kotlin.String, @Path("channelId") channelId: kotlin.String): Response<kotlin.collections.List<GroupMember>>
/**
* 判斷用戶是否擁有社團的Vip角色
*
* Responses:
* - 200: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到社團
* - 409: 找不到指派的角色
*
* @param groupId
* @param userId
* @return [kotlin.Boolean]
*/
@GET("api/v1/RoleUser/Group/{groupId}/CheckVipRole/{userId}")
suspend fun apiV1RoleUserGroupGroupIdCheckVipRoleUserIdGet(@Path("groupId") groupId: kotlin.String, @Path("userId") userId: kotlin.String): Response<kotlin.Boolean>
/**
* 取得用戶ID清單的角色列表
*
* Responses:
* - 200: Success
* - 401: Unauthorized
* - 403: Forbidden
*
* @param groupId
* @param userIds Fanci 用戶 ID (optional)
* @return [kotlin.collections.List<GroupMemberRoleInfos>]
*/
@GET("api/v1/RoleUser/Group/{groupId}")
suspend fun apiV1RoleUserGroupGroupIdGet(@Path("groupId") groupId: kotlin.String, @Query("UserIds") userIds: kotlin.collections.List<kotlin.String>? = null): Response<kotlin.collections.List<GroupMemberRoleInfos>>
/**
* 移除使用者的(多個)角色身分 __________🔒 指派身分
*
* Responses:
* - 204: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到社團
* - 409: 找不到指派的角色
*
* @param groupId 社團Id
* @param userId 成員Id
* @param roleIdsParam 使用者清單 (optional)
* @return [Unit]
*/
@DELETE("api/v1/RoleUser/Group/{groupId}/Member/{userId}")
suspend fun apiV1RoleUserGroupGroupIdMemberUserIdDelete(@Path("groupId") groupId: kotlin.String, @Path("userId") userId: kotlin.String, @Body roleIdsParam: RoleIdsParam? = null): Response<Unit>
/**
* 指派一個使用者的角色身分(可以設定多個role) __________🔒 指派身分
*
* Responses:
* - 204: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到社團
* - 409: 找不到指派的角色
*
* @param groupId 社團Id
* @param userId 成員Id
* @param roleIdsParam 使用者清單 (optional)
* @return [Unit]
*/
@PUT("api/v1/RoleUser/Group/{groupId}/Member/{userId}")
suspend fun apiV1RoleUserGroupGroupIdMemberUserIdPut(@Path("groupId") groupId: kotlin.String, @Path("userId") userId: kotlin.String, @Body roleIdsParam: RoleIdsParam? = null): Response<Unit>
/**
* 取得社團中\"不\"具有此角色身分的用戶清單 (可搜尋)
*
* Responses:
* - 200: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到社團
* - 409: 找不到指派的角色
*
* @param groupId
* @param roleId
* @param search (optional, default to "")
* @return [kotlin.collections.List<GroupMember>]
*/
@GET("api/v1/RoleUser/Group/{groupId}/NotInRole/{roleId}")
suspend fun apiV1RoleUserGroupGroupIdNotInRoleRoleIdGet(@Path("groupId") groupId: kotlin.String, @Path("roleId") roleId: kotlin.String, @Query("search") search: kotlin.String? = ""): Response<kotlin.collections.List<GroupMember>>
/**
* 移除使用者的角色身分 __________🔒 指派身分
*
* Responses:
* - 204: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到社團
* - 409: 找不到指派的角色
*
* @param groupId 社團Id
* @param roleId 角色Id
* @param useridsParam 使用者清單 (optional)
* @return [Unit]
*/
@HTTP(method = "DELETE", path = "api/v1/RoleUser/Group/{groupId}/Role/{roleId}", hasBody = true)
suspend fun apiV1RoleUserGroupGroupIdRoleRoleIdDelete(@Path("groupId") groupId: kotlin.String, @Path("roleId") roleId: kotlin.String, @Body useridsParam: UseridsParam? = null): Response<Unit>
/**
* 取得社團中具有此角色身分的用戶清單
*
* Responses:
* - 200: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到社團
* - 409: 找不到指派的角色
*
* @param groupId
* @param roleId
* @return [kotlin.collections.List<GroupMember>]
*/
@GET("api/v1/RoleUser/Group/{groupId}/Role/{roleId}")
suspend fun apiV1RoleUserGroupGroupIdRoleRoleIdGet(@Path("groupId") groupId: kotlin.String, @Path("roleId") roleId: kotlin.String): Response<kotlin.collections.List<GroupMember>>
/**
* 指派使用者角色身分 __________🔒 指派身分
*
* Responses:
* - 204: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到社團
* - 409: 找不到指派的角色
*
* @param groupId 社團Id
* @param roleId 角色Id
* @param useridsParam 使用者清單 (optional)
* @return [Unit]
*/
@PUT("api/v1/RoleUser/Group/{groupId}/Role/{roleId}")
suspend fun apiV1RoleUserGroupGroupIdRoleRoleIdPut(@Path("groupId") groupId: kotlin.String, @Path("roleId") roleId: kotlin.String, @Body useridsParam: UseridsParam? = null): Response<Unit>
/**
* 取得用戶於社團中所擁有的角色清單 (不含Vip)
*
* Responses:
* - 200: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到社團
* - 409: 找不到指派的角色
*
* @param groupId
* @param userId
* @return [kotlin.collections.List<FanciRole>]
*/
@GET("api/v1/RoleUser/Group/{groupId}/{userId}/Role")
suspend fun apiV1RoleUserGroupGroupIdUserIdRoleGet(@Path("groupId") groupId: kotlin.String, @Path("userId") userId: kotlin.String): Response<kotlin.collections.List<FanciRole>>
/**
* 取得用戶所擁有的社團Vip角色清單
*
* Responses:
* - 200: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到社團
* - 409: 找不到指派的角色
*
* @param groupId
* @param userId
* @return [kotlin.collections.List<PurchasedRole>]
*/
@GET("api/v1/RoleUser/Group/{groupId}/{userId}/VipRole")
suspend fun apiV1RoleUserGroupGroupIdUserIdVipRoleGet(@Path("groupId") groupId: kotlin.String, @Path("userId") userId: kotlin.String): Response<kotlin.collections.List<PurchasedRole>>
/**
* 取得社團中具有Vip角色身分的用戶清單 (任一種VIP)
*
* Responses:
* - 200: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到社團
* - 409: 找不到指派的角色
*
* @param groupId
* @return [kotlin.collections.List<GroupMember>]
*/
@GET("api/v1/RoleUser/Group/{groupId}/VipRole")
suspend fun apiV1RoleUserGroupGroupIdVipRoleGet(@Path("groupId") groupId: kotlin.String): Response<kotlin.collections.List<GroupMember>>
}
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/api/RoleUserApi.kt | 3198767796 |
package com.cmoney.fanciapi.fanci.api
import com.cmoney.fanciapi.infrastructure.CollectionFormats.*
import retrofit2.http.*
import retrofit2.Response
import okhttp3.RequestBody
import com.squareup.moshi.Json
import com.cmoney.fanciapi.fanci.model.User
import com.cmoney.fanciapi.fanci.model.UserParam
interface UserApi {
/**
* 取得使用者 __________🔒 cmoney token
*
* Responses:
* - 200: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到使用者
*
* @param id 使用者Id
* @return [User]
*/
@GET("api/v1/User/{id}")
suspend fun apiV1UserIdGet(@Path("id") id: kotlin.String): Response<User>
/**
* 取得我的個人資訊 __________🔒 已註冊的fanci使用者
*
* Responses:
* - 200: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到使用者
*
* @return [User]
*/
@GET("api/v1/User/me")
suspend fun apiV1UserMeGet(): Response<User>
/**
* 向fanci註冊使用者 __________🔒 cmoney token
*
* Responses:
* - 204: 成功
* - 401: 未驗證
* - 403: 沒有權限
*
* @param userParam 註冊參數 (optional)
* @return [Unit]
*/
@PUT("api/v1/User/me")
suspend fun apiV1UserMePut(@Body userParam: UserParam? = null): Response<Unit>
}
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/api/UserApi.kt | 2905783934 |
package com.cmoney.fanciapi.fanci.api
import com.cmoney.fanciapi.infrastructure.CollectionFormats.*
import retrofit2.http.*
import retrofit2.Response
import okhttp3.RequestBody
import com.squareup.moshi.Json
import com.cmoney.fanciapi.fanci.model.ApplyStatus
import com.cmoney.fanciapi.fanci.model.CountResult
import com.cmoney.fanciapi.fanci.model.GroupApplyParam
import com.cmoney.fanciapi.fanci.model.GroupApplyStatusParam
import com.cmoney.fanciapi.fanci.model.GroupRequirementApplyInfo
import com.cmoney.fanciapi.fanci.model.GroupRequirementApplyPaging
interface GroupApplyApi {
/**
* 取得我的所有社團申請
*
* Responses:
* - 200: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到該社團
*
* @return [kotlin.collections.List<GroupRequirementApplyInfo>]
*/
@GET("api/v1/GroupApply/Group/All/Me")
suspend fun apiV1GroupApplyGroupAllMeGet(): Response<kotlin.collections.List<GroupRequirementApplyInfo>>
/**
* 整批更新審核狀態(通過/拒絕) __________🔒 審核入社申請
*
* Responses:
* - 200: Success
* - 401: 未驗證
* - 403: 沒有權限
* - 204: 成功
* - 404: 找不到該社團
*
* @param groupId 社團Id
* @param groupApplyStatusParam 審核狀態參數 (optional)
* @return [Unit]
*/
@PUT("api/v1/GroupApply/Group/{groupId}/Approval")
suspend fun apiV1GroupApplyGroupGroupIdApprovalPut(@Path("groupId") groupId: kotlin.String, @Body groupApplyStatusParam: GroupApplyStatusParam? = null): Response<Unit>
/**
* 查詢未處理的入社申請筆數 __________🔒 審核入社申請
*
* Responses:
* - 200: Success
* - 401: Unauthorized
* - 403: Forbidden
*
* @param groupId
* @param applyStatus (optional)
* @return [CountResult]
*/
@GET("api/v1/GroupApply/Group/{groupId}/Count")
suspend fun apiV1GroupApplyGroupGroupIdCountGet(@Path("groupId") groupId: kotlin.String, @Query("applyStatus") applyStatus: ApplyStatus? = null): Response<CountResult>
/**
* 取得社團申請清單 __________🔒 審核入社申請
*
* Responses:
* - 200: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到該社團
* - 409: 社團id 不合法
*
* @param groupId 社團id
* @param applyStatus 申請狀態 (optional)
* @param startWeight 起始權重 (optional, default to 0L)
* @param pageSize 每頁筆數 (optional, default to 20)
* @return [GroupRequirementApplyPaging]
*/
@GET("api/v1/GroupApply/Group/{groupId}")
suspend fun apiV1GroupApplyGroupGroupIdGet(@Path("groupId") groupId: kotlin.String, @Query("applyStatus") applyStatus: ApplyStatus? = null, @Query("startWeight") startWeight: kotlin.Long? = 0L, @Query("pageSize") pageSize: kotlin.Int? = 20): Response<GroupRequirementApplyPaging>
/**
* 取得我的社團申請
*
* Responses:
* - 200: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到該社團
*
* @param groupId 社團Id
* @return [GroupRequirementApplyInfo]
*/
@GET("api/v1/GroupApply/Group/{groupId}/Me")
suspend fun apiV1GroupApplyGroupGroupIdMeGet(@Path("groupId") groupId: kotlin.String): Response<GroupRequirementApplyInfo>
/**
* 新增社團申請
*
* Responses:
* - 409: Conflict
* - 401: 未驗證
* - 403: 沒有權限
* - 204: 成功
* - 404: 找不到該社團
*
* @param groupId 社團Id
* @param groupApplyParam 社團申請參數 (optional)
* @return [Unit]
*/
@PUT("api/v1/GroupApply/Group/{groupId}")
suspend fun apiV1GroupApplyGroupGroupIdPut(@Path("groupId") groupId: kotlin.String, @Body groupApplyParam: GroupApplyParam? = null): Response<Unit>
}
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/api/GroupApplyApi.kt | 3116024871 |
package com.cmoney.fanciapi.fanci.api
import com.cmoney.fanciapi.infrastructure.CollectionFormats.*
import retrofit2.http.*
import retrofit2.Response
import okhttp3.RequestBody
import com.squareup.moshi.Json
import com.cmoney.fanciapi.fanci.model.Relation
import com.cmoney.fanciapi.fanci.model.User
import com.cmoney.fanciapi.fanci.model.UserPaging
interface RelationApi {
/**
* 解除與用戶的關係
*
* Responses:
* - 200: Success
* - 401: Unauthorized
* - 403: Forbidden
*
* @param relation
* @param blockUserId
* @return [Unit]
*/
@HTTP(method = "DELETE", path = "api/v1/Relation/{relation}/me/{blockUserId}", hasBody = true)
suspend fun apiV1RelationRelationMeBlockUserIdDelete(@Path("relation") relation: Relation, @Path("blockUserId") blockUserId: kotlin.String): Response<Unit>
/**
* 增加與用戶的關係
*
* Responses:
* - 200: Success
* - 401: Unauthorized
* - 403: Forbidden
*
* @param relation
* @param blockUserId
* @return [User]
*/
@PUT("api/v1/Relation/{relation}/me/{blockUserId}")
suspend fun apiV1RelationRelationMeBlockUserIdPut(@Path("relation") relation: Relation, @Path("blockUserId") blockUserId: kotlin.String): Response<User>
/**
* 取得有此關係的用戶清單
*
* Responses:
* - 200: Success
* - 401: Unauthorized
* - 403: Forbidden
*
* @param relation
* @param skip (optional, default to 0)
* @param take (optional, default to 20)
* @return [UserPaging]
*/
@GET("api/v1/Relation/{relation}/me")
suspend fun apiV1RelationRelationMeGet(@Path("relation") relation: Relation, @Query("skip") skip: kotlin.Int? = 0, @Query("take") take: kotlin.Int? = 20): Response<UserPaging>
}
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/api/RelationApi.kt | 551787351 |
package com.cmoney.fanciapi.fanci.api
import com.cmoney.fanciapi.infrastructure.CollectionFormats.*
import retrofit2.http.*
import retrofit2.Response
import okhttp3.RequestBody
import com.squareup.moshi.Json
import com.cmoney.fanciapi.fanci.model.ChannelPermission
import com.cmoney.fanciapi.fanci.model.GroupPermission
import com.cmoney.fanciapi.fanci.model.PatchPermissionParam
import com.cmoney.fanciapi.fanci.model.Permission
import com.cmoney.fanciapi.fanci.model.PermissionCategory
interface PermissionApi {
/**
* 取得user在此頻道擁有的權限
*
* Responses:
* - 200: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到該頻道
*
* @param channelId 聊天室頻道Id
* @return [ChannelPermission]
*/
@GET("api/v1/Permission/Channel/{channelId}")
suspend fun apiV1PermissionChannelChannelIdGet(@Path("channelId") channelId: kotlin.String): Response<ChannelPermission>
/**
* 取得管理權限表
*
* Responses:
* - 200: 成功
* - 401: Unauthorized
* - 403: Forbidden
*
* @return [kotlin.collections.List<PermissionCategory>]
*/
@GET("api/v1/Permission")
suspend fun apiV1PermissionGet(): Response<kotlin.collections.List<PermissionCategory>>
/**
* 取得user在此社團擁有的權限
*
* Responses:
* - 200: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到該社團
*
* @param groupId 社團Id
* @return [GroupPermission]
*/
@GET("api/v1/Permission/Group/{groupId}")
suspend fun apiV1PermissionGroupGroupIdGet(@Path("groupId") groupId: kotlin.String): Response<GroupPermission>
/**
* 取得單一權限資訊
*
* Responses:
* - 200: Success
* - 401: Unauthorized
* - 403: Forbidden
*
* @param id
* @return [Permission]
*/
@Deprecated("This api was deprecated")
@GET("api/v1/Permission/{id}")
suspend fun apiV1PermissionIdGet(@Path("id") id: kotlin.String): Response<Permission>
/**
*
*
* Responses:
* - 200: Success
* - 401: Unauthorized
* - 403: Forbidden
*
* @param id
* @param passCode (optional)
* @param patchPermissionParam (optional)
* @return [Permission]
*/
@Deprecated("This api was deprecated")
@PATCH("api/v1/Permission/{id}")
suspend fun apiV1PermissionIdPatch(@Path("id") id: kotlin.String, @Query("passCode") passCode: kotlin.String? = null, @Body patchPermissionParam: PatchPermissionParam? = null): Response<Permission>
}
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/api/PermissionApi.kt | 3954137259 |
package com.cmoney.fanciapi.fanci.api
import com.cmoney.fanciapi.infrastructure.CollectionFormats.*
import retrofit2.http.*
import retrofit2.Response
import okhttp3.RequestBody
import com.squareup.moshi.Json
import com.cmoney.fanciapi.fanci.model.BanParam
import com.cmoney.fanciapi.fanci.model.UserBanInformation
import com.cmoney.fanciapi.fanci.model.UseridsParam
interface BanApi {
/**
* 解除禁言 __________🔒 禁言
*
* Responses:
* - 200: Success
* - 401: Unauthorized
* - 403: Forbidden
*
* @param groupId
* @param useridsParam (optional)
* @return [Unit]
*/
@HTTP(method = "DELETE", path = "api/v1/Ban/Group/{groupId}", hasBody = true)
suspend fun apiV1BanGroupGroupIdDelete(@Path("groupId") groupId: kotlin.String, @Body useridsParam: UseridsParam? = null): Response<Unit>
/**
* 取得社團的禁言用戶清單 __________🔒 禁言
*
* Responses:
* - 200: Success
* - 401: Unauthorized
* - 403: Forbidden
*
* @param groupId 社團ID
* @return [kotlin.collections.List<UserBanInformation>]
*/
@GET("api/v1/Ban/Group/{groupId}")
suspend fun apiV1BanGroupGroupIdGet(@Path("groupId") groupId: kotlin.String): Response<kotlin.collections.List<UserBanInformation>>
/**
* 取得自己在社團的禁言狀態
*
* Responses:
* - 200: Success
* - 401: Unauthorized
* - 403: Forbidden
*
* @param groupId
* @return [UserBanInformation]
*/
@GET("api/v1/Ban/Group/{groupId}/me")
suspend fun apiV1BanGroupGroupIdMeGet(@Path("groupId") groupId: kotlin.String): Response<UserBanInformation>
/**
* 新增或調整某個用戶的禁言狀態 __________🔒 禁言
*
* Responses:
* - 200: Success
* - 401: Unauthorized
* - 403: Forbidden
*
* @param groupId
* @param banParam (optional)
* @return [Unit]
*/
@PUT("api/v1/Ban/Group/{groupId}")
suspend fun apiV1BanGroupGroupIdPut(@Path("groupId") groupId: kotlin.String, @Body banParam: BanParam? = null): Response<Unit>
/**
* 取得特定會員在社團的禁言狀態,沒有被ban會回傳404
*
* Responses:
* - 200: Success
* - 401: Unauthorized
* - 403: Forbidden
*
* @param groupId
* @param userId
* @return [UserBanInformation]
*/
@GET("api/v1/Ban/Group/{groupId}/{userId}")
suspend fun apiV1BanGroupGroupIdUserIdGet(@Path("groupId") groupId: kotlin.String, @Path("userId") userId: kotlin.String): Response<UserBanInformation>
}
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/api/BanApi.kt | 698319899 |
package com.cmoney.fanciapi.fanci.api
import com.cmoney.fanciapi.infrastructure.CollectionFormats.*
import retrofit2.http.*
import retrofit2.Response
import okhttp3.RequestBody
import com.squareup.moshi.Json
import com.cmoney.fanciapi.fanci.model.IUser
import com.cmoney.fanciapi.fanci.model.PurchasedSale
import com.cmoney.fanciapi.fanci.model.VipSale
interface VipApi {
/**
* 取得該用戶所購買的所有方案
*
* Responses:
* - 200: Success
* - 401: Unauthorized
* - 403: Forbidden
*
* @param userId
* @return [kotlin.collections.List<PurchasedSale>]
*/
@GET("api/v1/Vip/PurchasedSale/{userId}")
suspend fun apiV1VipPurchasedSaleUserIdGet(@Path("userId") userId: kotlin.String): Response<kotlin.collections.List<PurchasedSale>>
/**
* 取得授權的用戶
*
* Responses:
* - 200: Success
* - 401: Unauthorized
* - 403: Forbidden
*
* @param roleId
* @return [kotlin.collections.List<IUser>]
*/
@GET("api/v1/Vip/VipRole/{roleId}/Authorization")
suspend fun apiV1VipVipRoleRoleIdAuthorizationGet(@Path("roleId") roleId: kotlin.String): Response<kotlin.collections.List<IUser>>
/**
* 透過角色Id判斷是否購買VIP
*
* Responses:
* - 200: Success
* - 401: Unauthorized
* - 403: Forbidden
*
* @param roleId
* @param userId
* @return [kotlin.Boolean]
*/
@GET("api/v1/Vip/VipRole/{roleId}/Authorization/{userId}")
suspend fun apiV1VipVipRoleRoleIdAuthorizationUserIdGet(@Path("roleId") roleId: kotlin.String, @Path("userId") userId: kotlin.String): Response<kotlin.Boolean>
/**
* 透過角色Id取得該權限包相關的VIP方案
*
* Responses:
* - 200: Success
* - 401: Unauthorized
* - 403: Forbidden
*
* @param roleId
* @return [kotlin.collections.List<VipSale>]
*/
@GET("api/v1/Vip/VipSales/{roleId}")
suspend fun apiV1VipVipSalesRoleIdGet(@Path("roleId") roleId: kotlin.String): Response<kotlin.collections.List<VipSale>>
}
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/api/VipApi.kt | 1631480803 |
package com.cmoney.fanciapi.fanci.api
import com.cmoney.fanciapi.infrastructure.CollectionFormats.*
import retrofit2.http.*
import retrofit2.Response
import okhttp3.RequestBody
import com.squareup.moshi.Json
import com.cmoney.fanciapi.fanci.model.CastVoteParam
import com.cmoney.fanciapi.fanci.model.DeleteVotingsParam
import com.cmoney.fanciapi.fanci.model.IVotingOptionStatisticWithVoter
import com.cmoney.fanciapi.fanci.model.VotingIdParam
import com.cmoney.fanciapi.fanci.model.VotingParam
interface VotingApi {
/**
* 刪除投票活動 非建立者不給刪 當有一個活動為非建立者 全部不動 然後回無權限
*
* Responses:
* - 200: Success
* - 401: Unauthorized
* - 403: Forbidden
*
* @param channelId 頻道ID (驗證權限) (optional)
* @param deleteVotingsParam 刪除投票參數 (optional)
* @return [Unit]
*/
@HTTP(method = "DELETE", path = "api/v1/Voting", hasBody = true)
suspend fun apiV1VotingDelete(@Query("channelId") channelId: kotlin.String? = null, @Body deleteVotingsParam: DeleteVotingsParam? = null): Response<Unit>
/**
* 頻道創建投票 要有canPost權限
*
* Responses:
* - 200: Success
* - 401: Unauthorized
* - 403: Forbidden
*
* @param channelId 頻道ID (驗證權限) (optional)
* @param votingParam 投票資訊 (optional)
* @return [VotingIdParam]
*/
@POST("api/v1/Voting")
suspend fun apiV1VotingPost(@Query("channelId") channelId: kotlin.String? = null, @Body votingParam: VotingParam? = null): Response<VotingIdParam>
/**
* 頻道投票 要有canRead權限 投不存在的Option會直接失敗
*
* Responses:
* - 200: Success
* - 401: Unauthorized
* - 403: Forbidden
*
* @param votingId
* @param channelId 頻道ID (驗證權限) (optional)
* @param castVoteParam 投票 (optional)
* @return [Unit]
*/
@POST("api/v1/Voting/{votingId}/CastVote")
suspend fun apiV1VotingVotingIdCastVotePost(@Path("votingId") votingId: kotlin.String, @Query("channelId") channelId: kotlin.String? = null, @Body castVoteParam: CastVoteParam? = null): Response<Unit>
/**
* 結束頻道投票 需要是創建者
*
* Responses:
* - 200: Success
* - 401: Unauthorized
* - 403: Forbidden
*
* @param votingId 投票ID
* @param channelId 頻道ID (驗證權限) (optional)
* @return [Unit]
*/
@PUT("api/v1/Voting/{votingId}/End")
suspend fun apiV1VotingVotingIdEndPut(@Path("votingId") votingId: kotlin.String, @Query("channelId") channelId: kotlin.String? = null): Response<Unit>
/**
* 取得投票活動數據 非建立者不給看
*
* Responses:
* - 200: Success
* - 401: Unauthorized
* - 403: Forbidden
*
* @param votingId
* @param channelId (optional)
* @return [kotlin.collections.List<IVotingOptionStatisticWithVoter>]
*/
@GET("api/v1/Voting/{votingId}/Statistics")
suspend fun apiV1VotingVotingIdStatisticsGet(@Path("votingId") votingId: kotlin.String, @Query("channelId") channelId: kotlin.String? = null): Response<kotlin.collections.List<IVotingOptionStatisticWithVoter>>
}
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/api/VotingApi.kt | 1727773178 |
package com.cmoney.fanciapi.fanci.api
import com.cmoney.fanciapi.infrastructure.CollectionFormats.*
import retrofit2.http.*
import retrofit2.Response
import okhttp3.RequestBody
import com.squareup.moshi.Json
import com.cmoney.fanciapi.fanci.model.ColorTheme
import com.cmoney.fanciapi.fanci.model.Theme
interface ThemeColorApi {
/**
* 取得特定主題色卡包
*
* Responses:
* - 200: Success
*
* @param colorTheme
* @return [Theme]
*/
@GET("api/v1/ThemeColor/{colorTheme}")
suspend fun apiV1ThemeColorColorThemeGet(@Path("colorTheme") colorTheme: ColorTheme): Response<Theme>
/**
* 取得所有主題色卡包
*
* Responses:
* - 200: Success
*
* @return [kotlin.collections.Map<kotlin.String, Theme>]
*/
@GET("api/v1/ThemeColor")
suspend fun apiV1ThemeColorGet(): Response<kotlin.collections.Map<kotlin.String, Theme>>
}
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/api/ThemeColorApi.kt | 1898781653 |
package com.cmoney.fanciapi.fanci.api
import com.cmoney.fanciapi.infrastructure.CollectionFormats.*
import retrofit2.http.*
import retrofit2.Response
import okhttp3.RequestBody
import com.squareup.moshi.Json
import com.cmoney.fanciapi.fanci.model.GroupRequirement
import com.cmoney.fanciapi.fanci.model.GroupRequirementParam
interface GroupRequirementApi {
/**
* 取得加入社團的要求題目
*
* Responses:
* - 200: 成功
* - 401: Unauthorized
* - 403: Forbidden
* - 404: 找不到社團
*
* @param groupId 社團id
* @return [GroupRequirement]
*/
@GET("api/v1/GroupRequirement/group/{groupId}")
suspend fun apiV1GroupRequirementGroupGroupIdGet(@Path("groupId") groupId: kotlin.String): Response<GroupRequirement>
/**
* 新增或更新社團題目 __________🔒 建立與編輯入社問題
*
* Responses:
* - 409: Conflict
* - 200: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到社團
*
* @param groupId 社團id
* @param groupRequirementParam 題目參數 (optional)
* @return [GroupRequirement]
*/
@PUT("api/v1/GroupRequirement/group/{groupId}")
suspend fun apiV1GroupRequirementGroupGroupIdPut(@Path("groupId") groupId: kotlin.String, @Body groupRequirementParam: GroupRequirementParam? = null): Response<GroupRequirement>
}
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/api/GroupRequirementApi.kt | 2613278654 |
package com.cmoney.fanciapi.fanci.api
import com.cmoney.fanciapi.infrastructure.CollectionFormats.*
import retrofit2.http.*
import retrofit2.Response
import okhttp3.RequestBody
import com.squareup.moshi.Json
import com.cmoney.fanciapi.fanci.model.ChannelTabType
import com.cmoney.fanciapi.fanci.model.ChannelTabsSortParam
import com.cmoney.fanciapi.fanci.model.ChannelTabsStatus
interface ChannelTabApi {
/**
* 取得所有種類頻道功能區
*
* Responses:
* - 200: Success
* - 401: Unauthorized
* - 403: Forbidden
*
* @return [ChannelTabsSortParam]
*/
@GET("api/v1/ChannelTab/All")
suspend fun apiV1ChannelTabAllGet(): Response<ChannelTabsSortParam>
/**
* 取得頻道功能區啟用狀態
*
* Responses:
* - 200: Success
* - 401: Unauthorized
* - 403: Forbidden
*
* @param channelId 頻道ID
* @return [ChannelTabsStatus]
*/
@Deprecated("This api was deprecated")
@GET("api/v1/ChannelTab/{channelId}/Tab")
suspend fun apiV1ChannelTabChannelIdTabGet(@Path("channelId") channelId: kotlin.String): Response<ChannelTabsStatus>
/**
* 取得頻道功能區啟用狀態
*
* Responses:
* - 200: Success
* - 401: Unauthorized
* - 403: Forbidden
*
* @param channelId 頻道ID
* @return [ChannelTabsSortParam]
*/
@GET("api/v1/ChannelTab/{channelId}/Tabs")
suspend fun apiV1ChannelTabChannelIdTabsGet(@Path("channelId") channelId: kotlin.String): Response<ChannelTabsSortParam>
/**
* 編輯頻道功能區順序 __________🔒 編輯頻道
*
* Responses:
* - 204: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 400: 參數錯誤 功能區數量不符合
* - 404: 找不到該頻道
*
* @param channelId 頻道Id
* @param channelTabsSortParam (optional)
* @return [Unit]
*/
@PUT("api/v1/ChannelTab/{channelId}/Tabs/Sort")
suspend fun apiV1ChannelTabChannelIdTabsSortPut(@Path("channelId") channelId: kotlin.String, @Body channelTabsSortParam: ChannelTabsSortParam? = null): Response<Unit>
/**
* 關閉頻道功能區 __________🔒 編輯頻道
*
* Responses:
* - 204: No Content
* - 401: Unauthorized
* - 403: Forbidden
*
* @param channelId 頻道ID
* @param type
* @return [Unit]
*/
@DELETE("api/v1/ChannelTab/{channelId}/{type}")
suspend fun apiV1ChannelTabChannelIdTypeDelete(@Path("channelId") channelId: kotlin.String, @Path("type") type: ChannelTabType): Response<Unit>
/**
* 啟用頻道功能區 __________🔒 編輯頻道
*
* Responses:
* - 204: No Content
* - 401: Unauthorized
* - 403: Forbidden
*
* @param channelId 頻道ID
* @param type
* @return [Unit]
*/
@PUT("api/v1/ChannelTab/{channelId}/{type}")
suspend fun apiV1ChannelTabChannelIdTypePut(@Path("channelId") channelId: kotlin.String, @Path("type") type: ChannelTabType): Response<Unit>
}
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/api/ChannelTabApi.kt | 279335764 |
package com.cmoney.fanciapi.fanci.api
import com.cmoney.fanciapi.infrastructure.CollectionFormats.*
import retrofit2.http.*
import retrofit2.Response
import okhttp3.RequestBody
import com.squareup.moshi.Json
import com.cmoney.fanciapi.fanci.model.DefaultImageResource
interface DefaultImageApi {
/**
* 取得預設圖片
*
* Responses:
* - 200: Success
*
* @return [DefaultImageResource]
*/
@GET("api/v1/DefaultImage")
suspend fun apiV1DefaultImageGet(): Response<DefaultImageResource>
}
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/api/DefaultImageApi.kt | 3868729554 |
package com.cmoney.fanciapi.fanci.api
import com.cmoney.fanciapi.infrastructure.CollectionFormats.*
import retrofit2.http.*
import retrofit2.Response
import okhttp3.RequestBody
import com.squareup.moshi.Json
import com.cmoney.fanciapi.fanci.model.BulletinboardMessage
import com.cmoney.fanciapi.fanci.model.BulletinboardMessagePaging
import com.cmoney.fanciapi.fanci.model.BulletingBoardMessageParam
import com.cmoney.fanciapi.fanci.model.MessageIdParam
import com.cmoney.fanciapi.fanci.model.OrderType
import com.cmoney.fanciapi.fanci.model.PinnedMessageInfo
interface BulletinBoardApi {
/**
* 取得貼文區貼文列表 __________🔒 可看
*
* Responses:
* - 200: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到該頻道
*
* @param channelId 貼文區頻道Id
* @param take 取得筆數 (optional, default to 20)
* @param order 排序依據(預設為Latest) <br></br>Latest:代表從SerialNumber往前找 SerialNumber預設0 代表從最新往舊找,<br></br>Oldest:代表從SerialNumber往後找 SerialNumber預設0 代表從舊往新找<br></br>每次回傳weight為當下已經取得的最底一筆SerialNumber<br></br>所以下輪帶入SerialNumber並不會再包含該筆資料 (optional)
* @param fromSerialNumber 從哪一個序列號開始往回找 (optional)
* @return [BulletinboardMessagePaging]
*/
@GET("api/v1/BulletinBoard/{channelId}/Message")
suspend fun apiV1BulletinBoardChannelIdMessageGet(@Path("channelId") channelId: kotlin.String, @Query("take") take: kotlin.Int? = 20, @Query("order") order: OrderType? = null, @Query("fromSerialNumber") fromSerialNumber: kotlin.Long? = null): Response<BulletinboardMessagePaging>
/**
* 對貼文新增一則 留言 / 回覆 __________🔒 CanReply
*
* Responses:
* - 200: Success
* - 401: Unauthorized
* - 403: Forbidden
*
* @param channelId 頻道
* @param messageId 訊息
* @param bulletingBoardMessageParam BulletingBoardMessageParam (optional)
* @return [BulletinboardMessage]
*/
@POST("api/v1/BulletinBoard/{channelId}/Message/{messageId}/Comment")
suspend fun apiV1BulletinBoardChannelIdMessageMessageIdCommentPost(@Path("channelId") channelId: kotlin.String, @Path("messageId") messageId: kotlin.String, @Body bulletingBoardMessageParam: BulletingBoardMessageParam? = null): Response<BulletinboardMessage>
/**
* 取得貼文的 留言 / 回覆 __________🔒 可看
*
* Responses:
* - 200: Success
* - 401: Unauthorized
* - 403: Forbidden
*
* @param channelId 頻道ID
* @param messageId 貼文ID
* @param take 取得筆數 (optional, default to 20)
* @param order 排序方式 (optional)
* @param fromSerialNumber (optional)
* @return [BulletinboardMessagePaging]
*/
@GET("api/v1/BulletinBoard/{channelId}/Message/{messageId}/Comments")
suspend fun apiV1BulletinBoardChannelIdMessageMessageIdCommentsGet(@Path("channelId") channelId: kotlin.String, @Path("messageId") messageId: kotlin.String, @Query("take") take: kotlin.Int? = 20, @Query("order") order: OrderType? = null, @Query("fromSerialNumber") fromSerialNumber: kotlin.Long? = null): Response<BulletinboardMessagePaging>
/**
* 對貼文區新增一則貼文 __________🔒 可發文
*
* Responses:
* - 200: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到該頻道
*
* @param channelId 頻道Id
* @param bulletingBoardMessageParam 訊息參數 (optional)
* @return [BulletinboardMessage]
*/
@POST("api/v1/BulletinBoard/{channelId}/Message")
suspend fun apiV1BulletinBoardChannelIdMessagePost(@Path("channelId") channelId: kotlin.String, @Body bulletingBoardMessageParam: BulletingBoardMessageParam? = null): Response<BulletinboardMessage>
/**
* 取消貼文區公告 __________🔒 可管理
*
* Responses:
* - 200: Success
* - 401: 未驗證
* - 403: 沒有權限
* - 204: 成功
* - 404: 找不到該頻道
*
* @param channelId 頻道Id
* @return [Unit]
*/
@DELETE("api/v1/BulletinBoard/{channelId}/PinnedMessage")
suspend fun apiV1BulletinBoardChannelIdPinnedMessageDelete(@Path("channelId") channelId: kotlin.String): Response<Unit>
/**
* 取得貼文區的公告訊息 __________🔒 可看
*
* Responses:
* - 200: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到該頻道
*
* @param channelId 頻道Id
* @return [PinnedMessageInfo]
*/
@GET("api/v1/BulletinBoard/{channelId}/PinnedMessage")
suspend fun apiV1BulletinBoardChannelIdPinnedMessageGet(@Path("channelId") channelId: kotlin.String): Response<PinnedMessageInfo>
/**
* 公告貼文區的一則訊息 __________🔒 可管理
*
* Responses:
* - 200: Success
* - 401: 未驗證
* - 403: 沒有權限
* - 204: 成功
* - 404: 找不到該頻道
*
* @param channelId 貼文區頻道Id
* @param messageIdParam 公告訊息參數 (optional)
* @return [Unit]
*/
@PUT("api/v1/BulletinBoard/{channelId}/PinnedMessage")
suspend fun apiV1BulletinBoardChannelIdPinnedMessagePut(@Path("channelId") channelId: kotlin.String, @Body messageIdParam: MessageIdParam? = null): Response<Unit>
/**
* 清空使用者貼文未讀數 __________🔒 可看
*
* Responses:
* - 200: Success
* - 401: Unauthorized
* - 403: Forbidden
*
* @param channelId 頻道ID
* @return [Unit]
*/
@PUT("api/v1/BulletinBoard/{channelId}/ResetUnreadCount")
suspend fun apiV1BulletinBoardChannelIdResetUnreadCountPut(@Path("channelId") channelId: kotlin.String): Response<Unit>
}
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/api/BulletinBoardApi.kt | 540234145 |
package com.cmoney.fanciapi.fanci.api
import com.cmoney.fanciapi.infrastructure.CollectionFormats.*
import retrofit2.http.*
import retrofit2.Response
import okhttp3.RequestBody
import com.squareup.moshi.Json
import com.cmoney.fanciapi.fanci.model.ReportInformation
import com.cmoney.fanciapi.fanci.model.ReportParm
import com.cmoney.fanciapi.fanci.model.ReportStatusUpdateParam
interface UserReportApi {
/**
* 更新檢舉處理狀態 __________🔒 讀取被檢舉名單
*
* Responses:
* - 200: Success
* - 401: Unauthorized
* - 403: Forbidden
* - 204: 成功
*
* @param channelId
* @param id
* @param reportStatusUpdateParam (optional)
* @return [Unit]
*/
@PUT("api/v1/UserReport/Channel/{channelId}/{id}")
suspend fun apiV1UserReportChannelChannelIdIdPut(@Path("channelId") channelId: kotlin.String, @Path("id") id: kotlin.String, @Body reportStatusUpdateParam: ReportStatusUpdateParam? = null): Response<Unit>
/**
* 檢舉某頻道的內容
*
* Responses:
* - 200: Success
* - 401: Unauthorized
* - 403: Forbidden
* - 204: 成功
*
* @param channelId
* @param reportParm (optional)
* @return [ReportInformation]
*/
@POST("api/v1/UserReport/Channel/{channelId}")
suspend fun apiV1UserReportChannelChannelIdPost(@Path("channelId") channelId: kotlin.String, @Body reportParm: ReportParm? = null): Response<ReportInformation>
/**
* 取得社團的檢舉審核清單 __________🔒 讀取被檢舉名單
*
* Responses:
* - 200: Success
* - 401: Unauthorized
* - 403: Forbidden
*
* @param groupId
* @return [kotlin.collections.List<ReportInformation>]
*/
@GET("api/v1/UserReport/Group/{groupId}")
suspend fun apiV1UserReportGroupGroupIdGet(@Path("groupId") groupId: kotlin.String): Response<kotlin.collections.List<ReportInformation>>
}
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/api/UserReportApi.kt | 679647599 |
package com.cmoney.fanciapi.fanci.api
import com.cmoney.fanciapi.infrastructure.CollectionFormats.*
import retrofit2.http.*
import retrofit2.Response
import okhttp3.RequestBody
import com.squareup.moshi.Json
import com.cmoney.fanciapi.fanci.model.ChatMessage
import com.cmoney.fanciapi.fanci.model.ChatMessagePaging
import com.cmoney.fanciapi.fanci.model.ChatMessageParam
import com.cmoney.fanciapi.fanci.model.MessageIdParam
import com.cmoney.fanciapi.fanci.model.OrderType
import com.cmoney.fanciapi.fanci.model.PinnedMessageInfo
interface ChatRoomApi {
/**
* 取得聊天室訊息列表 __________🔒 可看
*
* Responses:
* - 200: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到該頻道
*
* @param chatRoomChannelId 聊天室頻道Id
* @param take 取得筆數 (optional, default to 20)
* @param order 排序依據(預設為Latest) <br></br>Latest:代表從SerialNumber往前找 SerialNumber預設0 代表從最新往舊找,<br></br>Oldest:代表從SerialNumber往後找 SerialNumber預設0 代表從舊往新找<br></br>每次回傳weight為當下已經取得的最底一筆SerialNumber<br></br>所以下輪帶入SerialNumber並不會再包含該筆資料 (optional)
* @param fromSerialNumber 從哪一個序列號開始往回找 (optional)
* @return [ChatMessagePaging]
*/
@GET("api/v1/ChatRoom/{chatRoomChannelId}/Message")
suspend fun apiV1ChatRoomChatRoomChannelIdMessageGet(@Path("chatRoomChannelId") chatRoomChannelId: kotlin.String, @Query("take") take: kotlin.Int? = 20, @Query("order") order: OrderType? = null, @Query("fromSerialNumber") fromSerialNumber: kotlin.Long? = null): Response<ChatMessagePaging>
/**
* 對聊天室新增一則聊天訊息 __________🔒 可發文
*
* Responses:
* - 200: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到該頻道
*
* @param chatRoomChannelId 聊天室頻道Id
* @param chatMessageParam 訊息參數 (optional)
* @return [ChatMessage]
*/
@POST("api/v1/ChatRoom/{chatRoomChannelId}/Message")
suspend fun apiV1ChatRoomChatRoomChannelIdMessagePost(@Path("chatRoomChannelId") chatRoomChannelId: kotlin.String, @Body chatMessageParam: ChatMessageParam? = null): Response<ChatMessage>
/**
* 取消聊天室公告 __________🔒 可管理
*
* Responses:
* - 200: Success
* - 401: 未驗證
* - 403: 沒有權限
* - 204: 成功
* - 404: 找不到該頻道
*
* @param chatRoomChannelId 聊天室頻道Id
* @return [Unit]
*/
@DELETE("api/v1/ChatRoom/{chatRoomChannelId}/PinnedMessage")
suspend fun apiV1ChatRoomChatRoomChannelIdPinnedMessageDelete(@Path("chatRoomChannelId") chatRoomChannelId: kotlin.String): Response<Unit>
/**
* 取得聊天室的公告訊息 __________🔒 可看
*
* Responses:
* - 200: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到該頻道
*
* @param chatRoomChannelId 聊天室頻道Id
* @return [PinnedMessageInfo]
*/
@GET("api/v1/ChatRoom/{chatRoomChannelId}/PinnedMessage")
suspend fun apiV1ChatRoomChatRoomChannelIdPinnedMessageGet(@Path("chatRoomChannelId") chatRoomChannelId: kotlin.String): Response<PinnedMessageInfo>
/**
* 公告聊天室的一則聊天訊息 __________🔒 可管理
*
* Responses:
* - 200: Success
* - 401: 未驗證
* - 403: 沒有權限
* - 204: 成功
* - 404: 找不到該頻道
*
* @param chatRoomChannelId 聊天室頻道Id
* @param messageIdParam 公告訊息參數 (optional)
* @return [Unit]
*/
@PUT("api/v1/ChatRoom/{chatRoomChannelId}/PinnedMessage")
suspend fun apiV1ChatRoomChatRoomChannelIdPinnedMessagePut(@Path("chatRoomChannelId") chatRoomChannelId: kotlin.String, @Body messageIdParam: MessageIdParam? = null): Response<Unit>
/**
* 清空使用者聊天室未讀數 __________🔒 可看
*
* Responses:
* - 200: Success
* - 401: Unauthorized
* - 403: Forbidden
*
* @param chatRoomChannelId
* @return [Unit]
*/
@PUT("api/v1/ChatRoom/{chatRoomChannelId}/ResetUnreadCount")
suspend fun apiV1ChatRoomChatRoomChannelIdResetUnreadCountPut(@Path("chatRoomChannelId") chatRoomChannelId: kotlin.String): Response<Unit>
}
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/api/ChatRoomApi.kt | 2286099381 |
package com.cmoney.fanciapi.fanci.api
import com.cmoney.fanciapi.infrastructure.CollectionFormats.*
import retrofit2.http.*
import retrofit2.Response
import okhttp3.RequestBody
import com.squareup.moshi.Json
import com.cmoney.fanciapi.fanci.model.GroupMember
import com.cmoney.fanciapi.fanci.model.GroupMemberPaging
import com.cmoney.fanciapi.fanci.model.UseridsParam
interface GroupMemberApi {
/**
* 取得社團會員清單
*
* Responses:
* - 200: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到社團
*
* @param groupId 社團id
* @param search 搜尋用戶暱稱的關鍵字 (optional, default to "")
* @param take 取得筆數 (optional, default to 20)
* @param startWeight 起始權重 (optional, default to 0)
* @param skip 跳脫筆數(已過時,請改用 startWeight,此參數未來將移除) (optional, default to 0)
* @return [GroupMemberPaging]
*/
@GET("api/v1/GroupMember/group/{groupId}")
suspend fun apiV1GroupMemberGroupGroupIdGet(@Path("groupId") groupId: kotlin.String, @Query("search") search: kotlin.String? = "", @Query("take") take: kotlin.Int? = 20, @Query("startWeight") startWeight: kotlin.Int? = 0, @Query("skip") skip: kotlin.Int? = 0): Response<GroupMemberPaging>
/**
* 離開社團
*
* Responses:
* - 204: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到社團
* - 409: 社長不得離開社團
*
* @param groupId 社團Id
* @return [Unit]
*/
@DELETE("api/v1/GroupMember/group/{groupId}/me")
suspend fun apiV1GroupMemberGroupGroupIdMeDelete(@Path("groupId") groupId: kotlin.String): Response<Unit>
/**
* 加入社團
*
* Responses:
* - 204: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到社團
* - 409: 該社團須申請審核
*
* @param groupId 社團Id
* @return [Unit]
*/
@PUT("api/v1/GroupMember/group/{groupId}/me")
suspend fun apiV1GroupMemberGroupGroupIdMePut(@Path("groupId") groupId: kotlin.String): Response<Unit>
/**
* 踢除成員離開社團 __________🔒 踢除
*
* Responses:
* - 204: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到社團
* - 409: 社長不得離開社團
*
* @param groupId 社團Id
* @param userId 要剔除的成員id
* @return [Unit]
*/
@DELETE("api/v1/GroupMember/group/{groupId}/{userId}")
suspend fun apiV1GroupMemberGroupGroupIdUserIdDelete(@Path("groupId") groupId: kotlin.String, @Path("userId") userId: kotlin.String): Response<Unit>
/**
* 取得特定社團會員清單
*
* Responses:
* - 200: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到社團
*
* @param groupId 社團id
* @param useridsParam 會員ids (optional)
* @return [kotlin.collections.List<GroupMember>]
*/
@POST("api/v1/GroupMember/Group/{groupId}/Users")
suspend fun apiV1GroupMemberGroupGroupIdUsersPost(@Path("groupId") groupId: kotlin.String, @Body useridsParam: UseridsParam? = null): Response<kotlin.collections.List<GroupMember>>
}
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/api/GroupMemberApi.kt | 766491332 |
package com.cmoney.fanciapi.fanci.api
import com.cmoney.fanciapi.infrastructure.CollectionFormats.*
import retrofit2.http.*
import retrofit2.Response
import okhttp3.RequestBody
import com.squareup.moshi.Json
import com.cmoney.fanciapi.fanci.model.Category
import com.cmoney.fanciapi.fanci.model.CategoryParam
import com.cmoney.fanciapi.fanci.model.EditGroupParam
import com.cmoney.fanciapi.fanci.model.FanciRole
import com.cmoney.fanciapi.fanci.model.Group
import com.cmoney.fanciapi.fanci.model.GroupPaging
import com.cmoney.fanciapi.fanci.model.GroupParam
import com.cmoney.fanciapi.fanci.model.OrderType
import com.cmoney.fanciapi.fanci.model.RoleChannelAuthType
import com.cmoney.fanciapi.fanci.model.RoleParam
import com.cmoney.fanciapi.fanci.model.UpdateIsNeedApprovalParam
interface GroupApi {
/**
* 取得社團列表
*
* Responses:
* - 200: 成功
*
* @param startWeight 起始權重 (optional, default to 2147483647L)
* @param pageSize 每頁筆數 (optional, default to 100)
* @param orderType 排序類型 (optional)
* @return [GroupPaging]
*/
@GET("api/v1/Group")
suspend fun apiV1GroupGet(@Query("startWeight") startWeight: kotlin.Long? = 2147483647L, @Query("pageSize") pageSize: kotlin.Int? = 100, @Query("orderType") orderType: OrderType? = null): Response<GroupPaging>
/**
* 清空使用者社團未讀數
*
* Responses:
* - 200: Success
* - 401: Unauthorized
* - 403: Forbidden
*
* @param groupID 頻道ID
* @return [Unit]
*/
@PUT("api/v1/Group/{groupID}/ResetUnreadCount")
suspend fun apiV1GroupGroupIDResetUnreadCountPut(@Path("groupID") groupID: kotlin.String): Response<Unit>
/**
* 新增社團 頻道分類 __________🔒 建立分類
*
* Responses:
* - 200: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到該社團
*
* @param groupId 社團Id
* @param categoryParam 分類參數 (optional)
* @return [Category]
*/
@POST("api/v1/Group/{groupId}/Category")
suspend fun apiV1GroupGroupIdCategoryPost(@Path("groupId") groupId: kotlin.String, @Body categoryParam: CategoryParam? = null): Response<Category>
/**
* 刪除/解散社團 __________🔒 社長
*
* Responses:
* - 204: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到該社團
*
* @param groupId 社團Id
* @return [Unit]
*/
@DELETE("api/v1/Group/{groupId}")
suspend fun apiV1GroupGroupIdDelete(@Path("groupId") groupId: kotlin.String): Response<Unit>
/**
* 取得特定社團
*
* Responses:
* - 200: 成功
* - 404: 找不到該社團
*
* @param groupId 社團Id
* @return [Group]
*/
@GET("api/v1/Group/{groupId}")
suspend fun apiV1GroupGroupIdGet(@Path("groupId") groupId: kotlin.String): Response<Group>
/**
* 更新社團是否公開 __________🔒 設定社團公開私密
*
* Responses:
* - 204: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到該社團
*
* @param groupId 社團Id
* @param updateIsNeedApprovalParam 更新參數 (optional)
* @return [Unit]
*/
@PUT("api/v1/Group/{groupId}/isNeedApproval")
suspend fun apiV1GroupGroupIdIsNeedApprovalPut(@Path("groupId") groupId: kotlin.String, @Body updateIsNeedApprovalParam: UpdateIsNeedApprovalParam? = null): Response<Unit>
/**
* 編輯社團資訊 __________🔒 編輯社團
*
* Responses:
* - 204: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到該社團
*
* @param groupId 社團Id
* @param editGroupParam 編輯社團參數 (optional)
* @return [Unit]
*/
@PUT("api/v1/Group/{groupId}")
suspend fun apiV1GroupGroupIdPut(@Path("groupId") groupId: kotlin.String, @Body editGroupParam: EditGroupParam? = null): Response<Unit>
/**
* 取得角色列表 (不包含VIP)
*
* Responses:
* - 200: 成功
* - 401: Unauthorized
* - 403: Forbidden
* - 404: 找不到該社團
*
* @param groupId 社團Id
* @return [kotlin.collections.List<FanciRole>]
*/
@GET("api/v1/Group/{groupId}/Role")
suspend fun apiV1GroupGroupIdRoleGet(@Path("groupId") groupId: kotlin.String): Response<kotlin.collections.List<FanciRole>>
/**
* 取得特定角色在Group中所有頻道權限
*
* Responses:
* - 200: 成功
* - 401: Unauthorized
* - 403: Forbidden
* - 404: 找不到該社團
*
* @param groupId 社團Id
* @param roleId
* @return [kotlin.collections.List<RoleChannelAuthType>]
*/
@GET("api/v1/Group/{groupId}/{roleId}/ChannelAuthType")
suspend fun apiV1GroupGroupIdRoleIdChannelAuthTypeGet(@Path("groupId") groupId: kotlin.String, @Path("roleId") roleId: kotlin.String): Response<kotlin.collections.List<RoleChannelAuthType>>
/**
* 新增角色(管理員) __________🔒 新增角色
*
* Responses:
* - 200: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到社團
* - 409: 已有相同名稱的角色
*
* @param groupId 社團Id
* @param roleParam 角色參數 (optional)
* @return [FanciRole]
*/
@POST("api/v1/Group/{groupId}/Role")
suspend fun apiV1GroupGroupIdRolePost(@Path("groupId") groupId: kotlin.String, @Body roleParam: RoleParam? = null): Response<FanciRole>
/**
* 刪除角色 __________🔒 刪除角色
*
* Responses:
* - 204: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到社團
* - 409: 找不到要刪除的角色
*
* @param groupId 社團Id
* @param roleId 角色Id
* @return [Unit]
*/
@DELETE("api/v1/Group/{groupId}/Role/{roleId}")
suspend fun apiV1GroupGroupIdRoleRoleIdDelete(@Path("groupId") groupId: kotlin.String, @Path("roleId") roleId: kotlin.String): Response<Unit>
/**
* 編輯角色 __________🔒 編輯角色
*
* Responses:
* - 204: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到社團
* - 409: 已有相同名稱的角色
*
* @param groupId 社團Id
* @param roleId 角色Id
* @param roleParam 角色參數 (optional)
* @return [Unit]
*/
@PUT("api/v1/Group/{groupId}/Role/{roleId}")
suspend fun apiV1GroupGroupIdRoleRoleIdPut(@Path("groupId") groupId: kotlin.String, @Path("roleId") roleId: kotlin.String, @Body roleParam: RoleParam? = null): Response<Unit>
/**
* 取得角色列表 (Vip)
*
* Responses:
* - 200: 成功
* - 401: Unauthorized
* - 403: Forbidden
* - 404: 找不到該社團
*
* @param groupId 社團Id
* @return [kotlin.collections.List<FanciRole>]
*/
@GET("api/v1/Group/{groupId}/VipRole")
suspend fun apiV1GroupGroupIdVipRoleGet(@Path("groupId") groupId: kotlin.String): Response<kotlin.collections.List<FanciRole>>
/**
* 新增Vip角色(限定後台使用)
*
* Responses:
* - 200: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到社團
* - 409: 已有相同名稱的角色
*
* @param groupId 社團Id
* @param roleParam 角色參數 (optional)
* @return [FanciRole]
*/
@POST("api/v1/Group/{groupId}/VipRole")
suspend fun apiV1GroupGroupIdVipRolePost(@Path("groupId") groupId: kotlin.String, @Body roleParam: RoleParam? = null): Response<FanciRole>
/**
* 取得我加入的社團清單
*
* Responses:
* - 200: 成功
* - 401: 未驗證
* - 403: 沒有權限
*
* @param startWeight 起始權重 (optional, default to 0L)
* @param pageSize 每頁筆數 (optional, default to 20)
* @return [GroupPaging]
*/
@GET("api/v1/Group/me")
suspend fun apiV1GroupMeGet(@Query("startWeight") startWeight: kotlin.Long? = 0L, @Query("pageSize") pageSize: kotlin.Int? = 20): Response<GroupPaging>
/**
* 新增社團 圖片網址長度限制100
*
* Responses:
* - 200: 成功
* - 401: 未驗證
* - 403: 沒有權限
*
* @param groupParam 新增社團參數 (optional)
* @return [Group]
*/
@POST("api/v1/Group")
suspend fun apiV1GroupPost(@Body groupParam: GroupParam? = null): Response<Group>
/**
* 取得角色列表
*
* Responses:
* - 200: 成功
* - 404: 找不到該社團
*
* @param groupId 社團Id
* @param isVip (optional)
* @return [kotlin.collections.List<FanciRole>]
*/
@GET("api/v2/Group/{groupId}/Role")
suspend fun apiV2GroupGroupIdRoleGet(@Path("groupId") groupId: kotlin.String, @Query("isVip") isVip: kotlin.Boolean? = null): Response<kotlin.collections.List<FanciRole>>
}
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/api/GroupApi.kt | 2040554313 |
package com.cmoney.fanciapi.fanci.api
import com.cmoney.fanciapi.infrastructure.CollectionFormats.*
import retrofit2.http.*
import retrofit2.Response
import okhttp3.RequestBody
import com.squareup.moshi.Json
import com.cmoney.fanciapi.fanci.model.Category
import com.cmoney.fanciapi.fanci.model.CategoryParam
import com.cmoney.fanciapi.fanci.model.Channel
import com.cmoney.fanciapi.fanci.model.ChannelPaging
import com.cmoney.fanciapi.fanci.model.ChannelParam
interface CategoryApi {
/**
* 取得分類下的頻道
*
* Responses:
* - 200: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到該分類
*
* @param categoryId 分類id
* @param startWeight 起始權重 (optional, default to 0L)
* @param pageSize 分頁筆數 (optional, default to 20)
* @return [ChannelPaging]
*/
@GET("api/v1/Category/{categoryId}/Channel")
suspend fun apiV1CategoryCategoryIdChannelGet(@Path("categoryId") categoryId: kotlin.String, @Query("startWeight") startWeight: kotlin.Long? = 0L, @Query("pageSize") pageSize: kotlin.Int? = 20): Response<ChannelPaging>
/**
* 在分類下新增頻道 __________🔒 建立頻道
*
* Responses:
* - 200: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到該分類
*
* @param categoryId 分類id
* @param channelParam 新增頻道參數 (optional)
* @return [Channel]
*/
@POST("api/v1/Category/{categoryId}/Channel")
suspend fun apiV1CategoryCategoryIdChannelPost(@Path("categoryId") categoryId: kotlin.String, @Body channelParam: ChannelParam? = null): Response<Channel>
/**
* 刪除分類 __________🔒 刪除分類
*
* Responses:
* - 204: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到該分類
*
* @param categoryId 分類Id
* @return [Unit]
*/
@DELETE("api/v1/Category/{categoryId}")
suspend fun apiV1CategoryCategoryIdDelete(@Path("categoryId") categoryId: kotlin.String): Response<Unit>
/**
* 取得特定分類
*
* Responses:
* - 200: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到該分類
*
* @param categoryId 分類id
* @return [Category]
*/
@GET("api/v1/Category/{categoryId}")
suspend fun apiV1CategoryCategoryIdGet(@Path("categoryId") categoryId: kotlin.String): Response<Category>
/**
* 重命名分類 __________🔒 編輯分類
*
* Responses:
* - 204: 成功
* - 401: 未驗證
* - 403: 沒有權限
* - 404: 找不到該分類
*
* @param categoryId 分類Id
* @param categoryParam 分類參數 (optional)
* @return [Unit]
*/
@PUT("api/v1/Category/{categoryId}/Name")
suspend fun apiV1CategoryCategoryIdNamePut(@Path("categoryId") categoryId: kotlin.String, @Body categoryParam: CategoryParam? = null): Response<Unit>
}
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/api/CategoryApi.kt | 3197536361 |
package com.cmoney.fanciapi.fanci.api
import com.cmoney.fanciapi.infrastructure.CollectionFormats.*
import retrofit2.http.*
import retrofit2.Response
import okhttp3.RequestBody
import com.squareup.moshi.Json
import com.cmoney.fanciapi.fanci.model.UserBuffInformation
interface BuffInformationApi {
/**
* 取得自己在頻道的Buff/Debuff狀態
*
* Responses:
* - 200: Success
* - 401: Unauthorized
* - 403: Forbidden
*
* @param channelId
* @return [UserBuffInformation]
*/
@GET("api/v1/BuffInformation/Channel/{channelId}/me")
suspend fun apiV1BuffInformationChannelChannelIdMeGet(@Path("channelId") channelId: kotlin.String): Response<UserBuffInformation>
/**
* 取得自己在社團的Buff/Debuff狀態
*
* Responses:
* - 200: Success
* - 401: Unauthorized
* - 403: Forbidden
*
* @param groupId
* @return [UserBuffInformation]
*/
@GET("api/v1/BuffInformation/Group/{groupId}/me")
suspend fun apiV1BuffInformationGroupGroupIdMeGet(@Path("groupId") groupId: kotlin.String): Response<UserBuffInformation>
}
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/fanci/api/BuffInformationApi.kt | 3217654264 |
package com.cmoney.fanciapi.auth
import java.io.IOException
import okhttp3.Interceptor
import okhttp3.Interceptor.Chain
import okhttp3.Response
class HttpBearerAuth(
private var schema: String = "",
var bearerToken: String = ""
) : Interceptor {
@Throws(IOException::class)
override fun intercept(chain: Chain): Response {
var request = chain.request()
// If the request already have an authorization (eg. Basic auth), do nothing
if (request.header("Authorization") == null && bearerToken.isNotBlank()) {
request = request.newBuilder()
.addHeader("Authorization", headerValue())
.build()
}
return chain.proceed(request)
}
private fun headerValue(): String {
return if (schema.isNotBlank()) {
"${upperCaseBearer()} $bearerToken"
} else {
bearerToken
}
}
private fun upperCaseBearer(): String {
return if (schema.lowercase().equals("bearer")) "Bearer" else schema
}
}
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/auth/HttpBearerAuth.kt | 4136641102 |
package com.cmoney.fanciapi.infrastructure
import com.squareup.moshi.FromJson
import com.squareup.moshi.ToJson
import java.time.OffsetDateTime
import java.time.format.DateTimeFormatter
class OffsetDateTimeAdapter {
@ToJson
fun toJson(value: OffsetDateTime): String {
return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(value)
}
@FromJson
fun fromJson(value: String): OffsetDateTime {
return OffsetDateTime.parse(value, DateTimeFormatter.ISO_OFFSET_DATE_TIME)
}
}
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/infrastructure/OffsetDateTimeAdapter.kt | 393599739 |
package com.cmoney.fanciapi.infrastructure
import com.squareup.moshi.FromJson
import com.squareup.moshi.ToJson
import java.net.URI
class URIAdapter {
@ToJson
fun toJson(uri: URI) = uri.toString()
@FromJson
fun fromJson(s: String): URI = URI.create(s)
}
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/infrastructure/URIAdapter.kt | 3274806700 |
package com.cmoney.fanciapi.infrastructure
import com.squareup.moshi.Moshi
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
object Serializer {
@JvmStatic
val moshiBuilder: Moshi.Builder = Moshi.Builder()
.add(OffsetDateTimeAdapter())
.add(LocalDateTimeAdapter())
.add(LocalDateAdapter())
.add(UUIDAdapter())
.add(ByteArrayAdapter())
.add(URIAdapter())
.add(KotlinJsonAdapterFactory())
.add(BigDecimalAdapter())
.add(BigIntegerAdapter())
@JvmStatic
val moshi: Moshi by lazy {
moshiBuilder.build()
}
}
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/infrastructure/Serializer.kt | 114842230 |
package com.cmoney.fanciapi.infrastructure
import com.squareup.moshi.FromJson
import com.squareup.moshi.ToJson
import java.time.LocalDate
import java.time.format.DateTimeFormatter
class LocalDateAdapter {
@ToJson
fun toJson(value: LocalDate): String {
return DateTimeFormatter.ISO_LOCAL_DATE.format(value)
}
@FromJson
fun fromJson(value: String): LocalDate {
return LocalDate.parse(value, DateTimeFormatter.ISO_LOCAL_DATE)
}
}
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/infrastructure/LocalDateAdapter.kt | 2450675449 |
package com.cmoney.fanciapi.infrastructure
import com.squareup.moshi.FromJson
import com.squareup.moshi.ToJson
class ByteArrayAdapter {
@ToJson
fun toJson(data: ByteArray): String = String(data)
@FromJson
fun fromJson(data: String): ByteArray = data.toByteArray()
}
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/infrastructure/ByteArrayAdapter.kt | 2200352120 |
package com.cmoney.fanciapi.infrastructure
class CollectionFormats {
open class CSVParams {
var params: List<String>
constructor(params: List<String>) {
this.params = params
}
constructor(vararg params: String) {
this.params = listOf(*params)
}
override fun toString(): String {
return params.joinToString(",")
}
}
open class SSVParams : CSVParams {
constructor(params: List<String>) : super(params)
constructor(vararg params: String) : super(*params)
override fun toString(): String {
return params.joinToString(" ")
}
}
class TSVParams : CSVParams {
constructor(params: List<String>) : super(params)
constructor(vararg params: String) : super(*params)
override fun toString(): String {
return params.joinToString("\t")
}
}
class PIPESParams : CSVParams {
constructor(params: List<String>) : super(params)
constructor(vararg params: String) : super(*params)
override fun toString(): String {
return params.joinToString("|")
}
}
class SPACEParams : SSVParams()
} | Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/infrastructure/CollectionFormats.kt | 2631734189 |
package com.cmoney.fanciapi.infrastructure
import com.squareup.moshi.FromJson
import com.squareup.moshi.ToJson
import java.math.BigDecimal
class BigDecimalAdapter {
@ToJson
fun toJson(value: BigDecimal): String {
return value.toPlainString()
}
@FromJson
fun fromJson(value: String): BigDecimal {
return BigDecimal(value)
}
}
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/infrastructure/BigDecimalAdapter.kt | 8031353 |
package com.cmoney.fanciapi.infrastructure
import com.squareup.moshi.FromJson
import com.squareup.moshi.ToJson
import java.util.UUID
class UUIDAdapter {
@ToJson
fun toJson(uuid: UUID) = uuid.toString()
@FromJson
fun fromJson(s: String): UUID = UUID.fromString(s)
}
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/infrastructure/UUIDAdapter.kt | 3358933428 |
package com.cmoney.fanciapi.infrastructure
import com.squareup.moshi.JsonDataException
import com.squareup.moshi.Moshi
import retrofit2.Response
@Throws(JsonDataException::class)
inline fun <reified T> Response<*>.getErrorResponse(serializerBuilder: Moshi.Builder = Serializer.moshiBuilder): T? {
val serializer = serializerBuilder.build()
val parser = serializer.adapter(T::class.java)
val response = errorBody()?.string()
if (response != null) {
return parser.fromJson(response)
}
return null
}
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/infrastructure/ResponseExt.kt | 597480002 |
package com.cmoney.fanciapi.infrastructure
import com.squareup.moshi.FromJson
import com.squareup.moshi.ToJson
import java.math.BigInteger
class BigIntegerAdapter {
@ToJson
fun toJson(value: BigInteger): String {
return value.toString()
}
@FromJson
fun fromJson(value: String): BigInteger {
return BigInteger(value)
}
}
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/infrastructure/BigIntegerAdapter.kt | 4292105941 |
package com.cmoney.fanciapi.infrastructure
import com.squareup.moshi.FromJson
import com.squareup.moshi.ToJson
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
class LocalDateTimeAdapter {
@ToJson
fun toJson(value: LocalDateTime): String {
return DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(value)
}
@FromJson
fun fromJson(value: String): LocalDateTime {
return LocalDateTime.parse(value, DateTimeFormatter.ISO_LOCAL_DATE_TIME)
}
}
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/infrastructure/LocalDateTimeAdapter.kt | 2807913375 |
package com.cmoney.fanciapi.infrastructure
import com.cmoney.fanciapi.auth.HttpBearerAuth
import okhttp3.Call
import okhttp3.Interceptor
import okhttp3.OkHttpClient
import retrofit2.Retrofit
import okhttp3.logging.HttpLoggingInterceptor
import retrofit2.Converter
import retrofit2.converter.scalars.ScalarsConverterFactory
import com.squareup.moshi.Moshi
import retrofit2.converter.moshi.MoshiConverterFactory
class ApiClient(
private var baseUrl: String = defaultBasePath,
private val okHttpClientBuilder: OkHttpClient.Builder? = null,
private val serializerBuilder: Moshi.Builder = Serializer.moshiBuilder,
private val callFactory : Call.Factory? = null,
private val converterFactory: Converter.Factory? = null,
) {
private val apiAuthorizations = mutableMapOf<String, Interceptor>()
var logger: ((String) -> Unit)? = null
private val retrofitBuilder: Retrofit.Builder by lazy {
Retrofit.Builder()
.baseUrl(baseUrl)
.addConverterFactory(ScalarsConverterFactory.create())
.addConverterFactory(MoshiConverterFactory.create(serializerBuilder.build()))
.apply {
if (converterFactory != null) {
addConverterFactory(converterFactory)
}
}
}
private val clientBuilder: OkHttpClient.Builder by lazy {
okHttpClientBuilder ?: defaultClientBuilder
}
private val defaultClientBuilder: OkHttpClient.Builder by lazy {
OkHttpClient()
.newBuilder()
.addInterceptor(HttpLoggingInterceptor { message -> logger?.invoke(message) }
.apply { level = HttpLoggingInterceptor.Level.BODY }
)
}
init {
normalizeBaseUrl()
}
constructor(
baseUrl: String = defaultBasePath,
okHttpClientBuilder: OkHttpClient.Builder? = null,
serializerBuilder: Moshi.Builder = Serializer.moshiBuilder,
authNames: Array<String>
) : this(baseUrl, okHttpClientBuilder, serializerBuilder) {
authNames.forEach { authName ->
val auth = when (authName) {
"oauth2" -> HttpBearerAuth("bearer")
else -> throw RuntimeException("auth name $authName not found in available auth names")
}
addAuthorization(authName, auth)
}
}
constructor(
baseUrl: String = defaultBasePath,
okHttpClientBuilder: OkHttpClient.Builder? = null,
serializerBuilder: Moshi.Builder = Serializer.moshiBuilder,
authName: String,
bearerToken: String
) : this(baseUrl, okHttpClientBuilder, serializerBuilder, arrayOf(authName)) {
setBearerToken(bearerToken)
}
fun setBearerToken(bearerToken: String): ApiClient {
apiAuthorizations.values.runOnFirst<Interceptor, HttpBearerAuth> {
this.bearerToken = bearerToken
}
return this
}
/**
* Adds an authorization to be used by the client
* @param authName Authentication name
* @param authorization Authorization interceptor
* @return ApiClient
*/
fun addAuthorization(authName: String, authorization: Interceptor): ApiClient {
if (apiAuthorizations.containsKey(authName)) {
throw RuntimeException("auth name $authName already in api authorizations")
}
apiAuthorizations[authName] = authorization
clientBuilder.addInterceptor(authorization)
return this
}
fun setLogger(logger: (String) -> Unit): ApiClient {
this.logger = logger
return this
}
fun <S> createService(serviceClass: Class<S>): S {
val usedCallFactory = this.callFactory ?: clientBuilder.build()
return retrofitBuilder.callFactory(usedCallFactory).build().create(serviceClass)
}
private fun normalizeBaseUrl() {
if (!baseUrl.endsWith("/")) {
baseUrl += "/"
}
}
private inline fun <T, reified U> Iterable<T>.runOnFirst(callback: U.() -> Unit) {
for (element in this) {
if (element is U) {
callback.invoke(element)
break
}
}
}
companion object {
@JvmStatic
protected val baseUrlKey = "com.cmoney.fanciapi.baseUrl"
@JvmStatic
val defaultBasePath: String by lazy {
System.getProperties().getProperty(baseUrlKey, "http://34.80.212.140/fanci")
}
}
}
| Fanci/fancyapi/src/main/java/com/cmoney/fanciapi/infrastructure/ApiClient.kt | 2543244109 |
package com.example.employeedirectory
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.Assert.*
/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.example.employeedirectory", appContext.packageName)
}
} | Employee_Directory/app/src/androidTest/java/com/example/employeedirectory/ExampleInstrumentedTest.kt | 1246875218 |
package com.example.employeedirectory
import org.junit.Test
import org.junit.Assert.*
/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class ExampleUnitTest {
@Test
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
} | Employee_Directory/app/src/test/java/com/example/employeedirectory/ExampleUnitTest.kt | 1694054419 |
package com.example.employeedirectory
data class Employee(val empId: String? = null, val empName: String? = null, val empPhone: String? = null) {
// Null default values create a no-argument default constructor, which is needed
// for deserialization from a DataSnapshot.
//Parameters used to create document fields
} | Employee_Directory/app/src/main/java/com/example/employeedirectory/Employee.kt | 332335471 |
package com.example.employeedirectory
import android.annotation.SuppressLint
import android.content.ClipboardManager
import android.content.Intent
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Button
import android.widget.ImageButton
import android.widget.TextView
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.google.firebase.firestore.FirebaseFirestore
import com.google.firebase.firestore.ktx.firestore
import com.google.firebase.ktx.Firebase
class MainActivity : AppCompatActivity() {
private var db = Firebase.firestore
private lateinit var empList: ArrayList<Employee>
@SuppressLint("MissingInflatedId")
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val addNew: Button = findViewById(R.id.btnNew)
val rvEmps: RecyclerView = findViewById(R.id.rvEmps)
rvEmps.layoutManager = LinearLayoutManager(this)
empList = arrayListOf()
db = FirebaseFirestore.getInstance()
//Read all Documents from EmpDir Collection
db.collection("EmpDir")
.get()
.addOnSuccessListener {
if(!it.isEmpty){
for(data in it.documents){
val emp: Employee? = data.toObject(Employee::class.java)
if(emp != null){
empList.add(emp)
}
}
rvEmps.adapter = EmpAdapter(empList)
}
}
.addOnFailureListener{
Toast.makeText(this, it.toString(), Toast.LENGTH_SHORT).show()
}
addNew.setOnClickListener {
val intent = Intent(this, AddEmployee::class.java)
startActivity(intent)
}
}
inner class EmpAdapter (private val empList: ArrayList<Employee>) : RecyclerView.Adapter<EmpAdapter.ViewHolder>() {
//Adapter controls interaction with UI
inner class ViewHolder(itemView: View): RecyclerView.ViewHolder(itemView){
val id: TextView = itemView.findViewById(R.id.tvID)
val name: TextView = itemView.findViewById(R.id.tvName)
val phone: TextView = itemView.findViewById(R.id.tvPhone)
val ibDelete: ImageButton = itemView.findViewById(R.id.ibDelete)
val ibEdit: ImageButton = itemView.findViewById(R.id.ibEdit)
val ibCopy: ImageButton = itemView.findViewById(R.id.ibCopy)
val ibShare: ImageButton = itemView.findViewById(R.id.ibShare)
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
val itemView = LayoutInflater.from(parent.context)
.inflate(R.layout.row, parent, false)
return ViewHolder(itemView)
}
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
holder.id.text = empList[position].empId
holder.name.text = empList[position].empName
holder.phone.text = empList[position].empPhone
//Copy list item to device clipboard
holder.ibCopy.setOnClickListener {
val str = holder.id.text.toString() + "\n" + holder.name.text.toString() + "\n" + holder.phone.text.toString()
val clip = getSystemService(CLIPBOARD_SERVICE) as ClipboardManager
clip.text = str
Toast.makeText(this@MainActivity, "Copied...", Toast.LENGTH_SHORT).show()
}
//Returns Document ID from EmpID search to facilitate Document deletion
holder.ibDelete.setOnClickListener {
var docID: String = ""
db.collection("EmpDir")
.whereEqualTo("empId", holder.id.text.toString())
.get()
.addOnSuccessListener { documents ->
for (document in documents) {
Toast.makeText(this@MainActivity, document.id, Toast.LENGTH_SHORT).show()
docID = document.id
}
db.collection("EmpDir").document(docID)
.delete()
.addOnSuccessListener { Toast.makeText(this@MainActivity, "Record successfully deleted.", Toast.LENGTH_SHORT).show() }
.addOnFailureListener { Toast.makeText(this@MainActivity, "Error deleting document!", Toast.LENGTH_SHORT).show() }
}
}
//Pass list item data to Activity for editing
holder.ibEdit.setOnClickListener {
val intent = Intent(this@MainActivity, AddEmployee::class.java)
intent.putExtra("EmpID", holder.id.text.toString())
intent.putExtra("EmpName", holder.name.text.toString())
intent.putExtra("EmpPhone", holder.phone.text.toString())
startActivity(intent)
}
//Share list item using device share options
holder.ibShare.setOnClickListener{
val str = holder.id.text.toString() + "\n" + holder.name.text.toString() + "\n" + holder.phone.text.toString()
val sendIntent: Intent = Intent().apply {
action = Intent.ACTION_SEND
putExtra(Intent.EXTRA_TEXT, str)
type = "text/plain"
}
val shareIntent = Intent.createChooser(sendIntent, null)
startActivity(shareIntent)
}
}
override fun getItemCount(): Int {
return empList.size
}
}
} | Employee_Directory/app/src/main/java/com/example/employeedirectory/MainActivity.kt | 1639765830 |
package com.example.employeedirectory
import android.content.Intent
import android.os.Bundle
import android.widget.Button
import android.widget.EditText
import android.widget.TextView
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import com.google.firebase.Firebase
import com.google.firebase.firestore.firestore
class AddEmployee : AppCompatActivity() {
var id = "0"
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_add_employee)
val eID: TextView = findViewById(R.id.etEmpID)
val eName: EditText = findViewById(R.id.etEmpName)
val ePhone: EditText = findViewById(R.id.etEmpPhone)
val addEmp: Button = findViewById(R.id.btnAdd)
//Read values from Main Activity and set id flag
try{
val extras = intent.extras
if (extras != null) {
id = extras.getString("EmpID", "0")
}
Toast.makeText(this, id, Toast.LENGTH_SHORT).show()
//Reconfigure Add Employee layout for Update action
if(id.toInt()!=0){
addEmp.text = "Update Employee"
eID.text = extras?.getString("EmpID")
eName.setText(extras?.getString("EmpName"))
ePhone.setText(extras?.getString("EmpPhone"))
}
} catch(ex: Exception){}
addEmp.setOnClickListener{
val db = Firebase.firestore
//Add Employee document process
if(id.toInt()==0) {
if (eID.text.isEmpty() || eName.text.isEmpty() || ePhone.text.isEmpty()) {
Toast.makeText(this, "Please complete all fields!", Toast.LENGTH_SHORT).show()
} else {
val employee =
Employee(eID.text.toString(), eName.text.toString(), ePhone.text.toString())
db.collection("EmpDir")
.add(employee)
Toast.makeText(this, "Employee added successfully", Toast.LENGTH_SHORT).show()
startActivity(Intent(this, MainActivity::class.java))
}
}else{
//Update Employee document process
var docID: String = ""
db.collection("EmpDir")
.whereEqualTo("empId", eID.text.toString())
.get()
.addOnSuccessListener { documents ->
for (document in documents) {
docID = document.id
}
db.collection("EmpDir").document(docID)
.update(
mapOf(
"empId" to eID.text.toString(),
"empName" to eName.text.toString(),
"empPhone" to ePhone.text.toString()
)
)
.addOnSuccessListener {
Toast.makeText(this, "Document successfully updated.", Toast.LENGTH_SHORT).show()
startActivity(Intent(this, MainActivity::class.java))
}
.addOnFailureListener { Toast.makeText(this, "Error updating document!", Toast.LENGTH_SHORT).show() }
}
}
}
}
} | Employee_Directory/app/src/main/java/com/example/employeedirectory/AddEmployee.kt | 2132512023 |
package ru.otus.otuskotlin.marketplace.plugin
import org.gradle.accessors.dm.LibrariesForLibs
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.tasks.compile.JavaCompile
import org.gradle.jvm.toolchain.JavaLanguageVersion
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.the
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
internal class BuildPluginMultiplatform : Plugin<Project> {
override fun apply(project: Project) = with(project) {
pluginManager.apply("org.jetbrains.kotlin.multiplatform")
group = rootProject.group
version = rootProject.version
plugins.withId("org.jetbrains.kotlin.multiplatform") {
extensions.configure<KotlinMultiplatformExtension> {
configureTargets(this@with)
sourceSets.configureEach {
languageSettings.apply {
languageVersion = "1.9"
progressiveMode = true
optIn("kotlin.time.ExperimentalTime")
}
}
}
}
}
}
private fun KotlinMultiplatformExtension.configureTargets(project: Project) {
val libs = project.the<LibrariesForLibs>()
targets {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(libs.versions.jvm.language.get()))
}
jvm {
compilations.configureEach {
compilerOptions.configure {
jvmTarget.set(JvmTarget.valueOf("JVM_${libs.versions.jvm.compiler.get()}"))
}
}
}
linuxX64()
macosArm64()
macosX64()
}
project.tasks.withType(JavaCompile::class.java) {
sourceCompatibility = libs.versions.jvm.language.get()
targetCompatibility = libs.versions.jvm.compiler.get()
}
}
| otus/build-plugin/src/main/kotlin/BuildPluginMultiplatform.kt | 226708352 |
package ru.otus.otuskotlin.marketplace.plugin
import org.gradle.api.Plugin
import org.gradle.api.Project
@Suppress("unused")
internal class BuildPluginJvm : Plugin<Project> {
override fun apply(project: Project) = with(project) {
pluginManager.apply("org.jetbrains.kotlin.jvm")
group = rootProject.group
version = rootProject.version
}
}
| otus/build-plugin/src/main/kotlin/BuildPluginJvm.kt | 990708889 |
package ru.otus.otuskotlin.interop
import kotlin.test.Test
import kotlin.test.assertEquals
class RustExampleTest {
@Test
fun rustExampleTest() {
val re = RustExample()
assertEquals(5, re.rust_add(3, 2))
}
}
| otus/lessons/m2l5-gradle/src/jvmTest/kotlin/RustExampleTest.kt | 2914678139 |
package ru.otus.otuskotlin.interop
class RustExample {
external fun rust_add(a: Int, b: Int): Int
init {
System.loadLibrary("c_jni")
}
}
| otus/lessons/m2l5-gradle/src/jvmMain/kotlin/RustExample.kt | 4130054944 |
package ru.otus.otuskotlin.coroutines
import org.junit.Test
import java.util.concurrent.CompletableFuture
class Ex2Future {
private fun someMethod(): CompletableFuture<String> = CompletableFuture.supplyAsync {
println("Some method")
Thread.sleep(1000)
//throw RuntimeException("Error")
"Some data"
}
private fun otherMethod(a: Int, throwPlace: Int = 0): CompletableFuture<Int> {
if (throwPlace == 1) throw RuntimeException("1")
return CompletableFuture.supplyAsync {
println("Other method")
if (throwPlace == 2) throw RuntimeException("2")
Thread.sleep(1000)
a * 2
}
}
@Test
fun future() {
someMethod()
.thenApply {
println("Apply")
it.length
}
.thenCompose {
otherMethod(it)
}
.handle { num, ex ->
if (ex != null) {
println("Exception $ex")
} else {
println("Complete $num")
}
}
.get()
println("Complete")
//Thread.sleep(3000)
}
@Test
fun exception() {
CompletableFuture.completedFuture(42)
.thenCompose {
try {
otherMethod(it, 1)
} catch (e: Exception) {
println("ThenCompose $e")
CompletableFuture.completedFuture(42)
}
}
.get()
println("Complete")
}
}
| otus/lessons/m2l1-coroutines/src/test/kotlin/ex2-Future.kt | 4112313909 |
package ru.otus.otuskotlin.coroutines
import kotlinx.coroutines.delay
import kotlinx.coroutines.runBlocking
import kotlin.test.Test
/**
* How to decompile file in IDEA
*
* 1. Select class: build -> classes -> kotlin -> main -> continuation -> DecompileMePleaseKt.class
* 2. Decompile: Tools -> Kotlin -> Decompile to Java
*/
class Ex4Decompile {
private suspend fun someMethod(): String {
var a = 1
var b = "x"
println("1 $a $b")
delay(100)
a += otherMethod(5)
b += "y"
println("2 $a $b")
delay(200)
a += 3
b = withCatch(b)
println("3 $a $b")
return "Some data $a $b"
}
// можете самостоятельно посмотреть во что декомпилируются остальные функции
private suspend fun otherMethod(a: Int): Int {
if (a == 0) return -1
var b = a
for (i in 1..10) {
delay(50)
b += 2
}
return b
}
private suspend fun withCatch(a: String): String {
try {
delay(100)
} catch(e: Exception) {
return "ex"
}
return "$a ok"
}
@Test
fun coro(): Unit = runBlocking {// ***
someMethod()
}
}
| otus/lessons/m2l1-coroutines/src/test/kotlin/ex4-Decompile.kt | 457361200 |
package ru.otus.otuskotlin.coroutines
import kotlin.concurrent.thread
import kotlin.test.Test
class Ex1Thread {
@Test
fun thr() {
thread {
println("Hello, thread started")
try {
for (i in 1..10) {
println("i = $i")
Thread.sleep(100)
if (i == 6) throw RuntimeException("Some error")
}
} catch (e: Exception) {
println("Exception")
}
}.join()
println("Thread complete")
}
}
| otus/lessons/m2l1-coroutines/src/test/kotlin/ex1-Thread.kt | 1898283115 |
package ru.otus.otuskotlin.coroutines
import kotlinx.coroutines.*
import kotlin.test.Test
class Ex5Job {
private fun CoroutineScope.createJob(name: String, start: CoroutineStart = CoroutineStart.DEFAULT) =
launch(start = start) {
delay(10)
println("start $name")
delay(1000)
println("complete $name")
}
@Test
fun join(): Unit = runBlocking {
val job1 = createJob("1")
job1.join()
println("After join")
}
@Test
fun manualStart(): Unit = runBlocking {
val job1 = createJob("1", start = CoroutineStart.LAZY)
delay(50)
println("Manual start")
job1.start()
}
@Test
fun dontStart(): Unit = runBlocking {
val job1 = createJob("1", start = CoroutineStart.LAZY)
delay(50)
job1.join()
}
@Test
fun cancel(): Unit = runBlocking {
val job1 = createJob("1")
delay(50)
job1.cancel()
println("After cancel")
}
@Suppress("RedundantSuspendModifier")
private suspend fun x() {
@Suppress("BlockingMethodInNonBlockingContext")
Thread.sleep(10)
}
@Test
fun cancelTrouble(): Unit = runBlocking(Dispatchers.Default) {
val job1 = launch {
for (i in 1..1000) {
x()
//if (!isActive) break
}
println("Job complete")
}
delay(50)
println("Before cancel")
job1.cancel()
println("After cancel")
}
@Test
fun scope() {
val scope = CoroutineScope(Job())
scope.createJob("1")
scope.createJob("2")
Thread.sleep(500)
scope.cancel()
}
@Test
fun scopeHierarchy(): Unit = runBlocking {
println("top $this")
val job1 = launch {
println("job1 block $this")
val myJob = this.coroutineContext.job
println("job1 myJob $myJob")
val job2 = launch {
println("job2 block $this")
}
println("job2 $job2")
}
println("job1 $job1")
}
}
| otus/lessons/m2l1-coroutines/src/test/kotlin/ex5-Job.kt | 611731550 |
@file:Suppress("UNUSED_PARAMETER")
package ru.otus.otuskotlin.coroutines
import kotlinx.coroutines.*
import org.junit.Test
import java.util.concurrent.atomic.AtomicInteger
class Ex3Coroutines {
private suspend fun someMethod(): String { // ***
println("Some method")
delay(1000) // ***
return "Some data"
}
private suspend fun otherMethod(a: Int, throwPlace: Int = 0): Int {
if (throwPlace == 1) throw RuntimeException("1")
println("Other method")
if (throwPlace == 2) throw RuntimeException("2")
delay(1000)
return a * 2
}
@Suppress("unused")
fun x() {
// someMethod()
}
@Test
fun coro(): Unit = runBlocking {// ***
launch {// ***
try {
val str = someMethod()
println("Apply")
val len = str.length
val num = otherMethod(len)
println("Complete $num")
} catch (ex: Exception) {
println("Exception $ex")
}
}.join()
println("Complete")
}
fun doSomething(block: suspend (Int) -> Unit) {
}
fun simpleMethod(i: Int) {
}
@Test
fun signature(): Unit = runBlocking {
val list = listOf(1, 2, 3)
list.forEach { otherMethod(it) } // это работает, потому что inline
// list.forEach (Consumer { otherMethod(it) }) // это не работает, потому что ждут обычную функцию
doSomething(::otherMethod) // ждут suspend и передаем его
doSomething(::simpleMethod) // ждут suspend, передаем обычный метод - это ок, котлин вставит преобразование
}
@Test
fun launch2(): Unit = runBlocking {// ***
launch {// ***
for (i in 1..10) {
println("coro1 $i")
delay(100)
}
}
launch {// ***
for (i in 1..10) {
println("coro2 $i")
delay(110)
}
}
}
@Test
fun launchMany(): Unit = runBlocking {// ***
val counter = AtomicInteger()
var dummyCounter = 0
println("START")
@OptIn(DelicateCoroutinesApi::class)
newFixedThreadPoolContext(10, "fixed").use { fixThreadDispatcher ->
launch {
for (i in 0..1_000_000) {
launch(fixThreadDispatcher) {
delay(100)
counter.incrementAndGet()
dummyCounter++
}
}
}.join()
}
println("COMPLETE ${counter.get()} Dummy: $dummyCounter")
}
}
| otus/lessons/m2l1-coroutines/src/test/kotlin/ex3-Coroutines.kt | 2276770228 |
package ru.otus.otuskotlin.coroutines.homework.easy
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.*
import kotlin.test.Test
class HWEasy {
@Test
fun easyHw(): Unit = runBlocking(Dispatchers.Default) {
val numbers = generateNumbers()
val toFind = 10
val toFindOther = 1000
val foundNumbers = listOf(
async {
findNumberInList(toFind, numbers)
},
async {
findNumberInList(toFindOther, numbers)
}
).awaitAll()
foundNumbers.forEach {
if (it != -1) {
println("Your number $it found!")
} else {
println("Not found number $toFind || $toFindOther")
}
}
}
}
| otus/lessons/m2l1-coroutines/src/test/kotlin/homework/easy/HWEasy.kt | 1048596340 |
package ru.otus.otuskotlin.coroutines.homework.easy
fun generateNumbers() = (0..10000).map {
(0..100).random()
}
| otus/lessons/m2l1-coroutines/src/test/kotlin/homework/easy/generateNumbers.kt | 1010295570 |
package ru.otus.otuskotlin.coroutines.homework.easy
fun findNumberInList(toFind: Int, numbers: List<Int>): Int {
Thread.sleep(2000L)
return numbers.firstOrNull { it == toFind } ?: -1
}
| otus/lessons/m2l1-coroutines/src/test/kotlin/homework/easy/findNumberInList.kt | 633812314 |
package ru.otus.otuskotlin.coroutines.homework.hard.dto
import com.fasterxml.jackson.annotation.JsonIgnoreProperties
@JsonIgnoreProperties(ignoreUnknown = true)
data class Meaning(
val definitions: List<Definition>
)
@JsonIgnoreProperties(ignoreUnknown = true)
data class Definition(
val definition: String,
val example: String? = ""
)
| otus/lessons/m2l1-coroutines/src/test/kotlin/homework/hard/dto/Meaning.kt | 4262852961 |
package ru.otus.otuskotlin.coroutines.homework.hard.dto
import com.fasterxml.jackson.annotation.JsonIgnoreProperties
@JsonIgnoreProperties(ignoreUnknown = true)
data class Dictionary(
val word: String,
val meanings: List<Meaning>
)
| otus/lessons/m2l1-coroutines/src/test/kotlin/homework/hard/dto/Dictionary.kt | 3588931846 |
package ru.otus.otuskotlin.coroutines.homework.hard
@Suppress("unused")
enum class Locale(val code: String) {
EN("en_US"),
RU("ru")
}
| otus/lessons/m2l1-coroutines/src/test/kotlin/homework/hard/Locale.kt | 2537947822 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.