fix miss file (#2)

Co-authored-by: daniel.w <daniel.w@intteam.net>
Reviewed-on: #2
This commit is contained in:
王性驊 2024-08-22 15:13:47 +00:00
parent 723008ea2b
commit 67a643f16b
6 changed files with 114 additions and 9 deletions

View File

@ -143,7 +143,9 @@ message UserInfo {
string language = 5;
string currency = 6;
string avatar = 7;
optional string nick_name = 8;
int64 create_time=8;
int64 update_time=9;
optional string nick_name = 10;
}
message GetUserInfoResp {

View File

@ -1,15 +1,14 @@
package accountlogic
import (
"app-cloudep-member-server/gen_result/pb/member"
"app-cloudep-member-server/internal/model"
"app-cloudep-member-server/internal/svc"
ers "code.30cm.net/digimon/library-go/errors"
"context"
ers "code.30cm.net/digimon/library-go/errors"
"app-cloudep-member-server/gen_result/pb/member"
"app-cloudep-member-server/internal/svc"
"github.com/zeromicro/go-zero/core/logx"
"google.golang.org/protobuf/proto"
)
type GetUserInfoLogic struct {
@ -47,7 +46,20 @@ func (l *GetUserInfoLogic) GetUserInfo(in *member.GetUserInfoReq) (*member.GetUs
}
if entity != nil {
return &member.GetUserInfoResp{}, nil
return &member.GetUserInfoResp{
Data: &member.UserInfo{
Uid: entity.Uid,
AlarmType: member.AlarmType(entity.AlarmType),
VerifyType: member.VerifyType(entity.VerifyType),
Status: member.MemberStatus(entity.Status),
NickName: proto.String(entity.NickName),
Language: entity.Language,
Currency: entity.Currency,
Avatar: entity.Avatar,
CreateTime: entity.CreateTime,
UpdateTime: entity.UpdateTime,
},
}, nil
}
return nil, ers.ResourceNotFound("filed to get user info")

View File

@ -5,6 +5,7 @@ import (
"app-cloudep-member-server/internal/model"
"context"
"fmt"
"google.golang.org/protobuf/proto"
"strconv"
ers "code.30cm.net/digimon/library-go/errors"
@ -56,7 +57,9 @@ func (l *ListMemberLogic) ListMember(in *member.ListUserInfoReq) (*member.ListUs
Status: member.MemberStatus(item.Status),
Language: item.Language,
Currency: item.Currency,
NickName: &item.NickName,
NickName: proto.String(item.NickName),
CreateTime: item.CreateTime,
UpdateTime: item.UpdateTime,
Avatar: item.Avatar,
})
}

View File

@ -50,7 +50,7 @@ func (l *VerifyRefreshCodeLogic) VerifyRefreshCode(in *member.VerifyRefreshCodeR
return nil, ers.DBError("failed to get data from redis")
}
if get != fmt.Sprintf("%d", in.CodeType) {
if get != fmt.Sprintf("%s", in.VerifyCode) {
return nil, ers.ArkInternal("Illegible Verify Code")
}

View File

@ -113,3 +113,17 @@ func (mr *MockAccountModelMockRecorder) Update(ctx, data any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*MockAccountModel)(nil).Update), ctx, data)
}
// UpdateTokenByLoginID mocks base method.
func (m *MockAccountModel) UpdateTokenByLoginID(ctx context.Context, account, token string) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "UpdateTokenByLoginID", ctx, account, token)
ret0, _ := ret[0].(error)
return ret0
}
// UpdateTokenByLoginID indicates an expected call of UpdateTokenByLoginID.
func (mr *MockAccountModelMockRecorder) UpdateTokenByLoginID(ctx, account, token any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateTokenByLoginID", reflect.TypeOf((*MockAccountModel)(nil).UpdateTokenByLoginID), ctx, account, token)
}

View File

@ -10,6 +10,7 @@
package mock
import (
member "app-cloudep-member-server/gen_result/pb/member"
model "app-cloudep-member-server/internal/model"
context "context"
sql "database/sql"
@ -41,6 +42,21 @@ func (m *MockUserTableModel) EXPECT() *MockUserTableModelMockRecorder {
return m.recorder
}
// Count mocks base method.
func (m *MockUserTableModel) Count(ctx context.Context) (int64, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Count", ctx)
ret0, _ := ret[0].(int64)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Count indicates an expected call of Count.
func (mr *MockUserTableModelMockRecorder) Count(ctx any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Count", reflect.TypeOf((*MockUserTableModel)(nil).Count), ctx)
}
// Delete mocks base method.
func (m *MockUserTableModel) Delete(ctx context.Context, id int64) error {
m.ctrl.T.Helper()
@ -70,6 +86,21 @@ func (mr *MockUserTableModelMockRecorder) FindOne(ctx, id any) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindOne", reflect.TypeOf((*MockUserTableModel)(nil).FindOne), ctx, id)
}
// FindOneByNickName mocks base method.
func (m *MockUserTableModel) FindOneByNickName(ctx context.Context, uid string) (*model.UserTable, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "FindOneByNickName", ctx, uid)
ret0, _ := ret[0].(*model.UserTable)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// FindOneByNickName indicates an expected call of FindOneByNickName.
func (mr *MockUserTableModelMockRecorder) FindOneByNickName(ctx, uid any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindOneByNickName", reflect.TypeOf((*MockUserTableModel)(nil).FindOneByNickName), ctx, uid)
}
// FindOneByUid mocks base method.
func (m *MockUserTableModel) FindOneByUid(ctx context.Context, uid string) (*model.UserTable, error) {
m.ctrl.T.Helper()
@ -100,6 +131,21 @@ func (mr *MockUserTableModelMockRecorder) Insert(ctx, data any) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Insert", reflect.TypeOf((*MockUserTableModel)(nil).Insert), ctx, data)
}
// ListMembers mocks base method.
func (m *MockUserTableModel) ListMembers(ctx context.Context, params *model.UserQueryParams) ([]*model.UserTable, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ListMembers", ctx, params)
ret0, _ := ret[0].([]*model.UserTable)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ListMembers indicates an expected call of ListMembers.
func (mr *MockUserTableModelMockRecorder) ListMembers(ctx, params any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListMembers", reflect.TypeOf((*MockUserTableModel)(nil).ListMembers), ctx, params)
}
// Update mocks base method.
func (m *MockUserTableModel) Update(ctx context.Context, data *model.UserTable) error {
m.ctrl.T.Helper()
@ -113,3 +159,31 @@ func (mr *MockUserTableModelMockRecorder) Update(ctx, data any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*MockUserTableModel)(nil).Update), ctx, data)
}
// UpdateSome mocks base method.
func (m *MockUserTableModel) UpdateSome(ctx context.Context, newData *member.UpdateUserInfoReq) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "UpdateSome", ctx, newData)
ret0, _ := ret[0].(error)
return ret0
}
// UpdateSome indicates an expected call of UpdateSome.
func (mr *MockUserTableModelMockRecorder) UpdateSome(ctx, newData any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateSome", reflect.TypeOf((*MockUserTableModel)(nil).UpdateSome), ctx, newData)
}
// UpdateStatus mocks base method.
func (m *MockUserTableModel) UpdateStatus(ctx context.Context, uid string, status int32) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "UpdateStatus", ctx, uid, status)
ret0, _ := ret[0].(error)
return ret0
}
// UpdateStatus indicates an expected call of UpdateStatus.
func (mr *MockUserTableModelMockRecorder) UpdateStatus(ctx, uid, status any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateStatus", reflect.TypeOf((*MockUserTableModel)(nil).UpdateStatus), ctx, uid, status)
}