-
Notifications
You must be signed in to change notification settings - Fork 0
/
IMFeature.kt
28 lines (19 loc) · 844 Bytes
/
IMFeature.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package com.hiwangzi.luv.feature
import com.hiwangzi.luv.feature.impl.IMFeatureImpl
import com.hiwangzi.luv.model.resource.IMGroup
import com.hiwangzi.luv.model.resource.IMMessage
import com.hiwangzi.luv.model.resource.User
import io.vertx.core.Future
import io.vertx.core.Vertx
fun imFeatureOf(vertx: Vertx): IMFeature {
return IMFeatureImpl(vertx)
}
interface IMFeature {
fun listMemberIdsByGroupId(groupId: String): Future<List<String>>
fun listMembersByGroupId(groupId: String): Future<List<User>>
fun listGroupsByUserId(userId: String): Future<List<IMGroup>>
// TODO pagination
fun listMessagesByGroupId(groupId: String): Future<List<IMMessage>>
fun saveMessage(groupId: String, message: IMMessage): Future<IMMessage>
fun createNewGroup(platformId: String, creatorId: String, inviteeId: String): Future<IMGroup>
}