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