Line data Source code
1 : package request
2 :
3 : // SuggestUserSkillRequest は Skill候補取得のためのリクエストDTOです
4 : type SuggestUserSkillRequest struct {
5 : SkillCategoryID *uint64 `json:"skill_category_id,omitempty"`
6 : Q *string `json:"q,omitempty"`
7 : Limit *int `json:"limit,omitempty"`
8 : WithDeleted *bool `json:"with_deleted,omitempty"`
9 : }
10 :
11 : // Normalize はリクエストDTOの値を正規化します
12 0 : func (r *SuggestUserSkillRequest) Normalize() {
13 0 : if r.SkillCategoryID != nil && *r.SkillCategoryID == 0 {
14 0 : r.SkillCategoryID = nil
15 0 : }
16 0 : if r.Limit != nil && *r.Limit <= 0 {
17 0 : r.Limit = nil
18 0 : }
19 0 : if r.WithDeleted != nil && !*r.WithDeleted {
20 0 : r.WithDeleted = nil
21 0 : }
22 : }
|