-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: attachment table field. feat: cache expiration for checkin code.…
… feat: get event invitee.
- Loading branch information
Showing
23 changed files
with
290 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
src/main/java/fun/sast/evento/lark/domain/lark/service/LarkUserService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package fun.sast.evento.lark.domain.lark.service; | ||
|
||
import fun.sast.evento.lark.domain.lark.value.LarkUser; | ||
|
||
import java.util.List; | ||
|
||
public interface LarkUserService { | ||
|
||
List<LarkUser> list(List<String> users); | ||
} |
46 changes: 46 additions & 0 deletions
46
src/main/java/fun/sast/evento/lark/domain/lark/service/impl/LarkUserServiceImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package fun.sast.evento.lark.domain.lark.service.impl; | ||
|
||
import com.lark.oapi.service.contact.v3.model.BatchUserReq; | ||
import com.lark.oapi.service.contact.v3.model.BatchUserResp; | ||
import fun.sast.evento.lark.domain.lark.service.LarkUserService; | ||
import fun.sast.evento.lark.domain.lark.value.LarkUser; | ||
import fun.sast.evento.lark.infrastructure.error.BusinessException; | ||
import fun.sast.evento.lark.infrastructure.error.ErrorEnum; | ||
import fun.sast.evento.lark.infrastructure.lark.OApi; | ||
import jakarta.annotation.Resource; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.stereotype.Service; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
@Service | ||
@Slf4j | ||
public class LarkUserServiceImpl implements LarkUserService { | ||
|
||
@Resource | ||
private OApi oApi; | ||
|
||
@Override | ||
public List<LarkUser> list(List<String> users) { | ||
if (users.isEmpty()) { | ||
return List.of(); | ||
} | ||
try { | ||
String[] userIds = users.toArray(new String[0]); | ||
BatchUserResp resp = oApi.getClient().contact().user().batch(BatchUserReq.newBuilder().userIds(userIds).build()); | ||
if (!resp.success()) { | ||
log.error("failed to list room: {}", resp.getMsg()); | ||
throw new BusinessException(ErrorEnum.LARK_ERROR_LIST_USER, resp.getMsg()); | ||
} | ||
return Arrays.stream(resp.getData().getItems()).map(user -> new LarkUser( | ||
user.getOpenId(), | ||
user.getName(), | ||
user.getAvatar().getAvatar240() | ||
)).toList(); | ||
} catch (Exception e) { | ||
log.error("list user error: {}", e.getMessage()); | ||
throw new RuntimeException(e.getMessage(), e); | ||
} | ||
} | ||
} |
Oops, something went wrong.