fix(test): 修复 CI 测试和 lint 错误

- 为所有 mock 实现添加 GetByIDs 方法以满足 AccountRepository 接口
- 重构 account_handler.go 中的类型断言,使用类型安全的变量
- 修复 gofmt 格式问题
This commit is contained in:
IanShaw027
2026-01-01 15:16:12 +08:00
parent 48764e15a5
commit c63192fcb5
7 changed files with 43 additions and 17 deletions

View File

@@ -40,6 +40,10 @@ func (s *accountRepoStub) GetByID(ctx context.Context, id int64) (*Account, erro
panic("unexpected GetByID call")
}
func (s *accountRepoStub) GetByIDs(ctx context.Context, ids []int64) ([]*Account, error) {
panic("unexpected GetByIDs call")
}
// ExistsByID 返回预设的存在性检查结果。
// 这是 Delete 方法调用的第一个仓储方法,用于验证账号是否存在。
func (s *accountRepoStub) ExistsByID(ctx context.Context, id int64) (bool, error) {