mirror of
https://github.com/FJurmanovic/wallet-go-api.git
synced 2026-02-06 06:08:16 +00:00
23 lines
505 B
Go
23 lines
505 B
Go
package model
|
|
|
|
type SubscriptionType struct {
|
|
tableName struct{} `pg:"subscriptionTypes,alias:subscriptionTypes"`
|
|
BaseModel
|
|
Name string `json:"name" pg:"name"`
|
|
Type string `json:"type" pg:"type,notnull"`
|
|
}
|
|
|
|
type NewSubscriptionTypeBody struct {
|
|
Name string `json:"name" form:"name"`
|
|
Type string `json:"type" form:"type"`
|
|
}
|
|
|
|
func (body *NewSubscriptionTypeBody) ToSubscriptionType() *SubscriptionType {
|
|
tm := new(SubscriptionType)
|
|
|
|
tm.Init()
|
|
tm.Name = body.Name
|
|
tm.Type = body.Type
|
|
|
|
return tm
|
|
} |