Compare commits

..

No commits in common. "8f987dff5227f61c7e8f89729097d5d998236ed0" and "ac18e084f3babef5f6a3326d53fe2df5d39256ee" have entirely different histories.

12 changed files with 463 additions and 608 deletions

File diff suppressed because it is too large Load Diff

View File

@ -443,8 +443,6 @@ func (m *UpdateMediaAccountReq) validate(all bool) error {
// no validation rules for ManagerUserName // no validation rules for ManagerUserName
// no validation rules for ArtistPhoneAreaCode
if len(errors) > 0 { if len(errors) > 0 {
return UpdateMediaAccountReqMultiError(errors) return UpdateMediaAccountReqMultiError(errors)
} }
@ -1064,8 +1062,6 @@ func (m *UpdateWorkImageReq) validate(all bool) error {
// no validation rules for ArtistName // no validation rules for ArtistName
// no validation rules for ArtistPhoneAreaCode
if len(errors) > 0 { if len(errors) > 0 {
return UpdateWorkImageReqMultiError(errors) return UpdateWorkImageReqMultiError(errors)
} }
@ -1489,8 +1485,6 @@ func (m *UpdateWorkVideoReq) validate(all bool) error {
// no validation rules for ArtistName // no validation rules for ArtistName
// no validation rules for ArtistPhoneAreaCode
if len(errors) > 0 { if len(errors) > 0 {
return UpdateWorkVideoReqMultiError(errors) return UpdateWorkVideoReqMultiError(errors)
} }
@ -2465,8 +2459,6 @@ func (m *UpdateStatusReq) validate(all bool) error {
// no validation rules for ConfirmStatus // no validation rules for ConfirmStatus
// no validation rules for ApprovalReply
if len(errors) > 0 { if len(errors) > 0 {
return UpdateStatusReqMultiError(errors) return UpdateStatusReqMultiError(errors)
} }

View File

@ -21,7 +21,6 @@ import (
"fmt" "fmt"
"fonchain-fiee/cmd/config" "fonchain-fiee/cmd/config"
"fonchain-fiee/pkg/cache" "fonchain-fiee/pkg/cache"
"fonchain-fiee/pkg/logger"
"fonchain-fiee/pkg/router" "fonchain-fiee/pkg/router"
) )
@ -45,7 +44,6 @@ func bootstrap() (err error) {
fmt.Println(configEnv) fmt.Println(configEnv)
fmt.Println(config.AppConfig) fmt.Println(config.AppConfig)
logger.LogInit(config.AppConfig)
////redis ////redis
redisConfig := cache.RedisConfig{ redisConfig := cache.RedisConfig{
RedisDB: configEnv.Redis.RedisDB, RedisDB: configEnv.Redis.RedisDB,

View File

@ -125,14 +125,6 @@ type Oss struct {
BaseDir string BaseDir string
CdnHost string CdnHost string
} }
type ZapLog struct {
Level string
Filename string
MaxSize int
MaxAge int
MaxBackups int
}
type Mobile struct { type Mobile struct {
SK string SK string
AK string AK string
@ -152,7 +144,6 @@ type Config struct {
Mobile Mobile `toml:"mobile"` Mobile Mobile `toml:"mobile"`
Ai Ai `toml:"ai"` Ai Ai `toml:"ai"`
Oss Oss `toml:"oss"` Oss Oss `toml:"oss"`
ZapLog ZapLog `toml:"zapLog"`
} }
/********start-配置信息*********/ /********start-配置信息*********/

View File

@ -34,10 +34,3 @@ Password = "Gy.123456"
[stripe] [stripe]
Webhookkey = "whsec_uOQpG6IZTqtfLuePIDtfLCGJPqedSCCN" Webhookkey = "whsec_uOQpG6IZTqtfLuePIDtfLCGJPqedSCCN"
[zapLog]
level = "info"
filename = "logs/fiee_zap.log"
max_size = 5
max_age = 30
max_backups = 30

View File

@ -33,11 +33,4 @@ BaseDir = "fiee"
CdnHost = "https://e-cdn.fontree.cn" CdnHost = "https://e-cdn.fontree.cn"
[stripe] [stripe]
Webhookkey = "whsec_Mol32WD1KcKHUdYsSwap0LR03q2g9qNY" Webhookkey = "whsec_Mol32WD1KcKHUdYsSwap0LR03q2g9qNY"
[zapLog]
level = "info"
filename = "logs/fiee_zap.log"
max_size = 5
max_age = 30
max_backups = 30

View File

@ -35,10 +35,3 @@ Password = "Gy.123456"
[stripe] [stripe]
Webhookkey = "whsec_uOQpG6IZTqtfLuePIDtfLCGJPqedSCCN" Webhookkey = "whsec_uOQpG6IZTqtfLuePIDtfLCGJPqedSCCN"
[zapLog]
level = "info"
filename = "logs/fiee_zap.log"
max_size = 5
max_age = 30
max_backups = 30

View File

@ -1,54 +0,0 @@
package logger
import (
"fonchain-fiee/cmd/config"
"github.com/natefinch/lumberjack"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"os"
)
func LogInit(appConfig *config.Config) *zap.Logger {
var err error
writeSyncer := getLogWriter(appConfig.ZapLog.Filename, appConfig.ZapLog.MaxSize, appConfig.ZapLog.MaxBackups, appConfig.ZapLog.MaxAge)
encoder := getEncoder()
var l = new(zapcore.Level)
err = l.UnmarshalText([]byte(appConfig.ZapLog.Level))
if err != nil {
return nil
}
var core zapcore.Core
//if appConfig.System.Mode == "dev" {
// 进入开发模式,日志输出到终端
consoleEncoder := zapcore.NewConsoleEncoder(zap.NewDevelopmentEncoderConfig())
core = zapcore.NewTee(
zapcore.NewCore(encoder, writeSyncer, l),
zapcore.NewCore(consoleEncoder, zapcore.Lock(os.Stdout), zapcore.DebugLevel),
)
//} else {
// core = zapcore.NewCore(encoder, writeSyncer, l)
//}
lg := zap.New(core, zap.AddCaller())
zap.ReplaceGlobals(lg)
return lg
}
func getEncoder() zapcore.Encoder {
encoderConfig := zap.NewProductionEncoderConfig()
encoderConfig.EncodeTime = zapcore.ISO8601TimeEncoder
encoderConfig.TimeKey = "time"
encoderConfig.EncodeLevel = zapcore.CapitalLevelEncoder
encoderConfig.EncodeDuration = zapcore.SecondsDurationEncoder
encoderConfig.EncodeCaller = zapcore.ShortCallerEncoder
return zapcore.NewJSONEncoder(encoderConfig)
}
func getLogWriter(filename string, maxSize, maxBackup, maxAge int) zapcore.WriteSyncer {
lumberJackLogger := &lumberjack.Logger{
Filename: filename,
MaxSize: maxSize,
MaxBackups: maxBackup,
MaxAge: maxAge,
}
return zapcore.AddSync(lumberJackLogger)
}

View File

@ -21,5 +21,4 @@ type Item struct {
ID int `json:"ID"` ID int `json:"ID"`
Domain string `json:"Domain"` Domain string `json:"Domain"`
Status int `json:"Status"` Status int `json:"Status"`
Reply string `json:"Reply"`
} }

View File

@ -13,7 +13,7 @@ import (
type CastService struct { type CastService struct {
} }
func (c *CastService) ApprovalDetail(approvalIds []int) (data map[int]modelCast.Item, err error) { func (c *CastService) ApprovalDetail(approvalIds []int) (data map[int]int, err error) {
type ApprovalDetailRequest struct { type ApprovalDetailRequest struct {
ID []int `json:"ID"` ID []int `json:"ID"`
} }
@ -33,9 +33,9 @@ func (c *CastService) ApprovalDetail(approvalIds []int) (data map[int]modelCast.
return return
} }
if respDetail.Status == 0 && len(respDetail.Data.Data) > 0 { if respDetail.Status == 0 && len(respDetail.Data.Data) > 0 {
data = make(map[int]modelCast.Item, len(respDetail.Data.Data)) data = make(map[int]int, len(respDetail.Data.Data))
for _, v := range respDetail.Data.Data { for _, v := range respDetail.Data.Data {
data[v.ID] = v data[v.ID] = v.Status
} }
} else { } else {
err = errors.New(e.GetMsg(e.ErrorHttp)) err = errors.New(e.GetMsg(e.ErrorHttp))

View File

@ -2,6 +2,7 @@ package cast
import ( import (
"context" "context"
"dubbo.apache.org/dubbo-go/v3/common/logger"
"errors" "errors"
"fonchain-fiee/api/accountFiee" "fonchain-fiee/api/accountFiee"
"fonchain-fiee/api/bundle" "fonchain-fiee/api/bundle"
@ -11,7 +12,6 @@ import (
modelCast "fonchain-fiee/pkg/model/cast" modelCast "fonchain-fiee/pkg/model/cast"
"fonchain-fiee/pkg/service" "fonchain-fiee/pkg/service"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"go.uber.org/zap"
"strconv" "strconv"
) )
@ -52,7 +52,7 @@ func UnbindManager(ctx *gin.Context) {
service.Error(ctx, err) service.Error(ctx, err)
return return
} }
zap.L().Info("UnbindManager resp", zap.Any("resp", resp)) logger.Error("UnbindManager resp" + resp.OldBindArtistUuid)
if resp.OldBindArtistUuid != "" { if resp.OldBindArtistUuid != "" {
userID, _ := strconv.ParseInt(resp.OldBindArtistUuid, 10, 64) userID, _ := strconv.ParseInt(resp.OldBindArtistUuid, 10, 64)
_, err = service.BundleProvider.AddBundleBalance(context.Background(), &bundle.AddBundleBalanceReq{ _, err = service.BundleProvider.AddBundleBalance(context.Background(), &bundle.AddBundleBalanceReq{
@ -121,7 +121,6 @@ func UpdateMediaAccount(ctx *gin.Context) {
} }
req.ArtistName = infoResp.Name req.ArtistName = infoResp.Name
req.ArtistPhone = infoResp.TelNum req.ArtistPhone = infoResp.TelNum
req.ArtistPhoneAreaCode = infoResp.TelAreaCode
if _, ok := cast.PlatformIDENUM_name[int32(req.PlatformID)]; !ok { if _, ok := cast.PlatformIDENUM_name[int32(req.PlatformID)]; !ok {
service.Error(ctx, errors.New(e.GetMsg(e.InvalidParams))) service.Error(ctx, errors.New(e.GetMsg(e.InvalidParams)))
return return

View File

@ -36,14 +36,12 @@ func UpdateWorkImage(ctx *gin.Context) {
} }
} else { } else {
infoResp = &accountFiee.UserInfoResponse{ infoResp = &accountFiee.UserInfoResponse{
Name: "小波", Name: "小波",
TelNum: "18288888888", TelNum: "18288888888",
TelAreaCode: "86",
} }
} }
req.ArtistName = infoResp.Name req.ArtistName = infoResp.Name
req.ArtistPhone = infoResp.TelNum req.ArtistPhone = infoResp.TelNum
req.ArtistPhoneAreaCode = infoResp.TelAreaCode
artistID, _ := strconv.ParseUint(req.ArtistUuid, 10, 64) artistID, _ := strconv.ParseUint(req.ArtistUuid, 10, 64)
if err = CheckUserBundleBalance(int32(artistID), modelCast.BalanceTypeImageValue); err != nil { if err = CheckUserBundleBalance(int32(artistID), modelCast.BalanceTypeImageValue); err != nil {
service.Error(ctx, err) service.Error(ctx, err)
@ -79,9 +77,8 @@ func UpdateWorkVideo(ctx *gin.Context) {
} }
} else { } else {
infoResp = &accountFiee.UserInfoResponse{ infoResp = &accountFiee.UserInfoResponse{
Name: "小波", Name: "小波",
TelNum: "18288888888", TelNum: "18288888888",
TelAreaCode: "86",
} }
} }
artistID, _ := strconv.ParseUint(req.ArtistUuid, 10, 64) artistID, _ := strconv.ParseUint(req.ArtistUuid, 10, 64)
@ -91,7 +88,6 @@ func UpdateWorkVideo(ctx *gin.Context) {
} }
req.ArtistName = infoResp.Name req.ArtistName = infoResp.Name
req.ArtistPhone = infoResp.TelNum req.ArtistPhone = infoResp.TelNum
req.ArtistPhoneAreaCode = infoResp.TelAreaCode
newCtx := NewCtxWithUserInfo(ctx) newCtx := NewCtxWithUserInfo(ctx)
resp, err := service.CastProvider.UpdateWorkVideo(newCtx, req) resp, err := service.CastProvider.UpdateWorkVideo(newCtx, req)
if err != nil { if err != nil {
@ -242,7 +238,7 @@ func UserBundleBalanceCost() {
func RefreshWorkApprovalStatus(approvalIDWorkUuidMap map[int]string) (err error) { func RefreshWorkApprovalStatus(approvalIDWorkUuidMap map[int]string) (err error) {
var castS = new(CastService) var castS = new(CastService)
var data = make(map[int]modelCast.Item) var data = make(map[int]int)
var approvalIDs []int var approvalIDs []int
for approvalId, _ := range approvalIDWorkUuidMap { for approvalId, _ := range approvalIDWorkUuidMap {
approvalIDs = append(approvalIDs, approvalId) approvalIDs = append(approvalIDs, approvalId)
@ -253,20 +249,19 @@ func RefreshWorkApprovalStatus(approvalIDWorkUuidMap map[int]string) (err error)
data, err = castS.ApprovalDetail(approvalIDs) data, err = castS.ApprovalDetail(approvalIDs)
// status: 1待审批 2审批通过 3审批不通过 6撤销发其中 7撤销完成 // status: 1待审批 2审批通过 3审批不通过 6撤销发其中 7撤销完成
if len(data) > 0 { if len(data) > 0 {
for approvalId, v := range data { for approvalId, approvalStatus := range data {
var workAction cast.WorkActionENUM var workAction cast.WorkActionENUM
if v.Status == 2 { if approvalStatus == 2 {
workAction = cast.WorkActionENUM_APPROVAL_PASS workAction = cast.WorkActionENUM_APPROVAL_PASS
} else if v.Status == 3 { } else if approvalStatus == 3 {
workAction = cast.WorkActionENUM_APPROVAL_REJECT workAction = cast.WorkActionENUM_APPROVAL_REJECT
} else { } else {
continue continue
} }
_, _ = service.CastProvider.UpdateStatus(context.Background(), &cast.UpdateStatusReq{ _, _ = service.CastProvider.UpdateStatus(context.Background(), &cast.UpdateStatusReq{
WorkAction: workAction, WorkAction: workAction,
WorkUuid: approvalIDWorkUuidMap[approvalId], WorkUuid: approvalIDWorkUuidMap[approvalId],
ApprovalID: fmt.Sprint(approvalId), ApprovalID: fmt.Sprint(approvalId),
ApprovalReply: v.Reply,
}) })
} }
} }