MCPcopy
hub / github.com/silenceper/wechat / AddOption

Method AddOption

work/checkin/checkin.go:322–335  ·  view source on GitHub ↗

AddOption 创建打卡规则 see https://developer.work.weixin.qq.com/document/path/98041#%E5%88%9B%E5%BB%BA%E6%89%93%E5%8D%A1%E8%A7%84%E5%88%99

(req *AddOptionRequest)

Source from the content-addressed store, hash-verified

320// AddOption 创建打卡规则
321// see https://developer.work.weixin.qq.com/document/path/98041#%E5%88%9B%E5%BB%BA%E6%89%93%E5%8D%A1%E8%A7%84%E5%88%99
322func (r *Client) AddOption(req *AddOptionRequest) error {
323 var (
324 accessToken string
325 err error
326 )
327 if accessToken, err = r.GetAccessToken(); err != nil {
328 return err
329 }
330 var response []byte
331 if response, err = util.PostJSON(fmt.Sprintf(addOptionURL, accessToken), req); err != nil {
332 return err
333 }
334 return util.DecodeWithCommonError(response, "AddOption")
335}
336
337// UpdateOptionRequest 修改打卡规则请求
338type UpdateOptionRequest struct {

Callers

nothing calls this directly

Calls 3

PostJSONFunction · 0.92
DecodeWithCommonErrorFunction · 0.92
GetAccessTokenMethod · 0.65

Tested by

no test coverage detected