Commit b5af48d0 by Li Feifei

add im_base field app_id

parent 79dee922
...@@ -10,6 +10,7 @@ type CompanyApp struct { ...@@ -10,6 +10,7 @@ type CompanyApp struct {
type ImBase struct { type ImBase struct {
Id int Id int
AppId int
CompanyUserId int64 CompanyUserId int64
MultideviceType int64 MultideviceType int64
MsgHookUrl string MsgHookUrl string
......
...@@ -18,3 +18,8 @@ func GetSecretByKey(key string) (error, string) { ...@@ -18,3 +18,8 @@ func GetSecretByKey(key string) (error, string) {
} }
return nil, u_app.Secret return nil, u_app.Secret
} }
func AppIsExit(appid int64) bool {
return db.MysqlClient.QueryTable(table_name).Filter("id", appid).Exist()
}
\ No newline at end of file
...@@ -100,6 +100,7 @@ type ConfigureRequest struct { ...@@ -100,6 +100,7 @@ type ConfigureRequest struct {
Common *Common `protobuf:"bytes,1,opt,name=Common,proto3" json:"Common,omitempty"` Common *Common `protobuf:"bytes,1,opt,name=Common,proto3" json:"Common,omitempty"`
Public *Public `protobuf:"bytes,2,opt,name=Public,proto3" json:"Public,omitempty"` Public *Public `protobuf:"bytes,2,opt,name=Public,proto3" json:"Public,omitempty"`
AppId int64 `protobuf:"varint,3,opt,name=AppId,proto3" json:"AppId,omitempty"`
} }
func (x *ConfigureRequest) Reset() { func (x *ConfigureRequest) Reset() {
...@@ -148,6 +149,13 @@ func (x *ConfigureRequest) GetPublic() *Public { ...@@ -148,6 +149,13 @@ func (x *ConfigureRequest) GetPublic() *Public {
return nil return nil
} }
func (x *ConfigureRequest) GetAppId() int64 {
if x != nil {
return x.AppId
}
return 0
}
type ConfigureReply struct { type ConfigureReply struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
...@@ -454,51 +462,52 @@ var file_u_proto_im_base_proto_rawDesc = []byte{ ...@@ -454,51 +462,52 @@ var file_u_proto_im_base_proto_rawDesc = []byte{
0x28, 0x03, 0x52, 0x0f, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x28, 0x03, 0x52, 0x0f, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54,
0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x4d, 0x73, 0x67, 0x48, 0x6f, 0x6f, 0x6b, 0x55, 0x72, 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x4d, 0x73, 0x67, 0x48, 0x6f, 0x6f, 0x6b, 0x55, 0x72,
0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x4d, 0x73, 0x67, 0x48, 0x6f, 0x6f, 0x6b, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x4d, 0x73, 0x67, 0x48, 0x6f, 0x6f, 0x6b,
0x55, 0x72, 0x6c, 0x22, 0x5a, 0x0a, 0x10, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x55, 0x72, 0x6c, 0x22, 0x78, 0x0a, 0x10, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f,
0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d,
0x6d, 0x6f, 0x6e, 0x52, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x22, 0x0a, 0x06, 0x50, 0x6d, 0x6f, 0x6e, 0x52, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x22, 0x0a, 0x06, 0x50,
0x75, 0x62, 0x6c, 0x69, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62,
0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x52, 0x06, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x22, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x52, 0x06, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x12,
0x10, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x1c, 0x0a, 0x05, 0x41, 0x70, 0x70, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, 0x06,
0x79, 0x22, 0x67, 0x0a, 0x13, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0xe2, 0xdf, 0x1f, 0x02, 0x10, 0x00, 0x52, 0x05, 0x41, 0x70, 0x70, 0x49, 0x64, 0x22, 0x10, 0x0a,
0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2c, 0x0a, 0x0d, 0x43, 0x6f, 0x6d, 0x70, 0x0e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22,
0x61, 0x6e, 0x79, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x67, 0x0a, 0x13, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x6c, 0x52,
0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x10, 0x00, 0x52, 0x0d, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2c, 0x0a, 0x0d, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x6e,
0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x79, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x06, 0xe2,
0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0xdf, 0x1f, 0x02, 0x10, 0x00, 0x52, 0x0d, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x55, 0x73,
0x6f, 0x6e, 0x52, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x22, 0x33, 0x0a, 0x0d, 0x47, 0x65, 0x65, 0x72, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x02,
0x74, 0x41, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a, 0x06, 0x43, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e,
0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x52, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x22, 0x33, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x41,
0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x22, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a, 0x06, 0x43, 0x6f, 0x6d,
0x32, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x4f, 0x6e, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x43,
0x79, 0x12, 0x20, 0x0a, 0x05, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x22, 0x32, 0x0a,
0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x52, 0x05, 0x52, 0x65, 0x0e, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x4f, 0x6e, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12,
0x70, 0x6c, 0x79, 0x22, 0x39, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x52, 0x65, 0x70, 0x20, 0x0a, 0x05, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a,
0x6c, 0x79, 0x12, 0x2a, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x18, 0x01, 0x20, 0x03, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x52, 0x05, 0x52, 0x65, 0x70, 0x6c,
0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x4f, 0x6e, 0x79, 0x22, 0x39, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x52, 0x65, 0x70, 0x6c, 0x79,
0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x52, 0x06, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x22, 0x57, 0x12, 0x2a, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b,
0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x32, 0x12, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x4f, 0x6e, 0x65, 0x52,
0x22, 0x0a, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x65, 0x70, 0x6c, 0x79, 0x52, 0x06, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x22, 0x57, 0x0a, 0x0d,
0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x06, 0x43, 0x6f, 0x6d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a,
0x6d, 0x6f, 0x6e, 0x12, 0x22, 0x0a, 0x06, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x18, 0x02, 0x20, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e,
0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x52, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f,
0x06, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x32, 0xe0, 0x01, 0x0a, 0x0f, 0x43, 0x6f, 0x6e, 0x66, 0x6e, 0x12, 0x22, 0x0a, 0x06, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28,
0x69, 0x67, 0x75, 0x72, 0x65, 0x53, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, 0x2e, 0x0a, 0x06, 0x53, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x52, 0x06, 0x50,
0x65, 0x6c, 0x65, 0x63, 0x74, 0x12, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x32, 0xe0, 0x01, 0x0a, 0x0f, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x75, 0x72, 0x65, 0x53, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, 0x2e, 0x0a, 0x06, 0x53, 0x65, 0x6c,
0x74, 0x41, 0x6c, 0x6c, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x31, 0x0a, 0x03, 0x41, 0x65, 0x63, 0x74, 0x12, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x52,
0x64, 0x64, 0x12, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x41,
0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6c, 0x6c, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x31, 0x0a, 0x03, 0x41, 0x64, 0x64,
0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x37, 0x12, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52,
0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6e, 0x66,
0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x37, 0x0a, 0x06,
0x74, 0x1a, 0x12, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6e, 0x66,
0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x31, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
0x65, 0x12, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x12, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x31, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12,
0x75, 0x72, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65,
0x6f, 0x33, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72,
0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
......
...@@ -30,6 +30,9 @@ func (this *ConfigureRequest) Validate() error { ...@@ -30,6 +30,9 @@ func (this *ConfigureRequest) Validate() error {
return github_com_mwitkow_go_proto_validators.FieldError("Public", err) return github_com_mwitkow_go_proto_validators.FieldError("Public", err)
} }
} }
if !(this.AppId > 0) {
return github_com_mwitkow_go_proto_validators.FieldError("AppId", fmt.Errorf(`value '%v' must be greater than '0'`, this.AppId))
}
return nil return nil
} }
func (this *ConfigureReply) Validate() error { func (this *ConfigureReply) Validate() error {
......
...@@ -33,6 +33,7 @@ func AddImBase(im *validator_struct.ConfigureAddStruct) error { ...@@ -33,6 +33,7 @@ func AddImBase(im *validator_struct.ConfigureAddStruct) error {
configure.CompanyUserId = im.CompanyUserId configure.CompanyUserId = im.CompanyUserId
configure.MsgHookUrl = im.MsgHookUrl configure.MsgHookUrl = im.MsgHookUrl
configure.MultideviceType = im.MultideviceType configure.MultideviceType = im.MultideviceType
configure.AppId = int(im.AppId)
_, err := db.MysqlClient.Insert(configure) _, err := db.MysqlClient.Insert(configure)
if err != nil { if err != nil {
err = status.Error(codes.Internal, err.Error()) err = status.Error(codes.Internal, err.Error())
......
...@@ -27,6 +27,10 @@ func (cs *ConfigureSevice) Add(ctx context.Context, ...@@ -27,6 +27,10 @@ func (cs *ConfigureSevice) Add(ctx context.Context,
err = errors.New("已经添加过配置,无需再添加") err = errors.New("已经添加过配置,无需再添加")
return return
} }
if ok := helper.AppIsExit(configure_add_struct.AppId); !ok {
err = errors.New("appid不存在")
return
}
// 添加配置 // 添加配置
if err = AddImBase(configure_add_struct); err != nil { if err = AddImBase(configure_add_struct); err != nil {
return return
......
...@@ -14,6 +14,7 @@ message Public { ...@@ -14,6 +14,7 @@ message Public {
message ConfigureRequest { message ConfigureRequest {
Common Common = 1; Common Common = 1;
Public Public = 2; Public Public = 2;
int64 AppId = 3 [(validator.field) = {int_gt: 0}];
} }
message ConfigureReply {} message ConfigureReply {}
......
...@@ -6,6 +6,7 @@ import "im-microservice/pb" ...@@ -6,6 +6,7 @@ import "im-microservice/pb"
type ConfigureAddStruct struct { type ConfigureAddStruct struct {
CompanyUserId int64 `validate:"required,numeric"` CompanyUserId int64 `validate:"required,numeric"`
MultideviceType int64 `validate:"required,numeric"` MultideviceType int64 `validate:"required,numeric"`
AppId int64 `validate:"required,numeric"`
MsgHookUrl string `validate:"required"` MsgHookUrl string `validate:"required"`
} }
...@@ -17,6 +18,7 @@ func NewConfigureAddStruct(inter interface{}) *ConfigureAddStruct { ...@@ -17,6 +18,7 @@ func NewConfigureAddStruct(inter interface{}) *ConfigureAddStruct {
config.CompanyUserId = c.Public.GetCompanyUserId() config.CompanyUserId = c.Public.GetCompanyUserId()
config.MultideviceType = c.Public.GetMultideviceType() config.MultideviceType = c.Public.GetMultideviceType()
config.MsgHookUrl = c.Public.GetMsgHookUrl() config.MsgHookUrl = c.Public.GetMsgHookUrl()
config.AppId = c.AppId
case map[string]interface{}: case map[string]interface{}:
var c = inter.(map[string]interface{}) var c = inter.(map[string]interface{})
if cui, ok := c["company_user_id"].(int64); ok { if cui, ok := c["company_user_id"].(int64); ok {
...@@ -28,6 +30,9 @@ func NewConfigureAddStruct(inter interface{}) *ConfigureAddStruct { ...@@ -28,6 +30,9 @@ func NewConfigureAddStruct(inter interface{}) *ConfigureAddStruct {
if mhu, ok := c["msg_hook_url"].(string); ok { if mhu, ok := c["msg_hook_url"].(string); ok {
config.MsgHookUrl = mhu config.MsgHookUrl = mhu
} }
if app_id, ok := c["app_id"].(int64); ok {
config.AppId = app_id
}
} }
return config return config
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment