27 lines
678 B
Go
27 lines
678 B
Go
package skill
|
|
|
|
import "errors"
|
|
|
|
type Definition struct {
|
|
ID string `json:"id"`
|
|
SkillKey string `json:"skill_key"`
|
|
Name string `json:"name"`
|
|
Description string `json:"description"`
|
|
SourceType string `json:"source_type"`
|
|
ContentMarkdown string `json:"content_markdown"`
|
|
Status string `json:"status"`
|
|
Version int `json:"version"`
|
|
CreatedAt string `json:"created_at"`
|
|
UpdatedAt string `json:"updated_at"`
|
|
}
|
|
|
|
func (s Definition) Validate() error {
|
|
if s.SkillKey == "" {
|
|
return errors.New("skill key is required")
|
|
}
|
|
if s.Name == "" {
|
|
return errors.New("skill name is required")
|
|
}
|
|
return nil
|
|
}
|