feat: 宠物加性格/过敏/备注字段 + 身份卡照护信息 + 微信取手机号
- Pet 增 personality/allergy/notes;建档表单加「性格标签(多选)/过敏/备注」 - IDCard 增 color/personality/owner/phone(脱敏)/allergy/notes/疫苗驱虫状态/发证机构 - 微信取手机号:POST /api/user/phone 用 getPhoneNumber 的 code 换手机号存库 (BindPhoneByCode 走 getuserphonenumber,复用 access_token) Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -210,3 +210,20 @@ func (h *Handler) UpdateProfile(c *gin.Context) {
|
||||
}
|
||||
response.OK(c, user)
|
||||
}
|
||||
|
||||
// BindPhone POST /api/user/phone 用小程序 getPhoneNumber 的 code 绑定手机号
|
||||
func (h *Handler) BindPhone(c *gin.Context) {
|
||||
var req struct {
|
||||
Code string `json:"code"`
|
||||
}
|
||||
if err := c.ShouldBindJSON(&req); err != nil || req.Code == "" {
|
||||
response.FailParams(c, "缺少 code")
|
||||
return
|
||||
}
|
||||
phone, err := h.svc.BindPhoneByCode(middleware.UserID(c), req.Code)
|
||||
if err != nil {
|
||||
response.FailErr(c, err)
|
||||
return
|
||||
}
|
||||
response.OK(c, gin.H{"phone": phone})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user