作者 yangfu

计算发现分 发现分百分比

... ... @@ -305,3 +305,9 @@ func (this *BaseController) Finish() {
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)))
}
}
//func(this *BaseController)Get(){
// if strings.HasSuffix(this.Ctx.Request.RequestURI,".mp3"){
// this.Ctx.ResponseWriter.Header().Set("Content-Type","audio/mpeg")
// }
//}
... ...
... ... @@ -3,6 +3,7 @@ package main
import (
"fmt"
"github.com/astaxie/beego"
"github.com/astaxie/beego/context"
_ "github.com/go-sql-driver/mysql"
"gitlab.fjmaimaimai.com/mmm-go/gocomm/common"
"gitlab.fjmaimaimai.com/mmm-go/gocomm/config"
... ... @@ -13,6 +14,7 @@ import (
"opp/internal/utils"
_ "opp/routers"
"os"
"strings"
"time"
)
... ... @@ -71,6 +73,8 @@ func init() {
log.Info(fmt.Sprintf("env REDIS_HOST:%v", os.Getenv("REDIS_HOST")))
log.Info(fmt.Sprintf("env REDIS_PORT:%v", os.Getenv("REDIS_PORT")))
log.Info(fmt.Sprintf("env aliyun_file_access:%v", os.Getenv("aliyun_file_access")))
//mime.AddExtensionType(".mp3","audio/mpeg")
}
func main() {
... ... @@ -79,6 +83,14 @@ func main() {
}()
log.Info("app on start!")
log.Info("Beego Run Mode:", beego.BConfig.RunMode)
beego.InsertFilter("file/opp/*", beego.BeforeStatic, FilterBeforeStatic)
beego.Run()
}
var FilterBeforeStatic = func(ctx *context.Context) {
if strings.HasSuffix(ctx.Request.RequestURI, ".mp3") {
//If-Modified-Since
//ctx.Request.Header.Add("If-Modified-Since","")
ctx.ResponseWriter.Header().Add("Content-Type", "audio/mpeg")
}
}
... ...
... ... @@ -338,7 +338,7 @@ type ChanceDetailResponse struct {
ApproveAccess *ApproveAccess `json:"approveAccess"` //
ChanceType NameItem `json:"chanceType"` //机会类型
ChanceTemplate NameItem `json:"template"` //机会模板
ReviewStatus int `json:"review_status"` //审核状态 1:待审核 2:被退回 3:已通过
ReviewStatus int `json:"reviewStatus"` //审核状态 1:待审核 2:被退回 3:已通过
}
type ChanceType struct {
... ...
... ... @@ -185,6 +185,7 @@ func GetChanceMarkData(userId, companyId int64, sourceId int64) (flag int, err e
)
if v, err = models.GetChanceFavorite(userId, companyId, sourceId, protocol.SourceTypeChance); err != nil {
if err == orm.ErrNoRows {
log.Error(userId, companyId, sourceId, err)
return 0, nil
}
return
... ...