diff --git a/api/account/account.pb.go b/api/account/account.pb.go index a8a3c72..fb29f0c 100644 --- a/api/account/account.pb.go +++ b/api/account/account.pb.go @@ -699,7 +699,7 @@ type UserListInfo struct { Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id"` Status int32 `protobuf:"varint,2,opt,name=status,proto3" json:"status"` Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name"` - Sex int32 `protobuf:"varint,4,opt,name=sex,proto3" json:"sex"` + Sex string `protobuf:"bytes,4,opt,name=sex,proto3" json:"sex"` Nationality string `protobuf:"bytes,5,opt,name=nationality,proto3" json:"nationality"` DocumentType int32 `protobuf:"varint,6,opt,name=documentType,proto3" json:"documentType"` CertificatePicture string `protobuf:"bytes,7,opt,name=certificatePicture,proto3" json:"certificatePicture"` @@ -771,11 +771,11 @@ func (x *UserListInfo) GetName() string { return "" } -func (x *UserListInfo) GetSex() int32 { +func (x *UserListInfo) GetSex() string { if x != nil { return x.Sex } - return 0 + return "" } func (x *UserListInfo) GetNationality() string { @@ -899,7 +899,7 @@ type UserListRequest struct { SubNum string `protobuf:"bytes,2,opt,name=subNum,proto3" json:"subNum"` RealNameOrNot int32 `protobuf:"varint,3,opt,name=realNameOrNot,proto3" json:"realNameOrNot"` Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name"` - Sex int32 `protobuf:"varint,5,opt,name=sex,proto3" json:"sex"` + Sex string `protobuf:"bytes,5,opt,name=sex,proto3" json:"sex"` DocumentType int32 `protobuf:"varint,6,opt,name=documentType,proto3" json:"documentType"` AuditStatus int32 `protobuf:"varint,7,opt,name=auditStatus,proto3" json:"auditStatus"` Page uint64 `protobuf:"varint,8,opt,name=page,proto3" json:"page"` @@ -966,11 +966,11 @@ func (x *UserListRequest) GetName() string { return "" } -func (x *UserListRequest) GetSex() int32 { +func (x *UserListRequest) GetSex() string { if x != nil { return x.Sex } - return 0 + return "" } func (x *UserListRequest) GetDocumentType() int32 { @@ -1009,7 +1009,7 @@ type UserInfoResponse struct { Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id"` Status int32 `protobuf:"varint,2,opt,name=status,proto3" json:"status"` Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name"` - Sex int32 `protobuf:"varint,4,opt,name=sex,proto3" json:"sex"` + Sex string `protobuf:"bytes,4,opt,name=sex,proto3" json:"sex"` Nationality string `protobuf:"bytes,5,opt,name=nationality,proto3" json:"nationality"` DocumentType int32 `protobuf:"varint,6,opt,name=documentType,proto3" json:"documentType"` CertificatePicture string `protobuf:"bytes,7,opt,name=certificatePicture,proto3" json:"certificatePicture"` @@ -1078,11 +1078,11 @@ func (x *UserInfoResponse) GetName() string { return "" } -func (x *UserInfoResponse) GetSex() int32 { +func (x *UserInfoResponse) GetSex() string { if x != nil { return x.Sex } - return 0 + return "" } func (x *UserInfoResponse) GetNationality() string { @@ -1238,7 +1238,7 @@ type RealNameRequest struct { Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name"` - Sex int32 `protobuf:"varint,3,opt,name=sex,proto3" json:"sex"` + Sex string `protobuf:"bytes,3,opt,name=sex,proto3" json:"sex"` Nationality string `protobuf:"bytes,4,opt,name=nationality,proto3" json:"nationality"` DocumentType int32 `protobuf:"varint,5,opt,name=documentType,proto3" json:"documentType"` CertificatePicture string `protobuf:"bytes,6,opt,name=certificatePicture,proto3" json:"certificatePicture"` @@ -1294,11 +1294,11 @@ func (x *RealNameRequest) GetName() string { return "" } -func (x *RealNameRequest) GetSex() int32 { +func (x *RealNameRequest) GetSex() string { if x != nil { return x.Sex } - return 0 + return "" } func (x *RealNameRequest) GetNationality() string { @@ -5729,7 +5729,7 @@ type AccountInfo struct { JobNum string `protobuf:"bytes,18,opt,name=JobNum,json=jobNum,proto3" json:"JobNum"` BirthDate string `protobuf:"bytes,19,opt,name=BirthDate,json=birth_date,proto3" json:"BirthDate"` Age uint64 `protobuf:"varint,20,opt,name=Age,json=age,proto3" json:"Age"` - Sex uint64 `protobuf:"varint,21,opt,name=Sex,json=sex,proto3" json:"Sex"` + Sex string `protobuf:"bytes,21,opt,name=Sex,json=sex,proto3" json:"Sex"` Title string `protobuf:"bytes,22,opt,name=Title,json=title,proto3" json:"Title"` Departments []*Department `protobuf:"bytes,23,rep,name=Departments,json=departments,proto3" json:"Departments"` Ip string `protobuf:"bytes,24,opt,name=Ip,json=ip,proto3" json:"Ip"` @@ -5926,11 +5926,11 @@ func (x *AccountInfo) GetAge() uint64 { return 0 } -func (x *AccountInfo) GetSex() uint64 { +func (x *AccountInfo) GetSex() string { if x != nil { return x.Sex } - return 0 + return "" } func (x *AccountInfo) GetTitle() string { @@ -7891,7 +7891,7 @@ var file_api_account_account_proto_rawDesc = []byte{ 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, - 0x65, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x73, 0x65, 0x78, 0x12, 0x20, 0x0a, + 0x65, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x65, 0x78, 0x12, 0x20, 0x0a, 0x0b, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x22, 0x0a, 0x0c, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x18, @@ -7934,7 +7934,7 @@ var file_api_account_account_proto_rawDesc = []byte{ 0x61, 0x6d, 0x65, 0x4f, 0x72, 0x4e, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x72, 0x65, 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x4f, 0x72, 0x4e, 0x6f, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x65, 0x78, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, + 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x65, 0x78, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x65, 0x78, 0x12, 0x22, 0x0a, 0x0c, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x75, 0x64, 0x69, 0x74, @@ -7948,7 +7948,7 @@ var file_api_account_account_proto_rawDesc = []byte{ 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x65, - 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x73, 0x65, 0x78, 0x12, 0x20, 0x0a, 0x0b, + 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x65, 0x78, 0x12, 0x20, 0x0a, 0x0b, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x22, 0x0a, 0x0c, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x18, 0x06, @@ -7984,7 +7984,7 @@ var file_api_account_account_proto_rawDesc = []byte{ 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x65, - 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x73, 0x65, 0x78, 0x12, 0x20, 0x0a, 0x0b, + 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x65, 0x78, 0x12, 0x20, 0x0a, 0x0b, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x22, 0x0a, 0x0c, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x18, 0x05, @@ -8536,7 +8536,7 @@ var file_api_account_account_proto_rawDesc = []byte{ 0x69, 0x72, 0x74, 0x68, 0x44, 0x61, 0x74, 0x65, 0x18, 0x13, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x62, 0x69, 0x72, 0x74, 0x68, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x41, 0x67, 0x65, 0x18, 0x14, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x61, 0x67, 0x65, 0x12, 0x10, 0x0a, 0x03, - 0x53, 0x65, 0x78, 0x18, 0x15, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x73, 0x65, 0x78, 0x12, 0x14, + 0x53, 0x65, 0x78, 0x18, 0x15, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x65, 0x78, 0x12, 0x14, 0x0a, 0x05, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x16, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x35, 0x0a, 0x0b, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x17, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x61, 0x63, 0x63, 0x6f, diff --git a/api/account/account.proto b/api/account/account.proto index 5ea7b70..b52bd5f 100644 --- a/api/account/account.proto +++ b/api/account/account.proto @@ -125,7 +125,7 @@ message UserListInfo{ uint64 id = 1; int32 status = 2; string name = 3; - int32 sex = 4; + string sex = 4; string nationality = 5; int32 documentType =6; string certificatePicture = 7; @@ -148,7 +148,7 @@ message UserListRequest{ string subNum = 2; int32 realNameOrNot = 3; string name = 4; - int32 sex = 5; + string sex = 5; int32 documentType = 6; int32 auditStatus = 7; uint64 page = 8; @@ -158,7 +158,7 @@ message UserInfoResponse{ uint64 id = 1; int32 status = 2; string name = 3; - int32 sex = 4; + string sex = 4; string nationality = 5; int32 documentType =6; string certificatePicture = 7; @@ -180,7 +180,7 @@ message RealNameResponse{ message RealNameRequest{ uint64 id = 1; string name = 2; - int32 sex = 3; + string sex = 3; string nationality = 4; int32 documentType = 5; string certificatePicture = 6; @@ -635,7 +635,7 @@ message AccountInfo { string JobNum = 18 [json_name = "jobNum"]; string BirthDate = 19 [json_name = "birth_date"]; uint64 Age = 20 [json_name = "age"]; - uint64 Sex = 21 [json_name = "sex"]; + string Sex = 21 [json_name = "sex"]; string Title = 22 [json_name = "title"]; repeated Department Departments = 23 [json_name = "departments"]; string Ip = 24 [json_name = "ip"]; diff --git a/pkg/model/real_name.go b/pkg/model/real_name.go index 34a03df..e6a4e8f 100644 --- a/pkg/model/real_name.go +++ b/pkg/model/real_name.go @@ -12,7 +12,7 @@ type RealName struct { UpdatedAt time.Time DeletedAt soft_delete.DeletedAt `gorm:"column:deleted_at;type:int(11)"` Name string `gorm:"column:name;comment:姓名" json:"name"` - Sex int `gorm:"column:sex;comment:性别:1男 2女" json:"sex"` + Sex string `gorm:"column:sex;comment:" json:"sex"` Nationality string `gorm:"column:nationality;comment:国籍" json:"nationality"` DocumentType int `gorm:"column:document_type;comment:证件类型:1护照 2身份证 3驾驶证 4居住证 5自拍照 6社保卡" json:"documentType"` CertificatePicture string `gorm:"type:varchar(500);column:certificate_picture;comment:证件照片" json:"certificatePicture"` diff --git a/pkg/serializer/user.go b/pkg/serializer/user.go index 6c09d95..330fbf0 100644 --- a/pkg/serializer/user.go +++ b/pkg/serializer/user.go @@ -73,7 +73,7 @@ func BuildUserList(user []*model.User) []*account.UserListInfo { if realName == nil { realName = &model.RealName{ Name: "", - Sex: 0, + Sex: "", Nationality: "", DocumentType: 0, CertificatePicture: "", @@ -87,7 +87,7 @@ func BuildUserList(user []*model.User) []*account.UserListInfo { Id: uint64(i.ID), Status: int32(i.Status), Name: realName.Name, - Sex: int32(realName.Sex), + Sex: realName.Sex, Nationality: realName.Nationality, DocumentType: int32(realName.DocumentType), CertificatePicture: realName.CertificatePicture, diff --git a/pkg/service/account.go b/pkg/service/account.go index f418ac4..0598fe9 100644 --- a/pkg/service/account.go +++ b/pkg/service/account.go @@ -385,7 +385,7 @@ func (a *AccountProvider) RealName(_ context.Context, in *account.RealNameReques // 如果没有找到实名信息,创建一个新的 RealName 记录 newRealName := model.RealName{ Name: in.Name, - Sex: int(in.Sex), + Sex: in.Sex, Nationality: in.Nationality, DocumentType: int(in.DocumentType), CertificatePicture: in.CertificatePicture, @@ -611,7 +611,7 @@ func (a *AccountProvider) Info(ctx context.Context, in *account.InfoRequest) (*a if realName == nil { realName = &model.RealName{ Name: "", - Sex: 0, + Sex: "", Nationality: "", DocumentType: 0, CertificatePicture: "", @@ -625,7 +625,7 @@ func (a *AccountProvider) Info(ctx context.Context, in *account.InfoRequest) (*a Id: uint64(user.ID), Status: int32(user.Status), Name: realName.Name, - Sex: int32(realName.Sex), + Sex: realName.Sex, Nationality: realName.Nationality, DocumentType: int32(realName.DocumentType), CertificatePicture: realName.CertificatePicture, @@ -666,7 +666,7 @@ func (a *AccountProvider) UserList(ctx context.Context, in *account.UserListRequ if in.AuditStatus != 0 { modelObj.Where("status = ? ", in.AuditStatus) } - if in.Sex != 0 { + if in.Sex != "" { modelObj.Where("RealName.sex = ?", in.Sex) } modelObj.Count(&count) @@ -865,7 +865,7 @@ func (a *AccountProvider) UserByTel(_ context.Context, in *account.UserByTelRequ if realName == nil { realName = &model.RealName{ Name: "", - Sex: 0, + Sex: "", Nationality: "", DocumentType: 0, CertificatePicture: "", @@ -879,7 +879,7 @@ func (a *AccountProvider) UserByTel(_ context.Context, in *account.UserByTelRequ Id: uint64(user.ID), Status: int32(user.Status), Name: realName.Name, - Sex: int32(realName.Sex), + Sex: realName.Sex, Nationality: realName.Nationality, DocumentType: int32(realName.DocumentType), CertificatePicture: realName.CertificatePicture,