更新用户配置信息
(user *User)
| 789 | |
| 790 | //更新用户配置信息 |
| 791 | func (d *db) updateUserProfile(user *User) error { |
| 792 | rawSQL := fmt.Sprintf("update user set display_name='%s', password='%s', phone='%s', wechat='%s', update_at='%s' where id=%d", |
| 793 | user.DisplayName, user.Password, user.PhoneNum, user.Wechat, time.Now().Format(timeFormat), user.ID) |
| 794 | log.Println(rawSQL) |
| 795 | if _, err := d.Exec(rawSQL); err != nil { |
| 796 | log.Println(err) |
| 797 | return err |
| 798 | } |
| 799 | return nil |
| 800 | } |
| 801 | |
| 802 | //设置用户角色 |
| 803 | func (d *db) setUserRole(userID int, roleNum int) error { |
no outgoing calls
no test coverage detected