refactor(account): 移除卡类型字段、优化账号列表查询和权限检查
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 6m18s
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 6m18s
- 移除 IoT 卡和号卡的 card_type 字段(数据库迁移) - 优化账号列表查询,支持按店铺和企业筛选 - 账号响应增加店铺名称和企业名称字段 - 实现批量加载店铺和企业名称,避免 N+1 查询 - 更新权限检查中间件,完善权限验证逻辑 - 更新相关测试用例,确保功能正确性
This commit is contained in:
@@ -25,14 +25,14 @@ func TestAuthorization_List(t *testing.T) {
|
||||
card1 := &model.IotCard{
|
||||
ICCID: fmt.Sprintf("AC1%d", ts),
|
||||
MSISDN: "13800001001",
|
||||
CardType: "data_card",
|
||||
|
||||
Status: 1,
|
||||
ShopID: &shop.ID,
|
||||
}
|
||||
card2 := &model.IotCard{
|
||||
ICCID: fmt.Sprintf("AC2%d", ts),
|
||||
MSISDN: "13800001002",
|
||||
CardType: "data_card",
|
||||
|
||||
Status: 1,
|
||||
ShopID: &shop.ID,
|
||||
}
|
||||
@@ -131,7 +131,7 @@ func TestAuthorization_GetDetail(t *testing.T) {
|
||||
card1 := &model.IotCard{
|
||||
ICCID: fmt.Sprintf("AC1%d", ts),
|
||||
MSISDN: "13800001001",
|
||||
CardType: "data_card",
|
||||
|
||||
Status: 1,
|
||||
ShopID: &shop.ID,
|
||||
}
|
||||
@@ -195,7 +195,7 @@ func TestAuthorization_UpdateRemark(t *testing.T) {
|
||||
card1 := &model.IotCard{
|
||||
ICCID: fmt.Sprintf("AC1%d", ts),
|
||||
MSISDN: "13800001001",
|
||||
CardType: "data_card",
|
||||
|
||||
Status: 1,
|
||||
ShopID: &shop.ID,
|
||||
}
|
||||
@@ -255,7 +255,7 @@ func TestAuthorization_DataPermission(t *testing.T) {
|
||||
card1 := &model.IotCard{
|
||||
ICCID: fmt.Sprintf("AC1%d", ts),
|
||||
MSISDN: "13800001001",
|
||||
CardType: "data_card",
|
||||
|
||||
Status: 1,
|
||||
ShopID: &shop.ID,
|
||||
}
|
||||
@@ -282,7 +282,7 @@ func TestAuthorization_DataPermission(t *testing.T) {
|
||||
otherCard := &model.IotCard{
|
||||
ICCID: fmt.Sprintf("OC%d", ts2),
|
||||
MSISDN: "13800002001",
|
||||
CardType: "data_card",
|
||||
|
||||
Status: 1,
|
||||
ShopID: &otherShop.ID,
|
||||
}
|
||||
@@ -379,7 +379,7 @@ func TestAuthorization_UpdateRemarkPermission(t *testing.T) {
|
||||
card := &model.IotCard{
|
||||
ICCID: fmt.Sprintf("PERM%d", ts),
|
||||
MSISDN: "13800003001",
|
||||
CardType: "data_card",
|
||||
|
||||
Status: 1,
|
||||
ShopID: &shop.ID,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user