log.go 779 B

12345678910111213141516171819202122232425262728293031323334
  1. package web
  2. import (
  3. "context"
  4. v1 "github.com/go-nunu/nunu-layout-advanced/api/v1"
  5. )
  6. type Log interface {
  7. EditLog(ctx context.Context, webId int64) error
  8. }
  9. // EditLog 修改日志配置
  10. func (s *aidedWebService) EditLog(ctx context.Context, webId int64) error {
  11. webConfigId, err := s.webForwardingRepository.GetWebConfigId(ctx, webId)
  12. if err != nil {
  13. return err
  14. }
  15. if err := s.cdn.EditWebLog(ctx, webConfigId, v1.WebLog{
  16. IsPrior: false,
  17. IsOn: true,
  18. Fields: []int64{1, 2, 6, 7},
  19. Status1: true,
  20. Status2: true,
  21. Status3: true,
  22. Status4: true,
  23. Status5: true,
  24. FirewallOnly: false,
  25. EnableClientClosed: false,
  26. }); err != nil {
  27. return err
  28. }
  29. return nil
  30. }