From c9341af4aab1a7a96ec8f8b6320579b1c73f1958 Mon Sep 17 00:00:00 2001 From: jiangyong Date: Sat, 27 Jun 2026 11:59:21 +0800 Subject: [PATCH] revert: remove duplicate GetVacationQuota from app_checkin --- qyweixin/app_checkin.go | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/qyweixin/app_checkin.go b/qyweixin/app_checkin.go index 1c97354..daa71b2 100644 --- a/qyweixin/app_checkin.go +++ b/qyweixin/app_checkin.go @@ -225,34 +225,3 @@ func (q *AppCheckin) GetCheckinDataV2(startDay, endDay string, userIds []string) return userDatas, nil } - -type VacationQuota struct { - VacationName string `json:"vacation_name"` - LeftQuota int64 `json:"left_quota"` - UsedQuota int64 `json:"used_quota"` - TotalQuota int64 `json:"total_quota"` -} - -func (q *AppCheckin) GetVacationQuota(userid string) ([]*VacationQuota, error) { - reqUrl := fmt.Sprintf("https://qyapi.weixin.qq.com/cgi-bin/checkin/getvacationquota?access_token=%s", q.GetToken()) - reqParam := fmt.Sprintf(`{"userid":"%s"}`, userid) - rspBody, err := util.HttpPostJson(reqUrl, nil, []byte(reqParam)) - if err != nil { - return nil, err - } - g := gjson.ParseBytes(rspBody) - if g.Get("errcode").Int() != 0 { - return nil, fmt.Errorf("%d:%s", g.Get("errcode").Int(), g.Get("errmsg").String()) - } - items := make([]*VacationQuota, 0) - for _, v := range g.Get("lists").Array() { - item := &VacationQuota{ - VacationName: v.Get("vacation_name").String(), - LeftQuota: v.Get("left_quota").Int(), - UsedQuota: v.Get("used_quota").Int(), - TotalQuota: v.Get("total_quota").Int(), - } - items = append(items, item) - } - return items, nil -}