handler.go 899 B

1234567891011121314151617181920212223242526272829303132
  1. package handler
  2. import (
  3. pb "bet24.com/servers/micros/platformconfig/proto"
  4. "context"
  5. "fmt"
  6. )
  7. func (h *PlatformConfig) SayHello(ctx context.Context, req *pb.Request, rsp *pb.Response) error {
  8. rsp.Data = fmt.Sprintf("Hello from %s:%s", pb.ServiceName, req.Name)
  9. return nil
  10. }
  11. func (h *PlatformConfig) GetConfig(ctx context.Context, req *pb.Request, rsp *pb.Response) error {
  12. rsp.Data = h.getConfig(req.Name)
  13. return nil
  14. }
  15. func (h *PlatformConfig) SetConfig(ctx context.Context, req *pb.Request, rsp *pb.Response) error {
  16. h.setConfig(req.Name, req.Value)
  17. return nil
  18. }
  19. func (h *PlatformConfig) GetConfigList(ctx context.Context, req *pb.Request, rsp *pb.Response) error {
  20. rsp.List = h.getConfigList()
  21. return nil
  22. }
  23. func (h *PlatformConfig) GetChangeLog(ctx context.Context, req *pb.Request, rsp *pb.Response) error {
  24. rsp.Data = getHistoryInstance().getChangeLogs(req.Name)
  25. return nil
  26. }