-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #490 from ArtisanCloud/develop
Develop
- Loading branch information
Showing
6 changed files
with
100 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package approval | ||
|
||
import ( | ||
"context" | ||
"github.com/ArtisanCloud/PowerWeChat/v3/src/kernel" | ||
"github.com/ArtisanCloud/PowerWeChat/v3/src/kernel/response" | ||
"github.com/ArtisanCloud/PowerWeChat/v3/src/work/oa/approval/request" | ||
) | ||
|
||
type Client struct { | ||
BaseClient *kernel.BaseClient | ||
} | ||
|
||
func NewClient(app kernel.ApplicationInterface) (*Client, error) { | ||
baseClient, err := kernel.NewBaseClient(&app, nil) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return &Client{ | ||
baseClient, | ||
}, nil | ||
} | ||
|
||
// 更新审批模板 | ||
// https://developer.work.weixin.qq.com/document/path/97438 | ||
func (comp *Client) UpdateTemplate(ctx context.Context, options *request.RequestUpdateTemplate) (*response.ResponseWork, error) { | ||
|
||
result := &response.ResponseWork{} | ||
|
||
_, err := comp.BaseClient.HttpPostJson(ctx, "cgi-bin/oa/approval/update_template", options, nil, nil, result) | ||
|
||
return result, err | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package reponse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package request | ||
|
||
type TemplateName struct { | ||
Text string `json:"text"` | ||
Lang string `json:"lang"` | ||
} | ||
|
||
type Title struct { | ||
Text string `json:"text"` | ||
Lang string `json:"lang"` | ||
} | ||
|
||
type Placeholder struct { | ||
Text string `json:"text"` | ||
Lang string `json:"lang"` | ||
} | ||
|
||
type Property struct { | ||
Control string `json:"control"` | ||
Id string `json:"id"` | ||
Title []Title `json:"title"` | ||
Placeholder []Placeholder `json:"placeholder"` | ||
Require int `json:"require"` | ||
UnPrint int `json:"un_print"` | ||
} | ||
|
||
type Control struct { | ||
Property Property `json:"property"` | ||
Config struct { | ||
} `json:"config"` | ||
} | ||
|
||
type TemplateContent struct { | ||
Controls []Control `json:"controls"` | ||
} | ||
|
||
type RequestUpdateTemplate struct { | ||
TemplateId string `json:"template_id"` | ||
TemplateName []TemplateName `json:"template_name"` | ||
TemplateContent TemplateContent `json:"template_content"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters