完成账号更新
This commit is contained in:
parent
9711496a8b
commit
99520e87d4
@ -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
|
||||
}
|
@ -109,6 +109,7 @@ type Redis struct {
|
||||
|
||||
type System struct {
|
||||
Mode string
|
||||
AppMode string
|
||||
Version string
|
||||
HttpPort string
|
||||
Host string
|
||||
|
@ -1,6 +1,6 @@
|
||||
[system]
|
||||
Domain = "artistinfo"
|
||||
AppMode = "debug"
|
||||
AppMode = "dev"
|
||||
HttpPort = ":8085"
|
||||
Host = "https://common.szjixun.cn"
|
||||
RedirectUri = "/api/redirect/url"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[system]
|
||||
Domain = "artistinfo"
|
||||
AppMode = "debug"
|
||||
AppMode = "prod"
|
||||
HttpPort = ":8085"
|
||||
Host = "https://common.szjixun.cn"
|
||||
RedirectUri = "/api/redirect/url"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[system]
|
||||
Domain = "artistinfo"
|
||||
AppMode = "debug"
|
||||
AppMode = "test"
|
||||
HttpPort = ":8085"
|
||||
Host = "https://common.szjixun.cn"
|
||||
RedirectUri = "/api/redirect/url"
|
||||
|
@ -2,9 +2,7 @@ package middleware
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net"
|
||||
"net/http"
|
||||
@ -31,12 +29,9 @@ func NewLogger() gin.HandlerFunc {
|
||||
if val == "" {
|
||||
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,
|
||||
string(data), c.ClientIP(), c.Request.UserAgent(), c.Errors.ByType(gin.ErrorTypePrivate).String(), latencyTime.String())
|
||||
|
||||
c.Request.Body = ioutil.NopCloser(bytes.NewBuffer(data))
|
||||
c.Request.Body = io.NopCloser(bytes.NewBuffer(data))
|
||||
c.Next()
|
||||
}
|
||||
}
|
||||
|
@ -1,13 +1,18 @@
|
||||
package cast
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fonchain-fiee/api/accountFiee"
|
||||
"fonchain-fiee/api/cast"
|
||||
"fonchain-fiee/cmd/config"
|
||||
"fonchain-fiee/pkg/service"
|
||||
"github.com/gin-gonic/gin"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
func UpdateMediaAccount(ctx *gin.Context) {
|
||||
var req *cast.UpdateMediaAccountReq
|
||||
var infoResp *accountFiee.UserInfoResponse
|
||||
var err error
|
||||
if err = ctx.ShouldBind(&req); err != nil {
|
||||
service.Error(ctx, err)
|
||||
@ -18,7 +23,25 @@ func UpdateMediaAccount(ctx *gin.Context) {
|
||||
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)
|
||||
if err != nil {
|
||||
service.Error(ctx, err)
|
||||
|
Loading…
Reference in New Issue
Block a user