refactor(account): 移除卡类型字段、优化账号列表查询和权限检查
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 6m18s

- 移除 IoT 卡和号卡的 card_type 字段(数据库迁移)
- 优化账号列表查询,支持按店铺和企业筛选
- 账号响应增加店铺名称和企业名称字段
- 实现批量加载店铺和企业名称,避免 N+1 查询
- 更新权限检查中间件,完善权限验证逻辑
- 更新相关测试用例,确保功能正确性
This commit is contained in:
2026-02-03 10:59:44 +08:00
parent ad6d43e0cd
commit fba8e9e76b
31 changed files with 409 additions and 145 deletions

View File

@@ -19,7 +19,7 @@ func TestGatewayCard_GetStatus(t *testing.T) {
card := &model.IotCard{
ICCID: "89860001234567890001",
CardType: "data_card",
CarrierID: 1,
Status: 1,
}
@@ -48,7 +48,7 @@ func TestGatewayCard_GetStatus(t *testing.T) {
card2 := &model.IotCard{
ICCID: "89860001234567890002",
CardType: "data_card",
CarrierID: 1,
Status: 1,
ShopID: &shop2.ID,
@@ -78,7 +78,7 @@ func TestGatewayCard_GetFlow(t *testing.T) {
card := &model.IotCard{
ICCID: "89860001234567890003",
CardType: "data_card",
CarrierID: 1,
Status: 1,
}
@@ -107,7 +107,7 @@ func TestGatewayCard_GetFlow(t *testing.T) {
card2 := &model.IotCard{
ICCID: "89860001234567890004",
CardType: "data_card",
CarrierID: 1,
Status: 1,
ShopID: &shop2.ID,
@@ -137,7 +137,7 @@ func TestGatewayCard_GetRealname(t *testing.T) {
card := &model.IotCard{
ICCID: "89860001234567890005",
CardType: "data_card",
CarrierID: 1,
Status: 1,
}
@@ -166,7 +166,7 @@ func TestGatewayCard_GetRealname(t *testing.T) {
card2 := &model.IotCard{
ICCID: "89860001234567890006",
CardType: "data_card",
CarrierID: 1,
Status: 1,
ShopID: &shop2.ID,
@@ -196,7 +196,7 @@ func TestGatewayCard_GetRealnameLink(t *testing.T) {
card := &model.IotCard{
ICCID: "89860001234567890007",
CardType: "data_card",
CarrierID: 1,
Status: 1,
}
@@ -225,7 +225,7 @@ func TestGatewayCard_GetRealnameLink(t *testing.T) {
card2 := &model.IotCard{
ICCID: "89860001234567890008",
CardType: "data_card",
CarrierID: 1,
Status: 1,
ShopID: &shop2.ID,
@@ -255,7 +255,7 @@ func TestGatewayCard_StopCard(t *testing.T) {
card := &model.IotCard{
ICCID: "89860001234567890009",
CardType: "data_card",
CarrierID: 1,
Status: 1,
}
@@ -284,7 +284,7 @@ func TestGatewayCard_StopCard(t *testing.T) {
card2 := &model.IotCard{
ICCID: "89860001234567890010",
CardType: "data_card",
CarrierID: 1,
Status: 1,
ShopID: &shop2.ID,
@@ -314,7 +314,7 @@ func TestGatewayCard_StartCard(t *testing.T) {
card := &model.IotCard{
ICCID: "89860001234567890011",
CardType: "data_card",
CarrierID: 1,
Status: 1,
}
@@ -343,7 +343,7 @@ func TestGatewayCard_StartCard(t *testing.T) {
card2 := &model.IotCard{
ICCID: "89860001234567890012",
CardType: "data_card",
CarrierID: 1,
Status: 1,
ShopID: &shop2.ID,