mirror of
https://github.com/simon-ding/polaris.git
synced 2026-06-08 02:57:38 +08:00
feat: save torrent link to history
This commit is contained in:
@@ -100,6 +100,20 @@ func (hc *HistoryCreate) SetNillableIndexerID(i *int) *HistoryCreate {
|
||||
return hc
|
||||
}
|
||||
|
||||
// SetLink sets the "link" field.
|
||||
func (hc *HistoryCreate) SetLink(s string) *HistoryCreate {
|
||||
hc.mutation.SetLink(s)
|
||||
return hc
|
||||
}
|
||||
|
||||
// SetNillableLink sets the "link" field if the given value is not nil.
|
||||
func (hc *HistoryCreate) SetNillableLink(s *string) *HistoryCreate {
|
||||
if s != nil {
|
||||
hc.SetLink(*s)
|
||||
}
|
||||
return hc
|
||||
}
|
||||
|
||||
// SetStatus sets the "status" field.
|
||||
func (hc *HistoryCreate) SetStatus(h history.Status) *HistoryCreate {
|
||||
hc.mutation.SetStatus(h)
|
||||
@@ -244,6 +258,10 @@ func (hc *HistoryCreate) createSpec() (*History, *sqlgraph.CreateSpec) {
|
||||
_spec.SetField(history.FieldIndexerID, field.TypeInt, value)
|
||||
_node.IndexerID = value
|
||||
}
|
||||
if value, ok := hc.mutation.Link(); ok {
|
||||
_spec.SetField(history.FieldLink, field.TypeString, value)
|
||||
_node.Link = value
|
||||
}
|
||||
if value, ok := hc.mutation.Status(); ok {
|
||||
_spec.SetField(history.FieldStatus, field.TypeEnum, value)
|
||||
_node.Status = value
|
||||
|
||||
Reference in New Issue
Block a user