media
This commit is contained in:
parent
b456c3da06
commit
bfdd9339e6
|
|
@ -316,6 +316,11 @@ func (a *App) Upload(path, kind string) (string, error) {
|
||||||
return cast.ToString(result["media_id"]), nil
|
return cast.ToString(result["media_id"]), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (a *App) MediaUrl(mediaId string) string {
|
||||||
|
mUrl := fmt.Sprintf("https://qyapi.weixin.qq.com/cgi-bin/media/get?access_token=%s&media_id=%s", a.GetToken(), mediaId)
|
||||||
|
return mUrl
|
||||||
|
}
|
||||||
|
|
||||||
func (q *App) GetJsapiConfig(url string) (*JsapiConfig, error) {
|
func (q *App) GetJsapiConfig(url string) (*JsapiConfig, error) {
|
||||||
ticket, err := q.getJsapiTicket()
|
ticket, err := q.getJsapiTicket()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,12 @@ package qyweixin
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"git.u8t.cn/open/gosdk/util"
|
"git.u8t.cn/open/gosdk/util"
|
||||||
"git.u8t.cn/open/goutil"
|
"git.u8t.cn/open/goutil"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
"github.com/spf13/cast"
|
"github.com/spf13/cast"
|
||||||
"strings"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Applyer struct {
|
type Applyer struct {
|
||||||
|
|
@ -165,9 +166,11 @@ func (d *ApproveDetail) GetData() map[string]string {
|
||||||
} else if content.Control == "Money" {
|
} else if content.Control == "Money" {
|
||||||
value = content.Value.NewMoney
|
value = content.Value.NewMoney
|
||||||
} else if content.Control == "File" {
|
} else if content.Control == "File" {
|
||||||
if len(content.Value.Files) > 0 {
|
fileIds := make([]string, 0)
|
||||||
value = content.Value.Files[0].FileId
|
for _, v := range content.Value.Files {
|
||||||
|
fileIds = append(fileIds, v.FileId)
|
||||||
}
|
}
|
||||||
|
value = strings.Join(fileIds, ",")
|
||||||
} else if content.Control == "Vacation" { //请假 : 请假类型,开始时间,结束时间,请假时长
|
} else if content.Control == "Vacation" { //请假 : 请假类型,开始时间,结束时间,请假时长
|
||||||
tp := content.Value.Vacation.Selector.Options[0].Value[0].Text
|
tp := content.Value.Vacation.Selector.Options[0].Value[0].Text
|
||||||
value = tp + "," + cast.ToString(content.Value.Vacation.Attendance.DateRange.NewBegin) +
|
value = tp + "," + cast.ToString(content.Value.Vacation.Attendance.DateRange.NewBegin) +
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue