本文整理汇总了Golang中github.com/PandoCloud/pando-cloud/pkg/models.Vendor.UpdatedAt方法的典型用法代码示例。如果您正苦于以下问题:Golang Vendor.UpdatedAt方法的具体用法?Golang Vendor.UpdatedAt怎么用?Golang Vendor.UpdatedAt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/PandoCloud/pando-cloud/pkg/models.Vendor
的用法示例。
在下文中一共展示了Vendor.UpdatedAt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: SaveVendor
// SaveVendor will create a vendor if the ID field is not initialized
// if ID field is initialized, it will update the conresponding vendor.
func (r *Registry) SaveVendor(vendor *models.Vendor, reply *models.Vendor) error {
db, err := getDB()
if err != nil {
return err
}
err = db.Save(vendor).Error
if err != nil {
return err
}
key, err := r.keygen.GenRandomKey(int64(vendor.ID))
if err != nil {
return err
}
vendor.VendorKey = key
err = db.Save(vendor).Error
if err != nil {
return err
}
reply.ID = vendor.ID
reply.VendorName = vendor.VendorName
reply.VendorDescription = vendor.VendorDescription
reply.VendorKey = vendor.VendorKey
reply.CreatedAt = vendor.CreatedAt
reply.UpdatedAt = vendor.UpdatedAt
return nil
}
示例2: setVendor
func setVendor(target *models.Vendor, src *models.Vendor) {
target.ID = src.ID
target.VendorName = src.VendorName
target.VendorDescription = src.VendorDescription
target.VendorKey = src.VendorKey
target.CreatedAt = src.CreatedAt
target.UpdatedAt = src.UpdatedAt
}