调整授权功能

This commit is contained in:
algotao
2025-11-23 12:01:33 +08:00
parent 4575590faa
commit c9d794430e
6 changed files with 51 additions and 45 deletions

View File

@@ -157,7 +157,7 @@ const (
ErrorCode_DATA_ERROR ErrorCode = 201 // 数据错误
ErrorCode_CMD_ERROR ErrorCode = 202 // 命令行执行错误
ErrorCode_API_ERROR ErrorCode = 301 // 调用内部API错误
ErrorCode_TARGET_ERROR ErrorCode = 401 // Target参数错误
ErrorCode_PARAM_ERROR ErrorCode = 401 // 参数错误
)
// Enum value maps for ErrorCode.
@@ -189,7 +189,7 @@ var (
201: "DATA_ERROR",
202: "CMD_ERROR",
301: "API_ERROR",
401: "TARGET_ERROR",
401: "PARAM_ERROR",
}
ErrorCode_value = map[string]int32{
"SUCC": 0,
@@ -218,7 +218,7 @@ var (
"DATA_ERROR": 201,
"CMD_ERROR": 202,
"API_ERROR": 301,
"TARGET_ERROR": 401,
"PARAM_ERROR": 401,
}
)
@@ -2219,12 +2219,12 @@ func (*GrantList) Descriptor() ([]byte, []int) {
// Grant 数据授权信息
type Grant struct {
state protoimpl.MessageState `protogen:"open.v1"`
SrtaAccountId uint32 `protobuf:"varint,1,opt,name=srta_account_id,json=srtaAccountId,proto3" json:"srta_account_id,omitempty"` // sRTA授权目标账号ID
GrantIndex string `protobuf:"bytes,2,opt,name=grant_index,json=grantIndex,proto3" json:"grant_index,omitempty"` // 授权索引。格式为 "index1, index2, index55-index64",例如 "1, 2, 55-64"
DataspaceId string `protobuf:"bytes,3,opt,name=dataspace_id,json=dataspaceId,proto3" json:"dataspace_id,omitempty"` // 授权数据空间ID
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
state protoimpl.MessageState `protogen:"open.v1"`
TargetAccountId uint32 `protobuf:"varint,1,opt,name=target_account_id,json=targetAccountId,proto3" json:"target_account_id,omitempty"` // sRTA授权目标账号ID
GrantIndex string `protobuf:"bytes,2,opt,name=grant_index,json=grantIndex,proto3" json:"grant_index,omitempty"` // 授权索引。格式为 "index1, index2, index55-index64",例如 "1, 2, 55-64"
DataspaceId uint32 `protobuf:"varint,3,opt,name=dataspace_id,json=dataspaceId,proto3" json:"dataspace_id,omitempty"` // 授权数据空间ID(数字型)
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Grant) Reset() {
@@ -2257,9 +2257,9 @@ func (*Grant) Descriptor() ([]byte, []int) {
return file_cmd_proto_rawDescGZIP(), []int{24}
}
func (x *Grant) GetSrtaAccountId() uint32 {
func (x *Grant) GetTargetAccountId() uint32 {
if x != nil {
return x.SrtaAccountId
return x.TargetAccountId
}
return 0
}
@@ -2271,11 +2271,11 @@ func (x *Grant) GetGrantIndex() string {
return ""
}
func (x *Grant) GetDataspaceId() string {
func (x *Grant) GetDataspaceId() uint32 {
if x != nil {
return x.DataspaceId
}
return ""
return 0
}
// ScriptRun 运行脚本
@@ -4887,12 +4887,12 @@ const file_cmd_proto_rawDesc = "" +
"\n" +
"BindDelete\x12#\n" +
"\x05binds\x18\x02 \x03(\v2\r.saasapi.BindR\x05binds\"\v\n" +
"\tGrantList\"s\n" +
"\x05Grant\x12&\n" +
"\x0fsrta_account_id\x18\x01 \x01(\rR\rsrtaAccountId\x12\x1f\n" +
"\tGrantList\"w\n" +
"\x05Grant\x12*\n" +
"\x11target_account_id\x18\x01 \x01(\rR\x0ftargetAccountId\x12\x1f\n" +
"\vgrant_index\x18\x02 \x01(\tR\n" +
"grantIndex\x12!\n" +
"\fdataspace_id\x18\x03 \x01(\tR\vdataspaceId\"\xa1\x01\n" +
"\fdataspace_id\x18\x03 \x01(\rR\vdataspaceId\"\xa1\x01\n" +
"\tScriptRun\x12\x1d\n" +
"\n" +
"lua_script\x18\x01 \x01(\tR\tluaScript\x12\x1d\n" +
@@ -5098,7 +5098,7 @@ const file_cmd_proto_rawDesc = "" +
"\x03ADQ\x10\x02\x12\x06\n" +
"\x02MP\x10\x03\x12\n" +
"\n" +
"\x06MktApi\x10\x04*\x8d\x04\n" +
"\x06MktApi\x10\x04*\x8c\x04\n" +
"\tErrorCode\x12\b\n" +
"\x04SUCC\x10\x00\x12\x13\n" +
"\x0fINVALID_ACCOUNT\x10e\x12\x15\n" +
@@ -5127,8 +5127,8 @@ const file_cmd_proto_rawDesc = "" +
"\n" +
"DATA_ERROR\x10\xc9\x01\x12\x0e\n" +
"\tCMD_ERROR\x10\xca\x01\x12\x0e\n" +
"\tAPI_ERROR\x10\xad\x02\x12\x11\n" +
"\fTARGET_ERROR\x10\x91\x03*\x16\n" +
"\tAPI_ERROR\x10\xad\x02\x12\x10\n" +
"\vPARAM_ERROR\x10\x91\x03*\x16\n" +
"\fCmdErrorCode\x12\x06\n" +
"\x02OK\x10\x00*^\n" +
"\n" +