完成账号更新

This commit is contained in:
戴育兵 2025-06-06 14:15:37 +08:00
parent 9711496a8b
commit 99520e87d4
7 changed files with 29 additions and 48 deletions

View File

@ -1,38 +0,0 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: pb/fiee/cast.proto
package cast
import (
fmt "fmt"
math "math"
proto "github.com/golang/protobuf/proto"
_ "github.com/envoyproxy/protoc-gen-validate/validate"
_ "google.golang.org/protobuf/types/known/wrapperspb"
_ "google.golang.org/protobuf/types/descriptorpb"
_ "google.golang.org/protobuf/types/known/emptypb"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
func (this *MediaUserListReq) Validate() error {
return nil
}
func (this *MediaUserListResp) Validate() error {
return nil
}
func (this *UpdateMediaAccountReq) Validate() error {
return nil
}
func (this *UpdateMediaAccountResp) Validate() error {
return nil
}
func (this *UpdateWorkReq) Validate() error {
return nil
}
func (this *UpdateWorkResp) Validate() error {
return nil
}

View File

@ -109,6 +109,7 @@ type Redis struct {
type System struct { type System struct {
Mode string Mode string
AppMode string
Version string Version string
HttpPort string HttpPort string
Host string Host string

View File

@ -1,6 +1,6 @@
[system] [system]
Domain = "artistinfo" Domain = "artistinfo"
AppMode = "debug" AppMode = "dev"
HttpPort = ":8085" HttpPort = ":8085"
Host = "https://common.szjixun.cn" Host = "https://common.szjixun.cn"
RedirectUri = "/api/redirect/url" RedirectUri = "/api/redirect/url"

View File

@ -1,6 +1,6 @@
[system] [system]
Domain = "artistinfo" Domain = "artistinfo"
AppMode = "debug" AppMode = "prod"
HttpPort = ":8085" HttpPort = ":8085"
Host = "https://common.szjixun.cn" Host = "https://common.szjixun.cn"
RedirectUri = "/api/redirect/url" RedirectUri = "/api/redirect/url"

View File

@ -1,6 +1,6 @@
[system] [system]
Domain = "artistinfo" Domain = "artistinfo"
AppMode = "debug" AppMode = "test"
HttpPort = ":8085" HttpPort = ":8085"
Host = "https://common.szjixun.cn" Host = "https://common.szjixun.cn"
RedirectUri = "/api/redirect/url" RedirectUri = "/api/redirect/url"

View File

@ -2,9 +2,7 @@ package middleware
import ( import (
"bytes" "bytes"
"fmt"
"io" "io"
"io/ioutil"
"log" "log"
"net" "net"
"net/http" "net/http"
@ -31,12 +29,9 @@ func NewLogger() gin.HandlerFunc {
if val == "" { if val == "" {
c.Request.Header.Set("Accept-Language", "zh-CN") c.Request.Header.Set("Accept-Language", "zh-CN")
} }
val2 := c.GetHeader("Accept-Language")
fmt.Println(val2)
log.Printf("[%s] %s %d %s %s %s %s %s %s", path, c.Request.Method, c.Writer.Status(), query, log.Printf("[%s] %s %d %s %s %s %s %s %s", path, c.Request.Method, c.Writer.Status(), query,
string(data), c.ClientIP(), c.Request.UserAgent(), c.Errors.ByType(gin.ErrorTypePrivate).String(), latencyTime.String()) string(data), c.ClientIP(), c.Request.UserAgent(), c.Errors.ByType(gin.ErrorTypePrivate).String(), latencyTime.String())
c.Request.Body = io.NopCloser(bytes.NewBuffer(data))
c.Request.Body = ioutil.NopCloser(bytes.NewBuffer(data))
c.Next() c.Next()
} }
} }

View File

@ -1,13 +1,18 @@
package cast package cast
import ( import (
"context"
"fonchain-fiee/api/accountFiee"
"fonchain-fiee/api/cast" "fonchain-fiee/api/cast"
"fonchain-fiee/cmd/config"
"fonchain-fiee/pkg/service" "fonchain-fiee/pkg/service"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"strconv"
) )
func UpdateMediaAccount(ctx *gin.Context) { func UpdateMediaAccount(ctx *gin.Context) {
var req *cast.UpdateMediaAccountReq var req *cast.UpdateMediaAccountReq
var infoResp *accountFiee.UserInfoResponse
var err error var err error
if err = ctx.ShouldBind(&req); err != nil { if err = ctx.ShouldBind(&req); err != nil {
service.Error(ctx, err) service.Error(ctx, err)
@ -18,7 +23,25 @@ func UpdateMediaAccount(ctx *gin.Context) {
return return
} }
// 查询艺人的信息 // 查询艺人的信息
service.AccountFieeProvider.Info // 字符串转整型
artistID, err := strconv.ParseUint(req.ArtistUuid, 10, 64)
if config.AppConfig.System.AppMode != "dev" {
infoResp, err = service.AccountFieeProvider.Info(context.Background(), &accountFiee.InfoRequest{
ID: artistID,
Domain: "app",
})
if err != nil {
service.Error(ctx, err)
return
}
} else {
infoResp = &accountFiee.UserInfoResponse{
Name: "小波",
TelNum: "18288888888",
}
}
req.ArtistUserName = infoResp.Name
req.ArtistPhone = infoResp.TelNum
resp, err := service.CastProvider.UpdateMediaAccount(ctx, req) resp, err := service.CastProvider.UpdateMediaAccount(ctx, req)
if err != nil { if err != nil {
service.Error(ctx, err) service.Error(ctx, err)