...
|
...
|
@@ -31,6 +31,7 @@ func (repository *PushDeviceRepository) FindOne(queryOptions map[string]interfac |
|
|
qs := o.QueryTable(model.TableName()).Filter("uid", queryOptions["uid"])
|
|
|
err := qs.One(model)
|
|
|
if err != nil {
|
|
|
err = domain.ERR_DB_NOT_FOUND
|
|
|
return nil, err
|
|
|
}
|
|
|
return repository.transformBgormModelToDomainModel(model)
|
...
|
...
|
@@ -54,7 +55,7 @@ func (repository *PushDeviceRepository) Find(queryOptions map[string]interface{} |
|
|
|
|
|
func (repository *PushDeviceRepository) UpdateDevice(uid int64, clientId, deviceToken string) error {
|
|
|
o := orm.NewOrm()
|
|
|
_, err := o.Raw("UPDATE push_device_info SET client_id=?,device_token = ? where uid=?", clientId, deviceToken, uid).Exec()
|
|
|
_, err := o.Raw("UPDATE push_device_info SET client_id=?,device_token = ?,update_at=now() where uid=?", clientId, deviceToken, uid).Exec()
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
...
|
...
|
|