作者 yangfu

计算发现分 发现分百分比

@@ -305,3 +305,9 @@ func (this *BaseController) Finish() { @@ -305,3 +305,9 @@ func (this *BaseController) Finish() {
305 log.Debug(fmt.Sprintf("<====Send to uid(%d) ucid(%v) client: %d byte\nRequestId:%s RspBodyData: %s", this.Header.Uid, this.Header.UserId, length, this.Header.GetRequestId(), string(strByte))) 305 log.Debug(fmt.Sprintf("<====Send to uid(%d) ucid(%v) client: %d byte\nRequestId:%s RspBodyData: %s", this.Header.Uid, this.Header.UserId, length, this.Header.GetRequestId(), string(strByte)))
306 } 306 }
307 } 307 }
  308 +
  309 +//func(this *BaseController)Get(){
  310 +// if strings.HasSuffix(this.Ctx.Request.RequestURI,".mp3"){
  311 +// this.Ctx.ResponseWriter.Header().Set("Content-Type","audio/mpeg")
  312 +// }
  313 +//}
@@ -3,6 +3,7 @@ package main @@ -3,6 +3,7 @@ package main
3 import ( 3 import (
4 "fmt" 4 "fmt"
5 "github.com/astaxie/beego" 5 "github.com/astaxie/beego"
  6 + "github.com/astaxie/beego/context"
6 _ "github.com/go-sql-driver/mysql" 7 _ "github.com/go-sql-driver/mysql"
7 "gitlab.fjmaimaimai.com/mmm-go/gocomm/common" 8 "gitlab.fjmaimaimai.com/mmm-go/gocomm/common"
8 "gitlab.fjmaimaimai.com/mmm-go/gocomm/config" 9 "gitlab.fjmaimaimai.com/mmm-go/gocomm/config"
@@ -13,6 +14,7 @@ import ( @@ -13,6 +14,7 @@ import (
13 "opp/internal/utils" 14 "opp/internal/utils"
14 _ "opp/routers" 15 _ "opp/routers"
15 "os" 16 "os"
  17 + "strings"
16 "time" 18 "time"
17 ) 19 )
18 20
@@ -71,6 +73,8 @@ func init() { @@ -71,6 +73,8 @@ func init() {
71 log.Info(fmt.Sprintf("env REDIS_HOST:%v", os.Getenv("REDIS_HOST"))) 73 log.Info(fmt.Sprintf("env REDIS_HOST:%v", os.Getenv("REDIS_HOST")))
72 log.Info(fmt.Sprintf("env REDIS_PORT:%v", os.Getenv("REDIS_PORT"))) 74 log.Info(fmt.Sprintf("env REDIS_PORT:%v", os.Getenv("REDIS_PORT")))
73 log.Info(fmt.Sprintf("env aliyun_file_access:%v", os.Getenv("aliyun_file_access"))) 75 log.Info(fmt.Sprintf("env aliyun_file_access:%v", os.Getenv("aliyun_file_access")))
  76 +
  77 + //mime.AddExtensionType(".mp3","audio/mpeg")
74 } 78 }
75 79
76 func main() { 80 func main() {
@@ -79,6 +83,14 @@ func main() { @@ -79,6 +83,14 @@ func main() {
79 }() 83 }()
80 log.Info("app on start!") 84 log.Info("app on start!")
81 log.Info("Beego Run Mode:", beego.BConfig.RunMode) 85 log.Info("Beego Run Mode:", beego.BConfig.RunMode)
82 - 86 + beego.InsertFilter("file/opp/*", beego.BeforeStatic, FilterBeforeStatic)
83 beego.Run() 87 beego.Run()
84 } 88 }
  89 +
  90 +var FilterBeforeStatic = func(ctx *context.Context) {
  91 + if strings.HasSuffix(ctx.Request.RequestURI, ".mp3") {
  92 + //If-Modified-Since
  93 + //ctx.Request.Header.Add("If-Modified-Since","")
  94 + ctx.ResponseWriter.Header().Add("Content-Type", "audio/mpeg")
  95 + }
  96 +}
@@ -338,7 +338,7 @@ type ChanceDetailResponse struct { @@ -338,7 +338,7 @@ type ChanceDetailResponse struct {
338 ApproveAccess *ApproveAccess `json:"approveAccess"` // 338 ApproveAccess *ApproveAccess `json:"approveAccess"` //
339 ChanceType NameItem `json:"chanceType"` //机会类型 339 ChanceType NameItem `json:"chanceType"` //机会类型
340 ChanceTemplate NameItem `json:"template"` //机会模板 340 ChanceTemplate NameItem `json:"template"` //机会模板
341 - ReviewStatus int `json:"review_status"` //审核状态 1:待审核 2:被退回 3:已通过 341 + ReviewStatus int `json:"reviewStatus"` //审核状态 1:待审核 2:被退回 3:已通过
342 } 342 }
343 343
344 type ChanceType struct { 344 type ChanceType struct {
@@ -185,6 +185,7 @@ func GetChanceMarkData(userId, companyId int64, sourceId int64) (flag int, err e @@ -185,6 +185,7 @@ func GetChanceMarkData(userId, companyId int64, sourceId int64) (flag int, err e
185 ) 185 )
186 if v, err = models.GetChanceFavorite(userId, companyId, sourceId, protocol.SourceTypeChance); err != nil { 186 if v, err = models.GetChanceFavorite(userId, companyId, sourceId, protocol.SourceTypeChance); err != nil {
187 if err == orm.ErrNoRows { 187 if err == orm.ErrNoRows {
  188 + log.Error(userId, companyId, sourceId, err)
188 return 0, nil 189 return 0, nil
189 } 190 }
190 return 191 return