-
Notifications
You must be signed in to change notification settings - Fork 0
/
user_dto.go
68 lines (58 loc) · 1.64 KB
/
user_dto.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package domain
type UserSetCityReq struct {
Region string `json:"region"`
Country string `json:"country"`
Province string `json:"province"`
City string `json:"city"`
}
type UserSetHeadResp struct {
Headimgurl string `json:"headimgurl"`
}
type UserSetNicknameReq struct {
Nickname string `json:"nickname" binding:"required"`
}
type UserSetSexReq struct {
Sex int `json:"sex" binding:"required"`
}
type UserSetSignatureReq struct {
Signature string `json:"signature" binding:"required,max=140"`
}
type UserSetHeightReq struct {
Height int `json:"height" binding:"required"`
}
type UserSetWeightReq struct {
Weight int `json:"weight" binding:"required"`
}
type UserSetBirthdayReq struct {
Birthday string `json:"birthday" binding:"required"`
}
type UserProfileResp struct {
Uri string `json:"uri"`
Nickname string `json:"nickname"`
Signature string `json:"signature"`
Sex int `json:"sex"`
Province string `json:"province"`
City string `json:"city"`
Country string `json:"country"`
Region string `json:"region"`
Headimgurl string `json:"headimgurl"`
Height int `json:"height"`
Weight int `json:"weight"`
Birthday string `json:"birthday"`
}
func TransProfileDto(profile *Profile) *UserProfileResp {
return &UserProfileResp{
Uri: profile.Uri,
Nickname: profile.Nickname,
Signature: profile.Signature,
Sex: profile.Sex,
Province: profile.Province,
City: profile.City,
Country: profile.Country,
Headimgurl: profile.Headimgurl,
Height: profile.Height,
Weight: profile.Weight,
Birthday: profile.Birthday,
Region: profile.Region,
}
}