mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-25 15:53:36 +01:00
31 lines
619 B
Go
31 lines
619 B
Go
// Copyright 2023 The Forgejo Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package forgefed
|
|
|
|
import (
|
|
"code.gitea.io/gitea/modules/validation"
|
|
ap "github.com/go-ap/activitypub"
|
|
)
|
|
|
|
// Star activity data type
|
|
// swagger:model
|
|
type Star struct {
|
|
// swagger:ignore
|
|
ap.Activity
|
|
}
|
|
|
|
func (a Star) MarshalJSON() ([]byte, error) {
|
|
return a.Activity.MarshalJSON()
|
|
}
|
|
|
|
func (s *Star) UnmarshalJSON(data []byte) error {
|
|
return s.UnmarshalJSON(data)
|
|
}
|
|
|
|
func (s Star) Validate() []string {
|
|
var result []string
|
|
result = append(result, validation.ValidateNotEmpty(string(s.Type), "type")...)
|
|
|
|
return result
|
|
}
|