generated from VLADIMIR/template
updates
This commit is contained in:
parent
3b93fd0ec2
commit
a7a9715faf
@ -13,7 +13,7 @@ service pinnedMessage {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
rpc GetDays(GetDaysReq) returns (GetDaysRsp) {
|
rpc GetSchedule(GetScheduleReq) returns (GetScheduleRsp) {
|
||||||
option (google.api.http) = {
|
option (google.api.http) = {
|
||||||
get: "/schedule"
|
get: "/schedule"
|
||||||
};
|
};
|
||||||
@ -24,10 +24,11 @@ message PingReq {}
|
|||||||
|
|
||||||
message PingRsp {}
|
message PingRsp {}
|
||||||
|
|
||||||
message GetDaysReq {}
|
message GetScheduleReq {}
|
||||||
|
|
||||||
message GetDaysRsp {
|
message GetScheduleRsp {
|
||||||
repeated Day days = 1;
|
string update_time = 1;
|
||||||
|
repeated Day days = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message Day {
|
message Day {
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
import{_ as o,c as s,a as t,o as a}from"./index-B2uxpdXk.js";const n={},c={class:"about"};function r(_,e){return a(),s("div",c,e[0]||(e[0]=[t("h1",null,"This is an about page",-1)]))}const l=o(n,[["render",r]]);export{l as default};
|
import{_ as o,c as s,a as t,o as a}from"./index-C9NzeG18.js";const n={},c={class:"about"};function r(_,e){return a(),s("div",c,e[0]||(e[0]=[t("h1",null,"This is an about page",-1)]))}const l=o(n,[["render",r]]);export{l as default};
|
||||||
File diff suppressed because one or more lines are too long
26
cmd/pinned_message/static/user/assets/index-C9NzeG18.js
Normal file
26
cmd/pinned_message/static/user/assets/index-C9NzeG18.js
Normal file
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
|||||||
:root{--vt-c-white: #ffffff;--vt-c-white-soft: #f8f8f8;--vt-c-white-mute: #f2f2f2;--vt-c-black: #181818;--vt-c-black-soft: #222222;--vt-c-black-mute: #282828;--vt-c-indigo: #2c3e50;--vt-c-divider-light-1: rgba(60, 60, 60, .29);--vt-c-divider-light-2: rgba(60, 60, 60, .12);--vt-c-divider-dark-1: rgba(84, 84, 84, .65);--vt-c-divider-dark-2: rgba(84, 84, 84, .48);--vt-c-text-light-1: var(--vt-c-indigo);--vt-c-text-light-2: rgba(60, 60, 60, .66);--vt-c-text-dark-1: var(--vt-c-white);--vt-c-text-dark-2: rgba(235, 235, 235, .64)}:root{--color-background: var(--vt-c-white);--color-background-soft: var(--vt-c-white-soft);--color-background-mute: var(--vt-c-white-mute);--color-border: var(--vt-c-divider-light-2);--color-border-hover: var(--vt-c-divider-light-1);--color-heading: var(--vt-c-text-light-1);--color-text: var(--vt-c-text-light-1);--section-gap: 160px}@media (prefers-color-scheme: dark){:root{--color-background: var(--vt-c-black);--color-background-soft: var(--vt-c-black-soft);--color-background-mute: var(--vt-c-black-mute);--color-border: var(--vt-c-divider-dark-2);--color-border-hover: var(--vt-c-divider-dark-1);--color-heading: var(--vt-c-text-dark-1);--color-text: var(--vt-c-text-dark-2)}}*,*:before,*:after{box-sizing:border-box;margin:0;font-weight:400}body{min-height:100vh;color:var(--color-text);background:#eee;transition:color .5s,background-color .5s;line-height:1.6;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-size:15px;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#app{max-width:1280px;margin:0 auto;padding:1rem;font-weight:400}a,.green{text-decoration:none;color:#00bd7e;transition:.4s;padding:3px}@media (hover: hover){a:hover{background-color:#00bd7e33}}@media (min-width: 1024px){body{display:flex;place-items:center}#app{display:grid;grid-template-columns:1fr 1fr;padding:0 2rem}}.day-block[data-v-e71f008c]{border:solid 2px #000058;margin:10px 0;padding:15px;border-radius:10px}.app[data-v-ac47f220]{color:#111}.item[data-v-fd0742eb]{margin-top:2rem;display:flex;position:relative}.details[data-v-fd0742eb]{flex:1;margin-left:1rem}i[data-v-fd0742eb]{display:flex;place-items:center;place-content:center;width:32px;height:32px;color:var(--color-text)}h3[data-v-fd0742eb]{font-size:1.2rem;font-weight:500;margin-bottom:.4rem;color:var(--color-heading)}@media (min-width: 1024px){.item[data-v-fd0742eb]{margin-top:0;padding:.4rem 0 1rem calc(var(--section-gap) / 2)}i[data-v-fd0742eb]{top:calc(50% - 25px);left:-26px;position:absolute;border:1px solid var(--color-border);background:var(--color-background);border-radius:8px;width:50px;height:50px}.item[data-v-fd0742eb]:before{content:" ";border-left:1px solid var(--color-border);position:absolute;left:0;bottom:calc(50% + 25px);height:calc(50% - 25px)}.item[data-v-fd0742eb]:after{content:" ";border-left:1px solid var(--color-border);position:absolute;left:0;top:calc(50% + 25px);height:calc(50% - 25px)}.item[data-v-fd0742eb]:first-of-type:before{display:none}.item[data-v-fd0742eb]:last-of-type:after{display:none}}
|
:root{--vt-c-white: #ffffff;--vt-c-white-soft: #f8f8f8;--vt-c-white-mute: #f2f2f2;--vt-c-black: #181818;--vt-c-black-soft: #222222;--vt-c-black-mute: #282828;--vt-c-indigo: #2c3e50;--vt-c-divider-light-1: rgba(60, 60, 60, .29);--vt-c-divider-light-2: rgba(60, 60, 60, .12);--vt-c-divider-dark-1: rgba(84, 84, 84, .65);--vt-c-divider-dark-2: rgba(84, 84, 84, .48);--vt-c-text-light-1: var(--vt-c-indigo);--vt-c-text-light-2: rgba(60, 60, 60, .66);--vt-c-text-dark-1: var(--vt-c-white);--vt-c-text-dark-2: rgba(235, 235, 235, .64)}:root{--color-background: var(--vt-c-white);--color-background-soft: var(--vt-c-white-soft);--color-background-mute: var(--vt-c-white-mute);--color-border: var(--vt-c-divider-light-2);--color-border-hover: var(--vt-c-divider-light-1);--color-heading: var(--vt-c-text-light-1);--color-text: var(--vt-c-text-light-1);--section-gap: 160px}@media (prefers-color-scheme: dark){:root{--color-background: var(--vt-c-black);--color-background-soft: var(--vt-c-black-soft);--color-background-mute: var(--vt-c-black-mute);--color-border: var(--vt-c-divider-dark-2);--color-border-hover: var(--vt-c-divider-dark-1);--color-heading: var(--vt-c-text-dark-1);--color-text: var(--vt-c-text-dark-2)}}*,*:before,*:after{box-sizing:border-box;margin:0;font-weight:400}body{min-height:100vh;color:var(--color-text);background:#eee;transition:color .5s,background-color .5s;line-height:1.6;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-size:15px;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#app{max-width:1280px;margin:0 auto;padding:1rem;font-weight:400}a,.green{text-decoration:none;color:#00bd7e;transition:.4s;padding:3px}@media (hover: hover){a:hover{background-color:#00bd7e33}}@media (min-width: 1024px){body{display:flex;place-items:center}#app{display:grid;grid-template-columns:1fr 1fr;padding:0 2rem}}.day-block[data-v-757696df]{border:solid 2px #000058;margin:10px 0;padding:15px;border-radius:10px}.app[data-v-ac47f220]{color:#111}.item[data-v-fd0742eb]{margin-top:2rem;display:flex;position:relative}.details[data-v-fd0742eb]{flex:1;margin-left:1rem}i[data-v-fd0742eb]{display:flex;place-items:center;place-content:center;width:32px;height:32px;color:var(--color-text)}h3[data-v-fd0742eb]{font-size:1.2rem;font-weight:500;margin-bottom:.4rem;color:var(--color-heading)}@media (min-width: 1024px){.item[data-v-fd0742eb]{margin-top:0;padding:.4rem 0 1rem calc(var(--section-gap) / 2)}i[data-v-fd0742eb]{top:calc(50% - 25px);left:-26px;position:absolute;border:1px solid var(--color-border);background:var(--color-background);border-radius:8px;width:50px;height:50px}.item[data-v-fd0742eb]:before{content:" ";border-left:1px solid var(--color-border);position:absolute;left:0;bottom:calc(50% + 25px);height:calc(50% - 25px)}.item[data-v-fd0742eb]:after{content:" ";border-left:1px solid var(--color-border);position:absolute;left:0;top:calc(50% + 25px);height:calc(50% - 25px)}.item[data-v-fd0742eb]:first-of-type:before{display:none}.item[data-v-fd0742eb]:last-of-type:after{display:none}}
|
||||||
@ -5,8 +5,8 @@
|
|||||||
<link rel="icon" href="/favicon.ico">
|
<link rel="icon" href="/favicon.ico">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Vite App</title>
|
<title>Vite App</title>
|
||||||
<script type="module" crossorigin src="/assets/index-B2uxpdXk.js"></script>
|
<script type="module" crossorigin src="/assets/index-C9NzeG18.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-B5NHYKUL.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-DY57WNIw.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
|
|||||||
@ -23,6 +23,6 @@ func (s *Server) Ping(_ context.Context, _ *proto.PingReq) (*proto.PingRsp, erro
|
|||||||
return &proto.PingRsp{}, nil
|
return &proto.PingRsp{}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Server) GetDays(ctx context.Context, req *proto.GetDaysReq) (*proto.GetDaysRsp, error) {
|
func (s *Server) GetSchedule(ctx context.Context, req *proto.GetScheduleReq) (*proto.GetScheduleRsp, error) {
|
||||||
return s.services.GetDays(ctx, req)
|
return s.services.GetSchedule(ctx, req)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,11 @@ package models
|
|||||||
|
|
||||||
import "time"
|
import "time"
|
||||||
|
|
||||||
|
type Schedule struct {
|
||||||
|
UpdateTime string `json:"update_time"`
|
||||||
|
Days []*Day `json:"days"`
|
||||||
|
}
|
||||||
|
|
||||||
// День с событиями
|
// День с событиями
|
||||||
type Day struct {
|
type Day struct {
|
||||||
Date time.Time `json:"date"`
|
Date time.Time `json:"date"`
|
||||||
|
|||||||
@ -45,24 +45,29 @@ func (p *ScheduleParser) Run(ctx context.Context) {
|
|||||||
defer ticker.Stop()
|
defer ticker.Stop()
|
||||||
|
|
||||||
sheetURL := "https://docs.google.com/spreadsheets/d/1v57bCAG764j1ULXDMb3amNFMzkkLmObKWsl5oE0Xq00/edit?gid=57461713#gid=57461713"
|
sheetURL := "https://docs.google.com/spreadsheets/d/1v57bCAG764j1ULXDMb3amNFMzkkLmObKWsl5oE0Xq00/edit?gid=57461713#gid=57461713"
|
||||||
|
p.parseAndSaveSchedule(ctx, sheetURL)
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
return
|
return
|
||||||
case <-ticker.C:
|
case <-ticker.C:
|
||||||
days, err := p.parseSchedule(ctx, sheetURL)
|
p.parseAndSaveSchedule(ctx, sheetURL)
|
||||||
if err != nil {
|
|
||||||
log.Printf("Error parse schedule: %s\n", sheetURL)
|
|
||||||
break
|
|
||||||
}
|
|
||||||
if err := p.scheduleStorage.SaveSchedule(days); err != nil {
|
|
||||||
log.Printf("Error save err: %s schedule: %s\n", err, sheetURL)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *ScheduleParser) parseSchedule(ctx context.Context, sheetURL string) ([]*models.Day, error) {
|
func (p *ScheduleParser) parseAndSaveSchedule(ctx context.Context, sheetURL string) {
|
||||||
|
schedule, err := p.parseSchedule(ctx, sheetURL)
|
||||||
|
if err != nil {
|
||||||
|
log.Printf("Error parse schedule: %s\n", sheetURL)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if err := p.scheduleStorage.SaveSchedule(schedule); err != nil {
|
||||||
|
log.Printf("Error save err: %s schedule: %s\n", err, sheetURL)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *ScheduleParser) parseSchedule(ctx context.Context, sheetURL string) (*models.Schedule, error) {
|
||||||
var performances []performance
|
var performances []performance
|
||||||
if err := p.dataParser.Parse(ctx, sheetURL, &performances); err != nil {
|
if err := p.dataParser.Parse(ctx, sheetURL, &performances); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -70,7 +75,7 @@ func (p *ScheduleParser) parseSchedule(ctx context.Context, sheetURL string) ([]
|
|||||||
return p.mapSchedule(performances), nil
|
return p.mapSchedule(performances), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *ScheduleParser) mapSchedule(performances []performance) []*models.Day {
|
func (p *ScheduleParser) mapSchedule(performances []performance) *models.Schedule {
|
||||||
days := []*models.Day{}
|
days := []*models.Day{}
|
||||||
currentDay := &models.Day{}
|
currentDay := &models.Day{}
|
||||||
for i, performance := range performances {
|
for i, performance := range performances {
|
||||||
@ -101,7 +106,10 @@ func (p *ScheduleParser) mapSchedule(performances []performance) []*models.Day {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
days = append(days, currentDay)
|
days = append(days, currentDay)
|
||||||
return days
|
return &models.Schedule{
|
||||||
|
UpdateTime: time.Now().String(),
|
||||||
|
Days: days,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *ScheduleParser) mapDate(date string) (time.Time, error) {
|
func (p *ScheduleParser) mapDate(date string) (time.Time, error) {
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"pinned_message/internal/models"
|
"pinned_message/internal/models"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -21,36 +22,48 @@ func NewScheduleStorage(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *ScheduleStorage) SaveSchedule(days []*models.Day) error {
|
func (s *ScheduleStorage) SaveSchedule(schedule *models.Schedule) error {
|
||||||
data, err := json.Marshal(days)
|
data, err := json.Marshal(schedule)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := os.WriteFile(s.filepath, data, 0644); err != nil {
|
if err := os.WriteFile(s.filepath, data, 0644); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
log.Printf("save story to: %s", s.filepath)
|
log.Printf("save schedule to: %s", s.filepath)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *ScheduleStorage) GetSchedule() ([]*models.Day, error) {
|
func (s *ScheduleStorage) GetSchedule() (*models.Schedule, error) {
|
||||||
data, err := os.ReadFile(s.filepath)
|
data, err := os.ReadFile(s.filepath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("story file %s not found", s.filepath)
|
return nil, fmt.Errorf("schedule file %s not found", s.filepath)
|
||||||
}
|
}
|
||||||
log.Printf("load story from: %s", s.filepath)
|
log.Printf("load schedule from: %s", s.filepath)
|
||||||
days := []*models.Day{}
|
schedule := &models.Schedule{}
|
||||||
if err := json.Unmarshal(data, &days); err != nil {
|
if err := json.Unmarshal(data, &schedule); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
filterDays := make([]*models.Day, 0, len(days))
|
filterDays := make([]*models.Day, 0, len(schedule.Days))
|
||||||
for _, day := range days {
|
for _, day := range schedule.Days {
|
||||||
if isBeforeToday(day.Date) {
|
if isBeforeToday(day.Date) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
for i := range day.Performances {
|
||||||
|
filterNumbers := make([]*models.Number, 0, len(day.Performances[i].Numbers))
|
||||||
|
for _, number := range day.Performances[i].Numbers {
|
||||||
|
name := strings.TrimSpace(number.Name)
|
||||||
|
if name == "" || name == "-" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
filterNumbers = append(filterNumbers, number)
|
||||||
|
}
|
||||||
|
day.Performances[i].Numbers = filterNumbers
|
||||||
|
}
|
||||||
filterDays = append(filterDays, day)
|
filterDays = append(filterDays, day)
|
||||||
}
|
}
|
||||||
return filterDays, nil
|
schedule.Days = filterDays
|
||||||
|
return schedule, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func isBeforeToday(targetDate time.Time) bool {
|
func isBeforeToday(targetDate time.Time) bool {
|
||||||
|
|||||||
@ -21,15 +21,17 @@ func NewServices(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Services) GetDays(context.Context, *proto.GetDaysReq) (*proto.GetDaysRsp, error) {
|
func (s *Services) GetSchedule(context.Context, *proto.GetScheduleReq) (*proto.GetScheduleRsp, error) {
|
||||||
days, err := s.scheduleStorage.GetSchedule()
|
schedule, err := s.scheduleStorage.GetSchedule()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, status.Errorf(codes.Internal, err.Error())
|
return nil, status.Errorf(codes.Internal, err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
res := &proto.GetDaysRsp{}
|
res := &proto.GetScheduleRsp{
|
||||||
for _, day := range days {
|
UpdateTime: schedule.UpdateTime,
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, day := range schedule.Days {
|
||||||
resPerformances := make([]*proto.Performance, 0, len(day.Performances))
|
resPerformances := make([]*proto.Performance, 0, len(day.Performances))
|
||||||
for _, performance := range day.Performances {
|
for _, performance := range day.Performances {
|
||||||
resNumbers := make([]*proto.Number, 0, len(performance.Numbers))
|
resNumbers := make([]*proto.Number, 0, len(performance.Numbers))
|
||||||
|
|||||||
@ -94,26 +94,26 @@ func (*PingRsp) Descriptor() ([]byte, []int) {
|
|||||||
return file_main_proto_rawDescGZIP(), []int{1}
|
return file_main_proto_rawDescGZIP(), []int{1}
|
||||||
}
|
}
|
||||||
|
|
||||||
type GetDaysReq struct {
|
type GetScheduleReq struct {
|
||||||
state protoimpl.MessageState `protogen:"open.v1"`
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GetDaysReq) Reset() {
|
func (x *GetScheduleReq) Reset() {
|
||||||
*x = GetDaysReq{}
|
*x = GetScheduleReq{}
|
||||||
mi := &file_main_proto_msgTypes[2]
|
mi := &file_main_proto_msgTypes[2]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GetDaysReq) String() string {
|
func (x *GetScheduleReq) String() string {
|
||||||
return protoimpl.X.MessageStringOf(x)
|
return protoimpl.X.MessageStringOf(x)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*GetDaysReq) ProtoMessage() {}
|
func (*GetScheduleReq) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *GetDaysReq) ProtoReflect() protoreflect.Message {
|
func (x *GetScheduleReq) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_main_proto_msgTypes[2]
|
mi := &file_main_proto_msgTypes[2]
|
||||||
if x != nil {
|
if x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
@ -125,32 +125,33 @@ func (x *GetDaysReq) ProtoReflect() protoreflect.Message {
|
|||||||
return mi.MessageOf(x)
|
return mi.MessageOf(x)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deprecated: Use GetDaysReq.ProtoReflect.Descriptor instead.
|
// Deprecated: Use GetScheduleReq.ProtoReflect.Descriptor instead.
|
||||||
func (*GetDaysReq) Descriptor() ([]byte, []int) {
|
func (*GetScheduleReq) Descriptor() ([]byte, []int) {
|
||||||
return file_main_proto_rawDescGZIP(), []int{2}
|
return file_main_proto_rawDescGZIP(), []int{2}
|
||||||
}
|
}
|
||||||
|
|
||||||
type GetDaysRsp struct {
|
type GetScheduleRsp struct {
|
||||||
state protoimpl.MessageState `protogen:"open.v1"`
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
Days []*Day `protobuf:"bytes,1,rep,name=days,proto3" json:"days,omitempty"`
|
UpdateTime string `protobuf:"bytes,1,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"`
|
||||||
|
Days []*Day `protobuf:"bytes,2,rep,name=days,proto3" json:"days,omitempty"`
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GetDaysRsp) Reset() {
|
func (x *GetScheduleRsp) Reset() {
|
||||||
*x = GetDaysRsp{}
|
*x = GetScheduleRsp{}
|
||||||
mi := &file_main_proto_msgTypes[3]
|
mi := &file_main_proto_msgTypes[3]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GetDaysRsp) String() string {
|
func (x *GetScheduleRsp) String() string {
|
||||||
return protoimpl.X.MessageStringOf(x)
|
return protoimpl.X.MessageStringOf(x)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*GetDaysRsp) ProtoMessage() {}
|
func (*GetScheduleRsp) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *GetDaysRsp) ProtoReflect() protoreflect.Message {
|
func (x *GetScheduleRsp) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_main_proto_msgTypes[3]
|
mi := &file_main_proto_msgTypes[3]
|
||||||
if x != nil {
|
if x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
@ -162,12 +163,19 @@ func (x *GetDaysRsp) ProtoReflect() protoreflect.Message {
|
|||||||
return mi.MessageOf(x)
|
return mi.MessageOf(x)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deprecated: Use GetDaysRsp.ProtoReflect.Descriptor instead.
|
// Deprecated: Use GetScheduleRsp.ProtoReflect.Descriptor instead.
|
||||||
func (*GetDaysRsp) Descriptor() ([]byte, []int) {
|
func (*GetScheduleRsp) Descriptor() ([]byte, []int) {
|
||||||
return file_main_proto_rawDescGZIP(), []int{3}
|
return file_main_proto_rawDescGZIP(), []int{3}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GetDaysRsp) GetDays() []*Day {
|
func (x *GetScheduleRsp) GetUpdateTime() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.UpdateTime
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *GetScheduleRsp) GetDays() []*Day {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.Days
|
return x.Days
|
||||||
}
|
}
|
||||||
@ -361,12 +369,12 @@ const file_main_proto_rawDesc = "" +
|
|||||||
"\n" +
|
"\n" +
|
||||||
"main.proto\x12\x14crabs.pinned_message\x1a\x1cgoogle/api/annotations.proto\"\t\n" +
|
"main.proto\x12\x14crabs.pinned_message\x1a\x1cgoogle/api/annotations.proto\"\t\n" +
|
||||||
"\aPingReq\"\t\n" +
|
"\aPingReq\"\t\n" +
|
||||||
"\aPingRsp\"\f\n" +
|
"\aPingRsp\"\x10\n" +
|
||||||
"\n" +
|
"\x0eGetScheduleReq\"`\n" +
|
||||||
"GetDaysReq\";\n" +
|
"\x0eGetScheduleRsp\x12\x1f\n" +
|
||||||
"\n" +
|
"\vupdate_time\x18\x01 \x01(\tR\n" +
|
||||||
"GetDaysRsp\x12-\n" +
|
"updateTime\x12-\n" +
|
||||||
"\x04days\x18\x01 \x03(\v2\x19.crabs.pinned_message.DayR\x04days\"`\n" +
|
"\x04days\x18\x02 \x03(\v2\x19.crabs.pinned_message.DayR\x04days\"`\n" +
|
||||||
"\x03Day\x12\x12\n" +
|
"\x03Day\x12\x12\n" +
|
||||||
"\x04date\x18\x01 \x01(\tR\x04date\x12E\n" +
|
"\x04date\x18\x01 \x01(\tR\x04date\x12E\n" +
|
||||||
"\fperformances\x18\x02 \x03(\v2!.crabs.pinned_message.PerformanceR\fperformances\"\xd3\x01\n" +
|
"\fperformances\x18\x02 \x03(\v2!.crabs.pinned_message.PerformanceR\fperformances\"\xd3\x01\n" +
|
||||||
@ -379,10 +387,10 @@ const file_main_proto_rawDesc = "" +
|
|||||||
"\anumbers\x18\x05 \x03(\v2\x1c.crabs.pinned_message.NumberR\anumbers\x12\x1a\n" +
|
"\anumbers\x18\x05 \x03(\v2\x1c.crabs.pinned_message.NumberR\anumbers\x12\x1a\n" +
|
||||||
"\bcostumes\x18\x06 \x01(\tR\bcostumes\"\x1c\n" +
|
"\bcostumes\x18\x06 \x01(\tR\bcostumes\"\x1c\n" +
|
||||||
"\x06Number\x12\x12\n" +
|
"\x06Number\x12\x12\n" +
|
||||||
"\x04name\x18\x01 \x01(\tR\x04name2\xc6\x01\n" +
|
"\x04name\x18\x01 \x01(\tR\x04name2\xd2\x01\n" +
|
||||||
"\rpinnedMessage\x12S\n" +
|
"\rpinnedMessage\x12S\n" +
|
||||||
"\x04Ping\x12\x1d.crabs.pinned_message.PingReq\x1a\x1d.crabs.pinned_message.PingRsp\"\r\x82\xd3\xe4\x93\x02\a\x12\x05/ping\x12`\n" +
|
"\x04Ping\x12\x1d.crabs.pinned_message.PingReq\x1a\x1d.crabs.pinned_message.PingRsp\"\r\x82\xd3\xe4\x93\x02\a\x12\x05/ping\x12l\n" +
|
||||||
"\aGetDays\x12 .crabs.pinned_message.GetDaysReq\x1a .crabs.pinned_message.GetDaysRsp\"\x11\x82\xd3\xe4\x93\x02\v\x12\t/scheduleB\vZ\tpkg/protob\x06proto3"
|
"\vGetSchedule\x12$.crabs.pinned_message.GetScheduleReq\x1a$.crabs.pinned_message.GetScheduleRsp\"\x11\x82\xd3\xe4\x93\x02\v\x12\t/scheduleB\vZ\tpkg/protob\x06proto3"
|
||||||
|
|
||||||
var (
|
var (
|
||||||
file_main_proto_rawDescOnce sync.Once
|
file_main_proto_rawDescOnce sync.Once
|
||||||
@ -400,20 +408,20 @@ var file_main_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
|
|||||||
var file_main_proto_goTypes = []any{
|
var file_main_proto_goTypes = []any{
|
||||||
(*PingReq)(nil), // 0: crabs.pinned_message.PingReq
|
(*PingReq)(nil), // 0: crabs.pinned_message.PingReq
|
||||||
(*PingRsp)(nil), // 1: crabs.pinned_message.PingRsp
|
(*PingRsp)(nil), // 1: crabs.pinned_message.PingRsp
|
||||||
(*GetDaysReq)(nil), // 2: crabs.pinned_message.GetDaysReq
|
(*GetScheduleReq)(nil), // 2: crabs.pinned_message.GetScheduleReq
|
||||||
(*GetDaysRsp)(nil), // 3: crabs.pinned_message.GetDaysRsp
|
(*GetScheduleRsp)(nil), // 3: crabs.pinned_message.GetScheduleRsp
|
||||||
(*Day)(nil), // 4: crabs.pinned_message.Day
|
(*Day)(nil), // 4: crabs.pinned_message.Day
|
||||||
(*Performance)(nil), // 5: crabs.pinned_message.Performance
|
(*Performance)(nil), // 5: crabs.pinned_message.Performance
|
||||||
(*Number)(nil), // 6: crabs.pinned_message.Number
|
(*Number)(nil), // 6: crabs.pinned_message.Number
|
||||||
}
|
}
|
||||||
var file_main_proto_depIdxs = []int32{
|
var file_main_proto_depIdxs = []int32{
|
||||||
4, // 0: crabs.pinned_message.GetDaysRsp.days:type_name -> crabs.pinned_message.Day
|
4, // 0: crabs.pinned_message.GetScheduleRsp.days:type_name -> crabs.pinned_message.Day
|
||||||
5, // 1: crabs.pinned_message.Day.performances:type_name -> crabs.pinned_message.Performance
|
5, // 1: crabs.pinned_message.Day.performances:type_name -> crabs.pinned_message.Performance
|
||||||
6, // 2: crabs.pinned_message.Performance.numbers:type_name -> crabs.pinned_message.Number
|
6, // 2: crabs.pinned_message.Performance.numbers:type_name -> crabs.pinned_message.Number
|
||||||
0, // 3: crabs.pinned_message.pinnedMessage.Ping:input_type -> crabs.pinned_message.PingReq
|
0, // 3: crabs.pinned_message.pinnedMessage.Ping:input_type -> crabs.pinned_message.PingReq
|
||||||
2, // 4: crabs.pinned_message.pinnedMessage.GetDays:input_type -> crabs.pinned_message.GetDaysReq
|
2, // 4: crabs.pinned_message.pinnedMessage.GetSchedule:input_type -> crabs.pinned_message.GetScheduleReq
|
||||||
1, // 5: crabs.pinned_message.pinnedMessage.Ping:output_type -> crabs.pinned_message.PingRsp
|
1, // 5: crabs.pinned_message.pinnedMessage.Ping:output_type -> crabs.pinned_message.PingRsp
|
||||||
3, // 6: crabs.pinned_message.pinnedMessage.GetDays:output_type -> crabs.pinned_message.GetDaysRsp
|
3, // 6: crabs.pinned_message.pinnedMessage.GetSchedule:output_type -> crabs.pinned_message.GetScheduleRsp
|
||||||
5, // [5:7] is the sub-list for method output_type
|
5, // [5:7] is the sub-list for method output_type
|
||||||
3, // [3:5] is the sub-list for method input_type
|
3, // [3:5] 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 type_name
|
||||||
|
|||||||
@ -56,24 +56,24 @@ func local_request_PinnedMessage_Ping_0(ctx context.Context, marshaler runtime.M
|
|||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func request_PinnedMessage_GetDays_0(ctx context.Context, marshaler runtime.Marshaler, client PinnedMessageClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
func request_PinnedMessage_GetSchedule_0(ctx context.Context, marshaler runtime.Marshaler, client PinnedMessageClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
var (
|
var (
|
||||||
protoReq GetDaysReq
|
protoReq GetScheduleReq
|
||||||
metadata runtime.ServerMetadata
|
metadata runtime.ServerMetadata
|
||||||
)
|
)
|
||||||
if req.Body != nil {
|
if req.Body != nil {
|
||||||
_, _ = io.Copy(io.Discard, req.Body)
|
_, _ = io.Copy(io.Discard, req.Body)
|
||||||
}
|
}
|
||||||
msg, err := client.GetDays(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.GetSchedule(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func local_request_PinnedMessage_GetDays_0(ctx context.Context, marshaler runtime.Marshaler, server PinnedMessageServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
func local_request_PinnedMessage_GetSchedule_0(ctx context.Context, marshaler runtime.Marshaler, server PinnedMessageServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
var (
|
var (
|
||||||
protoReq GetDaysReq
|
protoReq GetScheduleReq
|
||||||
metadata runtime.ServerMetadata
|
metadata runtime.ServerMetadata
|
||||||
)
|
)
|
||||||
msg, err := server.GetDays(ctx, &protoReq)
|
msg, err := server.GetSchedule(ctx, &protoReq)
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,25 +103,25 @@ func RegisterPinnedMessageHandlerServer(ctx context.Context, mux *runtime.ServeM
|
|||||||
}
|
}
|
||||||
forward_PinnedMessage_Ping_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
forward_PinnedMessage_Ping_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
})
|
})
|
||||||
mux.Handle(http.MethodGet, pattern_PinnedMessage_GetDays_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
mux.Handle(http.MethodGet, pattern_PinnedMessage_GetSchedule_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
ctx, cancel := context.WithCancel(req.Context())
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
defer cancel()
|
defer cancel()
|
||||||
var stream runtime.ServerTransportStream
|
var stream runtime.ServerTransportStream
|
||||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/crabs.pinned_message.PinnedMessage/GetDays", runtime.WithHTTPPathPattern("/schedule"))
|
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/crabs.pinned_message.PinnedMessage/GetSchedule", runtime.WithHTTPPathPattern("/schedule"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
resp, md, err := local_request_PinnedMessage_GetDays_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
resp, md, err := local_request_PinnedMessage_GetSchedule_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
forward_PinnedMessage_GetDays_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
forward_PinnedMessage_GetSchedule_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
})
|
})
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
@ -180,32 +180,32 @@ func RegisterPinnedMessageHandlerClient(ctx context.Context, mux *runtime.ServeM
|
|||||||
}
|
}
|
||||||
forward_PinnedMessage_Ping_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
forward_PinnedMessage_Ping_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
})
|
})
|
||||||
mux.Handle(http.MethodGet, pattern_PinnedMessage_GetDays_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
mux.Handle(http.MethodGet, pattern_PinnedMessage_GetSchedule_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
ctx, cancel := context.WithCancel(req.Context())
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
defer cancel()
|
defer cancel()
|
||||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/crabs.pinned_message.PinnedMessage/GetDays", runtime.WithHTTPPathPattern("/schedule"))
|
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/crabs.pinned_message.PinnedMessage/GetSchedule", runtime.WithHTTPPathPattern("/schedule"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
resp, md, err := request_PinnedMessage_GetDays_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
resp, md, err := request_PinnedMessage_GetSchedule_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
forward_PinnedMessage_GetDays_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
forward_PinnedMessage_GetSchedule_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
})
|
})
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
pattern_PinnedMessage_Ping_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"ping"}, ""))
|
pattern_PinnedMessage_Ping_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"ping"}, ""))
|
||||||
pattern_PinnedMessage_GetDays_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"schedule"}, ""))
|
pattern_PinnedMessage_GetSchedule_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"schedule"}, ""))
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
forward_PinnedMessage_Ping_0 = runtime.ForwardResponseMessage
|
forward_PinnedMessage_Ping_0 = runtime.ForwardResponseMessage
|
||||||
forward_PinnedMessage_GetDays_0 = runtime.ForwardResponseMessage
|
forward_PinnedMessage_GetSchedule_0 = runtime.ForwardResponseMessage
|
||||||
)
|
)
|
||||||
|
|||||||
@ -35,12 +35,12 @@
|
|||||||
},
|
},
|
||||||
"/schedule": {
|
"/schedule": {
|
||||||
"get": {
|
"get": {
|
||||||
"operationId": "pinnedMessage_GetDays",
|
"operationId": "pinnedMessage_GetSchedule",
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "A successful response.",
|
"description": "A successful response.",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/pinned_messageGetDaysRsp"
|
"$ref": "#/definitions/pinned_messageGetScheduleRsp"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"default": {
|
"default": {
|
||||||
@ -71,9 +71,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"pinned_messageGetDaysRsp": {
|
"pinned_messageGetScheduleRsp": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
"update_time": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"days": {
|
"days": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
|
|||||||
@ -20,7 +20,7 @@ const _ = grpc.SupportPackageIsVersion9
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
PinnedMessage_Ping_FullMethodName = "/crabs.pinned_message.pinnedMessage/Ping"
|
PinnedMessage_Ping_FullMethodName = "/crabs.pinned_message.pinnedMessage/Ping"
|
||||||
PinnedMessage_GetDays_FullMethodName = "/crabs.pinned_message.pinnedMessage/GetDays"
|
PinnedMessage_GetSchedule_FullMethodName = "/crabs.pinned_message.pinnedMessage/GetSchedule"
|
||||||
)
|
)
|
||||||
|
|
||||||
// PinnedMessageClient is the client API for PinnedMessage service.
|
// PinnedMessageClient is the client API for PinnedMessage service.
|
||||||
@ -28,7 +28,7 @@ const (
|
|||||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||||
type PinnedMessageClient interface {
|
type PinnedMessageClient interface {
|
||||||
Ping(ctx context.Context, in *PingReq, opts ...grpc.CallOption) (*PingRsp, error)
|
Ping(ctx context.Context, in *PingReq, opts ...grpc.CallOption) (*PingRsp, error)
|
||||||
GetDays(ctx context.Context, in *GetDaysReq, opts ...grpc.CallOption) (*GetDaysRsp, error)
|
GetSchedule(ctx context.Context, in *GetScheduleReq, opts ...grpc.CallOption) (*GetScheduleRsp, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
type pinnedMessageClient struct {
|
type pinnedMessageClient struct {
|
||||||
@ -49,10 +49,10 @@ func (c *pinnedMessageClient) Ping(ctx context.Context, in *PingReq, opts ...grp
|
|||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *pinnedMessageClient) GetDays(ctx context.Context, in *GetDaysReq, opts ...grpc.CallOption) (*GetDaysRsp, error) {
|
func (c *pinnedMessageClient) GetSchedule(ctx context.Context, in *GetScheduleReq, opts ...grpc.CallOption) (*GetScheduleRsp, error) {
|
||||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
out := new(GetDaysRsp)
|
out := new(GetScheduleRsp)
|
||||||
err := c.cc.Invoke(ctx, PinnedMessage_GetDays_FullMethodName, in, out, cOpts...)
|
err := c.cc.Invoke(ctx, PinnedMessage_GetSchedule_FullMethodName, in, out, cOpts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -64,7 +64,7 @@ func (c *pinnedMessageClient) GetDays(ctx context.Context, in *GetDaysReq, opts
|
|||||||
// for forward compatibility.
|
// for forward compatibility.
|
||||||
type PinnedMessageServer interface {
|
type PinnedMessageServer interface {
|
||||||
Ping(context.Context, *PingReq) (*PingRsp, error)
|
Ping(context.Context, *PingReq) (*PingRsp, error)
|
||||||
GetDays(context.Context, *GetDaysReq) (*GetDaysRsp, error)
|
GetSchedule(context.Context, *GetScheduleReq) (*GetScheduleRsp, error)
|
||||||
mustEmbedUnimplementedPinnedMessageServer()
|
mustEmbedUnimplementedPinnedMessageServer()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,8 +78,8 @@ type UnimplementedPinnedMessageServer struct{}
|
|||||||
func (UnimplementedPinnedMessageServer) Ping(context.Context, *PingReq) (*PingRsp, error) {
|
func (UnimplementedPinnedMessageServer) Ping(context.Context, *PingReq) (*PingRsp, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented")
|
||||||
}
|
}
|
||||||
func (UnimplementedPinnedMessageServer) GetDays(context.Context, *GetDaysReq) (*GetDaysRsp, error) {
|
func (UnimplementedPinnedMessageServer) GetSchedule(context.Context, *GetScheduleReq) (*GetScheduleRsp, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method GetDays not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method GetSchedule not implemented")
|
||||||
}
|
}
|
||||||
func (UnimplementedPinnedMessageServer) mustEmbedUnimplementedPinnedMessageServer() {}
|
func (UnimplementedPinnedMessageServer) mustEmbedUnimplementedPinnedMessageServer() {}
|
||||||
func (UnimplementedPinnedMessageServer) testEmbeddedByValue() {}
|
func (UnimplementedPinnedMessageServer) testEmbeddedByValue() {}
|
||||||
@ -120,20 +120,20 @@ func _PinnedMessage_Ping_Handler(srv interface{}, ctx context.Context, dec func(
|
|||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
func _PinnedMessage_GetDays_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
func _PinnedMessage_GetSchedule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(GetDaysReq)
|
in := new(GetScheduleReq)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if interceptor == nil {
|
if interceptor == nil {
|
||||||
return srv.(PinnedMessageServer).GetDays(ctx, in)
|
return srv.(PinnedMessageServer).GetSchedule(ctx, in)
|
||||||
}
|
}
|
||||||
info := &grpc.UnaryServerInfo{
|
info := &grpc.UnaryServerInfo{
|
||||||
Server: srv,
|
Server: srv,
|
||||||
FullMethod: PinnedMessage_GetDays_FullMethodName,
|
FullMethod: PinnedMessage_GetSchedule_FullMethodName,
|
||||||
}
|
}
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
return srv.(PinnedMessageServer).GetDays(ctx, req.(*GetDaysReq))
|
return srv.(PinnedMessageServer).GetSchedule(ctx, req.(*GetScheduleReq))
|
||||||
}
|
}
|
||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
@ -150,8 +150,8 @@ var PinnedMessage_ServiceDesc = grpc.ServiceDesc{
|
|||||||
Handler: _PinnedMessage_Ping_Handler,
|
Handler: _PinnedMessage_Ping_Handler,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
MethodName: "GetDays",
|
MethodName: "GetSchedule",
|
||||||
Handler: _PinnedMessage_GetDays_Handler,
|
Handler: _PinnedMessage_GetSchedule_Handler,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Streams: []grpc.StreamDesc{},
|
Streams: []grpc.StreamDesc{},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user