From b79d49d399dbd78a752366779871b41b56a95df6 Mon Sep 17 00:00:00 2001 From: zzw <1464003642@qq.com> Date: Mon, 31 Aug 2026 14:29:43 +0800 Subject: [PATCH] fix: types field --- services/wecom/internal/dao/user.go | 5 ++--- services/wecom/internal/logic/helper.go | 4 ++-- services/wecom/internal/logic/typesLogic.go | 1 - 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/services/wecom/internal/dao/user.go b/services/wecom/internal/dao/user.go index 2b3a79f..f895095 100644 --- a/services/wecom/internal/dao/user.go +++ b/services/wecom/internal/dao/user.go @@ -40,8 +40,7 @@ type UserListItem struct { UpdatedAt string `json:"updated_at"` } -// UserTypeOption 用户类型选项(前端下拉) type UserTypeOption struct { - Value uint8 `json:"value"` - Label string `json:"label"` + ID uint8 `json:"id"` + Name string `json:"name"` } diff --git a/services/wecom/internal/logic/helper.go b/services/wecom/internal/logic/helper.go index 0739ee4..3f0e816 100644 --- a/services/wecom/internal/logic/helper.go +++ b/services/wecom/internal/logic/helper.go @@ -33,8 +33,8 @@ func typeText(t uint8) string { func userTypeOptions() []dao.UserTypeOption { return []dao.UserTypeOption{ - {Value: dao.UserTypeAdmin, Label: "管理员"}, - {Value: dao.UserTypeSale, Label: "销售"}, + {ID: dao.UserTypeAdmin, Name: "管理员"}, + {ID: dao.UserTypeSale, Name: "销售"}, } } diff --git a/services/wecom/internal/logic/typesLogic.go b/services/wecom/internal/logic/typesLogic.go index deaed26..89fa57e 100644 --- a/services/wecom/internal/logic/typesLogic.go +++ b/services/wecom/internal/logic/typesLogic.go @@ -23,7 +23,6 @@ func NewTypesLogic(ctx context.Context, svcCtx *svc.ServiceContext) *TypesLogic } } -// Types 用户类型选项(管理员 / 销售) func (l *TypesLogic) Types(_ *wecom.EmptyReq) (*wecom.Response, error) { return okResponse(userTypeOptions()), nil }