From 462fb961325b29dcda29ab8d40d2a995e82a996d Mon Sep 17 00:00:00 2001 From: shoulinwei Date: Mon, 29 Jan 2024 14:17:13 +0800 Subject: [PATCH] add prototype file --- .gitignore | 2 +- csst_dfs_proto/common/account/account.proto | 72 +++++ csst_dfs_proto/common/ephem/ephem.proto | 189 +++++++++++++ csst_dfs_proto/common/error.proto | 9 + csst_dfs_proto/common/jwt/jwt.proto | 26 ++ csst_dfs_proto/common/misc/misc.proto | 15 + csst_dfs_proto/common/oauth2/oauth2.proto | 76 +++++ csst_dfs_proto/facility/brick/brick.proto | 85 ++++++ .../facility/calmerge/calmerge.proto | 93 ++++++ .../facility/detector/detector.proto | 110 ++++++++ csst_dfs_proto/facility/level0/level0.proto | 109 +++++++ .../facility/level0prc/level0prc.proto | 56 ++++ csst_dfs_proto/facility/level1/level1.proto | 119 ++++++++ .../facility/level1prc/level1prc.proto | 56 ++++ csst_dfs_proto/facility/level2/level2.proto | 144 ++++++++++ .../level2producer/level2producer.proto | 168 +++++++++++ .../facility/level2type/level2type.proto | 68 +++++ .../facility/observation/observation.proto | 87 ++++++ .../facility/otherdata/otherdata.proto | 60 ++++ csst_dfs_proto/hstdm/level2/level2.proto | 86 ++++++ csst_dfs_proto/msc/level2/level2.proto | 265 ++++++++++++++++++ csst_dfs_proto/msc/level2co/level2co.proto | 239 ++++++++++++++++ .../sls/level2spectra/level2spectra.proto | 84 ++++++ 23 files changed, 2217 insertions(+), 1 deletion(-) create mode 100644 csst_dfs_proto/common/account/account.proto create mode 100644 csst_dfs_proto/common/ephem/ephem.proto create mode 100644 csst_dfs_proto/common/error.proto create mode 100644 csst_dfs_proto/common/jwt/jwt.proto create mode 100644 csst_dfs_proto/common/misc/misc.proto create mode 100644 csst_dfs_proto/common/oauth2/oauth2.proto create mode 100644 csst_dfs_proto/facility/brick/brick.proto create mode 100644 csst_dfs_proto/facility/calmerge/calmerge.proto create mode 100644 csst_dfs_proto/facility/detector/detector.proto create mode 100644 csst_dfs_proto/facility/level0/level0.proto create mode 100644 csst_dfs_proto/facility/level0prc/level0prc.proto create mode 100644 csst_dfs_proto/facility/level1/level1.proto create mode 100644 csst_dfs_proto/facility/level1prc/level1prc.proto create mode 100644 csst_dfs_proto/facility/level2/level2.proto create mode 100644 csst_dfs_proto/facility/level2producer/level2producer.proto create mode 100644 csst_dfs_proto/facility/level2type/level2type.proto create mode 100644 csst_dfs_proto/facility/observation/observation.proto create mode 100644 csst_dfs_proto/facility/otherdata/otherdata.proto create mode 100644 csst_dfs_proto/hstdm/level2/level2.proto create mode 100644 csst_dfs_proto/msc/level2/level2.proto create mode 100644 csst_dfs_proto/msc/level2co/level2co.proto create mode 100644 csst_dfs_proto/sls/level2spectra/level2spectra.proto diff --git a/.gitignore b/.gitignore index 1cbc3e0..51ed9f9 100644 --- a/.gitignore +++ b/.gitignore @@ -40,6 +40,6 @@ test_reports.xml **/_version.py -**/*.proto +# **/*.proto .hypothesis diff --git a/csst_dfs_proto/common/account/account.proto b/csst_dfs_proto/common/account/account.proto new file mode 100644 index 0000000..89f239e --- /dev/null +++ b/csst_dfs_proto/common/account/account.proto @@ -0,0 +1,72 @@ +syntax = "proto3"; + + +package dfs.common.account; +option go_package = "cnlab.net/csst/proto/common/account"; + +service Account { + rpc Read(ReadRequest) returns (ReadResponse) {} + rpc Create(CreateRequest) returns (CreateResponse) {} + rpc Update(UpdateRequest) returns (UpdateResponse) {} + rpc Delete(DeleteRequest) returns (DeleteResponse) {} + rpc Search(SearchRequest) returns (SearchResponse) {} +} + +message Record { + // uuid + string id = 1; + // service or user + string type = 2; + // service name, username, etc + string client_id = 3; + // we leave this blank in responses + // used for update and create + string client_secret = 4; + map metadata = 5; + // unix timestamp + int64 created = 6; + // unix timestamp + int64 updated = 7; +} + +message ReadRequest { + string id = 1; +} + +message ReadResponse { + Record account = 1; +} + +message CreateRequest { + // If id is blank, one will be generated + Record account = 1; +} + +message CreateResponse { +} + +message UpdateRequest { + // Id and client_id cannot be changed + Record account = 1; +} + +message UpdateResponse { +} + +message DeleteRequest { + string id = 1; +} + +message DeleteResponse { +} + +message SearchRequest { + string client_id = 1; + string type = 2; + int64 limit = 3; + int64 offset = 4; +} + +message SearchResponse { + repeated Record accounts = 1; +} diff --git a/csst_dfs_proto/common/ephem/ephem.proto b/csst_dfs_proto/common/ephem/ephem.proto new file mode 100644 index 0000000..76fb740 --- /dev/null +++ b/csst_dfs_proto/common/ephem/ephem.proto @@ -0,0 +1,189 @@ +syntax = "proto3"; + +package dfs.ephem; +option go_package = "cnlab.net/csst/proto/common/ephem"; + +import "common/error.proto"; + +service EphemSearchSrv { + rpc Gaia3Search(EphemSearchRequest) returns (stream Gaia3SearchResponse) {} +} + +message Gaia3Record { + int64 SolutionId = 1; + string Designation = 2; + int64 SourceId = 3; + int64 RandomIndex = 4; + double RefEpoch = 5; + double Ra = 6; + double RaError = 7; + double Dec = 8; + double DecError = 9; + double Parallax = 10; + double ParallaxError = 11; + double ParallaxOverError = 12; + double Pm = 13; + double Pmra = 14; + double PmraError = 15; + double Pmdec = 16; + double PmdecError = 17; + double RaDecCorr = 18; + double RaParallaxCorr = 19; + double RaPmraCorr = 20; + double RaPmdecCorr = 21; + double DecParallaxCorr = 22; + double DecPmraCorr = 23; + double DecPmdecCorr = 24; + double ParallaxPmraCorr = 25; + double ParallaxPmdecCorr = 26; + double PmraPmdecCorr = 27; + int64 AstrometricNObsAl = 28; + int64 AstrometricNObsAc = 29; + int64 AstrometricNGoodObsAl = 30; + int64 AstrometricNBadObsAl = 31; + double AstrometricGofAl = 32; + double AstrometricChi2Al = 33; + double AstrometricExcessNoise = 34; + double AstrometricExcessNoiseSig = 35; + int64 AstrometricParamsSolved = 36; + int32 AstrometricPrimaryFlag = 37; + double NuEffUsedInAstrometry = 38; + double Pseudocolour = 39; + double PseudocolourError = 40; + double RaPseudocolourCorr = 41; + double DecPseudocolourCorr = 42; + double ParallaxPseudocolourCorr = 43; + double PmraPseudocolourCorr = 44; + double PmdecPseudocolourCorr = 45; + int64 AstrometricMatchedTransits = 46; + int64 VisibilityPeriodsUsed = 47; + double AstrometricSigma5dMax = 48; + int64 MatchedTransits = 49; + int64 NewMatchedTransits = 50; + int64 MatchedTransitsRemoved = 51; + double IpdGofHarmonicAmplitude = 52; + double IpdGofHarmonicPhase = 53; + int64 IpdFracMultiPeak = 54; + int64 IpdFracOddWin = 55; + double Ruwe = 56; + double ScanDirectionStrengthK1 = 57; + double ScanDirectionStrengthK2 = 58; + double ScanDirectionStrengthK3 = 59; + double ScanDirectionStrengthK4 = 60; + double ScanDirectionMeanK1 = 61; + double ScanDirectionMeanK2 = 62; + double ScanDirectionMeanK3 = 63; + double ScanDirectionMeanK4 = 64; + int32 DuplicatedSource = 65; + int64 PhotGNObs = 66; + double PhotGMeanFlux = 67; + double PhotGMeanFluxError = 68; + double PhotGMeanFluxOverError = 69; + double PhotGMeanMag = 70; + int64 PhotBpNObs = 71; + double PhotBpMeanFlux = 72; + double PhotBpMeanFluxError = 73; + double PhotBpMeanFluxOverError = 74; + double PhotBpMeanMag = 75; + int64 PhotRpNObs = 76; + double PhotRpMeanFlux = 77; + double PhotRpMeanFluxError = 78; + double PhotRpMeanFluxOverError = 79; + double PhotRpMeanMag = 80; + double PhotBpRpExcessFactor = 81; + double PhotBpNContaminatedTransits = 82; + double PhotBpNBlendedTransits = 83; + double PhotRpNContaminatedTransits = 84; + double PhotRpNBlendedTransits = 85; + double PhotProcMode = 86; + double BpRp = 87; + double BpG = 88; + double GRp = 89; + double RadialVelocity = 90; + double RadialVelocityError = 91; + double RvMethodUsed = 92; + double RvNbTransits = 93; + double RvNbDeblendedTransits = 94; + double RvVisibilityPeriodsUsed = 95; + double RvExpectedSigToNoise = 96; + double RvRenormalisedGof = 97; + double RvChisqPvalue = 98; + double RvTimeDuration = 99; + double RvAmplitudeRobust = 100; + double RvTemplateTeff = 101; + double RvTemplateLogg = 102; + double RvTemplateFeH = 103; + double RvAtmParamOrigin = 104; + double Vbroad = 105; + double VbroadError = 106; + double VbroadNbTransits = 107; + double GrvsMag = 108; + double GrvsMagError = 109; + double GrvsMagNbTransits = 110; + double RvsSpecSigToNoise = 111; + string PhotVariableFlag = 112; + double L = 113; + double B = 114; + double EclLon = 115; + double EclLat = 116; + int32 InQsoCandidates = 117; + int32 InGalaxyCandidates = 118; + int64 NonSingleStar = 119; + int32 HasXpContinuous = 120; + int32 HasXpSampled = 121; + int32 HasRvs = 122; + int32 HasEpochPhotometry = 123; + int32 HasEpochRv = 124; + int32 HasMcmcGspphot = 125; + int32 HasMcmcMsc = 126; + int32 InAndromedaSurvey = 127; + double ClassprobDscCombmodQuasar = 128; + double ClassprobDscCombmodGalaxy = 129; + double ClassprobDscCombmodStar = 130; + double TeffGspphot = 131; + double TeffGspphotLower = 132; + double TeffGspphotUpper = 133; + double LoggGspphot = 134; + double LoggGspphotLower = 135; + double LoggGspphotUpper = 136; + double MhGspphot = 137; + double MhGspphotLower = 138; + double MhGspphotUpper = 139; + double DistanceGspphot = 140; + double DistanceGspphotLower = 141; + double DistanceGspphotUpper = 142; + double AzeroGspphot = 143; + double AzeroGspphotLower = 144; + double AzeroGspphotUpper = 145; + double AgGspphot = 146; + double AgGspphotLower = 147; + double AgGspphotUpper = 148; + double EbpminrpGspphot = 149; + double EbpminrpGspphotLower = 150; + double EbpminrpGspphotUpper = 151; + string LibnameGspphot = 152; + int32 NS8HIdx = 153; + int32 NS16HIdx = 154; + int32 NS32HIdx = 155; + int32 NS64HIdx = 156; + int32 FileIdx = 157; +} + +message EphemSearchRequest { + double ra = 1; + double dec = 2; + double radius = 3; + string columns = 4; + double minMag = 5; + double maxMag = 6; + int64 obstime = 7; + int64 limit = 8; +} + +message Gaia3SearchResponse { + bool success = 1; + int32 totalCount = 2; + common.Error error = 3; + bytes records = 4; +} + diff --git a/csst_dfs_proto/common/error.proto b/csst_dfs_proto/common/error.proto new file mode 100644 index 0000000..3c6f568 --- /dev/null +++ b/csst_dfs_proto/common/error.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; +package common; + +option go_package = "cnlab.net/csst/proto/common"; + +message Error { + int32 code = 1; + string detail = 2; +} \ No newline at end of file diff --git a/csst_dfs_proto/common/jwt/jwt.proto b/csst_dfs_proto/common/jwt/jwt.proto new file mode 100644 index 0000000..6d39eb1 --- /dev/null +++ b/csst_dfs_proto/common/jwt/jwt.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; + +package dfs.jwt; +option go_package = "cnlab.net/csst/proto/common/auth"; +import "common/error.proto"; + +service AuthSrv { + rpc MakeAccessToken (Request) returns (Response) { + } + rpc DelUserAccessToken (Request) returns (Response) { + } + rpc GetCachedAccessToken (Request) returns (Response) { + } +} + +message Request { + int64 userId = 1; + string userName = 2; + string token = 3; +} + +message Response { + bool success = 1; + common.Error error = 2; + string token = 3; +} \ No newline at end of file diff --git a/csst_dfs_proto/common/misc/misc.proto b/csst_dfs_proto/common/misc/misc.proto new file mode 100644 index 0000000..496dd89 --- /dev/null +++ b/csst_dfs_proto/common/misc/misc.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; + +package dfs.common.misc; +option go_package = "cnlab.net/csst/proto/common/misc"; + +service MiscSrv { + rpc GetSeqId(GetSeqIdReq) returns (GetSeqIdResp) {} +} + +message GetSeqIdReq { + string prefix = 1; +} +message GetSeqIdResp { + int64 nextId = 1; +} diff --git a/csst_dfs_proto/common/oauth2/oauth2.proto b/csst_dfs_proto/common/oauth2/oauth2.proto new file mode 100644 index 0000000..91524b9 --- /dev/null +++ b/csst_dfs_proto/common/oauth2/oauth2.proto @@ -0,0 +1,76 @@ +syntax = "proto3"; + +package dfs.common.oauth2; +option go_package = "cnlab.net/csst/proto/common/oauth2"; + +service Oauth2 { + rpc Authorize(AuthorizeRequest) returns (AuthorizeResponse) {} + rpc Token(TokenRequest) returns (TokenResponse) {} + rpc Revoke(RevokeRequest) returns (RevokeResponse) {} + rpc Introspect(IntrospectRequest) returns (IntrospectResponse) {} +} + +message Token { + string access_token = 1; + string token_type = 2; + string refresh_token = 3; + int64 expires_at = 4; + repeated string scopes = 5; + // metadata associated with the token + map metadata = 6; +} + +message AuthorizeRequest { + // code, token (not supported) + string response_type = 1; + string client_id = 2; + repeated string scopes = 3; + string state = 4; + string redirect_uri = 5; +} + +message AuthorizeResponse { + string code = 1; + string state = 2; + + // implicit response + Token token = 3; +} + +message TokenRequest { + string client_id = 1; + string client_secret = 2; + string code = 3; + // password (not supported), client_credentials, authorization_code, refresh_token + string grant_type = 4; + string redirect_uri = 5; + string refresh_token = 6; + + // scopes can be added for client_credentials request + repeated string scopes = 7; + // metadata to be stored with a token that's generated + map metadata = 8; +} + +message TokenResponse { + Token token = 1; +} + +message RevokeRequest { + // revoke access token + string access_token = 1; + // revoke via refresh token + string refresh_token = 2; +} + +message RevokeResponse { +} + +message IntrospectRequest { + string access_token = 1; +} + +message IntrospectResponse { + Token token = 1; + bool active = 2; +} diff --git a/csst_dfs_proto/facility/brick/brick.proto b/csst_dfs_proto/facility/brick/brick.proto new file mode 100644 index 0000000..7beb7a3 --- /dev/null +++ b/csst_dfs_proto/facility/brick/brick.proto @@ -0,0 +1,85 @@ +syntax = "proto3"; + +package dfs.facility.brick; +option go_package = "cnlab.net/csst/proto/facility/brick"; +import "common/error.proto"; + +service BrickSrv { + rpc Find(FindBrickReq) returns (FindBrickResp) {} + rpc Get(GetBrickReq) returns (GetBrickResp) {} + rpc Write(WriteBrickReq) returns (WriteBrickResp) {} + rpc FindObsStatus(FindObsStatusReq) returns (FindObsStatusResp) {} + rpc FindLevel1(FindLevel1Req) returns (FindLevel1Resp) {} +} +message BrickRecord { + int64 id = 1; + float ra = 2; + float dec = 3; + string boundingbox = 4; +} +message BrickObsStatusRecord { + int64 brick_id = 1; + string band = 2; + int32 cover_num = 3; + string update_time = 4; +} +message BrickLevel1Record { + int64 brick_id = 1; + int64 level1_id = 2; + string obs_id = 3; + string module = 4; + string obs_time = 5; +} +message FindBrickReq { + int32 limit = 1; + map other_conditions = 2; +} + +message FindBrickResp { + bool success = 1; + int32 totalCount = 2; + common.Error error = 3; + repeated BrickRecord records = 4; +} + +message GetBrickReq { + int64 id = 1; +} +message GetBrickResp { + BrickRecord record = 1; +} + +message WriteBrickReq { + BrickRecord record = 1; +} +message WriteBrickResp { + bool success = 1; + common.Error error = 2; + BrickRecord record = 3; +} +message FindObsStatusReq { + int64 brick_id = 1; + string band = 2; + int32 limit = 3; + map other_conditions = 4; +} + +message FindObsStatusResp { + bool success = 1; + int32 totalCount = 2; + common.Error error = 3; + repeated BrickObsStatusRecord records = 4; +} +message FindLevel1Req { + int64 brick_id = 1; + int64 level1_id = 2; + string module = 3; + int32 limit = 4; +} + +message FindLevel1Resp { + bool success = 1; + int32 totalCount = 2; + common.Error error = 3; + repeated BrickLevel1Record records = 4; +} \ No newline at end of file diff --git a/csst_dfs_proto/facility/calmerge/calmerge.proto b/csst_dfs_proto/facility/calmerge/calmerge.proto new file mode 100644 index 0000000..f73b151 --- /dev/null +++ b/csst_dfs_proto/facility/calmerge/calmerge.proto @@ -0,0 +1,93 @@ +syntax = "proto3"; + +package dfs.facility.calmerge; +option go_package = "cnlab.net/csst/proto/facility/calmerge"; +import "common/error.proto"; + +service CalMergeSrv { + rpc Find(FindCalMergeReq) returns (FindCalMergeResp) {} + rpc GetLatestByL0(GetLatestByL0Req) returns (GetLatestByL0Resp) {} + rpc Get(GetCalMergeReq) returns (GetCalMergeResp) {} + rpc Write(WriteCalMergeReq) returns (WriteCalMergeResp) {} + rpc UpdateQc1Status(UpdateQc1StatusReq) returns (UpdateQc1StatusResp) {} + rpc UpdateProcStatus(UpdateProcStatusReq) returns (UpdateProcStatusResp) {} +} +message CalMergeRecord { + int64 id = 1; + string cal_id = 2; + string detector_no = 3; + string ref_type = 4; + string obs_time = 5; + float exp_time = 6; + string filename = 7; + string file_path = 8; + int32 qc1_status = 9; + string qc1_time = 10; + int32 prc_status = 11; + string prc_time = 12; + string create_time = 13; + repeated string level0_ids = 14; +} + +message FindCalMergeReq { + string detector_no = 1; + string ref_type = 2; + string exp_time_start = 3; + string exp_time_end = 4; + int32 qc1_status = 5; + int32 prc_status = 6; + string file_name = 7; + int32 limit = 8; + map other_conditions = 9; +} + +message FindCalMergeResp { + bool success = 1; + int32 totalCount = 2; + common.Error error = 3; + repeated CalMergeRecord records = 4; +} +message GetLatestByL0Req { + string level0_id = 1; + string ref_type = 2; +} +message GetLatestByL0Resp { + CalMergeRecord record = 3; +} +message GetCalMergeReq { + int64 id = 1; + string cal_id = 2; +} +message GetCalMergeResp { + CalMergeRecord record = 1; +} + +message WriteCalMergeReq { + CalMergeRecord record = 1; +} +message WriteCalMergeResp { + bool success = 1; + common.Error error = 2; + CalMergeRecord record = 3; +} + +message UpdateQc1StatusReq { + int64 id = 1; + string cal_id = 2; + int32 status = 3; +} + +message UpdateQc1StatusResp { + bool success = 1; + common.Error error = 2; +} +message UpdateProcStatusReq { + int64 id = 1; + string cal_id = 2; + int32 status = 3; +} + +message UpdateProcStatusResp { + bool success = 1; + common.Error error = 2; +} diff --git a/csst_dfs_proto/facility/detector/detector.proto b/csst_dfs_proto/facility/detector/detector.proto new file mode 100644 index 0000000..9ff76b7 --- /dev/null +++ b/csst_dfs_proto/facility/detector/detector.proto @@ -0,0 +1,110 @@ +syntax = "proto3"; + +package dfs.facility.detector; +option go_package = "cnlab.net/csst/proto/facility/detector"; +import "common/error.proto"; + +service DetectorSrv { + rpc Find(FindDetectorReq) returns (FindDetectorResp) {} + rpc Get(GetDetectorReq) returns (GetDetectorResp) {} + rpc Write(WriteDetectorReq) returns (WriteDetectorResp) {} + rpc Update(UpdateDetectorReq) returns (UpdateDetectorResp) {} + rpc Delete(DeleteDetectorReq) returns (DeleteDetectorResp) {} + rpc FindStatus(FindStatusReq) returns (FindStatusResp) {} + rpc GetStatus(GetStatusReq) returns (GetStatusResp) {} + rpc WriteStatus(WriteStatusReq) returns (WriteStatusResp) {} +} +message Detector { + string no = 1; + string detector_name = 2; + string module_id = 3; + string filter_id = 4; + string create_time = 5; + string update_time = 6; +} +message DetectorStatus { + int64 id = 1; + string detector_no = 2; + string status = 3; + string status_time = 4; + string create_time = 5; +} +message FindDetectorReq { + string module_id = 1; + string key = 2; +} + +message FindDetectorResp { + bool success = 1; + int32 totalCount = 2; + common.Error error = 3; + repeated Detector records = 4; +} + +message GetDetectorReq { + string no = 1; +} + +message GetDetectorResp { + Detector record = 1; +} + +message WriteDetectorReq { + Detector record = 1; +} + +message WriteDetectorResp { + bool success = 1; + common.Error error = 2; + Detector record = 3; +} + +message UpdateDetectorReq { + Detector record = 3; +} + +message UpdateDetectorResp { + bool success = 1; + common.Error error = 2; +} +message DeleteDetectorReq { + string no = 1; +} + +message DeleteDetectorResp { + bool success = 1; + common.Error error = 2; +} +message FindStatusReq { + string detector_no = 1; + string status_begin_time = 2; + string status_end_time = 3; + int32 limit = 4; +} + +message FindStatusResp { + bool success = 1; + int32 totalCount = 2; + common.Error error = 3; + repeated DetectorStatus records = 4; +} + +message GetStatusReq { + int64 id = 1; +} + +message GetStatusResp { + DetectorStatus record = 1; +} + +message WriteStatusReq { + DetectorStatus record = 1; +} + +message WriteStatusResp { + bool success = 1; + common.Error error = 2; + DetectorStatus record = 3; +} + + diff --git a/csst_dfs_proto/facility/level0/level0.proto b/csst_dfs_proto/facility/level0/level0.proto new file mode 100644 index 0000000..b0425ea --- /dev/null +++ b/csst_dfs_proto/facility/level0/level0.proto @@ -0,0 +1,109 @@ +syntax = "proto3"; + +package dfs.facility.level0; +option go_package = "cnlab.net/csst/proto/facility/level0"; +import "common/error.proto"; + +service Level0Srv { + rpc Find(FindLevel0DataReq) returns (FindLevel0DataResp) {} + rpc FindByBrickIds(FindByBrickIdsReq) returns (FindByBrickIdsResp) {} + rpc Get(GetLevel0DataReq) returns (GetLevel0DataResp) {} + rpc Write(WriteLevel0DataReq) returns (WriteLevel0DataResp) {} + rpc UpdateQc0Status(UpdateQc0StatusReq) returns (UpdateQc0StatusResp) {} + rpc UpdateProcStatus(UpdateProcStatusReq) returns (UpdateProcStatusResp) {} +} +message Level0Record { + int64 id = 1; + string level0_id = 2; + string obs_id = 3; + string detector_no = 4; + string module_id = 5; + string obs_type = 6; + string obs_time = 7; + float exp_time = 8; + string filter = 9; + int64 detector_status_id = 10; + string filename = 11; + string file_path = 12; + int32 qc0_status = 13; + string qc0_time = 14; + int32 prc_status = 15; + string prc_time = 16; + string create_time = 17; + string header = 18; +} + +message FindLevel0DataReq { + string obs_id = 1; + string module_id = 2; + string detector_no = 3; + string obs_type = 4; + string exp_time_start = 5; + string exp_time_end = 6; + int32 qc0_status = 7; + int32 prc_status = 8; + string file_name = 9; + float ra_obj = 10; + float dec_obj = 11; + float radius = 12; + string object_name = 13; + string filter = 14; + string version = 15; + int32 limit = 16; + map other_conditions = 17; +} + +message FindLevel0DataResp { + bool success = 1; + int32 totalCount = 2; + common.Error error = 3; + repeated Level0Record records = 4; +} +message FindByBrickIdsReq { + repeated int32 brick_ids = 1; +} +message FindByBrickIdsResp { + bool success = 1; + common.Error error = 2; + repeated Level0Record records = 3; +} +message GetLevel0DataReq { + int64 id = 1; + string level0_id = 2; + string obs_type = 3; +} + +message GetLevel0DataResp { + Level0Record record = 1; +} +message WriteLevel0DataReq { + Level0Record record = 1; +} + +message WriteLevel0DataResp { + bool success = 1; + common.Error error = 2; + Level0Record record = 3; +} +message UpdateQc0StatusReq { + int64 id = 1; + string level0_id = 2; + string obs_type = 3; + int32 status = 4; +} + +message UpdateQc0StatusResp { + bool success = 1; + common.Error error = 2; +} +message UpdateProcStatusReq { + int64 id = 1; + string level0_id = 2; + string obs_type = 3; + int32 status = 4; +} + +message UpdateProcStatusResp { + bool success = 1; + common.Error error = 2; +} diff --git a/csst_dfs_proto/facility/level0prc/level0prc.proto b/csst_dfs_proto/facility/level0prc/level0prc.proto new file mode 100644 index 0000000..f2291c3 --- /dev/null +++ b/csst_dfs_proto/facility/level0prc/level0prc.proto @@ -0,0 +1,56 @@ +syntax = "proto3"; + +package dfs.facility.level0prc; +option go_package = "cnlab.net/csst/proto/facility/level0prc"; +import "common/error.proto"; + +service Level0PrcSrv { + rpc Find(FindLevel0PrcReq) returns (FindLevel0PrcResp) {} + rpc Write(WriteLevel0PrcReq) returns (WriteLevel0PrcResp) {} + rpc UpdateProcStatus(UpdateProcStatusReq) returns (UpdateProcStatusResp) {} +} +message Level0PrcRecord { + int64 id = 1; + string level0_id = 2; + string pipeline_id = 3; + string prc_module = 4; + string params_file_path = 5; + int32 prc_status = 6; + string prc_time = 7; + string result_file_path = 8; +} + +message FindLevel0PrcReq { + string level0_id = 1; + string pipeline_id = 2; + string prc_module = 3; + int32 prc_status = 4; + map other_conditions = 5; +} + +message FindLevel0PrcResp { + bool success = 1; + int32 totalCount = 2; + common.Error error = 3; + repeated Level0PrcRecord records = 4; +} + +message WriteLevel0PrcReq { + Level0PrcRecord record = 1; +} + +message WriteLevel0PrcResp { + bool success = 1; + common.Error error = 2; + Level0PrcRecord record = 3; +} + +message UpdateProcStatusReq { + int64 id = 1; + int32 status = 2; +} + +message UpdateProcStatusResp { + bool success = 1; + common.Error error = 2; +} diff --git a/csst_dfs_proto/facility/level1/level1.proto b/csst_dfs_proto/facility/level1/level1.proto new file mode 100644 index 0000000..fa1f28f --- /dev/null +++ b/csst_dfs_proto/facility/level1/level1.proto @@ -0,0 +1,119 @@ +syntax = "proto3"; + +package dfs.facility.level1; +option go_package = "cnlab.net/csst/proto/facility/level1"; +import "common/error.proto"; + +service Level1Srv { + rpc Find(FindLevel1Req) returns (FindLevel1Resp) {} + rpc FindByIds(FindByIdsReq) returns (FindByIdsResp) {} + rpc FindByBrickIds(FindByBrickIdsReq) returns (FindByBrickIdsResp) {} + rpc FindByQc1Status(FindLevel1Req) returns (FindLevel1Resp) {} + rpc Get(GetLevel1Req) returns (GetLevel1Resp) {} + rpc Write(stream WriteLevel1Req) returns (WriteLevel1Resp) {} + rpc UpdateQc1Status(UpdateQc1StatusReq) returns (UpdateQc1StatusResp) {} + rpc UpdateProcStatus(UpdateProcStatusReq) returns (UpdateProcStatusResp) {} +} +message Level1Record { + int64 id = 1; + string level0_id = 2; + string data_type = 3; + int64 cor_sci_id = 4; + string module_id = 5; + string prc_params = 6; + string filter = 7; + string filename = 8; + string file_path = 9; + int32 qc1_status = 10; + string qc1_time = 11; + int32 prc_status = 12; + string prc_time = 13; + string create_time = 14; + string pipeline_id = 15; + string header = 16; + string detector_no = 17; + string pmapname = 18; + int32 build = 19; + map refs = 20; +} + +message FindLevel1Req { + string obs_id = 1; + string level0_id = 2; + string data_type = 3; + string module_id = 4; + string create_time_start = 5; + string create_time_end = 6; + int32 qc1_status = 7; + int32 prc_status = 8; + string filename = 9; + int32 limit = 10; + string pipeline_id = 11; + string detector_no = 12; + string filter = 13; + string object_name = 14; + string pmapname = 15; + int32 build = 16; + map other_conditions = 17; +} + +message FindLevel1Resp { + bool success = 1; + int32 totalCount = 2; + common.Error error = 3; + repeated Level1Record records = 4; +} +message FindByBrickIdsReq { + repeated int32 brick_ids = 1; +} +message FindByBrickIdsResp { + bool success = 1; + common.Error error = 2; + repeated Level1Record records = 3; +} +message FindByIdsReq { + repeated int32 ids = 1; +} +message FindByIdsResp { + bool success = 1; + common.Error error = 2; + repeated Level1Record records = 3; +} +message GetLevel1Req { + int64 id = 1; + string level0_id = 2; + string data_type = 3; +} + +message GetLevel1Resp { + Level1Record record = 1; +} + +message WriteLevel1Req { + Level1Record record = 1; + bytes data = 2; +} + +message WriteLevel1Resp { + bool success = 1; + common.Error error = 2; + Level1Record record = 3; +} +message UpdateQc1StatusReq { + int64 id = 1; + int32 status = 2; +} + +message UpdateQc1StatusResp { + bool success = 1; + common.Error error = 2; +} +message UpdateProcStatusReq { + int64 id = 1; + int32 status = 2; +} + +message UpdateProcStatusResp { + bool success = 1; + common.Error error = 2; +} diff --git a/csst_dfs_proto/facility/level1prc/level1prc.proto b/csst_dfs_proto/facility/level1prc/level1prc.proto new file mode 100644 index 0000000..c483a71 --- /dev/null +++ b/csst_dfs_proto/facility/level1prc/level1prc.proto @@ -0,0 +1,56 @@ +syntax = "proto3"; + +package dfs.facility.level1prc; +option go_package = "cnlab.net/csst/proto/facility/level1prc"; +import "common/error.proto"; + +service Level1PrcSrv { + rpc Find(FindLevel1PrcReq) returns (FindLevel1PrcResp) {} + rpc Write(WriteLevel1PrcReq) returns (WriteLevel1PrcResp) {} + rpc UpdateProcStatus(UpdateProcStatusReq) returns (UpdateProcStatusResp) {} +} +message Level1PrcRecord { + int64 id = 1; + int64 level1_id = 2; + string pipeline_id = 3; + string prc_module = 4; + string params_file_path = 5; + int32 prc_status = 6; + string prc_time = 7; + string result_file_path = 8; +} + +message FindLevel1PrcReq { + int64 level1_id = 1; + string pipeline_id = 2; + string prc_module = 3; + int32 prc_status = 4; + map other_conditions = 5; +} + +message FindLevel1PrcResp { + bool success = 1; + int32 totalCount = 2; + common.Error error = 3; + repeated Level1PrcRecord records = 4; +} + +message WriteLevel1PrcReq { + Level1PrcRecord record = 1; +} + +message WriteLevel1PrcResp { + bool success = 1; + common.Error error = 2; + Level1PrcRecord record = 3; +} + +message UpdateProcStatusReq { + int64 id = 1; + int32 status = 2; +} + +message UpdateProcStatusResp { + bool success = 1; + common.Error error = 2; +} diff --git a/csst_dfs_proto/facility/level2/level2.proto b/csst_dfs_proto/facility/level2/level2.proto new file mode 100644 index 0000000..80478fc --- /dev/null +++ b/csst_dfs_proto/facility/level2/level2.proto @@ -0,0 +1,144 @@ +syntax = "proto3"; + +package dfs.facility.level2; +option go_package = "cnlab.net/csst/proto/facility/level2"; +import "common/error.proto"; + +service Level2Srv { + rpc Find(FindLevel2Req) returns (FindLevel2Resp) {} + rpc FindCatalog(FindLevel2CatalogReq) returns (stream FindLevel2CatalogResp) {} + rpc FindExistedBricks(FindExistedBricksReq) returns (FindExistedBricksResp) {} + rpc Get(GetLevel2Req) returns (GetLevel2Resp) {} + rpc Write(stream WriteLevel2Req) returns (WriteLevel2Resp) {} + rpc UpdateQc2Status(UpdateQc2StatusReq) returns (UpdateQc2StatusResp) {} + rpc UpdateProcStatus(UpdateProcStatusReq) returns (UpdateProcStatusResp) {} + rpc ExecSQL(ExecSQLReq) returns (ExecSQLResp) {} + rpc CoordCond(CoordCondReq) returns (CoordCondResp) {} +} +message Level2Record { + int64 id = 1; + string level0_id = 2; + int64 level1_id = 3; + int64 brick_id = 4; + string module_id = 5; + string object_name = 6; + string data_type = 7; + string filename = 8; + string file_path = 9; + int32 qc2_status = 10; + string qc2_time = 11; + int32 prc_status = 12; + string prc_time = 13; + string create_time = 14; + string update_time = 15; + string pipeline_id = 16; + int32 import_status = 17; + int32 build = 18; +} + +message FindLevel2Req { + string level0_id = 1; + int64 level1_id = 2; + int64 brick_id = 3; + string data_type = 4; + string module_id = 5; + string create_time_start = 6; + string create_time_end = 7; + int32 qc2_status = 8; + int32 prc_status = 9; + int32 import_status = 10; + string filename = 11; + string object_name = 12; + string pipeline_id = 13; + int32 build = 14; + int32 limit = 15; + int32 page = 16; + map other_conditions = 17; +} + +message FindLevel2Resp { + bool success = 1; + int32 totalCount = 2; + common.Error error = 3; + repeated Level2Record records = 4; +} + +message GetLevel2Req { + int64 id = 1; +} + +message GetLevel2Resp { + Level2Record record = 1; +} + +message WriteLevel2Req { + Level2Record record = 1; + bytes data = 2; +} + +message WriteLevel2Resp { + bool success = 1; + common.Error error = 2; + Level2Record record = 3; +} +message UpdateQc2StatusReq { + int64 id = 1; + int32 status = 2; +} + +message UpdateQc2StatusResp { + bool success = 1; + common.Error error = 2; +} +message UpdateProcStatusReq { + int64 id = 1; + int32 status = 2; +} + +message UpdateProcStatusResp { + bool success = 1; + common.Error error = 2; +} + +message FindLevel2CatalogReq { + string sql = 1; + int32 limit = 2; +} + +message FindLevel2CatalogResp { + bool success = 1; + int32 totalCount = 2; + common.Error error = 3; + bytes records = 4; +} +message FindExistedBricksReq { + string data_type = 1; +} +message FindExistedBricksResp { + bool success = 1; + common.Error error = 2; + repeated int32 brick_ids = 3; +} +message ExecSQLReq { + string sql = 1; +} + +message ExecSQLResp { + bool success = 1; + int32 totalCount = 2; + common.Error error = 3; +} + +message CoordCondReq { + string data_type = 1; + double ra = 2; + double dec = 3; + double radius = 4; +} + +message CoordCondResp { + bool success = 1; + int32 totalCount = 2; + common.Error error = 3; + string condition = 4; +} \ No newline at end of file diff --git a/csst_dfs_proto/facility/level2producer/level2producer.proto b/csst_dfs_proto/facility/level2producer/level2producer.proto new file mode 100644 index 0000000..c7342bb --- /dev/null +++ b/csst_dfs_proto/facility/level2producer/level2producer.proto @@ -0,0 +1,168 @@ +syntax = "proto3"; + +package dfs.facility.level2producer; +option go_package = "cnlab.net/csst/proto/facility/level2producer"; +import "common/error.proto"; + +service Level2ProducerSrv { + rpc Register(RegisterReq) returns (RegisterResp) {} + rpc Find(FindReq) returns (FindResp) {} + rpc FindNexts(FindNextsReq) returns (FindNextsResp) {} + rpc FindStart(FindStartReq) returns (FindStartResp) {} + rpc Get(GetReq) returns (GetResp) {} + rpc Update(UpdateReq) returns (UpdateResp) {} + rpc Delete(DeleteReq) returns (DeleteResp) {} + + rpc NewJob(NewJobReq) returns (NewJobResp) {} + rpc GetJob(GetJobReq) returns (GetJobResp) {} + rpc UpdateJob(UpdateJobReq) returns (UpdateJobResp) {} + + rpc WriteRunning(WriteRunningReq) returns (WriteRunningResp) {} + rpc GetRunning(GetRunningReq) returns (GetRunningResp) {} + rpc UpdateRunning(UpdateRunningReq) returns (UpdateRunningResp) {} + rpc FindRunning(FindRunningReq) returns (FindRunningResp) {} +} +message Level2ProducerRecord { + int64 id = 1; + string name = 2; + string gitlink = 3; + string paramfiles = 4; + string image = 5; + int32 priority = 6; + repeated int64 pre_producers = 7; + string create_time = 8; + string update_time = 9; +} +message Level2JobRecord { + int64 id = 1; + string name = 2; + string dag = 3; + int32 status = 4; + string create_time = 5; + string update_time = 6; +} +message Level2ProducerRuningRecord { + int64 id = 1; + int64 job_id = 2; + int64 producer_id = 3; + int64 brick_id = 4; + string start_time = 5; + string end_time = 6; + int32 prc_status = 7; + string prc_result = 8; + string create_time = 9; + string update_time = 10; +} +message RegisterReq { + Level2ProducerRecord record = 1; +} +message RegisterResp { + bool success = 1; + common.Error error = 2; + Level2ProducerRecord record = 3; +} +message FindReq { + string key = 1; + int32 limit = 2; +} +message FindResp { + bool success = 1; + int32 totalCount = 2; + common.Error error = 3; + repeated Level2ProducerRecord records = 4; +} +message FindStartReq { + string key = 1; +} +message FindStartResp { + bool success = 1; + int32 totalCount = 2; + common.Error error = 3; + repeated Level2ProducerRecord records = 4; +} +message FindNextsReq { + int64 id = 1; +} +message FindNextsResp { + bool success = 1; + int32 totalCount = 2; + common.Error error = 3; + repeated Level2ProducerRecord records = 4; +} +message GetReq { + int64 id = 1; +} +message GetResp { + Level2ProducerRecord record = 1; +} +message UpdateReq { + Level2ProducerRecord record = 1; +} +message UpdateResp { + bool success = 1; + common.Error error = 2; +} +message DeleteReq { + int64 id = 1; +} +message DeleteResp { + bool success = 1; + common.Error error = 2; +} +message NewJobReq { + Level2JobRecord record = 1; +} +message NewJobResp { + bool success = 1; + common.Error error = 2; + Level2JobRecord record = 3; +} +message GetJobReq { + int64 id = 1; +} +message GetJobResp { + Level2JobRecord record = 1; +} +message UpdateJobReq { + Level2JobRecord record = 1; +} +message UpdateJobResp { + bool success = 1; + common.Error error = 2; +} +message WriteRunningReq { + Level2ProducerRuningRecord record = 1; +} +message WriteRunningResp { + bool success = 1; + common.Error error = 2; + Level2ProducerRuningRecord record = 3; +} +message GetRunningReq { + int64 id = 1; +} +message GetRunningResp { + Level2ProducerRuningRecord record = 1; +} +message UpdateRunningReq { + Level2ProducerRuningRecord record = 1; +} +message UpdateRunningResp { + bool success = 1; + common.Error error = 2; +} +message FindRunningReq { + int64 job_id = 1; + int64 producer_id = 2; + int64 brick_id = 3; + int32 prc_status = 4; + string start_time = 5; + string end_time = 6; + int32 limit = 7; +} +message FindRunningResp { + bool success = 1; + int32 totalCount = 2; + common.Error error = 3; + repeated Level2ProducerRuningRecord records = 4; +} diff --git a/csst_dfs_proto/facility/level2type/level2type.proto b/csst_dfs_proto/facility/level2type/level2type.proto new file mode 100644 index 0000000..aff0f77 --- /dev/null +++ b/csst_dfs_proto/facility/level2type/level2type.proto @@ -0,0 +1,68 @@ +syntax = "proto3"; + +package dfs.facility.level2Type; +option go_package = "cnlab.net/csst/proto/facility/level2Type"; +import "common/error.proto"; + +service Level2TypeSrv { + rpc Find(FindLevel2TypeReq) returns (FindLevel2TypeResp) {} + rpc Get(GetLevel2TypeReq) returns (GetLevel2TypeResp) {} + rpc Write(stream WriteLevel2TypeReq) returns (WriteLevel2TypeResp) {} + rpc UpdateImportStatus(UpdateImportStatusReq) returns (UpdateImportStatusResp) {} +} +message Level2TypeRecord { + string data_type = 1; + string module_id = 2; + string key_column = 3; + int32 hdu_index = 4; + string demo_filename = 5; + string demo_file_path = 6; + string ra_column = 7; + string dec_column = 8; + string update_time = 9; + string create_time = 10; + int32 import_status = 11; +} + +message FindLevel2TypeReq { + string module_id = 1; + string data_type = 2; + int32 import_status = 3; + int32 page = 4; + int32 limit = 5; +} + +message FindLevel2TypeResp { + bool success = 1; + int32 totalCount = 2; + common.Error error = 3; + repeated Level2TypeRecord records = 4; +} + +message GetLevel2TypeReq { + string data_type = 1; +} + +message GetLevel2TypeResp { + Level2TypeRecord record = 1; +} + +message WriteLevel2TypeReq { + Level2TypeRecord record = 1; + bytes data = 2; +} + +message WriteLevel2TypeResp { + bool success = 1; + common.Error error = 2; + Level2TypeRecord record = 3; +} +message UpdateImportStatusReq { + string data_type = 1; + int32 status = 2; +} + +message UpdateImportStatusResp { + bool success = 1; + common.Error error = 2; +} \ No newline at end of file diff --git a/csst_dfs_proto/facility/observation/observation.proto b/csst_dfs_proto/facility/observation/observation.proto new file mode 100644 index 0000000..c7beae8 --- /dev/null +++ b/csst_dfs_proto/facility/observation/observation.proto @@ -0,0 +1,87 @@ +syntax = "proto3"; + +package dfs.facility.observation; +option go_package = "cnlab.net/csst/proto/facility/observation"; +import "common/error.proto"; + +service ObservationSrv { + rpc Find(FindObservationReq) returns (FindObservationResp) {} + rpc Get(GetObservationReq) returns (GetObservationResp) {} + rpc Write(WriteObservationReq) returns (WriteObservationResp) {} + rpc UpdateQc0Status(UpdateQc0StatusReq) returns (UpdateQc0StatusResp) {} + rpc UpdateProcStatus(UpdateProcStatusReq) returns (UpdateProcStatusResp) {} +} +message Observation { + int64 id = 1; + string obs_id = 2; + string obs_time = 3; + float exp_time = 4; + string module_id = 5; + string obs_type = 6; + int64 facility_status_id = 7; + int64 module_status_id = 8; + int32 qc0_status = 9; + string qc0_time = 10; + int32 prc_status = 11; + string prc_time = 12; + string create_time = 13; + int32 import_status = 14; +} + +message FindObservationReq { + string module_id = 1; + string obs_type = 2; + string exp_time_start = 3; + string exp_time_end = 4; + int32 qc0_status = 5; + int32 prc_status = 6; + int32 limit = 7; + map other_conditions = 8; +} + +message FindObservationResp { + bool success = 1; + int32 totalCount = 2; + common.Error error = 3; + repeated Observation records = 4; +} + +message GetObservationReq { + int64 id = 1; + string obs_id = 2; +} + +message GetObservationResp { + Observation observation = 1; +} + +message WriteObservationReq { + Observation record = 1; +} + +message WriteObservationResp { + bool success = 1; + common.Error error = 2; + Observation record = 3; +} + +message UpdateQc0StatusReq { + int64 id = 1; + string obs_id = 2; + int32 status = 3; +} + +message UpdateQc0StatusResp { + bool success = 1; + common.Error error = 2; +} +message UpdateProcStatusReq { + int64 id = 1; + string obs_id = 2; + int32 status = 3; +} + +message UpdateProcStatusResp { + bool success = 1; + common.Error error = 2; +} diff --git a/csst_dfs_proto/facility/otherdata/otherdata.proto b/csst_dfs_proto/facility/otherdata/otherdata.proto new file mode 100644 index 0000000..3db1057 --- /dev/null +++ b/csst_dfs_proto/facility/otherdata/otherdata.proto @@ -0,0 +1,60 @@ +syntax = "proto3"; + +package dfs.facility.otherdata; +option go_package = "cnlab.net/csst/proto/facility/otherdata"; +import "common/error.proto"; + +service OtherDataSrv { + rpc Find(FindOtherDataReq) returns (FindOtherDataResp) {} + rpc Get(GetOtherDataReq) returns (GetOtherDataResp) {} + rpc Write(stream WriteOtherDataReq) returns (WriteOtherDataResp) {} +} +message OtherDataRecord { + int64 id = 1; + string obs_id = 2; + string detector_no = 3; + string module_id = 4; + string file_type = 5; + string filename = 6; + string file_path = 7; + string create_time = 8; + string pipeline_id = 9; +} + +message FindOtherDataReq { + string obs_id = 1; + string module_id = 2; + string detector_no = 3; + string file_type = 4; + string filename = 5; + string create_time_start = 6; + string create_time_end = 7; + string pipeline_id = 8; + int32 limit = 9; +} + +message FindOtherDataResp { + bool success = 1; + int32 totalCount = 2; + common.Error error = 3; + repeated OtherDataRecord records = 4; +} + +message GetOtherDataReq { + int64 id = 1; +} + +message GetOtherDataResp { + OtherDataRecord record = 1; +} +message WriteOtherDataReq { + OtherDataRecord record = 1; + bytes data = 2; +} + +message WriteOtherDataResp { + bool success = 1; + common.Error error = 2; + OtherDataRecord record = 3; +} + diff --git a/csst_dfs_proto/hstdm/level2/level2.proto b/csst_dfs_proto/hstdm/level2/level2.proto new file mode 100644 index 0000000..2a762bd --- /dev/null +++ b/csst_dfs_proto/hstdm/level2/level2.proto @@ -0,0 +1,86 @@ +syntax = "proto3"; + +package dfs.hstdm.level2; +option go_package = "cnlab.net/csst/proto/hstdm/level2"; +import "common/error.proto"; + +service Level2Srv { + rpc Find(FindLevel2Req) returns (FindLevel2Resp) {} + rpc Get(GetLevel2Req) returns (GetLevel2Resp) {} + rpc Write(stream WriteLevel2Req) returns (WriteLevel2Resp) {} + rpc UpdateQc2Status(UpdateQc2StatusReq) returns (UpdateQc2StatusResp) {} + rpc UpdateProcStatus(UpdateProcStatusReq) returns (UpdateProcStatusResp) {} +} +message Level2Record { + int64 id = 1; + string level0_id = 2; + int64 level1_id = 3; + int64 project_id = 4; + string file_type = 5; + string filename = 6; + string file_path = 7; + int32 qc2_status = 8; + string qc2_time = 9; + int32 prc_status = 10; + string prc_time = 11; + string create_time = 12; + string pipeline_id = 13; +} + +message FindLevel2Req { + string level0_id = 1; + int64 level1_id = 2; + int64 project_id = 3; + int64 file_type = 4; + string create_time_start = 5; + string create_time_end = 6; + int32 qc2_status = 7; + int32 prc_status = 8; + string filename = 9; + int32 limit = 10; + map other_conditions = 11; +} + +message FindLevel2Resp { + bool success = 1; + int32 totalCount = 2; + common.Error error = 3; + repeated Level2Record records = 4; +} + +message GetLevel2Req { + int64 id = 1; +} + +message GetLevel2Resp { + Level2Record record = 1; +} + +message WriteLevel2Req { + Level2Record record = 1; + bytes data = 2; +} + +message WriteLevel2Resp { + bool success = 1; + common.Error error = 2; + Level2Record record = 3; +} +message UpdateQc2StatusReq { + int64 id = 1; + int32 status = 2; +} + +message UpdateQc2StatusResp { + bool success = 1; + common.Error error = 2; +} +message UpdateProcStatusReq { + int64 id = 1; + int32 status = 2; +} + +message UpdateProcStatusResp { + bool success = 1; + common.Error error = 2; +} diff --git a/csst_dfs_proto/msc/level2/level2.proto b/csst_dfs_proto/msc/level2/level2.proto new file mode 100644 index 0000000..02d1ba7 --- /dev/null +++ b/csst_dfs_proto/msc/level2/level2.proto @@ -0,0 +1,265 @@ +syntax = "proto3"; + +package dfs.msc.level2; +option go_package = "cnlab.net/csst/proto/msc/level2"; +import "common/error.proto"; + +service Level2Srv { + rpc Find(FindLevel2Req) returns (FindLevel2Resp) {} + rpc FindCatalog(FindLevel2CatalogReq) returns (stream FindLevel2CatalogResp) {} + rpc FindCatalogFile(FindLevel2CatalogReq) returns (FindCatalogFileResp) {} + rpc FindExistedBricks(FindExistedBricksReq) returns (FindExistedBricksResp) {} + rpc Get(GetLevel2Req) returns (GetLevel2Resp) {} + rpc Write(stream WriteLevel2Req) returns (WriteLevel2Resp) {} + rpc UpdateQc2Status(UpdateQc2StatusReq) returns (UpdateQc2StatusResp) {} + rpc UpdateProcStatus(UpdateProcStatusReq) returns (UpdateProcStatusResp) {} + rpc DeleteCatalogByLevel2Id(DeleteCatalogByLevel2IdReq) returns (DeleteCatalogByLevel2IdResp) {} +} +message Level2Record { + int64 id = 1; + string level0_id = 2; + int64 level1_id = 3; + string data_type = 4; + string filename = 5; + string file_path = 6; + string obs_time = 7; + int32 qc2_status = 8; + string qc2_time = 9; + int32 prc_status = 10; + string prc_time = 11; + string create_time = 12; + string pipeline_id = 13; + int32 import_status = 14; +} + +message FindLevel2Req { + string level0_id = 1; + int64 level1_id = 2; + string data_type = 3; + string create_time_start = 4; + string create_time_end = 5; + int32 qc2_status = 6; + int32 prc_status = 7; + string filename = 8; + int32 limit = 9; + map other_conditions = 10; +} + +message FindLevel2Resp { + bool success = 1; + int32 totalCount = 2; + common.Error error = 3; + repeated Level2Record records = 4; +} + +message GetLevel2Req { + int64 id = 1; +} + +message GetLevel2Resp { + Level2Record record = 1; +} +message FindExistedBricksReq { + +} +message FindExistedBricksResp { + bool success = 1; + common.Error error = 2; + repeated int32 brick_ids = 3; +} + +message WriteLevel2Req { + Level2Record record = 1; + bytes data = 2; +} + +message WriteLevel2Resp { + bool success = 1; + common.Error error = 2; + Level2Record record = 3; +} +message UpdateQc2StatusReq { + int64 id = 1; + int32 status = 2; +} + +message UpdateQc2StatusResp { + bool success = 1; + common.Error error = 2; +} +message UpdateProcStatusReq { + int64 id = 1; + int32 status = 2; +} + +message UpdateProcStatusResp { + bool success = 1; + common.Error error = 2; +} + +message Level2CatalogRecord { + int64 level2_id = 1; + int64 ID = 2; + int32 CCDNO = 3; + int32 objID = 4; + float X = 5; + double XErr = 6; + float Y = 7; + double YErr = 8; + double RA = 9; + double RAErr = 10; + double DEC = 11; + double DECErr = 12; + float A = 13; + float AErr = 14; + float B = 15; + float BErr = 16; + float PA = 17; + float PAErr = 18; + int32 Flag = 19; + int32 Flag_ISO = 20; + int32 Flag_ISO_Num = 21; + float FWHM = 22; + float AB = 23; + float E = 24; + double Flux_Kron = 25; + float FluxErr_Kron = 26; + double Mag_Kron = 27; + double MagErr_Kron = 28; + double Radius_Kron = 29; + float Sky = 30; + float Flux_Aper1 = 31; + float FluxErr_Aper1 = 32; + float Mag_Aper1 = 33; + float MagErr_Aper1 = 34; + float Flux_Aper2 = 35; + float FluxErr_Aper2 = 36; + float Mag_Aper2 = 37; + float MagErr_Aper2 = 38; + float Flux_Aper3 = 39; + float FluxErr_Aper3 = 40; + float Mag_Aper3 = 41; + float MagErr_Aper3 = 42; + float Flux_Aper4 = 43; + float FluxErr_Aper4 = 44; + float Mag_Aper4 = 45; + float MagErr_Aper4 = 46; + float Flux_Aper5 = 47; + float FluxErr_Aper5 = 48; + float Mag_Aper5 = 49; + float MagErr_Aper5 = 50; + float Flux_Aper6 = 51; + float FluxErr_Aper6 = 52; + float Mag_Aper6 = 53; + float MagErr_Aper6 = 54; + float Flux_Aper7 = 55; + float FluxErr_Aper7 = 56; + float Mag_Aper7 = 57; + float MagErr_Aper7 = 58; + float Flux_Aper8 = 59; + float FluxErr_Aper8 = 60; + float Mag_Aper8 = 61; + float MagErr_Aper8 = 62; + float Flux_Aper9 = 63; + float FluxErr_Aper9 = 64; + float Mag_Aper9 = 65; + float MagErr_Aper9 = 66; + float Flux_Aper10 = 67; + float FluxErr_Aper10 = 68; + float Mag_Aper10 = 69; + float MagErr_Aper10 = 70; + float Flux_Aper11 = 71; + float FluxErr_Aper11 = 72; + float Mag_Aper11 = 73; + float MagErr_Aper11 = 74; + float Flux_Aper12 = 75; + float FluxErr_Aper12 = 76; + float Mag_Aper12 = 77; + float MagErr_Aper12 = 78; + int32 Type = 79; + float R20 = 80; + float R50 = 81; + float R90 = 82; + double X_PSF = 83; + double Y_PSF = 84; + double RA_PSF = 85; + double DEC_PSF = 86; + float Chi2_PSF = 87; + float Flux_PSF = 88; + float FluxErr_PSF = 89; + float Mag_PSF = 90; + float MagErr_PSF = 91; + double X_Model = 92; + double Y_Model = 93; + double RA_Model = 94; + double DEC_Model = 95; + float Chi2_Model = 96; + int32 Flag_Model = 97; + float Flux_Model = 98; + float FluxErr_Model = 99; + float Mag_Model = 100; + float MagErr_Model = 101; + float Flux_Bulge = 102; + float FluxErr_Bulge = 103; + float Mag_Bulge = 104; + float MagErr_Bulge = 105; + float Re_Bulge = 106; + float ReErr_Bulge = 107; + float E_Bulge = 108; + float EErr_Bulge = 109; + float PA_Bulge = 110; + float PAErr_Bulge = 111; + float Flux_Disk = 112; + float FluxErr_Disk = 113; + float Mag_Disk = 114; + float MagErr_Disk = 115; + float Re_Disk = 116; + float ReErr_Disk = 117; + float E_Disk = 118; + float EErr_Disk = 119; + float PA_Disk = 120; + float PAErr_Disk = 121; + float Ratio_Disk = 122; + float RatioErr_Disk = 123; + float Spread_Model = 124; + float SpreadErr_Model = 125; + int32 Brick_Id = 126; +} +message FindLevel2CatalogReq { + string brick_ids = 1; + string obs_id = 2; + string detector_no = 3; + string filter = 4; + double ra = 5; + double dec = 6; + double radius = 7; + double minMag = 8; + double maxMag = 9; + string obs_time_start = 10; + string obs_time_end = 11; + int32 limit = 12; + string columns = 13; +} + +message FindLevel2CatalogResp { + bool success = 1; + int32 totalCount = 2; + common.Error error = 3; + bytes records = 4; +} + +message FindCatalogFileResp { + bool success = 1; + int32 totalCount = 2; + common.Error error = 3; + repeated Level2Record records = 4; +} + +message DeleteCatalogByLevel2IdReq { + int64 level2_id = 1; +} + +message DeleteCatalogByLevel2IdResp { + bool success = 1; + common.Error error = 2; +} \ No newline at end of file diff --git a/csst_dfs_proto/msc/level2co/level2co.proto b/csst_dfs_proto/msc/level2co/level2co.proto new file mode 100644 index 0000000..54ea6a6 --- /dev/null +++ b/csst_dfs_proto/msc/level2co/level2co.proto @@ -0,0 +1,239 @@ +syntax = "proto3"; + +package dfs.msc.level2co; +option go_package = "cnlab.net/csst/proto/msc/level2co"; +import "common/error.proto"; + +service Level2CoSrv { + rpc Find(FindLevel2CoReq) returns (FindLevel2CoResp) {} + rpc FindCatalog(FindLevel2CoCatalogReq) returns (FindLevel2CoCatalogResp) {} + rpc Get(GetLevel2CoReq) returns (GetLevel2CoResp) {} + rpc Write(stream WriteLevel2CoReq) returns (WriteLevel2CoResp) {} + rpc UpdateQc2Status(UpdateQc2StatusReq) returns (UpdateQc2StatusResp) {} + rpc UpdateProcStatus(UpdateProcStatusReq) returns (UpdateProcStatusResp) {} + rpc DeleteCatalogByLevel2CoId(DeleteCatalogByLevel2CoIdReq) returns (DeleteCatalogByLevel2CoIdResp) {} +} +message Level2CoRecord { + int64 id = 1; + string data_type = 2; + string filename = 3; + string file_path = 4; + int32 qc2_status = 5; + string qc2_time = 6; + int32 prc_status = 7; + string prc_time = 8; + string create_time = 9; + string pipeline_id = 10; + int32 import_status = 11; +} + +message FindLevel2CoReq { + string data_type = 1; + string create_time_start = 2; + string create_time_end = 3; + int32 qc2_status = 4; + int32 prc_status = 5; + string filename = 6; + int32 limit = 7; + map other_conditions = 8; +} + +message FindLevel2CoResp { + bool success = 1; + int32 totalCount = 2; + common.Error error = 3; + repeated Level2CoRecord records = 4; +} + +message GetLevel2CoReq { + int64 id = 1; +} + +message GetLevel2CoResp { + Level2CoRecord record = 1; +} + +message WriteLevel2CoReq { + Level2CoRecord record = 1; + bytes data = 2; +} + +message WriteLevel2CoResp { + bool success = 1; + common.Error error = 2; + Level2CoRecord record = 3; +} +message UpdateQc2StatusReq { + int64 id = 1; + int32 status = 2; +} + +message UpdateQc2StatusResp { + bool success = 1; + common.Error error = 2; +} +message UpdateProcStatusReq { + int64 id = 1; + int32 status = 2; +} + +message UpdateProcStatusResp { + bool success = 1; + common.Error error = 2; +} +message Level2CoCatalogRecord { + int64 ID = 1; + float X = 2; + double XErr = 3; + float Y = 4; + double YErr = 5; + double RA = 6; + double RAErr = 7; + double DEC = 8; + double DECErr = 9; + float A = 10; + float AErr = 11; + float B = 12; + float BErr = 13; + float PA = 14; + float PAErr = 15; + int32 Flag = 16; + int32 Flag_ISO = 17; + int32 Flag_ISO_Num = 18; + float FWHM = 19; + float AB = 20; + float E = 21; + double Flux_Kron = 22; + float FluxErr_Kron = 23; + double Mag_Kron = 24; + double MagErr_Kron = 25; + double Radius_Kron = 26; + float Sky = 27; + float Flux_Aper1 = 28; + float FluxErr_Aper1 = 29; + float Mag_Aper1 = 30; + float MagErr_Aper1 = 31; + float Flux_Aper2 = 32; + float FluxErr_Aper2 = 33; + float Mag_Aper2 = 34; + float MagErr_Aper2 = 35; + float Flux_Aper3 = 36; + float FluxErr_Aper3 = 37; + float Mag_Aper3 = 38; + float MagErr_Aper3 = 39; + float Flux_Aper4 = 40; + float FluxErr_Aper4 = 41; + float Mag_Aper4 = 42; + float MagErr_Aper4 = 43; + float Flux_Aper5 = 44; + float FluxErr_Aper5 = 45; + float Mag_Aper5 = 46; + float MagErr_Aper5 = 47; + float Flux_Aper6 = 48; + float FluxErr_Aper6 = 49; + float Mag_Aper6 = 50; + float MagErr_Aper6 = 51; + float Flux_Aper7 = 52; + float FluxErr_Aper7 = 53; + float Mag_Aper7 = 54; + float MagErr_Aper7 = 55; + float Flux_Aper8 = 56; + float FluxErr_Aper8 = 57; + float Mag_Aper8 = 58; + float MagErr_Aper8 = 59; + float Flux_Aper9 = 60; + float FluxErr_Aper9 = 61; + float Mag_Aper9 = 62; + float MagErr_Aper9 = 63; + float Flux_Aper10 = 64; + float FluxErr_Aper10 = 65; + float Mag_Aper10 = 66; + float MagErr_Aper10 = 67; + float Flux_Aper11 = 68; + float FluxErr_Aper11 = 69; + float Mag_Aper11 = 70; + float MagErr_Aper11 = 71; + float Flux_Aper12 = 72; + float FluxErr_Aper12 = 73; + float Mag_Aper12 = 74; + float MagErr_Aper12 = 75; + int32 Type = 76; + float R20 = 77; + float R50 = 78; + float R90 = 79; + double X_PSF = 80; + double Y_PSF = 81; + double RA_PSF = 82; + double DEC_PSF = 83; + float Chi2_PSF = 84; + float Flux_PSF = 85; + float FluxErr_PSF = 86; + float Mag_PSF = 87; + float MagErr_PSF = 88; + double X_Model = 89; + double Y_Model = 90; + double RA_Model = 91; + double DEC_Model = 92; + float Chi2_Model = 93; + int32 Flag_Model = 94; + float Flux_Model = 95; + float FluxErr_Model = 96; + float Mag_Model = 97; + float MagErr_Model = 98; + float Flux_Bulge = 99; + float FluxErr_Bulge = 100; + float Mag_Bulge = 101; + float MagErr_Bulge = 102; + float Re_Bulge = 103; + float ReErr_Bulge = 104; + float E_Bulge = 105; + float EErr_Bulge = 106; + float PA_Bulge = 107; + float PAErr_Bulge = 108; + float Flux_Disk = 109; + float FluxErr_Disk = 110; + float Mag_Disk = 111; + float MagErr_Disk = 112; + float Re_Disk = 113; + float ReErr_Disk = 114; + float E_Disk = 115; + float EErr_Disk = 116; + float PA_Disk = 117; + float PAErr_Disk = 118; + float Ratio_Disk = 119; + float RatioErr_Disk = 120; + float Spread_Model = 121; + float SpreadErr_Model = 122; + int32 NS128HIdx = 123; +} + +message FindLevel2CoCatalogReq { + string obs_id = 1; + string detector_no = 2; + string ra = 3; + string dec = 4; + double radius = 5; + double minMag = 6; + double maxMag = 7; + string obs_time_start = 8; + string obs_time_end = 9; + int32 limit = 10; +} + +message FindLevel2CoCatalogResp { + bool success = 1; + int32 totalCount = 2; + common.Error error = 3; + repeated Level2CoCatalogRecord records = 4; +} + + + +message DeleteCatalogByLevel2CoIdReq { + int64 level2_id = 1; +} + +message DeleteCatalogByLevel2CoIdResp { + bool success = 1; + common.Error error = 2; +} \ No newline at end of file diff --git a/csst_dfs_proto/sls/level2spectra/level2spectra.proto b/csst_dfs_proto/sls/level2spectra/level2spectra.proto new file mode 100644 index 0000000..e22a472 --- /dev/null +++ b/csst_dfs_proto/sls/level2spectra/level2spectra.proto @@ -0,0 +1,84 @@ +syntax = "proto3"; + +package dfs.sls.level2spectra; +option go_package = "cnlab.net/csst/proto/sls/level2spectra"; +import "common/error.proto"; + +service Level2spectraSrv { + rpc Find(FindLevel2spectraReq) returns (FindLevel2spectraResp) {} + rpc Get(GetLevel2spectraReq) returns (GetLevel2spectraResp) {} + rpc Write(stream WriteLevel2spectraReq) returns (WriteLevel2spectraResp) {} + rpc UpdateQc2Status(UpdateQc2StatusReq) returns (UpdateQc2StatusResp) {} + rpc UpdateProcStatus(UpdateProcStatusReq) returns (UpdateProcStatusResp) {} +} +message Level2spectraRecord { + int64 id = 1; + string level0_id = 2; + int64 level1_id = 3; + string file_type = 4; + string filename = 5; + string file_path = 6; + int32 qc2_status = 7; + string qc2_time = 8; + int32 prc_status = 9; + string prc_time = 10; + string create_time = 11; + string pipeline_id = 12; +} + +message FindLevel2spectraReq { + string level0_id = 1; + int64 level1_id = 2; + int64 file_type = 3; + string create_time_start = 4; + string create_time_end = 5; + int32 qc2_status = 6; + int32 prc_status = 7; + string filename = 8; + int32 limit = 9; + map other_conditions = 10; +} + +message FindLevel2spectraResp { + bool success = 1; + int32 totalCount = 2; + common.Error error = 3; + repeated Level2spectraRecord records = 4; +} + +message GetLevel2spectraReq { + int64 id = 1; +} + +message GetLevel2spectraResp { + Level2spectraRecord record = 1; +} + +message WriteLevel2spectraReq { + Level2spectraRecord record = 1; + bytes data = 2; +} + +message WriteLevel2spectraResp { + bool success = 1; + common.Error error = 2; + Level2spectraRecord record = 3; +} +message UpdateQc2StatusReq { + int64 id = 1; + int32 status = 2; +} + +message UpdateQc2StatusResp { + bool success = 1; + common.Error error = 2; +} +message UpdateProcStatusReq { + int64 id = 1; + int32 status = 2; +} + +message UpdateProcStatusResp { + bool success = 1; + common.Error error = 2; +} -- GitLab