feat: remove role id

This commit is contained in:
daniel.w 2024-08-03 22:37:12 +08:00
parent 461209bcfe
commit 9c4ea12b88
6 changed files with 21 additions and 35 deletions

View File

@ -4,7 +4,6 @@ CREATE TABLE `user_table` (
`alarm_type` tinyint DEFAULT 0 NOT NULL COMMENT '告警狀態 0. 異常 1. 正常(未告警) 2.系統告警中', `alarm_type` tinyint DEFAULT 0 NOT NULL COMMENT '告警狀態 0. 異常 1. 正常(未告警) 2.系統告警中',
`status` tinyint DEFAULT 0 NOT NULL COMMENT '會員狀態 0. 異常 1. 尚未驗證 2. 啟用 3. 停權中 4. 信箱以驗證 5. 手機以驗證 6. GA 以驗證', `status` tinyint DEFAULT 0 NOT NULL COMMENT '會員狀態 0. 異常 1. 尚未驗證 2. 啟用 3. 停權中 4. 信箱以驗證 5. 手機以驗證 6. GA 以驗證',
`uid` VARCHAR(255) NOT NULL, `uid` VARCHAR(255) NOT NULL,
`role_id` VARCHAR(255) NOT NULL DEFAULT '',
`language` VARCHAR(255) NOT NULL DEFAULT '', `language` VARCHAR(255) NOT NULL DEFAULT '',
`currency` VARCHAR(255) NOT NULL DEFAULT '', `currency` VARCHAR(255) NOT NULL DEFAULT '',
`nick_name` VARCHAR(255) DEFAULT '', `nick_name` VARCHAR(255) DEFAULT '',

View File

@ -72,12 +72,11 @@ message CreateUserInfoReq {
VerifyType verify_type = 2; VerifyType verify_type = 2;
AlarmType alarm_type = 3; AlarmType alarm_type = 3;
MemberStatus status = 4; MemberStatus status = 4;
string role_id = 5; string language = 5;
string language = 6; string currency = 6;
string currency = 7; optional string nick_name = 7;
optional string nick_name = 8; optional uint32 gender = 8;
optional uint32 gender = 9; optional int64 birthday = 9;
optional int64 birthday = 10;
} }
message GetAccountInfoResp { message GetAccountInfoResp {
@ -95,8 +94,7 @@ message UpdateUserInfoReq {
optional int64 birthday = 6; optional int64 birthday = 6;
optional VerifyType verify_type = 7; optional VerifyType verify_type = 7;
optional AlarmType alarm_type = 8; optional AlarmType alarm_type = 8;
optional string role_id = 9; optional MemberStatus status = 9;
optional MemberStatus status = 10;
} }
message GetUIDByAccountReq { message GetUIDByAccountReq {
@ -152,12 +150,11 @@ message UserInfo {
VerifyType verify_type = 2; VerifyType verify_type = 2;
AlarmType alarm_type = 3; AlarmType alarm_type = 3;
MemberStatus status = 4; MemberStatus status = 4;
string role_id = 5; string language = 5;
string language = 6; string currency = 6;
string currency = 7; optional string nick_name = 7;
optional string nick_name = 8; optional uint32 gender = 8;
optional uint32 gender = 9; optional int64 birthday = 9;
optional int64 birthday = 10;
} }
message GetUserInfoResp { message GetUserInfoResp {
@ -166,14 +163,13 @@ message GetUserInfoResp {
} }
message ListUserInfoReq { message ListUserInfoReq {
optional string role_id = 1; optional VerifyType verify_type = 1;
optional VerifyType verify_type = 2; optional AlarmType alarm_type = 2;
optional AlarmType alarm_type = 3; optional MemberStatus status = 3;
optional MemberStatus status = 4; optional int64 create_start_time = 4;
optional int64 create_start_time = 5; optional int64 create_end_time = 5;
optional int64 create_end_time = 6; int64 page_size =6;
int64 page_size =7; int64 page_index=7;
int64 page_index=8;
} }
message ListUserInfoResp { message ListUserInfoResp {

View File

@ -51,7 +51,6 @@ func (l *BindUserInfoLogic) BindUserInfo(in *member.CreateUserInfoReq) (*member.
VerifyType: int32(in.GetVerifyType()), VerifyType: int32(in.GetVerifyType()),
AlarmType: int32(in.GetAlarmType()), AlarmType: int32(in.GetAlarmType()),
Status: int32(in.GetStatus()), Status: int32(in.GetStatus()),
RoleId: in.GetRoleId(),
Language: in.GetLanguage(), Language: in.GetLanguage(),
Currency: in.GetCurrency(), Currency: in.GetCurrency(),
NickName: in.GetNickName(), NickName: in.GetNickName(),
@ -67,7 +66,6 @@ func (l *BindUserInfoLogic) BindUserInfo(in *member.CreateUserInfoReq) (*member.
VerifyType: int64(in.GetVerifyType()), VerifyType: int64(in.GetVerifyType()),
AlarmType: int64(in.GetAlarmType()), AlarmType: int64(in.GetAlarmType()),
Status: int64(in.GetStatus()), Status: int64(in.GetStatus()),
RoleId: in.GetRoleId(),
Language: in.GetLanguage(), Language: in.GetLanguage(),
Currency: in.GetCurrency(), Currency: in.GetCurrency(),
NickName: in.GetNickName(), NickName: in.GetNickName(),

View File

@ -36,11 +36,6 @@ func parse(in *member.ListUserInfoReq) (model.UserQueryParams, error) {
// 設置 PageIndex // 設置 PageIndex
filter.PageIndex = getValidPageIndex(in.PageIndex) filter.PageIndex = getValidPageIndex(in.PageIndex)
// 設置 RoleId
if in.RoleId != nil {
filter.RoleId = in.RoleId
}
// 設置 VerifyType // 設置 VerifyType
svt := fmt.Sprintf("%d", in.GetVerifyType().Number()) svt := fmt.Sprintf("%d", in.GetVerifyType().Number())
vt, err := getInt32FromStringPointer(&svt) vt, err := getInt32FromStringPointer(&svt)
@ -142,7 +137,6 @@ func (l *ListMemberLogic) ListMember(in *member.ListUserInfoReq) (*member.ListUs
VerifyType: member.VerifyType(item.VerifyType), VerifyType: member.VerifyType(item.VerifyType),
AlarmType: member.AlarmType(item.AlarmType), AlarmType: member.AlarmType(item.AlarmType),
Status: member.MemberStatus(item.Status), Status: member.MemberStatus(item.Status),
RoleId: item.RoleId,
Language: item.Language, Language: item.Language,
Currency: item.Currency, Currency: item.Currency,
NickName: &item.NickName, NickName: &item.NickName,

View File

@ -177,10 +177,7 @@ func (m *defaultUserTableModel) UpdateSome(ctx context.Context, newData *member.
updates = append(updates, "status = ?") updates = append(updates, "status = ?")
args = append(args, *newData.Status) args = append(args, *newData.Status)
} }
if newData.RoleId != nil {
updates = append(updates, "role_id = ?")
args = append(args, *newData.RoleId)
}
if newData.Language != nil { if newData.Language != nil {
updates = append(updates, "language = ?") updates = append(updates, "language = ?")
args = append(args, *newData.Language) args = append(args, *newData.Language)

View File

@ -4,6 +4,8 @@
goctl goctl
goctl rpc protoc ./generate/protobuf/member.proto --style=go_zero --go_out=./gen_result/pb --go-grpc_out=./gen_result/pb --zrpc_out=.
go get -d github.com/envoyproxy/protoc-gen-validate go get -d github.com/envoyproxy/protoc-gen-validate
mockgen -source=./validate.go -destination=../../mock/lib/validate.go -package=lib mockgen -source=./validate.go -destination=../../mock/lib/validate.go -package=lib