浏览代码

added attachment caching path for CRM

master
Patrick Peng Sun 8 年前
父节点
当前提交
8cfad7ba5b
共有 3 个文件被更改,包括 13 次插入0 次删除
  1. +1
    -0
      common_test.go
  2. +8
    -0
      main.go
  3. +4
    -0
      server.go

+ 1
- 0
common_test.go 查看文件

@@ -19,6 +19,7 @@ func SetupConfig() {
"https://c.hitxy.org.au/",
"wechat",
"crmwechat.api"}
GlobalPath = PathsConfig{"/tmp"}
}

func AssertEqual(t *testing.T, a interface{}, b interface{}, message string) {

+ 8
- 0
main.go 查看文件

@@ -5,6 +5,14 @@ import (
"net/http"
)

//PathsConfig all system available pathes
type PathsConfig struct {
CRMAttachment string `json:"crm_attachmeng"`
}

//GlobalPath all global pathes configurations
var GlobalPath = PathsConfig{"/tmp/"}

func main() {
err := readConfig() //wechat API config
if err != nil {

+ 4
- 0
server.go 查看文件

@@ -187,3 +187,7 @@ func uploadHandler(w http.ResponseWriter, r *http.Request) {
defer f.Close()
io.Copy(f, file)
}

func crmAttachmentHandler(w http.Response, r *http.Request) {
http.ServeFile(w, r)
}

正在加载...
取消
保存