通过配置合并简化配置文件
Some checks are pending
/ build-services (app/admin_service/Dockerfile, admin, admin) (push) Waiting to run
/ build-services (app/auth_service/Dockerfile, auth, auth) (push) Waiting to run
/ build-services (app/ecpm_service/Dockerfile, ecpm, ecpm) (push) Waiting to run
/ build-services (app/ranking_service/Dockerfile, ranking, ranking) (push) Waiting to run
/ build-services (app/user_service/Dockerfile, user, user) (push) Waiting to run
/ start-services (push) Blocked by required conditions
Some checks are pending
/ build-services (app/admin_service/Dockerfile, admin, admin) (push) Waiting to run
/ build-services (app/auth_service/Dockerfile, auth, auth) (push) Waiting to run
/ build-services (app/ecpm_service/Dockerfile, ecpm, ecpm) (push) Waiting to run
/ build-services (app/ranking_service/Dockerfile, ranking, ranking) (push) Waiting to run
/ build-services (app/user_service/Dockerfile, user, user) (push) Waiting to run
/ start-services (push) Blocked by required conditions
This commit is contained in:
parent
dff700f182
commit
b0d719312b
@ -41,4 +41,4 @@ jobs:
|
|||||||
COMPOSE_PROJECT_NAME: youtu_grpc
|
COMPOSE_PROJECT_NAME: youtu_grpc
|
||||||
- name: clean up
|
- name: clean up
|
||||||
run: |
|
run: |
|
||||||
docker rmi $(docker images -f "dangling=true" -q)
|
docker system prune -f
|
||||||
|
@ -22,7 +22,7 @@ message GetAppListResponse {
|
|||||||
|
|
||||||
message AppInfo {
|
message AppInfo {
|
||||||
int32 id = 1;
|
int32 id = 1;
|
||||||
string type = 2;
|
int32 type = 2;
|
||||||
string app_id = 3;
|
string app_id = 3;
|
||||||
string secret = 4;
|
string secret = 4;
|
||||||
string remark = 5;
|
string remark = 5;
|
||||||
@ -46,6 +46,14 @@ message AddAppResponse {
|
|||||||
bool success = 1;
|
bool success = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message CoverAppRequest {
|
||||||
|
repeated AppInfo app_info = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message CoverAppResponse {
|
||||||
|
bool success = 1;
|
||||||
|
}
|
||||||
|
|
||||||
service admin_service {
|
service admin_service {
|
||||||
rpc Ping(Request) returns(Response);
|
rpc Ping(Request) returns(Response);
|
||||||
// 获取app列表
|
// 获取app列表
|
||||||
@ -59,4 +67,7 @@ service admin_service {
|
|||||||
|
|
||||||
// AddApp 添加app
|
// AddApp 添加app
|
||||||
rpc AddApp(AddAppRequest) returns(AddAppResponse);
|
rpc AddApp(AddAppRequest) returns(AddAppResponse);
|
||||||
|
|
||||||
|
// 覆盖app数据
|
||||||
|
rpc CoverApp(CoverAppRequest) returns(CoverAppResponse);
|
||||||
}
|
}
|
||||||
|
@ -192,7 +192,7 @@ func (x *GetAppListResponse) GetAppList() []*AppInfo {
|
|||||||
type AppInfo struct {
|
type AppInfo struct {
|
||||||
state protoimpl.MessageState `protogen:"open.v1"`
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||||
Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
|
Type int32 `protobuf:"varint,2,opt,name=type,proto3" json:"type,omitempty"`
|
||||||
AppId string `protobuf:"bytes,3,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"`
|
AppId string `protobuf:"bytes,3,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"`
|
||||||
Secret string `protobuf:"bytes,4,opt,name=secret,proto3" json:"secret,omitempty"`
|
Secret string `protobuf:"bytes,4,opt,name=secret,proto3" json:"secret,omitempty"`
|
||||||
Remark string `protobuf:"bytes,5,opt,name=remark,proto3" json:"remark,omitempty"`
|
Remark string `protobuf:"bytes,5,opt,name=remark,proto3" json:"remark,omitempty"`
|
||||||
@ -239,11 +239,11 @@ func (x *AppInfo) GetId() int32 {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *AppInfo) GetType() string {
|
func (x *AppInfo) GetType() int32 {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.Type
|
return x.Type
|
||||||
}
|
}
|
||||||
return ""
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *AppInfo) GetAppId() string {
|
func (x *AppInfo) GetAppId() string {
|
||||||
@ -457,6 +457,94 @@ func (x *AddAppResponse) GetSuccess() bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type CoverAppRequest struct {
|
||||||
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
|
AppInfo []*AppInfo `protobuf:"bytes,1,rep,name=app_info,json=appInfo,proto3" json:"app_info,omitempty"`
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *CoverAppRequest) Reset() {
|
||||||
|
*x = CoverAppRequest{}
|
||||||
|
mi := &file_admin_service_proto_msgTypes[9]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *CoverAppRequest) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*CoverAppRequest) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *CoverAppRequest) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_admin_service_proto_msgTypes[9]
|
||||||
|
if x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use CoverAppRequest.ProtoReflect.Descriptor instead.
|
||||||
|
func (*CoverAppRequest) Descriptor() ([]byte, []int) {
|
||||||
|
return file_admin_service_proto_rawDescGZIP(), []int{9}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *CoverAppRequest) GetAppInfo() []*AppInfo {
|
||||||
|
if x != nil {
|
||||||
|
return x.AppInfo
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type CoverAppResponse struct {
|
||||||
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
|
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *CoverAppResponse) Reset() {
|
||||||
|
*x = CoverAppResponse{}
|
||||||
|
mi := &file_admin_service_proto_msgTypes[10]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *CoverAppResponse) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*CoverAppResponse) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *CoverAppResponse) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_admin_service_proto_msgTypes[10]
|
||||||
|
if x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use CoverAppResponse.ProtoReflect.Descriptor instead.
|
||||||
|
func (*CoverAppResponse) Descriptor() ([]byte, []int) {
|
||||||
|
return file_admin_service_proto_rawDescGZIP(), []int{10}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *CoverAppResponse) GetSuccess() bool {
|
||||||
|
if x != nil {
|
||||||
|
return x.Success
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
var File_admin_service_proto protoreflect.FileDescriptor
|
var File_admin_service_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
var file_admin_service_proto_rawDesc = string([]byte{
|
var file_admin_service_proto_rawDesc = string([]byte{
|
||||||
@ -474,7 +562,7 @@ var file_admin_service_proto_rawDesc = string([]byte{
|
|||||||
0x2e, 0x41, 0x70, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x61, 0x70, 0x70, 0x4c, 0x69, 0x73,
|
0x2e, 0x41, 0x70, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x61, 0x70, 0x70, 0x4c, 0x69, 0x73,
|
||||||
0x74, 0x22, 0x9a, 0x01, 0x0a, 0x07, 0x41, 0x70, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a,
|
0x74, 0x22, 0x9a, 0x01, 0x0a, 0x07, 0x41, 0x70, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a,
|
||||||
0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a,
|
0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a,
|
||||||
0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70,
|
0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74, 0x79, 0x70,
|
||||||
0x65, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28,
|
0x65, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28,
|
||||||
0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x63, 0x72,
|
0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x63, 0x72,
|
||||||
0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74,
|
0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74,
|
||||||
@ -494,32 +582,44 @@ var file_admin_service_proto_rawDesc = string([]byte{
|
|||||||
0x52, 0x07, 0x61, 0x70, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x2a, 0x0a, 0x0e, 0x41, 0x64, 0x64,
|
0x52, 0x07, 0x61, 0x70, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x2a, 0x0a, 0x0e, 0x41, 0x64, 0x64,
|
||||||
0x41, 0x70, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73,
|
0x41, 0x70, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73,
|
||||||
0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75,
|
0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75,
|
||||||
0x63, 0x63, 0x65, 0x73, 0x73, 0x32, 0xf3, 0x02, 0x0a, 0x0d, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f,
|
0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0x44, 0x0a, 0x0f, 0x43, 0x6f, 0x76, 0x65, 0x72, 0x41, 0x70,
|
||||||
0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x37, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, 0x12,
|
0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x31, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x5f,
|
||||||
0x16, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e,
|
0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x61, 0x64, 0x6d,
|
||||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f,
|
0x69, 0x6e, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x41, 0x70, 0x70, 0x49, 0x6e,
|
||||||
0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
0x66, 0x6f, 0x52, 0x07, 0x61, 0x70, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x2c, 0x0a, 0x10, 0x43,
|
||||||
0x12, 0x51, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x41, 0x70, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x20,
|
0x6f, 0x76, 0x65, 0x72, 0x41, 0x70, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
|
||||||
0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x47,
|
0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08,
|
||||||
0x65, 0x74, 0x41, 0x70, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x32, 0xc0, 0x03, 0x0a, 0x0d, 0x61, 0x64,
|
||||||
0x1a, 0x21, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
|
0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x37, 0x0a, 0x04, 0x50,
|
||||||
0x2e, 0x47, 0x65, 0x74, 0x41, 0x70, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
0x69, 0x6e, 0x67, 0x12, 0x16, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x65, 0x72, 0x76,
|
||||||
0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x09, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x6e, 0x65,
|
0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x61, 0x64,
|
||||||
0x12, 0x16, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
|
0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70,
|
||||||
0x2e, 0x41, 0x70, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0x1d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e,
|
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x41, 0x70, 0x70, 0x4c, 0x69,
|
||||||
0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52,
|
0x73, 0x74, 0x12, 0x20, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69,
|
||||||
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x09, 0x44, 0x65, 0x6c, 0x65, 0x74,
|
0x63, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x70, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71,
|
||||||
0x65, 0x41, 0x70, 0x70, 0x12, 0x1f, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x65, 0x72,
|
0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x65, 0x72,
|
||||||
0x76, 0x69, 0x63, 0x65, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x70, 0x70, 0x52, 0x65,
|
0x76, 0x69, 0x63, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x70, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x52,
|
||||||
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x65,
|
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x09, 0x55, 0x70, 0x64, 0x61, 0x74,
|
||||||
0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70,
|
0x65, 0x4f, 0x6e, 0x65, 0x12, 0x16, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x65, 0x72,
|
||||||
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x45, 0x0a, 0x06, 0x41, 0x64, 0x64, 0x41, 0x70, 0x70, 0x12, 0x1c,
|
0x76, 0x69, 0x63, 0x65, 0x2e, 0x41, 0x70, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0x1d, 0x2e, 0x61,
|
||||||
0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x41,
|
0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x43, 0x6f, 0x6d,
|
||||||
0x64, 0x64, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x61,
|
0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x09, 0x44,
|
||||||
0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x41, 0x64, 0x64,
|
0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x70, 0x70, 0x12, 0x1f, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e,
|
||||||
0x41, 0x70, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x11, 0x5a, 0x0f, 0x2e,
|
0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41,
|
||||||
0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x62, 0x06,
|
0x70, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x61, 0x64, 0x6d, 0x69,
|
||||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
0x6e, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e,
|
||||||
|
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x45, 0x0a, 0x06, 0x41, 0x64, 0x64, 0x41,
|
||||||
|
0x70, 0x70, 0x12, 0x1c, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69,
|
||||||
|
0x63, 0x65, 0x2e, 0x41, 0x64, 0x64, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||||
|
0x1a, 0x1d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
|
||||||
|
0x2e, 0x41, 0x64, 0x64, 0x41, 0x70, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
|
||||||
|
0x4b, 0x0a, 0x08, 0x43, 0x6f, 0x76, 0x65, 0x72, 0x41, 0x70, 0x70, 0x12, 0x1e, 0x2e, 0x61, 0x64,
|
||||||
|
0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x43, 0x6f, 0x76, 0x65,
|
||||||
|
0x72, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x61, 0x64,
|
||||||
|
0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x43, 0x6f, 0x76, 0x65,
|
||||||
|
0x72, 0x41, 0x70, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x11, 0x5a, 0x0f,
|
||||||
|
0x2e, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x62,
|
||||||
|
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
})
|
})
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -534,7 +634,7 @@ func file_admin_service_proto_rawDescGZIP() []byte {
|
|||||||
return file_admin_service_proto_rawDescData
|
return file_admin_service_proto_rawDescData
|
||||||
}
|
}
|
||||||
|
|
||||||
var file_admin_service_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
|
var file_admin_service_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
|
||||||
var file_admin_service_proto_goTypes = []any{
|
var file_admin_service_proto_goTypes = []any{
|
||||||
(*Request)(nil), // 0: admin_service.Request
|
(*Request)(nil), // 0: admin_service.Request
|
||||||
(*Response)(nil), // 1: admin_service.Response
|
(*Response)(nil), // 1: admin_service.Response
|
||||||
@ -545,25 +645,30 @@ var file_admin_service_proto_goTypes = []any{
|
|||||||
(*DeleteAppRequest)(nil), // 6: admin_service.DeleteAppRequest
|
(*DeleteAppRequest)(nil), // 6: admin_service.DeleteAppRequest
|
||||||
(*AddAppRequest)(nil), // 7: admin_service.AddAppRequest
|
(*AddAppRequest)(nil), // 7: admin_service.AddAppRequest
|
||||||
(*AddAppResponse)(nil), // 8: admin_service.AddAppResponse
|
(*AddAppResponse)(nil), // 8: admin_service.AddAppResponse
|
||||||
|
(*CoverAppRequest)(nil), // 9: admin_service.CoverAppRequest
|
||||||
|
(*CoverAppResponse)(nil), // 10: admin_service.CoverAppResponse
|
||||||
}
|
}
|
||||||
var file_admin_service_proto_depIdxs = []int32{
|
var file_admin_service_proto_depIdxs = []int32{
|
||||||
4, // 0: admin_service.GetAppListResponse.app_list:type_name -> admin_service.AppInfo
|
4, // 0: admin_service.GetAppListResponse.app_list:type_name -> admin_service.AppInfo
|
||||||
4, // 1: admin_service.AddAppRequest.app_info:type_name -> admin_service.AppInfo
|
4, // 1: admin_service.AddAppRequest.app_info:type_name -> admin_service.AppInfo
|
||||||
0, // 2: admin_service.admin_service.Ping:input_type -> admin_service.Request
|
4, // 2: admin_service.CoverAppRequest.app_info:type_name -> admin_service.AppInfo
|
||||||
2, // 3: admin_service.admin_service.GetAppList:input_type -> admin_service.GetAppListRequest
|
0, // 3: admin_service.admin_service.Ping:input_type -> admin_service.Request
|
||||||
4, // 4: admin_service.admin_service.UpdateOne:input_type -> admin_service.AppInfo
|
2, // 4: admin_service.admin_service.GetAppList:input_type -> admin_service.GetAppListRequest
|
||||||
6, // 5: admin_service.admin_service.DeleteApp:input_type -> admin_service.DeleteAppRequest
|
4, // 5: admin_service.admin_service.UpdateOne:input_type -> admin_service.AppInfo
|
||||||
7, // 6: admin_service.admin_service.AddApp:input_type -> admin_service.AddAppRequest
|
6, // 6: admin_service.admin_service.DeleteApp:input_type -> admin_service.DeleteAppRequest
|
||||||
1, // 7: admin_service.admin_service.Ping:output_type -> admin_service.Response
|
7, // 7: admin_service.admin_service.AddApp:input_type -> admin_service.AddAppRequest
|
||||||
3, // 8: admin_service.admin_service.GetAppList:output_type -> admin_service.GetAppListResponse
|
9, // 8: admin_service.admin_service.CoverApp:input_type -> admin_service.CoverAppRequest
|
||||||
5, // 9: admin_service.admin_service.UpdateOne:output_type -> admin_service.CommonResponse
|
1, // 9: admin_service.admin_service.Ping:output_type -> admin_service.Response
|
||||||
5, // 10: admin_service.admin_service.DeleteApp:output_type -> admin_service.CommonResponse
|
3, // 10: admin_service.admin_service.GetAppList:output_type -> admin_service.GetAppListResponse
|
||||||
8, // 11: admin_service.admin_service.AddApp:output_type -> admin_service.AddAppResponse
|
5, // 11: admin_service.admin_service.UpdateOne:output_type -> admin_service.CommonResponse
|
||||||
7, // [7:12] is the sub-list for method output_type
|
5, // 12: admin_service.admin_service.DeleteApp:output_type -> admin_service.CommonResponse
|
||||||
2, // [2:7] is the sub-list for method input_type
|
8, // 13: admin_service.admin_service.AddApp:output_type -> admin_service.AddAppResponse
|
||||||
2, // [2:2] is the sub-list for extension type_name
|
10, // 14: admin_service.admin_service.CoverApp:output_type -> admin_service.CoverAppResponse
|
||||||
2, // [2:2] is the sub-list for extension extendee
|
9, // [9:15] is the sub-list for method output_type
|
||||||
0, // [0:2] is the sub-list for field type_name
|
3, // [3:9] is the sub-list for method input_type
|
||||||
|
3, // [3:3] is the sub-list for extension type_name
|
||||||
|
3, // [3:3] is the sub-list for extension extendee
|
||||||
|
0, // [0:3] is the sub-list for field type_name
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { file_admin_service_proto_init() }
|
func init() { file_admin_service_proto_init() }
|
||||||
@ -577,7 +682,7 @@ func file_admin_service_proto_init() {
|
|||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_admin_service_proto_rawDesc), len(file_admin_service_proto_rawDesc)),
|
RawDescriptor: unsafe.Slice(unsafe.StringData(file_admin_service_proto_rawDesc), len(file_admin_service_proto_rawDesc)),
|
||||||
NumEnums: 0,
|
NumEnums: 0,
|
||||||
NumMessages: 9,
|
NumMessages: 11,
|
||||||
NumExtensions: 0,
|
NumExtensions: 0,
|
||||||
NumServices: 1,
|
NumServices: 1,
|
||||||
},
|
},
|
||||||
|
@ -24,6 +24,7 @@ const (
|
|||||||
AdminService_UpdateOne_FullMethodName = "/admin_service.admin_service/UpdateOne"
|
AdminService_UpdateOne_FullMethodName = "/admin_service.admin_service/UpdateOne"
|
||||||
AdminService_DeleteApp_FullMethodName = "/admin_service.admin_service/DeleteApp"
|
AdminService_DeleteApp_FullMethodName = "/admin_service.admin_service/DeleteApp"
|
||||||
AdminService_AddApp_FullMethodName = "/admin_service.admin_service/AddApp"
|
AdminService_AddApp_FullMethodName = "/admin_service.admin_service/AddApp"
|
||||||
|
AdminService_CoverApp_FullMethodName = "/admin_service.admin_service/CoverApp"
|
||||||
)
|
)
|
||||||
|
|
||||||
// AdminServiceClient is the client API for AdminService service.
|
// AdminServiceClient is the client API for AdminService service.
|
||||||
@ -33,12 +34,14 @@ type AdminServiceClient interface {
|
|||||||
Ping(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
|
Ping(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
|
||||||
// 获取app列表
|
// 获取app列表
|
||||||
GetAppList(ctx context.Context, in *GetAppListRequest, opts ...grpc.CallOption) (*GetAppListResponse, error)
|
GetAppList(ctx context.Context, in *GetAppListRequest, opts ...grpc.CallOption) (*GetAppListResponse, error)
|
||||||
// 修改app列表
|
// UpdateOne 修改app数据
|
||||||
UpdateOne(ctx context.Context, in *AppInfo, opts ...grpc.CallOption) (*CommonResponse, error)
|
UpdateOne(ctx context.Context, in *AppInfo, opts ...grpc.CallOption) (*CommonResponse, error)
|
||||||
// 删除app
|
// DeleteApp 删除app
|
||||||
DeleteApp(ctx context.Context, in *DeleteAppRequest, opts ...grpc.CallOption) (*CommonResponse, error)
|
DeleteApp(ctx context.Context, in *DeleteAppRequest, opts ...grpc.CallOption) (*CommonResponse, error)
|
||||||
// 添加app
|
// AddApp 添加app
|
||||||
AddApp(ctx context.Context, in *AddAppRequest, opts ...grpc.CallOption) (*AddAppResponse, error)
|
AddApp(ctx context.Context, in *AddAppRequest, opts ...grpc.CallOption) (*AddAppResponse, error)
|
||||||
|
// 覆盖app数据
|
||||||
|
CoverApp(ctx context.Context, in *CoverAppRequest, opts ...grpc.CallOption) (*CoverAppResponse, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
type adminServiceClient struct {
|
type adminServiceClient struct {
|
||||||
@ -99,6 +102,16 @@ func (c *adminServiceClient) AddApp(ctx context.Context, in *AddAppRequest, opts
|
|||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *adminServiceClient) CoverApp(ctx context.Context, in *CoverAppRequest, opts ...grpc.CallOption) (*CoverAppResponse, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
|
out := new(CoverAppResponse)
|
||||||
|
err := c.cc.Invoke(ctx, AdminService_CoverApp_FullMethodName, in, out, cOpts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
// AdminServiceServer is the server API for AdminService service.
|
// AdminServiceServer is the server API for AdminService service.
|
||||||
// All implementations must embed UnimplementedAdminServiceServer
|
// All implementations must embed UnimplementedAdminServiceServer
|
||||||
// for forward compatibility.
|
// for forward compatibility.
|
||||||
@ -106,12 +119,14 @@ type AdminServiceServer interface {
|
|||||||
Ping(context.Context, *Request) (*Response, error)
|
Ping(context.Context, *Request) (*Response, error)
|
||||||
// 获取app列表
|
// 获取app列表
|
||||||
GetAppList(context.Context, *GetAppListRequest) (*GetAppListResponse, error)
|
GetAppList(context.Context, *GetAppListRequest) (*GetAppListResponse, error)
|
||||||
// 修改app列表
|
// UpdateOne 修改app数据
|
||||||
UpdateOne(context.Context, *AppInfo) (*CommonResponse, error)
|
UpdateOne(context.Context, *AppInfo) (*CommonResponse, error)
|
||||||
// 删除app
|
// DeleteApp 删除app
|
||||||
DeleteApp(context.Context, *DeleteAppRequest) (*CommonResponse, error)
|
DeleteApp(context.Context, *DeleteAppRequest) (*CommonResponse, error)
|
||||||
// 添加app
|
// AddApp 添加app
|
||||||
AddApp(context.Context, *AddAppRequest) (*AddAppResponse, error)
|
AddApp(context.Context, *AddAppRequest) (*AddAppResponse, error)
|
||||||
|
// 覆盖app数据
|
||||||
|
CoverApp(context.Context, *CoverAppRequest) (*CoverAppResponse, error)
|
||||||
mustEmbedUnimplementedAdminServiceServer()
|
mustEmbedUnimplementedAdminServiceServer()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -137,6 +152,9 @@ func (UnimplementedAdminServiceServer) DeleteApp(context.Context, *DeleteAppRequ
|
|||||||
func (UnimplementedAdminServiceServer) AddApp(context.Context, *AddAppRequest) (*AddAppResponse, error) {
|
func (UnimplementedAdminServiceServer) AddApp(context.Context, *AddAppRequest) (*AddAppResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method AddApp not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method AddApp not implemented")
|
||||||
}
|
}
|
||||||
|
func (UnimplementedAdminServiceServer) CoverApp(context.Context, *CoverAppRequest) (*CoverAppResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method CoverApp not implemented")
|
||||||
|
}
|
||||||
func (UnimplementedAdminServiceServer) mustEmbedUnimplementedAdminServiceServer() {}
|
func (UnimplementedAdminServiceServer) mustEmbedUnimplementedAdminServiceServer() {}
|
||||||
func (UnimplementedAdminServiceServer) testEmbeddedByValue() {}
|
func (UnimplementedAdminServiceServer) testEmbeddedByValue() {}
|
||||||
|
|
||||||
@ -248,6 +266,24 @@ func _AdminService_AddApp_Handler(srv interface{}, ctx context.Context, dec func
|
|||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func _AdminService_CoverApp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(CoverAppRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(AdminServiceServer).CoverApp(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: AdminService_CoverApp_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(AdminServiceServer).CoverApp(ctx, req.(*CoverAppRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
// AdminService_ServiceDesc is the grpc.ServiceDesc for AdminService service.
|
// AdminService_ServiceDesc is the grpc.ServiceDesc for AdminService service.
|
||||||
// It's only intended for direct use with grpc.RegisterService,
|
// It's only intended for direct use with grpc.RegisterService,
|
||||||
// and not to be introspected or modified (even as a copy)
|
// and not to be introspected or modified (even as a copy)
|
||||||
@ -275,6 +311,10 @@ var AdminService_ServiceDesc = grpc.ServiceDesc{
|
|||||||
MethodName: "AddApp",
|
MethodName: "AddApp",
|
||||||
Handler: _AdminService_AddApp_Handler,
|
Handler: _AdminService_AddApp_Handler,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
MethodName: "CoverApp",
|
||||||
|
Handler: _AdminService_CoverApp_Handler,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
Streams: []grpc.StreamDesc{},
|
Streams: []grpc.StreamDesc{},
|
||||||
Metadata: "admin_service.proto",
|
Metadata: "admin_service.proto",
|
||||||
|
@ -18,6 +18,8 @@ type (
|
|||||||
AddAppResponse = admin_service.AddAppResponse
|
AddAppResponse = admin_service.AddAppResponse
|
||||||
AppInfo = admin_service.AppInfo
|
AppInfo = admin_service.AppInfo
|
||||||
CommonResponse = admin_service.CommonResponse
|
CommonResponse = admin_service.CommonResponse
|
||||||
|
CoverAppRequest = admin_service.CoverAppRequest
|
||||||
|
CoverAppResponse = admin_service.CoverAppResponse
|
||||||
DeleteAppRequest = admin_service.DeleteAppRequest
|
DeleteAppRequest = admin_service.DeleteAppRequest
|
||||||
GetAppListRequest = admin_service.GetAppListRequest
|
GetAppListRequest = admin_service.GetAppListRequest
|
||||||
GetAppListResponse = admin_service.GetAppListResponse
|
GetAppListResponse = admin_service.GetAppListResponse
|
||||||
@ -28,12 +30,14 @@ type (
|
|||||||
Ping(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
|
Ping(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
|
||||||
// 获取app列表
|
// 获取app列表
|
||||||
GetAppList(ctx context.Context, in *GetAppListRequest, opts ...grpc.CallOption) (*GetAppListResponse, error)
|
GetAppList(ctx context.Context, in *GetAppListRequest, opts ...grpc.CallOption) (*GetAppListResponse, error)
|
||||||
// 修改app列表
|
// UpdateOne 修改app数据
|
||||||
UpdateOne(ctx context.Context, in *AppInfo, opts ...grpc.CallOption) (*CommonResponse, error)
|
UpdateOne(ctx context.Context, in *AppInfo, opts ...grpc.CallOption) (*CommonResponse, error)
|
||||||
// 删除app
|
// DeleteApp 删除app
|
||||||
DeleteApp(ctx context.Context, in *DeleteAppRequest, opts ...grpc.CallOption) (*CommonResponse, error)
|
DeleteApp(ctx context.Context, in *DeleteAppRequest, opts ...grpc.CallOption) (*CommonResponse, error)
|
||||||
// 添加app
|
// AddApp 添加app
|
||||||
AddApp(ctx context.Context, in *AddAppRequest, opts ...grpc.CallOption) (*AddAppResponse, error)
|
AddApp(ctx context.Context, in *AddAppRequest, opts ...grpc.CallOption) (*AddAppResponse, error)
|
||||||
|
// 覆盖app数据
|
||||||
|
CoverApp(ctx context.Context, in *CoverAppRequest, opts ...grpc.CallOption) (*CoverAppResponse, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultAdminService struct {
|
defaultAdminService struct {
|
||||||
@ -58,20 +62,26 @@ func (m *defaultAdminService) GetAppList(ctx context.Context, in *GetAppListRequ
|
|||||||
return client.GetAppList(ctx, in, opts...)
|
return client.GetAppList(ctx, in, opts...)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改app列表
|
// UpdateOne 修改app数据
|
||||||
func (m *defaultAdminService) UpdateOne(ctx context.Context, in *AppInfo, opts ...grpc.CallOption) (*CommonResponse, error) {
|
func (m *defaultAdminService) UpdateOne(ctx context.Context, in *AppInfo, opts ...grpc.CallOption) (*CommonResponse, error) {
|
||||||
client := admin_service.NewAdminServiceClient(m.cli.Conn())
|
client := admin_service.NewAdminServiceClient(m.cli.Conn())
|
||||||
return client.UpdateOne(ctx, in, opts...)
|
return client.UpdateOne(ctx, in, opts...)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除app
|
// DeleteApp 删除app
|
||||||
func (m *defaultAdminService) DeleteApp(ctx context.Context, in *DeleteAppRequest, opts ...grpc.CallOption) (*CommonResponse, error) {
|
func (m *defaultAdminService) DeleteApp(ctx context.Context, in *DeleteAppRequest, opts ...grpc.CallOption) (*CommonResponse, error) {
|
||||||
client := admin_service.NewAdminServiceClient(m.cli.Conn())
|
client := admin_service.NewAdminServiceClient(m.cli.Conn())
|
||||||
return client.DeleteApp(ctx, in, opts...)
|
return client.DeleteApp(ctx, in, opts...)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加app
|
// AddApp 添加app
|
||||||
func (m *defaultAdminService) AddApp(ctx context.Context, in *AddAppRequest, opts ...grpc.CallOption) (*AddAppResponse, error) {
|
func (m *defaultAdminService) AddApp(ctx context.Context, in *AddAppRequest, opts ...grpc.CallOption) (*AddAppResponse, error) {
|
||||||
client := admin_service.NewAdminServiceClient(m.cli.Conn())
|
client := admin_service.NewAdminServiceClient(m.cli.Conn())
|
||||||
return client.AddApp(ctx, in, opts...)
|
return client.AddApp(ctx, in, opts...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 覆盖app数据
|
||||||
|
func (m *defaultAdminService) CoverApp(ctx context.Context, in *CoverAppRequest, opts ...grpc.CallOption) (*CoverAppResponse, error) {
|
||||||
|
client := admin_service.NewAdminServiceClient(m.cli.Conn())
|
||||||
|
return client.CoverApp(ctx, in, opts...)
|
||||||
|
}
|
||||||
|
36
app/admin_service/internal/logic/cover_app_logic.go
Normal file
36
app/admin_service/internal/logic/cover_app_logic.go
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
package logic
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/admin_service/admin_service"
|
||||||
|
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/admin_service/internal/svc"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
|
)
|
||||||
|
|
||||||
|
type CoverAppLogic struct {
|
||||||
|
ctx context.Context
|
||||||
|
svcCtx *svc.ServiceContext
|
||||||
|
logx.Logger
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewCoverAppLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CoverAppLogic {
|
||||||
|
return &CoverAppLogic{
|
||||||
|
ctx: ctx,
|
||||||
|
svcCtx: svcCtx,
|
||||||
|
Logger: logx.WithContext(ctx),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// CoverApp 覆盖app数据
|
||||||
|
func (l *CoverAppLogic) CoverApp(in *admin_service.CoverAppRequest) (*admin_service.CoverAppResponse, error) {
|
||||||
|
// 删除所有app数据
|
||||||
|
l.svcCtx.Cached.DeleteAllFromEtcd(l.ctx)
|
||||||
|
// 添加新数据
|
||||||
|
for _, app := range in.AppInfo {
|
||||||
|
l.svcCtx.Cached.PutToEtcd(l.ctx, app)
|
||||||
|
}
|
||||||
|
|
||||||
|
return &admin_service.CoverAppResponse{}, nil
|
||||||
|
}
|
@ -34,20 +34,26 @@ func (s *AdminServiceServer) GetAppList(ctx context.Context, in *admin_service.G
|
|||||||
return l.GetAppList(in)
|
return l.GetAppList(in)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改app列表
|
// UpdateOne 修改app数据
|
||||||
func (s *AdminServiceServer) UpdateOne(ctx context.Context, in *admin_service.AppInfo) (*admin_service.CommonResponse, error) {
|
func (s *AdminServiceServer) UpdateOne(ctx context.Context, in *admin_service.AppInfo) (*admin_service.CommonResponse, error) {
|
||||||
l := logic.NewUpdateOneLogic(ctx, s.svcCtx)
|
l := logic.NewUpdateOneLogic(ctx, s.svcCtx)
|
||||||
return l.UpdateOne(in)
|
return l.UpdateOne(in)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除app
|
// DeleteApp 删除app
|
||||||
func (s *AdminServiceServer) DeleteApp(ctx context.Context, in *admin_service.DeleteAppRequest) (*admin_service.CommonResponse, error) {
|
func (s *AdminServiceServer) DeleteApp(ctx context.Context, in *admin_service.DeleteAppRequest) (*admin_service.CommonResponse, error) {
|
||||||
l := logic.NewDeleteAppLogic(ctx, s.svcCtx)
|
l := logic.NewDeleteAppLogic(ctx, s.svcCtx)
|
||||||
return l.DeleteApp(in)
|
return l.DeleteApp(in)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加app
|
// AddApp 添加app
|
||||||
func (s *AdminServiceServer) AddApp(ctx context.Context, in *admin_service.AddAppRequest) (*admin_service.AddAppResponse, error) {
|
func (s *AdminServiceServer) AddApp(ctx context.Context, in *admin_service.AddAppRequest) (*admin_service.AddAppResponse, error) {
|
||||||
l := logic.NewAddAppLogic(ctx, s.svcCtx)
|
l := logic.NewAddAppLogic(ctx, s.svcCtx)
|
||||||
return l.AddApp(in)
|
return l.AddApp(in)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 覆盖app数据
|
||||||
|
func (s *AdminServiceServer) CoverApp(ctx context.Context, in *admin_service.CoverAppRequest) (*admin_service.CoverAppResponse, error) {
|
||||||
|
l := logic.NewCoverAppLogic(ctx, s.svcCtx)
|
||||||
|
return l.CoverApp(in)
|
||||||
|
}
|
||||||
|
@ -16,7 +16,7 @@ import (
|
|||||||
|
|
||||||
// EcpmConfig 定义数据结构
|
// EcpmConfig 定义数据结构
|
||||||
type EcpmConfig struct {
|
type EcpmConfig struct {
|
||||||
AppID string `json:"appId"`
|
AppID string `json:"appId,omitempty"`
|
||||||
ECPM float32 `json:"eCPM"`
|
ECPM float32 `json:"eCPM"`
|
||||||
IPU uint32 `json:"IPU"`
|
IPU uint32 `json:"IPU"`
|
||||||
}
|
}
|
||||||
@ -25,7 +25,7 @@ type EcpmConfig struct {
|
|||||||
type AppData struct {
|
type AppData struct {
|
||||||
AppID string `json:"appId,omitempty"`
|
AppID string `json:"appId,omitempty"`
|
||||||
AppSecret string `json:"appSecret"`
|
AppSecret string `json:"appSecret"`
|
||||||
Type string `json:"type"`
|
Type int32 `json:"type"`
|
||||||
Remark string `json:"remark"`
|
Remark string `json:"remark"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -266,6 +266,12 @@ func (data *AppDataCache) DeleteFromEtcd(ctx context.Context, key string) {
|
|||||||
_, _ = data.client.Delete(ctx, ecpmDataKey+key)
|
_, _ = data.client.Delete(ctx, ecpmDataKey+key)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DeleteAllFromEtcd 从etcd删除
|
||||||
|
func (data *AppDataCache) DeleteAllFromEtcd(ctx context.Context) {
|
||||||
|
_, _ = data.client.Delete(ctx, appDataKey, clientv3.WithPrefix())
|
||||||
|
_, _ = data.client.Delete(ctx, ecpmDataKey, clientv3.WithPrefix())
|
||||||
|
}
|
||||||
|
|
||||||
// PutToEtcd 向etcd写入
|
// PutToEtcd 向etcd写入
|
||||||
func (data *AppDataCache) PutToEtcd(ctx context.Context, appInfo *admin_service.AppInfo) {
|
func (data *AppDataCache) PutToEtcd(ctx context.Context, appInfo *admin_service.AppInfo) {
|
||||||
appData := &AppData{
|
appData := &AppData{
|
||||||
|
@ -1,12 +1 @@
|
|||||||
package config
|
package config
|
||||||
|
|
||||||
import "github.com/zeromicro/go-zero/zrpc"
|
|
||||||
|
|
||||||
type Config struct {
|
|
||||||
zrpc.RpcServerConf
|
|
||||||
AppData []struct {
|
|
||||||
AppId string
|
|
||||||
AppSecret string
|
|
||||||
Type string
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -68,7 +68,7 @@ func NewServiceContext(c config.Config) *ServiceContext {
|
|||||||
type AppData struct {
|
type AppData struct {
|
||||||
AppId string `json:"appId"`
|
AppId string `json:"appId"`
|
||||||
AppSecret string `json:"appSecret"`
|
AppSecret string `json:"appSecret"`
|
||||||
Type string `json:"type"`
|
Type int32 `json:"type"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type AppDataList []AppData
|
type AppDataList []AppData
|
||||||
|
@ -7,8 +7,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
DouyinClientType = "douyin"
|
DouyinClientType = iota
|
||||||
WechatClientType = "wechat"
|
WechatClientType
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -48,9 +48,11 @@ func (svc *ServiceContext) initEtcd() {
|
|||||||
ch := make(chan config.WatchKV)
|
ch := make(chan config.WatchKV)
|
||||||
go config.EtcdGetOneAndWatch(context.Background(), cli, EcpmConfigWatchKey, ch)
|
go config.EtcdGetOneAndWatch(context.Background(), cli, EcpmConfigWatchKey, ch)
|
||||||
|
|
||||||
|
go func() {
|
||||||
for res := range ch {
|
for res := range ch {
|
||||||
svc.EcpmConfig.SetAllByJson(strings.TrimPrefix(res.Key, EcpmConfigWatchKey), res.Value)
|
svc.EcpmConfig.SetAllByJson(strings.TrimPrefix(res.Key, EcpmConfigWatchKey), res.Value)
|
||||||
}
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
svc.etcdCli = cli
|
svc.etcdCli = cli
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@ import (
|
|||||||
"github.com/zeromicro/go-zero/zrpc"
|
"github.com/zeromicro/go-zero/zrpc"
|
||||||
"go.etcd.io/etcd/api/v3/mvccpb"
|
"go.etcd.io/etcd/api/v3/mvccpb"
|
||||||
clientv3 "go.etcd.io/etcd/client/v3"
|
clientv3 "go.etcd.io/etcd/client/v3"
|
||||||
|
"log"
|
||||||
"os"
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -60,11 +61,29 @@ func GetConfig(c *Config, serverName string) (err error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 读取公共配置并合并
|
||||||
|
serviceConfig := viper.New()
|
||||||
|
err = serviceConfig.AddRemoteProvider("etcd3", viper.GetString(EtcdAddrKey), Prefix+"common.rpc")
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("Failed to read service config: %v", err)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
serviceConfig.SetConfigType("json")
|
||||||
|
if err := serviceConfig.ReadRemoteConfig(); err != nil {
|
||||||
|
log.Fatalf("Failed to read service config: %v", err)
|
||||||
|
}
|
||||||
|
err = viper.MergeConfigMap(serviceConfig.AllSettings())
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
err = viper.Unmarshal(&c)
|
err = viper.Unmarshal(&c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
c.RpcServerConf.Name = serverName + ".rpc"
|
c.RpcServerConf.Name = serverName + ".rpc"
|
||||||
|
c.RpcServerConf.Etcd.Key = serverName + ".rpc"
|
||||||
c.RpcServerConf.ServiceConf.Mode = c.Mode
|
c.RpcServerConf.ServiceConf.Mode = c.Mode
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user