更新
This commit is contained in:
commit
2b554ab871
36
.gitignore
vendored
Normal file
36
.gitignore
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
# local env files
|
||||
.env.local
|
||||
.env.*.local
|
||||
|
||||
# Log files
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
.vscode
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
|
||||
*.iml
|
||||
# Binaries for programs and plugins
|
||||
*.exe
|
||||
*.exe~
|
||||
*.dll
|
||||
*.so
|
||||
*.dylib
|
||||
|
||||
# Test binary, built with `go test -c`
|
||||
*.test
|
||||
|
||||
# Output of the go coverage tool, specifically when used with LiteIDE
|
||||
*.out
|
||||
|
||||
|
||||
/cmd/logs/*.log
|
||||
/cmd/runtime/log/*.log
|
||||
/build/*
|
11
DockerBuildTest.bat
Normal file
11
DockerBuildTest.bat
Normal file
@ -0,0 +1,11 @@
|
||||
go env -w GOOS=linux
|
||||
cd ./build
|
||||
del artistinfo-dev
|
||||
cd ..
|
||||
go build -ldflags "-s -w" -o ./build/artistinfo-dev ./cmd/app.go
|
||||
docker rmi artistinfo-dev
|
||||
docker rmi 121.229.45.214:9006/artistinfo-dev
|
||||
docker build . -f .\DockerfileWindowsTest -t artistinfo-dev
|
||||
docker tag artistinfo-dev 121.229.45.214:9006/artistinfo-dev
|
||||
docker push 121.229.45.214:9006/artistinfo-dev
|
||||
pause
|
@ -9,7 +9,7 @@ WORKDIR /app
|
||||
|
||||
COPY fonchain-artistinfo /app/fonchain-artistinfo
|
||||
ADD utils /app/utils
|
||||
ADD electronic-contract /app/electronic-contract
|
||||
#ADD electronic-contract /app/electronic-contract
|
||||
|
||||
|
||||
WORKDIR /app/fonchain-artistinfo
|
||||
|
@ -3,31 +3,33 @@ FROM golang:alpine AS builder
|
||||
LABEL stage=gobuilder
|
||||
#ENV DUBBO_GO_CONFIG_PATH ./conf/dubbogo.yaml
|
||||
#ENV MODE_ENV test
|
||||
ENV TZ Asia/Shanghai
|
||||
ENV CGO_ENABLED 0
|
||||
ENV GOPROXY https://goproxy.cn,direct
|
||||
#RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
|
||||
#RUN apk update --no-cache && apk add --no-cache tzdata
|
||||
|
||||
WORKDIR /build
|
||||
COPY ./utils ../utils
|
||||
ADD ./fonchain-backup/go.mod .
|
||||
ADD ./fonchain-backup/go.sum .
|
||||
RUN go mod download
|
||||
COPY ./fonchain-backup .
|
||||
#COPY ./utils ../utils
|
||||
#ADD ./fonchain-artist/go.mod .
|
||||
#ADD ./fonchain-artist/go.sum .
|
||||
#RUN go mod download
|
||||
#COPY ./fonchain-artist .
|
||||
#
|
||||
#RUN go build -ldflags "-s -w" -o /app/artistServer ./cmd/app.go
|
||||
|
||||
RUN go build -ldflags "-s -w" -o /app/backup ./cmd/app.go
|
||||
COPY ./build/artistinfo-dev /app/artistinfo-dev
|
||||
|
||||
FROM alpine
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
|
||||
RUN apk update --no-cache
|
||||
RUN apk add --no-cache ca-certificates
|
||||
RUN apk add --no-cache tzdata
|
||||
COPY ./fonchain-backup/conf /app/conf
|
||||
COPY ./fonchain-backup/conf /conf
|
||||
|
||||
COPY ./conf /app/conf
|
||||
COPY ./conf/test /conf
|
||||
ENV TZ Asia/Shanghai
|
||||
ENV DUBBO_GO_CONFIG_PATH ./conf/dubbogo.yaml
|
||||
ENV MODE_ENV test
|
||||
WORKDIR /app
|
||||
COPY --from=builder /app/backup .
|
||||
EXPOSE 9021
|
||||
CMD ["/app/backup"]
|
||||
COPY --from=builder /app/artistinfo-dev .
|
||||
EXPOSE 20050
|
||||
CMD ["/app/artistinfo-dev"]
|
||||
|
Binary file not shown.
10
cmd/app.go
10
cmd/app.go
@ -11,15 +11,17 @@ import (
|
||||
"github.com/fonchain/fonchain-artistinfo/pkg/cache"
|
||||
db "github.com/fonchain/fonchain-artistinfo/pkg/db"
|
||||
"github.com/fonchain/fonchain-artistinfo/pkg/m"
|
||||
_ "github.com/fonchain/fonchain-artistinfo/pkg/service"
|
||||
)
|
||||
|
||||
// export DUBBO_GO_CONFIG_PATH= PATH_TO_SAMPLES/helloworld/go-server/conf/dubbogo.yaml
|
||||
func main() {
|
||||
fmt.Println("第一处")
|
||||
config.SetProviderService(&controller.ArtistInfoProvider{})
|
||||
config.SetProviderService(&controller.ContractProvider{})
|
||||
config.SetProviderService(&controller.ArtWorkProvider{})
|
||||
config.SetProviderService(&controller.SupplyProvider{})
|
||||
config.SetProviderService(&controller.ArtistInfoUserProvider{})
|
||||
config.SetProviderService(&controller.ArtistInfoArtworkProvider{})
|
||||
config.SetProviderService(&controller.ArtistInfoArtshowProvider{})
|
||||
config.SetProviderService(&controller.ArtistInfoContractProvider{})
|
||||
// config.SetConsumerService(&controller.StatementServerProvider{})
|
||||
db.Init(m.SERVER_CONFIG)
|
||||
cache.InitRedis(m.SERVER_CONFIG)
|
||||
if err := config.Load(); err != nil {
|
||||
|
@ -1,109 +0,0 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/fonchain/fonchain-artistinfo/cmd/internal/logic"
|
||||
"github.com/fonchain/fonchain-artistinfo/pb/artistinfo"
|
||||
)
|
||||
|
||||
type ArtistInfoProvider struct {
|
||||
artistinfo.UnimplementedArtistInfoServer
|
||||
artistInfoLogic *logic.ArtistInfo
|
||||
}
|
||||
|
||||
func (a *ArtistInfoProvider) RegisterUser(ctx context.Context, req *artistinfo.RegisterUserRequest) (rep *artistinfo.RegisterUserRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
// backup := &artistInfo.GetUserInfoRespond{}
|
||||
if rep, err = a.artistInfoLogic.RegisterUser(req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rep, nil
|
||||
}
|
||||
func (a *ArtistInfoProvider) CreateUserInfo(ctx context.Context, req *artistinfo.CreateUserInfoRequest) (rep *artistinfo.CreateUserInfoRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
// backup := &artistInfo.GetUserInfoRespond{}
|
||||
if rep, err = a.artistInfoLogic.CreateUserInfo(req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rep, nil
|
||||
}
|
||||
func (a *ArtistInfoProvider) GetUser(ctx context.Context, req *artistinfo.GetUserRequest) (rep *artistinfo.GetUserRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
// backup := &artistInfo.GetUserInfoRespond{}
|
||||
if rep, err = a.artistInfoLogic.GetUser(req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rep, nil
|
||||
}
|
||||
func (a *ArtistInfoProvider) GetUserById(ctx context.Context, req *artistinfo.GetUserByIdRequest) (rep *artistinfo.GetUserByIdRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
// backup := &artistInfo.GetUserInfoRespond{}
|
||||
if rep, err = a.artistInfoLogic.GetUserById(req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rep, nil
|
||||
}
|
||||
func (a *ArtistInfoProvider) UpdateRealName(ctx context.Context, req *artistinfo.UpdateRealNameRequest) (rep *artistinfo.UpdateRealNameRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
// backup := &artistInfo.GetUserInfoRespond{}
|
||||
if rep, err = a.artistInfoLogic.UpdateRealName(req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func (a *ArtistInfoProvider) FinishVerify(ctx context.Context, req *artistinfo.FinishVerifyRequest) (rep *artistinfo.FinishVerifyRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
// backup := &artistInfo.GetUserInfoRespond{}
|
||||
if rep, err = a.artistInfoLogic.FinishVerify(req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func (a *ArtistInfoProvider) CheckUserLock(ctx context.Context, req *artistinfo.CheckUserLockRequest) (rep *artistinfo.CheckUserLockRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
// backup := &artistInfo.GetUserInfoRespond{}
|
||||
if rep, err = a.artistInfoLogic.CheckUserLock(req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func (a *ArtistInfoProvider) ArtistSupplyList(ctx context.Context, req *artistinfo.ArtistSupplyListRequest) (rep *artistinfo.ArtistSupplyListRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
// backup := &artistInfo.GetUserInfoRespond{}
|
||||
if rep, err = a.artistInfoLogic.ArtistSupplyList(req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func (a *ArtistInfoProvider) CheckInvitedCode(ctx context.Context, req *artistinfo.CheckInvitedCodeRequest) (rep *artistinfo.GetUserRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
// backup := &artistInfo.CheckInvitedCodeInfoRespond{}
|
||||
if rep, err = a.artistInfoLogic.CheckInvitedCode(req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func (a *ArtistInfoProvider) UnFinishList(ctx context.Context, req *artistinfo.UnFinishListRequest) (rep *artistinfo.UnFinishListRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
// backup := &artistInfo.UnFinishListInfoRespond{}
|
||||
if rep, err = a.artistInfoLogic.UnFinishList(req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func (a *ArtistInfoProvider) GetUserMsg(ctx context.Context, req *artistinfo.GetUserMsgRequest) (rep *artistinfo.GetUserMsgRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
// backup := &artistInfo.GetUserMsgInfoRespond{}
|
||||
if rep, err = a.artistInfoLogic.GetUserMsg(req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rep, nil
|
||||
}
|
88
cmd/internal/controller/artistInfo_artwork.go
Normal file
88
cmd/internal/controller/artistInfo_artwork.go
Normal file
@ -0,0 +1,88 @@
|
||||
// Package controller -----------------------------
|
||||
// @file : artwork.go
|
||||
// @author : JJXu
|
||||
// @contact : wavingbear@163.com
|
||||
// @time : 2023/2/24 18:12
|
||||
// -------------------------------------------
|
||||
package controller
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
|
||||
"github.com/fonchain/fonchain-artistinfo/cmd/internal/logic"
|
||||
"github.com/fonchain/fonchain-artistinfo/pb/artistInfoArtwork"
|
||||
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||
)
|
||||
|
||||
var _ artistInfoArtwork.ArtistInfoArtworkServer = new(ArtistInfoArtworkProvider)
|
||||
|
||||
type ArtistInfoArtworkProvider struct {
|
||||
artistInfoArtwork.UnimplementedArtistInfoArtworkServer
|
||||
artistInfoLogic logic.ArtistInfoArtworkLogic
|
||||
}
|
||||
|
||||
func (a ArtistInfoArtworkProvider) ArtistArtworkStatic(ctx context.Context, request *artistInfoArtwork.ArtistArtworkStaticRequest) (*artistInfoArtwork.ArtistArtworkStaticResponse, error) {
|
||||
return a.artistInfoLogic.ArtworkStatic(request)
|
||||
}
|
||||
|
||||
// 进入画作补充信息的流程
|
||||
func (a ArtistInfoArtworkProvider) GenerateArtworkSupplementInfo(ctx context.Context, request *artistInfoArtwork.ArtworkUidsRequest) (*emptypb.Empty, error) {
|
||||
return a.artistInfoLogic.GenerateArtworkSupplementInfo(request)
|
||||
}
|
||||
|
||||
// 画作基本信息是否可编辑
|
||||
func (a ArtistInfoArtworkProvider) CheckArtworkBaseInfoEditable(ctx context.Context, request *artistInfoArtwork.ArtworkUidRequest) (*artistInfoArtwork.CheckArtworkEditableResponse, error) {
|
||||
if request.ArtworkUid == "" {
|
||||
return nil, errors.New("ArtworkUid 不能为空")
|
||||
}
|
||||
return a.artistInfoLogic.CheckArtworkEditable(request, 2)
|
||||
}
|
||||
|
||||
// 画作补充信息是否可编辑
|
||||
func (a ArtistInfoArtworkProvider) CheckArtworkSupplementInfoEditable(ctx context.Context, request *artistInfoArtwork.ArtworkUidRequest) (*artistInfoArtwork.CheckArtworkEditableResponse, error) {
|
||||
if request.ArtworkUid == "" {
|
||||
return nil, errors.New("ArtworkUid 不能为空")
|
||||
}
|
||||
return a.artistInfoLogic.CheckArtworkEditable(request, 3)
|
||||
}
|
||||
|
||||
// 更新画作审批状态
|
||||
func (a ArtistInfoArtworkProvider) UpdateArtworkAuditStatus(ctx context.Context, request *artistInfoArtwork.UpdateArtworkAuditStatusRequest) (*artistInfoArtwork.ArtworkCommonNoParams, error) {
|
||||
if request.FlowIndex != 2 && request.FlowIndex != 3 {
|
||||
return nil, errors.New("FlowIndex 不能为空")
|
||||
}
|
||||
return a.artistInfoLogic.UpdateArtworkAuditStatus(request)
|
||||
}
|
||||
|
||||
func (a ArtistInfoArtworkProvider) GetArtworkLockDetail(ctx context.Context, request *artistInfoArtwork.GetArtworkLockDetailRequest) (*artistInfoArtwork.ArtistLockInfo, error) {
|
||||
return a.artistInfoLogic.GetArtworkLockDetail(request)
|
||||
}
|
||||
|
||||
// CreateArtworkLockRecord 创建画作锁定记录
|
||||
func (a ArtistInfoArtworkProvider) CreateArtworkLockRecord(ctx context.Context, req *artistInfoArtwork.CreateArtworkLockRecordReq) (*artistInfoArtwork.ArtworkCommonNoParams, error) {
|
||||
if req.ArtworkUid == "" || req.ArtistUid == "" {
|
||||
return nil, errors.New("参数错误")
|
||||
}
|
||||
return a.artistInfoLogic.CreateArtworkLockRecord(req)
|
||||
}
|
||||
|
||||
// ArtworkLockAction 修改画作锁状态
|
||||
func (a ArtistInfoArtworkProvider) ArtworkLockAction(ctx context.Context, request *artistInfoArtwork.ArtworkLockActionRequest) (*artistInfoArtwork.ArtworkCommonNoParams, error) {
|
||||
return a.artistInfoLogic.ArtworkLockAction(request)
|
||||
}
|
||||
|
||||
// DeleteArtworkRecord 删除话走锁记录
|
||||
func (a ArtistInfoArtworkProvider) DeleteArtworkRecord(ctx context.Context, request *artistInfoArtwork.DeleteArtworkRecordRequest) (*artistInfoArtwork.ArtworkCommonNoParams, error) {
|
||||
return a.artistInfoLogic.DeleteArtworkRecord(request)
|
||||
}
|
||||
|
||||
// GetArtworkRecordUids 获取画作锁记录
|
||||
func (a ArtistInfoArtworkProvider) GetArtworkLockRecords(ctx context.Context, request *artistInfoArtwork.GetArtworkLockRecordsRequest) (*artistInfoArtwork.ArtworkLockList, error) {
|
||||
return a.artistInfoLogic.GetArtworkLockRecords(request)
|
||||
}
|
||||
|
||||
// GetArtworkLockHistoryGroup 查询画作历史记录,按照锁定时间分组
|
||||
func (a ArtistInfoArtworkProvider) GetArtworkLockHistoryGroup(ctx context.Context, request *artistInfoArtwork.GetArtworkLockHistoryRequest) (*artistInfoArtwork.GetArtworkLockHistoryResponse, error) {
|
||||
return a.artistInfoLogic.GetArtworkLockHistoryGroup(request)
|
||||
}
|
246
cmd/internal/controller/artistInfo_user.go
Normal file
246
cmd/internal/controller/artistInfo_user.go
Normal file
@ -0,0 +1,246 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/fonchain/fonchain-artistinfo/cmd/model"
|
||||
"github.com/fonchain/fonchain-artistinfo/pb/artistInfoUser"
|
||||
db "github.com/fonchain/fonchain-artistinfo/pkg/db"
|
||||
"gorm.io/gorm"
|
||||
|
||||
"github.com/fonchain/fonchain-artistinfo/cmd/internal/logic"
|
||||
)
|
||||
|
||||
var _ artistInfoUser.ArtistInfoUserServer = new(ArtistInfoUserProvider)
|
||||
|
||||
type ArtistInfoUserProvider struct {
|
||||
artistInfoUser.UnimplementedArtistInfoUserServer
|
||||
artistInfoLogic *logic.ArtistInfoUser
|
||||
}
|
||||
|
||||
func (a *ArtistInfoUserProvider) GetInviteStaticList(ctx context.Context, request *artistInfoUser.GetInviteStaticListRequest) (*artistInfoUser.GetInviteStaticListResponse, error) {
|
||||
return a.artistInfoLogic.GetInviteStaticList(request)
|
||||
}
|
||||
|
||||
func (a *ArtistInfoUserProvider) GetInviterUserList(ctx context.Context, request *artistInfoUser.GetInviterUserListRequest) (*artistInfoUser.GetInvitedUserListResponse, error) {
|
||||
return a.artistInfoLogic.GetInviterUserList(request)
|
||||
}
|
||||
|
||||
func (a *ArtistInfoUserProvider) GetInvitedUserList(ctx context.Context, request *artistInfoUser.GetInvitedUserListRequest) (*artistInfoUser.GetInvitedUserListResponse, error) {
|
||||
return a.artistInfoLogic.GetInvitedUserList(request)
|
||||
}
|
||||
|
||||
func (a *ArtistInfoUserProvider) FindUsersUserView(ctx context.Context, request *artistInfoUser.FindUsersRequest) (*artistInfoUser.FindUsersUserViewResponse, error) {
|
||||
return a.artistInfoLogic.FindUsersUserView(request)
|
||||
}
|
||||
|
||||
func (a *ArtistInfoUserProvider) FindUsers(ctx context.Context, request *artistInfoUser.FindUsersRequest) (*artistInfoUser.FindUsersResponse, error) {
|
||||
return a.artistInfoLogic.FindUserList(request)
|
||||
}
|
||||
|
||||
func (a *ArtistInfoUserProvider) RegisterUser(ctx context.Context, req *artistInfoUser.RegisterUserRequest) (rep *artistInfoUser.RegisterUserRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
//新增邀请码判断 by JJXu 2023-03-07
|
||||
//if req.UserInviteCode == "" {
|
||||
// return nil, errors.New("邀请码不能为空")
|
||||
//}
|
||||
if rep, err = a.artistInfoLogic.RegisterUser(req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func (a *ArtistInfoUserProvider) UpdateIdCard(ctx context.Context, in *artistInfoUser.UpdateIdCardRequest) (rep *artistInfoUser.CommonNoParams, err error) {
|
||||
var thisUser model.User
|
||||
db.DB.Where("mgmt_acc_id = ?", in.MgmtAccId).Preload("RealNameInfo").Find(&thisUser)
|
||||
if thisUser.RealNameInfo == nil {
|
||||
thisUser.RealNameInfo = &model.RealName{}
|
||||
}
|
||||
if in.Name != "" {
|
||||
thisUser.RealNameInfo.Name = in.Name
|
||||
}
|
||||
if in.IdNum != "" {
|
||||
thisUser.RealNameInfo.IdNum = in.IdNum
|
||||
}
|
||||
if in.Age != 0 {
|
||||
thisUser.RealNameInfo.Age = int(in.Age)
|
||||
}
|
||||
if in.Sex != "" {
|
||||
thisUser.RealNameInfo.Sex = model.SexType(in.Sex)
|
||||
}
|
||||
if in.Address != "" {
|
||||
thisUser.RealNameInfo.Address = in.Address
|
||||
}
|
||||
if in.IdCardFront != "" {
|
||||
thisUser.RealNameInfo.IdCardFront = in.IdCardFront
|
||||
}
|
||||
if in.IdCardBack != "" {
|
||||
thisUser.RealNameInfo.IdCardBack = in.IdCardBack
|
||||
}
|
||||
if in.Birthday != "" {
|
||||
thisUser.RealNameInfo.Birthday = in.Birthday
|
||||
}
|
||||
err = db.DB.Session(&gorm.Session{FullSaveAssociations: true}).Save(&thisUser).Error
|
||||
return
|
||||
}
|
||||
|
||||
func (a *ArtistInfoUserProvider) GetUser(ctx context.Context, req *artistInfoUser.GetUserRequest) (rep *artistInfoUser.GetUserRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
// backup := &artistinfoUser.GetUserInfoRespond{}
|
||||
if rep, err = a.artistInfoLogic.GetUser(req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func (a *ArtistInfoUserProvider) GetUserById(ctx context.Context, req *artistInfoUser.GetUserByIdRequest) (rep *artistInfoUser.GetUserByIdRespond, err error) {
|
||||
return a.artistInfoLogic.GetUserById(req)
|
||||
}
|
||||
|
||||
//func (a *ArtistInfoUserProvider ) UpdateRealName(ctx context.Context, req *artistinfoUser.UpdateRealNameRequest) (rep *artistinfoUser.UpdateRealNameRespond, err error) {
|
||||
// fmt.Println("第一处")
|
||||
// // backup := &artistinfoUser.GetUserInfoRespond{}
|
||||
// if rep, err = a.artistInfoLogic.UpdateRealName(req); err != nil {
|
||||
// return nil, err
|
||||
// }
|
||||
// return rep, nil
|
||||
//}
|
||||
|
||||
func (a *ArtistInfoUserProvider) FinishVerify(ctx context.Context, req *artistInfoUser.FinishVerifyRequest) (rep *artistInfoUser.FinishVerifyRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
// backup := &artistinfoUser.GetUserInfoRespond{}
|
||||
if rep, err = a.artistInfoLogic.FinishVerify(req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rep, nil
|
||||
}
|
||||
func (a *ArtistInfoUserProvider) UserLock(ctx context.Context, req *artistInfoUser.UserLockRequest) (rep *artistInfoUser.UserLockRespond, err error) {
|
||||
return a.artistInfoLogic.UserLock(req)
|
||||
}
|
||||
func (a *ArtistInfoUserProvider) CheckUserLock(ctx context.Context, req *artistInfoUser.CheckUserLockRequest) (rep *artistInfoUser.CheckUserLockRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
// backup := &artistinfoUser.GetUserInfoRespond{}
|
||||
if rep, err = a.artistInfoLogic.CheckUserLock(req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func (a *ArtistInfoUserProvider) ArtistSupplyList(ctx context.Context, req *artistInfoUser.ArtistSupplyListRequest) (rep *artistInfoUser.ArtistSupplyListRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
// backup := &artistinfoUser.GetUserInfoRespond{}
|
||||
if rep, err = a.artistInfoLogic.ArtistSupplyList(req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func (a *ArtistInfoUserProvider) CheckInvitedCode(ctx context.Context, req *artistInfoUser.CheckInvitedCodeRequest) (rep *artistInfoUser.GetUserRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
// backup := &artistinfoUser.CheckInvitedCodeInfoRespond{}
|
||||
if rep, err = a.artistInfoLogic.CheckInvitedCode(req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func (a *ArtistInfoUserProvider) UnFinishList(ctx context.Context, req *artistInfoUser.UnFinishListRequest) (rep *artistInfoUser.UnFinishListRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
// backup := &artistinfoUser.UnFinishListInfoRespond{}
|
||||
if rep, err = a.artistInfoLogic.UnFinishList(req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func (a *ArtistInfoUserProvider) GetUserMsg(ctx context.Context, req *artistInfoUser.GetUserMsgRequest) (rep *artistInfoUser.GetUserMsgRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
// backup := &artistinfoUser.GetUserMsgInfoRespond{}
|
||||
if rep, err = a.artistInfoLogic.GetUserMsg(req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
// 绑定邀请人和受邀请人的账号,并加入到次数统计
|
||||
func (a *ArtistInfoUserProvider) BindInviteInvitedAccount(ctx context.Context, in *artistInfoUser.BindInviteInvitedAccountRequest) (res *artistInfoUser.BindInviteInvitedAccountRespond, err error) {
|
||||
// 查询受邀请人是否存在
|
||||
if in.InvitedUserId == 0 {
|
||||
var thisUser model.User
|
||||
if err = db.DB.Where("id = ? AND invite_code = ?", in.InvitedUserId, in.InviteCode).First(&thisUser).Error; err != nil {
|
||||
if err == gorm.ErrRecordNotFound {
|
||||
return nil, errors.New("受邀请人不存在")
|
||||
} else {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
}
|
||||
var data model.Invite
|
||||
// 受邀请者只能绑定一个邀请人
|
||||
if err = db.DB.Where("invited_id = ?", in.InvitedUserId).Find(&data).Error; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if data.ID == 0 {
|
||||
data = model.Invite{
|
||||
InvitedId: in.InvitedUserId,
|
||||
InvitedCode: in.InvitedCode,
|
||||
InviteCode: in.InviteCode,
|
||||
}
|
||||
if err = db.DB.Create(&data).Error; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
// 添加到次数统计
|
||||
var countData model.UserInvited
|
||||
if err = db.DB.Where("invite_code = ? AND invited_code =?", in.InviteCode, in.InvitedCode).Find(&countData).Error; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if countData.ID == 0 {
|
||||
countData = model.UserInvited{
|
||||
InvitedUserId: in.InvitedUserId, //受邀请人的画家宝用户id
|
||||
Count: 1,
|
||||
InvitedCode: in.InvitedCode,
|
||||
InviteCode: in.InviteCode,
|
||||
}
|
||||
if err = db.DB.Create(&countData).Error; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
} else {
|
||||
countData.Count += 1
|
||||
if err = db.DB.Model(model.UserInvited{}).Where("id = ?", countData.ID).Update("count", countData.Count).Error; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
|
||||
func (a *ArtistInfoUserProvider) BindArtistId(ctx context.Context, in *artistInfoUser.BindArtistIdRequest) (*artistInfoUser.BindArtistIdResp, error) {
|
||||
var updateData = map[string]any{
|
||||
"mgmt_artist_id": in.ArtistId,
|
||||
"mgmt_artist_uid": in.ArtistUid,
|
||||
//"fdd_state": 2,
|
||||
}
|
||||
if err := db.DB.Model(model.User{}).Where("mgmt_acc_id = ?", in.UserId).Updates(&updateData).Error; err != nil {
|
||||
return &artistInfoUser.BindArtistIdResp{Error: err.Error()}, err
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (a *ArtistInfoUserProvider) FindUser(ctx context.Context, in *artistInfoUser.FindUserRequest) (*artistInfoUser.UserInfo, error) {
|
||||
return a.artistInfoLogic.FindUser(in)
|
||||
}
|
||||
|
||||
func (a *ArtistInfoUserProvider) UpdateUserData(ctx context.Context, in *artistInfoUser.UserInfo) (*artistInfoUser.CommonNoParams, error) {
|
||||
return a.artistInfoLogic.UpdateUserData(in)
|
||||
}
|
||||
|
||||
func (a *ArtistInfoUserProvider) PreSaveArtistInfo(ctx context.Context, in *artistInfoUser.PreSaveArtistInfoData) (res *artistInfoUser.CommonNoParams, er error) {
|
||||
return a.artistInfoLogic.PreSaveArtistInfo(in)
|
||||
}
|
||||
|
||||
func (a *ArtistInfoUserProvider) GetPreSaveArtistInfo(ctx context.Context, in *artistInfoUser.GetPreSaveArtistInfoRequest) (res *artistInfoUser.PreSaveArtistInfoData, err error) {
|
||||
return a.artistInfoLogic.GetPreSaveArtistInfo(in)
|
||||
}
|
116
cmd/internal/controller/artistinfo_artshow.go
Normal file
116
cmd/internal/controller/artistinfo_artshow.go
Normal file
@ -0,0 +1,116 @@
|
||||
// Package controller -----------------------------
|
||||
// @file : artshowVideo.go
|
||||
// @author : JJXu
|
||||
// @contact : wavingbear@163.com
|
||||
// @time : 2023/3/2 10:52
|
||||
// -------------------------------------------
|
||||
package controller
|
||||
|
||||
import (
|
||||
context "context"
|
||||
"github.com/fonchain/fonchain-artistinfo/cmd/internal/logic"
|
||||
"github.com/fonchain/fonchain-artistinfo/pb/artistinfoArtshow"
|
||||
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||
)
|
||||
|
||||
// 画展包视频
|
||||
var _ artistinfoArtshow.ArtistInfoArtshowServer = new(ArtistInfoArtshowProvider)
|
||||
|
||||
type ArtistInfoArtshowProvider struct {
|
||||
artistinfoArtshow.UnimplementedArtistInfoArtshowServer
|
||||
videoLogic logic.ArtshowVideoLogic
|
||||
artistIndexLogic logic.ArtshowArtistIndexLogic
|
||||
artistSupplementLogic logic.ArtshowArtistSupplementLogic
|
||||
artshowLogic logic.ArtshowLogic
|
||||
}
|
||||
|
||||
func (a ArtistInfoArtshowProvider) GetArtshowHistroyList(ctx context.Context, request *artistinfoArtshow.GetArtshowHistroyListRequest) (*artistinfoArtshow.GetArtshowHistroyListResponse, error) {
|
||||
return a.artshowLogic.GetArtshowHistroyList(request)
|
||||
}
|
||||
|
||||
// ----------------- 画展包-画家补充信息
|
||||
func (a ArtistInfoArtshowProvider) GetArtistSupplementDetail(ctx context.Context, request *artistinfoArtshow.GetArtistSupplementDetailRequest) (*artistinfoArtshow.ArtistSupplementInfo, error) {
|
||||
return a.artistSupplementLogic.GetSupplementDetail(request)
|
||||
}
|
||||
|
||||
func (a ArtistInfoArtshowProvider) GetArtistSupplementList(ctx context.Context, request *artistinfoArtshow.GetArtistSupplementListRequest) (*artistinfoArtshow.GetArtistSupplementListResponse, error) {
|
||||
return a.artistSupplementLogic.GetSupplementList(request)
|
||||
}
|
||||
|
||||
func (a ArtistInfoArtshowProvider) CreateArtistSupplement(ctx context.Context, info *artistinfoArtshow.ArtistSupplementInfo) (*emptypb.Empty, error) {
|
||||
return nil, a.artistSupplementLogic.CreateSupplement(info)
|
||||
}
|
||||
|
||||
func (a ArtistInfoArtshowProvider) BatchCreateArtistSupplement(ctx context.Context, request *artistinfoArtshow.BatchCreateArtistSupplementRequest) (*emptypb.Empty, error) {
|
||||
return nil, a.artistSupplementLogic.BatchCreateSupplement(request)
|
||||
}
|
||||
|
||||
func (a ArtistInfoArtshowProvider) AuditArtistSupplement(ctx context.Context, request *artistinfoArtshow.AuditArtistSupplementRequest) (*emptypb.Empty, error) {
|
||||
return a.artistSupplementLogic.AuditSupplement(request)
|
||||
}
|
||||
|
||||
func (a ArtistInfoArtshowProvider) UpdateArtistSupplement(ctx context.Context, request *artistinfoArtshow.UpdateArtistSupplementRequest) (*emptypb.Empty, error) {
|
||||
return a.artistSupplementLogic.UpdateSupplement(request)
|
||||
}
|
||||
|
||||
func (a ArtistInfoArtshowProvider) DeletedArtistSupplement(ctx context.Context, request *artistinfoArtshow.DeletedArtistSupplementRequest) (*emptypb.Empty, error) {
|
||||
return a.artistSupplementLogic.DeletedSupplement(request)
|
||||
}
|
||||
|
||||
// ----------------- 画展包-画家指数
|
||||
func (a ArtistInfoArtshowProvider) GetArtistIndexDetail(ctx context.Context, request *artistinfoArtshow.GetArtistIndexDetailRequest) (*artistinfoArtshow.ArtistIndexInfo, error) {
|
||||
return a.artistIndexLogic.GetArtistIndexDetail(request)
|
||||
}
|
||||
|
||||
func (a ArtistInfoArtshowProvider) GetArtistIndexList(ctx context.Context, request *artistinfoArtshow.GetArtistIndexListRequest) (*artistinfoArtshow.GetArtistIndexListResponse, error) {
|
||||
return a.artistIndexLogic.GetArtistIndexList(request)
|
||||
}
|
||||
|
||||
func (a ArtistInfoArtshowProvider) CreateArtistIndex(ctx context.Context, info *artistinfoArtshow.ArtistIndexInfo) (*emptypb.Empty, error) {
|
||||
return nil, a.artistIndexLogic.CreateArtistIndex(info)
|
||||
}
|
||||
|
||||
func (a ArtistInfoArtshowProvider) BatchCreateArtistIndex(ctx context.Context, request *artistinfoArtshow.BatchCreateArtistIndexRequest) (*emptypb.Empty, error) {
|
||||
return nil, a.artistIndexLogic.BatchCreateArtistIndex(request)
|
||||
}
|
||||
|
||||
func (a ArtistInfoArtshowProvider) AuditArtistIndex(ctx context.Context, request *artistinfoArtshow.AuditArtistIndexRequest) (*emptypb.Empty, error) {
|
||||
return a.artistIndexLogic.AuditArtistIndex(request)
|
||||
}
|
||||
|
||||
func (a ArtistInfoArtshowProvider) UpdateArtistIndex(ctx context.Context, request *artistinfoArtshow.UpdateArtistIndexRequest) (*emptypb.Empty, error) {
|
||||
return a.artistIndexLogic.UpdateArtistIndex(request)
|
||||
}
|
||||
|
||||
func (a ArtistInfoArtshowProvider) DeletedArtistIndex(ctx context.Context, request *artistinfoArtshow.DeletedArtistIndexRequest) (*emptypb.Empty, error) {
|
||||
return a.artistIndexLogic.DeletedArtistIndex(request)
|
||||
}
|
||||
|
||||
// ----------------- 画展包-视频资料
|
||||
func (a ArtistInfoArtshowProvider) GetArtshowVideoDetail(ctx context.Context, request *artistinfoArtshow.GetArtshowVideoDetailRequest) (*artistinfoArtshow.ArtshowVideoInfo, error) {
|
||||
return a.videoLogic.GetArtshowVideoDetail(request)
|
||||
}
|
||||
|
||||
func (a ArtistInfoArtshowProvider) BatchCreateArtshowVideo(ctx context.Context, request *artistinfoArtshow.BatchCreateArtshowVideoRequest) (*emptypb.Empty, error) {
|
||||
return nil, a.videoLogic.BatchCreateArtshowVideo(request)
|
||||
}
|
||||
|
||||
func (a ArtistInfoArtshowProvider) CreateArtshowVideo(ctx context.Context, info *artistinfoArtshow.ArtshowVideoInfo) (*emptypb.Empty, error) {
|
||||
return nil, a.videoLogic.CreateArtshowVideo(info)
|
||||
}
|
||||
|
||||
func (a ArtistInfoArtshowProvider) GetArtshowVideoList(ctx context.Context, requst *artistinfoArtshow.GetArtshowVideoListRequst) (*artistinfoArtshow.GetArtshowVideoListResponse, error) {
|
||||
return a.videoLogic.GetArtshowVideoList(requst)
|
||||
}
|
||||
|
||||
func (a ArtistInfoArtshowProvider) AuditArtshowVideo(ctx context.Context, request *artistinfoArtshow.AuditArtshowVideoRequest) (*emptypb.Empty, error) {
|
||||
return a.videoLogic.AuditArtshowVideo(request)
|
||||
}
|
||||
|
||||
func (a ArtistInfoArtshowProvider) UpdateArtshowVideo(ctx context.Context, request *artistinfoArtshow.UpdateArtshowVideoRequest) (*emptypb.Empty, error) {
|
||||
return a.videoLogic.UpdateArtshowVideo(request)
|
||||
}
|
||||
|
||||
func (a ArtistInfoArtshowProvider) DeletedArtshowVideo(ctx context.Context, request *artistinfoArtshow.DeletedArtshowVideoRequest) (*emptypb.Empty, error) {
|
||||
return a.videoLogic.DeletedArtshowVideo(request)
|
||||
}
|
44
cmd/internal/controller/artistinfo_statement.go
Normal file
44
cmd/internal/controller/artistinfo_statement.go
Normal file
@ -0,0 +1,44 @@
|
||||
package controller
|
||||
|
||||
// import (
|
||||
// "context"
|
||||
|
||||
// "github.com/fonchain/fonchain-artistinfo/cmd/internal/logic"
|
||||
// "github.com/fonchain/fonchain-artistinfo/pb/artistinfoStatement"
|
||||
// emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||
// )
|
||||
|
||||
// //go:generate mockgen -destination .\artistinfoStatement_triple.pb.go -package controller -source ..\..\..\pb\artistinfoStatement\artistinfoStatement_triple.pb.go StatementServer
|
||||
|
||||
// type StatementServerProvider struct {
|
||||
// artistinfoStatement.UnimplementedStatementServer
|
||||
// logic logic.StatementServerLogic
|
||||
// }
|
||||
|
||||
// func (s *StatementServerProvider) CreateStatementBatch(ctx context.Context, in *artistinfoStatement.StatementBatchRequest) (res *artistinfoStatement.CreateStatementBatchResponse, err error) {
|
||||
// return s.logic.CreateStatementBatch(in)
|
||||
// }
|
||||
|
||||
// func (s *StatementServerProvider) BatchCreateStatementBatch(ctx context.Context, in *artistinfoStatement.BatchCreateStatementBatchRequest) (*emptypb.Empty, error) {
|
||||
// return s.logic.BatchCreateStatementBatch(in)
|
||||
// }
|
||||
|
||||
// func (s *StatementServerProvider) GetStatementBatchList(ctx context.Context, in *artistinfoStatement.GetStatementBatchListRequest) (*artistinfoStatement.GetStatementBatchListResponse, error) {
|
||||
// return s.logic.GetStatementBatchList(in)
|
||||
// }
|
||||
|
||||
// func (s *StatementServerProvider) CreateStatementDetail(ctx context.Context, in *artistinfoStatement.StatementDetailRequest) (*artistinfoStatement.CreateStatementDetailResponse, error) {
|
||||
// return s.logic.CreateStatementDetail(in)
|
||||
// }
|
||||
|
||||
// func (s *StatementServerProvider) BatchCreateStatementDetail(ctx context.Context, in *artistinfoStatement.BatchCreateStatementDetailRequest) (*emptypb.Empty, error) {
|
||||
// return s.logic.BatchCreateStatementDetail(in)
|
||||
// }
|
||||
|
||||
// func (s *StatementServerProvider) GetStatementDetailList(ctx context.Context, in *artistinfoStatement.GetStatementDetailListRequest) (*artistinfoStatement.GetStatementDetailListResponse, error) {
|
||||
// return s.logic.GetStatementDetailList(in)
|
||||
// }
|
||||
|
||||
// func (s *StatementServerProvider) GetStatementBatchTimeMenus(ctx context.Context, in *artistinfoStatement.GetStatementBatchListRequest) (*artistinfoStatement.GetStatementBatchTimeMenusResponse, error) {
|
||||
// return s.logic.GetStatementBatchTimeMenus(in)
|
||||
// }
|
@ -5,15 +5,47 @@ import (
|
||||
"fmt"
|
||||
|
||||
"github.com/fonchain/fonchain-artistinfo/cmd/internal/logic"
|
||||
"github.com/fonchain/fonchain-artistinfo/pb/contract"
|
||||
contract "github.com/fonchain/fonchain-artistinfo/pb/contract"
|
||||
)
|
||||
|
||||
type ContractProvider struct {
|
||||
contract.UnimplementedContractServer
|
||||
type ArtistInfoContractProvider struct {
|
||||
contract.UnimplementedArtistContractServer
|
||||
contractLogic *logic.Contract
|
||||
}
|
||||
|
||||
func (c *ContractProvider) FinishContract(ctx context.Context, req *contract.FinishContractRequest) (rep *contract.FinishContractRespond, err error) {
|
||||
func (c *ArtistInfoContractProvider) CreateContract(ctx context.Context, req *contract.CreateContractRequest) (rep *contract.CreateContractRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
if rep, err = c.contractLogic.CreateContract(req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func (c *ArtistInfoContractProvider) ContractListMgmt(ctx context.Context, req *contract.ContractListMgmtRequest) (rep *contract.ContractListMgmtRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
if rep, err = c.contractLogic.ContractListMgmt(req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func (c *ArtistInfoContractProvider) ContractList(ctx context.Context, req *contract.ContractListRequest) (rep *contract.ContractListRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
if rep, err = c.contractLogic.ContractList(req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func (c *ArtistInfoContractProvider) SignContract(ctx context.Context, req *contract.SignContractRequest) (rep *contract.SignContractRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
if rep, err = c.contractLogic.SignContract(req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func (c *ArtistInfoContractProvider) FinishContract(ctx context.Context, req *contract.FinishContractRequest) (rep *contract.FinishContractRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
if rep, err = c.contractLogic.FinishContract(req); err != nil {
|
||||
return nil, err
|
||||
@ -21,39 +53,47 @@ func (c *ContractProvider) FinishContract(ctx context.Context, req *contract.Fin
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func (c *ContractProvider) ContractList(ctx context.Context, req *contract.ContractListRequest) (rep *contract.ContractListRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
if rep, err = c.contractLogic.ContractList(req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rep, nil
|
||||
}
|
||||
func (c *ContractProvider) GetContract(ctx context.Context, req *contract.GetContractRequest) (rep *contract.ContractData, err error) {
|
||||
fmt.Println("第一处")
|
||||
if rep, err = c.contractLogic.GetContract(req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rep, nil
|
||||
}
|
||||
func (c *ContractProvider) ContractTxList(ctx context.Context, req *contract.ContractTxListRequest) (rep *contract.ContractTxListRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
if rep, err = c.contractLogic.ContractTxList(req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rep, nil
|
||||
}
|
||||
// func (c *ContractProvider) ContractTxList(ctx context.Context, req *contract.ContractTxListRequest) (rep *contract.ContractTxListRespond, err error) {
|
||||
// fmt.Println("第一处")
|
||||
// if rep, err = c.contractLogic.ContractTxList(req); err != nil {
|
||||
// return nil, err
|
||||
// }
|
||||
// return rep, nil
|
||||
// }
|
||||
|
||||
func (c *ContractProvider) UpdateContract(ctx context.Context, req *contract.UpdateContractRequest) (rep *contract.UpdateContractRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
if rep, err = c.contractLogic.UpdateContract(req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rep, nil
|
||||
}
|
||||
func (c *ContractProvider) UpdateContractTx(ctx context.Context, req *contract.UpdateContractTxRequest) (rep *contract.UpdateContractTxRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
if rep, err = c.contractLogic.UpdateContractTx(req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rep, nil
|
||||
}
|
||||
// func (c *ContractProvider) ContractList(ctx context.Context, req *contract.ContractListRequest) (rep *contract.ContractListRespond, err error) {
|
||||
// fmt.Println("第一处")
|
||||
// if rep, err = c.contractLogic.ContractList(req); err != nil {
|
||||
// return nil, err
|
||||
// }
|
||||
// return rep, nil
|
||||
// }
|
||||
// func (c *ContractProvider) GetContract(ctx context.Context, req *contract.GetContractRequest) (rep *contract.ContractData, err error) {
|
||||
// fmt.Println("第一处")
|
||||
// if rep, err = c.contractLogic.GetContract(req); err != nil {
|
||||
// return nil, err
|
||||
// }
|
||||
// return rep, nil
|
||||
// }
|
||||
// func (c *ContractProvider) ContractTxList(ctx context.Context, req *contract.ContractTxListRequest) (rep *contract.ContractTxListRespond, err error) {
|
||||
// fmt.Println("第一处")
|
||||
// if rep, err = c.contractLogic.ContractTxList(req); err != nil {
|
||||
// return nil, err
|
||||
// }
|
||||
// return rep, nil
|
||||
// }
|
||||
|
||||
// func (c *ContractProvider) UpdateContract(ctx context.Context, req *contract.UpdateContractRequest) (rep *contract.UpdateContractRespond, err error) {
|
||||
// fmt.Println("第一处")
|
||||
// if rep, err = c.contractLogic.UpdateContract(req); err != nil {
|
||||
// return nil, err
|
||||
// }
|
||||
// return rep, nil
|
||||
// }
|
||||
// func (c *ContractProvider) UpdateContractTx(ctx context.Context, req *contract.UpdateContractTxRequest) (rep *contract.UpdateContractTxRespond, err error) {
|
||||
// fmt.Println("第一处")
|
||||
// if rep, err = c.contractLogic.UpdateContractTx(req); err != nil {
|
||||
// return nil, err
|
||||
// }
|
||||
// return rep, nil
|
||||
// }
|
||||
|
@ -1,110 +1,103 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/fonchain/fonchain-artistinfo/cmd/internal/logic"
|
||||
"github.com/fonchain/fonchain-artistinfo/pb/supplyinfo"
|
||||
)
|
||||
|
||||
type SupplyProvider struct {
|
||||
supplyinfo.UnimplementedSupplyInfoServer
|
||||
SupplyLogic *logic.Supply
|
||||
}
|
||||
|
||||
func (a *SupplyProvider) GetSupplyInfoList(ctx context.Context, req *supplyinfo.GetSupplyInfoListRequest) (rep *supplyinfo.GetSupplyInfoListRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
if rep, err = a.SupplyLogic.GetSupplyInfoList(req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func (a *SupplyProvider) GetSupplyInfo(ctx context.Context, req *supplyinfo.GetSupplyInfoRequest) (rep *supplyinfo.GetSupplyInfoData, err error) {
|
||||
fmt.Println("第一处")
|
||||
if rep, err = a.SupplyLogic.GetSupplyInfo(req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func (a *SupplyProvider) UpdateSupplyInfo(ctx context.Context, req *supplyinfo.UpdateSupplyInfoRequest) (rep *supplyinfo.UpdateSupplyInfoRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
if rep, err = a.SupplyLogic.UpdateSupplyInfo(req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func (a *SupplyProvider) GetVideoList(ctx context.Context, req *supplyinfo.GetVideoListRequest) (rep *supplyinfo.GetVideoListRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
if rep, err = a.SupplyLogic.GetVideoList(req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func (a *SupplyProvider) GetVideo(ctx context.Context, req *supplyinfo.GetVideoRequest) (rep *supplyinfo.GetVideoListData, err error) {
|
||||
fmt.Println("第一处")
|
||||
if rep, err = a.SupplyLogic.GetVideo(req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func (a *SupplyProvider) UpdateVideo(ctx context.Context, req *supplyinfo.UpdateVideoRequest) (rep *supplyinfo.UpdateVideoRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
if rep, err = a.SupplyLogic.UpdateVideo(req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func (a *SupplyProvider) GetExam(ctx context.Context, req *supplyinfo.GetExamRequest) (rep *supplyinfo.GetExamListData, err error) {
|
||||
fmt.Println("第一处")
|
||||
if rep, err = a.SupplyLogic.GetExam(req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func (a *SupplyProvider) GetExamList(ctx context.Context, req *supplyinfo.GetExamListRequest) (rep *supplyinfo.GetExamListRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
if rep, err = a.SupplyLogic.GetExamList(req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func (a *SupplyProvider) UpdateExam(ctx context.Context, req *supplyinfo.UpdateExamRequest) (rep *supplyinfo.UpdateExamRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
if rep, err = a.SupplyLogic.UpdateExam(req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func (a *SupplyProvider) GetArtistInfoList(ctx context.Context, req *supplyinfo.GetArtistInfoListRequest) (rep *supplyinfo.GetArtistInfoListRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
if rep, err = a.SupplyLogic.GetArtistInfoList(req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func (a *SupplyProvider) GetArtistInfo(ctx context.Context, req *supplyinfo.GetArtistInfoRequest) (rep *supplyinfo.GetArtistInfoListData, err error) {
|
||||
fmt.Println("第一处")
|
||||
if rep, err = a.SupplyLogic.GetArtistInfo(req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func (a *SupplyProvider) UpdateArtistInfo(ctx context.Context, req *supplyinfo.UpdateArtistInfoRequest) (rep *supplyinfo.UpdateArtistInfoRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
if rep, err = a.SupplyLogic.UpdateArtistInfo(req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rep, nil
|
||||
}
|
||||
//
|
||||
//type SupplyProvider struct {
|
||||
// supplyinfo.UnimplementedSupplyInfoServer
|
||||
// SupplyLogic *logic.Supply
|
||||
//}
|
||||
//
|
||||
//func (a *SupplyProvider) GetSupplyInfoList(ctx context.Context, req *supplyinfo.GetSupplyInfoListRequest) (rep *supplyinfo.GetSupplyInfoListRespond, err error) {
|
||||
// fmt.Println("第一处")
|
||||
// if rep, err = a.SupplyLogic.GetSupplyInfoList(req); err != nil {
|
||||
// return nil, err
|
||||
// }
|
||||
// return rep, nil
|
||||
//}
|
||||
//
|
||||
//func (a *SupplyProvider) GetSupplyInfo(ctx context.Context, req *supplyinfo.GetSupplyInfoRequest) (rep *supplyinfo.GetSupplyInfoData, err error) {
|
||||
// fmt.Println("第一处")
|
||||
// if rep, err = a.SupplyLogic.GetSupplyInfo(req); err != nil {
|
||||
// return nil, err
|
||||
// }
|
||||
// return rep, nil
|
||||
//}
|
||||
//
|
||||
//func (a *SupplyProvider) UpdateSupplyInfo(ctx context.Context, req *supplyinfo.UpdateSupplyInfoRequest) (rep *supplyinfo.UpdateSupplyInfoRespond, err error) {
|
||||
// fmt.Println("第一处")
|
||||
// if rep, err = a.SupplyLogic.UpdateSupplyInfo(req); err != nil {
|
||||
// return nil, err
|
||||
// }
|
||||
// return rep, nil
|
||||
//}
|
||||
//
|
||||
//func (a *SupplyProvider) GetVideoList(ctx context.Context, req *supplyinfo.GetVideoListRequest) (rep *supplyinfo.GetVideoListRespond, err error) {
|
||||
// fmt.Println("第一处")
|
||||
// if rep, err = a.SupplyLogic.GetVideoList(req); err != nil {
|
||||
// return nil, err
|
||||
// }
|
||||
// return rep, nil
|
||||
//}
|
||||
//
|
||||
//func (a *SupplyProvider) GetVideo(ctx context.Context, req *supplyinfo.GetVideoRequest) (rep *supplyinfo.GetVideoListData, err error) {
|
||||
// fmt.Println("第一处")
|
||||
// if rep, err = a.SupplyLogic.GetVideo(req); err != nil {
|
||||
// return nil, err
|
||||
// }
|
||||
// return rep, nil
|
||||
//}
|
||||
//
|
||||
//func (a *SupplyProvider) UpdateVideo(ctx context.Context, req *supplyinfo.UpdateVideoRequest) (rep *supplyinfo.UpdateVideoRespond, err error) {
|
||||
// fmt.Println("第一处")
|
||||
// if rep, err = a.SupplyLogic.UpdateVideo(req); err != nil {
|
||||
// return nil, err
|
||||
// }
|
||||
// return rep, nil
|
||||
//}
|
||||
//
|
||||
//func (a *SupplyProvider) GetExam(ctx context.Context, req *supplyinfo.GetExamRequest) (rep *supplyinfo.GetExamListData, err error) {
|
||||
// fmt.Println("第一处")
|
||||
// if rep, err = a.SupplyLogic.GetExam(req); err != nil {
|
||||
// return nil, err
|
||||
// }
|
||||
// return rep, nil
|
||||
//}
|
||||
//
|
||||
//func (a *SupplyProvider) GetExamList(ctx context.Context, req *supplyinfo.GetExamListRequest) (rep *supplyinfo.GetExamListRespond, err error) {
|
||||
// fmt.Println("第一处")
|
||||
// if rep, err = a.SupplyLogic.GetExamList(req); err != nil {
|
||||
// return nil, err
|
||||
// }
|
||||
// return rep, nil
|
||||
//}
|
||||
//
|
||||
//func (a *SupplyProvider) UpdateExam(ctx context.Context, req *supplyinfo.UpdateExamRequest) (rep *supplyinfo.UpdateExamRespond, err error) {
|
||||
// fmt.Println("第一处")
|
||||
// if rep, err = a.SupplyLogic.UpdateExam(req); err != nil {
|
||||
// return nil, err
|
||||
// }
|
||||
// return rep, nil
|
||||
//}
|
||||
//
|
||||
//func (a *SupplyProvider) GetArtistInfoList(ctx context.Context, req *supplyinfo.GetArtistInfoListRequest) (rep *supplyinfo.GetArtistInfoListRespond, err error) {
|
||||
// fmt.Println("第一处")
|
||||
// if rep, err = a.SupplyLogic.GetArtistInfoList(req); err != nil {
|
||||
// return nil, err
|
||||
// }
|
||||
// return rep, nil
|
||||
//}
|
||||
//
|
||||
//func (a *SupplyProvider) GetArtistInfo(ctx context.Context, req *supplyinfo.GetArtistInfoRequest) (rep *supplyinfo.GetArtistInfoListData, err error) {
|
||||
// fmt.Println("第一处")
|
||||
// if rep, err = a.SupplyLogic.GetArtistInfo(req); err != nil {
|
||||
// return nil, err
|
||||
// }
|
||||
// return rep, nil
|
||||
//}
|
||||
//
|
||||
//func (a *SupplyProvider) UpdateArtistInfo(ctx context.Context, req *supplyinfo.UpdateArtistInfoRequest) (rep *supplyinfo.UpdateArtistInfoRespond, err error) {
|
||||
// fmt.Println("第一处")
|
||||
// if rep, err = a.SupplyLogic.UpdateArtistInfo(req); err != nil {
|
||||
// return nil, err
|
||||
// }
|
||||
// return rep, nil
|
||||
//}
|
||||
|
@ -1,427 +0,0 @@
|
||||
package dao
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/alibaba/sentinel-golang/logging"
|
||||
"github.com/fonchain/fonchain-artistinfo/cmd/model"
|
||||
"github.com/fonchain/fonchain-artistinfo/pb/artistinfo"
|
||||
db "github.com/fonchain/fonchain-artistinfo/pkg/db"
|
||||
"github.com/fonchain/fonchain-artistinfo/pkg/m"
|
||||
"github.com/fonchain/utils/utils"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
func RegisterUser(req *artistinfo.RegisterUserRequest) (rep *artistinfo.RegisterUserRespond, err error) {
|
||||
|
||||
var user model.User
|
||||
user.TelNum = req.TelNum
|
||||
user.MgmtArtistId = req.MgmtArtistId
|
||||
if err := db.DB.Create(&user).Error; err != nil {
|
||||
zap.L().Error("register user err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return nil, err
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func CreateUserInfo(req *artistinfo.CreateUserInfoRequest) (rep *artistinfo.CreateUserInfoRespond, err error) {
|
||||
var user model.User
|
||||
//找到用户
|
||||
fmt.Println("req.Id:", req.Id)
|
||||
fmt.Println("第三处")
|
||||
err = db.DB.Where("id = ?", req.Id).First(&user).Error
|
||||
if err != nil {
|
||||
fmt.Println("第四处")
|
||||
fmt.Println(err.Error())
|
||||
zap.L().Error("CreateUserInfo err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return nil, err
|
||||
}
|
||||
fmt.Println(11)
|
||||
var realNameFind model.RealName
|
||||
err = db.DB.Where("id_num = ?", req.IdCard).First(&realNameFind).Error
|
||||
if err == nil {
|
||||
fmt.Println("第五处")
|
||||
fmt.Println(12)
|
||||
if realNameFind.ID != 0 {
|
||||
fmt.Println("第六处")
|
||||
zap.L().Error("register user err", zap.Error(err))
|
||||
err = errors.New("此身份证已实名认证")
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
fmt.Println("第四处")
|
||||
fmt.Println(12)
|
||||
var realname = model.RealName{
|
||||
Name: req.RealName,
|
||||
IDNum: req.IdCard,
|
||||
TelNum: req.TelNum,
|
||||
IdcardFront: req.IdCardFront,
|
||||
IdcardBack: req.IdCardBack,
|
||||
}
|
||||
err = db.DB.Save(&realname).Error
|
||||
if err != nil {
|
||||
fmt.Println("第九处")
|
||||
zap.L().Error("CreateUserInfo err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
fmt.Println(13)
|
||||
err = db.DB.Where("id_num=?", realname.IDNum).First(&realname).Error
|
||||
if err != nil {
|
||||
zap.L().Error("CreateUserInfo err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
fmt.Println(14)
|
||||
user.ID = req.Id
|
||||
user.Name = req.RealName
|
||||
user.PenName = req.PenName
|
||||
user.RealNameID = int32(realname.ID)
|
||||
user.StageName = req.StageName
|
||||
user.Age = int32(utils.IdCardTurnAge(realname.IDNum))
|
||||
user.Sex = req.Sex
|
||||
user.JoinAssoTime = req.JoinAssoTime
|
||||
user.CertificateNum = req.CertificateNum
|
||||
conAddessByte, err := json.Marshal(req.ConAddress)
|
||||
if err != nil {
|
||||
zap.L().Error("CreateUserInfo err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return nil, err
|
||||
}
|
||||
user.ConAddress = string(conAddessByte)
|
||||
user.CreateAt = time.Now().Unix()
|
||||
user.Photo = req.Photo
|
||||
user.WxAccount = req.WxAccount
|
||||
user.CertificateImg = req.CertificateImg
|
||||
user.Video = req.Video
|
||||
user.IsRealName = 1
|
||||
var invite model.Invite
|
||||
|
||||
err = db.DB.Where("user_id = ?", user.ID).First(&invite).Error
|
||||
if err != nil {
|
||||
logging.Info(err.Error())
|
||||
if err.Error() == "record not found" {
|
||||
|
||||
} else {
|
||||
zap.L().Error("CreateUserInfo err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
if invite.ID == 0 {
|
||||
InvitedId, err := CheckInvitedCodes(req.InvitedCode)
|
||||
if err == nil {
|
||||
var invite InviteService
|
||||
invite.UserId = uint(req.Id)
|
||||
invite.InvitedId = InvitedId
|
||||
Createinvite(invite)
|
||||
}
|
||||
}
|
||||
|
||||
fmt.Printf("%+v\n", user)
|
||||
user.ID = req.Id
|
||||
err = db.DB.Save(&user).Error
|
||||
if err != nil {
|
||||
zap.L().Error("CreateUserInfo err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return
|
||||
|
||||
}
|
||||
|
||||
type InvitedCodeService struct {
|
||||
InvitedCode string `form:"invitedCode" json:"invitedCode"`
|
||||
}
|
||||
type InviteService struct {
|
||||
Id uint `json:"id"`
|
||||
UserId uint `form:"userId" json:"userId"`
|
||||
InvitedId uint `form:"invitedId" json:"invitedId"`
|
||||
}
|
||||
|
||||
func Createinvite(service InviteService) {
|
||||
|
||||
var invite model.Invite
|
||||
invite.UserId = int32(service.UserId)
|
||||
invite.InvitedId = int32(service.InvitedId)
|
||||
db.DB.Create(&invite)
|
||||
|
||||
}
|
||||
|
||||
func CheckInvitedCodes(invitedCode string) (uint, error) {
|
||||
|
||||
var user model.User
|
||||
//找到用户
|
||||
if err := db.DB.Where("invited_code =?", invitedCode).Find(&user).Error; err != nil {
|
||||
return 0, err
|
||||
}
|
||||
if user.ID == 0 {
|
||||
return 0, errors.New("邀请码无效")
|
||||
}
|
||||
return uint(user.ID), nil
|
||||
}
|
||||
func GetUser(req *artistinfo.GetUserRequest) (rep *artistinfo.GetUserRespond, err error) {
|
||||
rep = &artistinfo.GetUserRespond{}
|
||||
// service := &artist.UserUpdateInfoService{}
|
||||
var user model.User
|
||||
if err = db.DB.Where("tel_num = ?", req.TelNum).First(&user).Error; err != nil {
|
||||
zap.L().Error("get user info err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return nil, err
|
||||
}
|
||||
// rep.
|
||||
fmt.Println(user)
|
||||
rep.Id = user.ID
|
||||
rep.MgmtUserId = user.MgmtUserId
|
||||
rep.MgmtArtistId = user.MgmtArtistId
|
||||
rep.TelNum = user.TelNum
|
||||
rep.IsFdd = user.FddState
|
||||
rep.IsRealName = user.IsRealName
|
||||
rep.Ruler = user.Ruler
|
||||
// service.QrCodeImg = fmt.Sprintf("https://cdn.fontree.cn/artistmgmt/static/qrcode/%v.png", user.InvitedCode)
|
||||
|
||||
// service.QrCodeImgDownload = fmt.Sprintf("https://cdn.fontree.cn/artistmgmt/static/qrcode/%v-2.png", user.InvitedCode)
|
||||
// rep.Data = service
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func GetUserById(req *artistinfo.GetUserByIdRequest) (rep *artistinfo.GetUserByIdRespond, err error) {
|
||||
rep = &artistinfo.GetUserByIdRespond{}
|
||||
fmt.Println("id:", req.Id)
|
||||
fmt.Println("123")
|
||||
zap.L().Info("!!!!")
|
||||
fmt.Println("456")
|
||||
// service := &artist.UserUpdateInfoService{}
|
||||
var user model.User
|
||||
fmt.Println("666")
|
||||
if err = db.DB.Where("id = ?", req.Id).First(&user).Error; err != nil {
|
||||
zap.L().Info("!!!!3")
|
||||
zap.L().Error("get user info err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return
|
||||
}
|
||||
fmt.Printf("%+v\n", user)
|
||||
fmt.Println("6666")
|
||||
zap.L().Info("!!!!5")
|
||||
// rep.
|
||||
fmt.Println("777")
|
||||
rep.Id = user.ID
|
||||
rep.MgmtUserId = user.MgmtUserId
|
||||
rep.MgmtArtistId = user.MgmtArtistId
|
||||
rep.TelNum = user.TelNum
|
||||
rep.IsFdd = user.FddState
|
||||
rep.IsRealName = user.IsRealName
|
||||
rep.Ruler = user.Ruler
|
||||
return rep, nil
|
||||
}
|
||||
func UpdateRealName(req *artistinfo.UpdateRealNameRequest) (rep *artistinfo.UpdateRealNameRespond, err error) {
|
||||
|
||||
var user model.User
|
||||
user.ID = req.Id
|
||||
if err = db.DB.Model(&user).Update("is_real_name", 1).Error; err != nil {
|
||||
zap.L().Error("get user info err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return nil, err
|
||||
}
|
||||
return rep, nil
|
||||
|
||||
}
|
||||
func FinishVerify(req *artistinfo.FinishVerifyRequest) (rep *artistinfo.FinishVerifyRespond, err error) {
|
||||
var user model.User
|
||||
user.ID = req.Id
|
||||
if err = db.DB.Model(&user).Update("isfdd", 2).Error; err != nil {
|
||||
zap.L().Error("get user info err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return nil, err
|
||||
}
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func ArtistSupplyList(req *artistinfo.ArtistSupplyListRequest) (rep *artistinfo.ArtistSupplyListRespond, err error) {
|
||||
var artistList = make([]artistinfo.ArtistArtworkSupplyListResponseData, 0)
|
||||
var args []interface{}
|
||||
sql := `select cc.* from (SELECT a.id,a.name,a.pen_name,a.is_import,a.tel_num,a.sex,a.age,b.id_num,a.invited_code,a.certificate_num,a.con_address,b.idcard_front,b.idcard_back,a.photo,a.video,a.created_at,a.updated_at,a.is_lock,a.certificate_img,min(d.created_at) as dd from user a inner join real_name b on a.real_name_id = b.id left join bank c on a.id = c.user_id left join supply_info d on a.id = d.user_id where (d.types = 1 or d.types = 4 or d.types = 2 or d.types = 3 or d.types =6) and a.is_real_name = true `
|
||||
sqlWhere := ` `
|
||||
sqlGroup := ` group by a.id order by min(d.created_at) desc ) cc inner join supply_info f where dd >0 and dd = f.created_at and cc.id = f.user_id group by cc.id,dd `
|
||||
var count uint64
|
||||
tx := db.DB.Raw("select count(*) from (" + sql + sqlWhere + sqlGroup + ") cc").Scan(&count)
|
||||
if tx.Error != nil {
|
||||
zap.L().Error("get user info err", zap.Error(tx.Error))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return nil, err
|
||||
}
|
||||
rep.Count = count
|
||||
var sqlLimit = " limit ?,? "
|
||||
args = append(args, (req.Page-1)*req.PageSize)
|
||||
args = append(args, req.PageSize)
|
||||
err = db.DB.Raw(sql + sqlWhere + sqlGroup + sqlLimit).Scan(&artistList).Error
|
||||
if err != nil {
|
||||
zap.L().Error("get user info err", zap.Error(tx.Error))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return nil, err
|
||||
}
|
||||
for _, v := range artistList {
|
||||
rep.Data = append(rep.Data, &v)
|
||||
}
|
||||
return rep, nil
|
||||
}
|
||||
func UserLock(req *artistinfo.UserLockRequest) (rep *artistinfo.UserLockRespond, err error) {
|
||||
var user model.User
|
||||
user.ID = uint64(req.Id)
|
||||
if err = db.DB.Model(&user).Update("is_lock", req.IsLock).Error; err != nil {
|
||||
zap.L().Error("get user info err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if !req.IsLock {
|
||||
|
||||
var vas model.ExhVideo
|
||||
vas.UserId = uint(req.Id)
|
||||
if err = db.DB.Model(&vas).Update("state", 5).Where("state = 1 or state = 2 or state = 3").Error; err != nil {
|
||||
zap.L().Error("get user info err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return nil, err
|
||||
}
|
||||
var ee model.ExhExam
|
||||
ee.UserId = uint(req.Id)
|
||||
if err = db.DB.Model(&ee).Update("state", 5).Where("state = 1 or state = 2 or state = 3 or state = 4").Error; err != nil {
|
||||
zap.L().Error("get user info err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return nil, err
|
||||
}
|
||||
var si model.SupplyInfo
|
||||
si.UserId = uint(req.Id)
|
||||
if err = db.DB.Model(&si).Update("state", 5).Where("state = 1 or state = 2 or state = 3 or state = 4").Error; err != nil {
|
||||
zap.L().Error("get user info err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return nil, err
|
||||
}
|
||||
var ai model.ArtistInfo
|
||||
ai.UserId = uint(req.Id)
|
||||
if err = db.DB.Model(&ai).Update("state", 5).Where("state = 1 or state = 2 or state = 3 or state = 4").Error; err != nil {
|
||||
zap.L().Error("get user info err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func CheckInvitedCode(req *artistinfo.CheckInvitedCodeRequest) (rep *artistinfo.GetUserRespond, err error) {
|
||||
rep = &artistinfo.GetUserRespond{}
|
||||
// service := &artist.UserUpdateInfoService{}
|
||||
var user model.User
|
||||
if err = db.DB.First(&user, "invited_code = ?", req.InvitedCode).Error; err != nil {
|
||||
zap.L().Error("get user info err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return nil, err
|
||||
}
|
||||
// rep.
|
||||
rep.Id = user.ID
|
||||
rep.MgmtUserId = user.MgmtUserId
|
||||
rep.MgmtArtistId = user.MgmtArtistId
|
||||
rep.TelNum = user.TelNum
|
||||
rep.IsFdd = user.IsFdd
|
||||
rep.IsRealName = user.IsRealName
|
||||
rep.Ruler = user.Ruler
|
||||
// service.QrCodeImg = fmt.Sprintf("https://cdn.fontree.cn/artistmgmt/static/qrcode/%v.png", user.InvitedCode)
|
||||
|
||||
// service.QrCodeImgDownload = fmt.Sprintf("https://cdn.fontree.cn/artistmgmt/static/qrcode/%v-2.png", user.InvitedCode)
|
||||
// rep.Data = service
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func UnFinishList(req *artistinfo.UnFinishListRequest) (rep *artistinfo.UnFinishListRespond, err error) {
|
||||
rep = &artistinfo.UnFinishListRespond{}
|
||||
var user model.User
|
||||
if err := db.DB.Where("id = ? ", req.Id).First(&user).Error; err != nil {
|
||||
zap.L().Error("get user info err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return nil, err
|
||||
|
||||
}
|
||||
var realName model.RealName
|
||||
if err := db.DB.Where("id = ? ", user.RealNameID).First(&realName).Error; err != nil {
|
||||
zap.L().Error("get user info err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return nil, err
|
||||
}
|
||||
var contract model.Contract
|
||||
var contractCount int64
|
||||
if err := db.DB.Model(&contract).Where("state = ? and (user_id = ? or card_id = ?) and (type =1 or type = 2 or type = 3)", "1", user.ID, realName.IDNum).Count(&contractCount).Error; err != nil {
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return nil, err
|
||||
}
|
||||
rep.ContractList = contractCount
|
||||
var accountStateCount int64
|
||||
fmt.Println(realName.IDNum)
|
||||
if err := db.DB.Model(&contract).Where("state = ? and (user_id = ? or card_id = ?) and type = 4", "1", user.ID, realName.IDNum).Count(&accountStateCount).Error; err != nil {
|
||||
zap.L().Error("get user info err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return nil, err
|
||||
}
|
||||
rep.AccountStateList = accountStateCount
|
||||
var supplyInfo model.SupplyInfo
|
||||
var supplyInfoCount int64
|
||||
if err := db.DB.Model(&supplyInfo).Where("types = ? and user_id = ? ", "1", user.ID).Count(&supplyInfoCount).Error; err != nil {
|
||||
zap.L().Error("get user info err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return nil, err
|
||||
}
|
||||
rep.SupplyInfoList += supplyInfoCount
|
||||
var exhVideo model.ExhVideo
|
||||
var exhVideoCount int64
|
||||
if err := db.DB.Model(&exhVideo).Where("types = ? and user_id = ? ", "1", user.ID).Count(&exhVideoCount).Error; err != nil {
|
||||
zap.L().Error("get user info err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return nil, err
|
||||
}
|
||||
rep.SupplyInfoList += exhVideoCount
|
||||
var exhExam model.ExhExam
|
||||
var exhExamCount int64
|
||||
if err := db.DB.Model(&exhExam).Where("types = ? and user_id = ? ", "1", user.ID).Count(&exhExamCount).Error; err != nil {
|
||||
zap.L().Error("get user info err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return nil, err
|
||||
}
|
||||
rep.SupplyInfoList += exhExamCount
|
||||
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func GetUserMsg(req *artistinfo.GetUserMsgRequest) (rep *artistinfo.GetUserMsgRespond, err error) {
|
||||
var user model.User
|
||||
|
||||
err = db.DB.Where("id = ?", req.Id).First(&user).Error
|
||||
if err != nil {
|
||||
zap.L().Error("get user info err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return nil, err
|
||||
}
|
||||
userByte, err := json.Marshal(user)
|
||||
if err != nil {
|
||||
zap.L().Error("1get user info err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return nil, err
|
||||
}
|
||||
fmt.Println(string(userByte))
|
||||
var re = new(artistinfo.GetUserMsgRespond)
|
||||
err = json.Unmarshal(userByte, re)
|
||||
if err != nil {
|
||||
zap.L().Error("1get user info err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return nil, err
|
||||
}
|
||||
rep = re
|
||||
return rep, nil
|
||||
}
|
1148
cmd/internal/dao/artistInfo_user.go
Normal file
1148
cmd/internal/dao/artistInfo_user.go
Normal file
File diff suppressed because it is too large
Load Diff
119
cmd/internal/dao/artistinfo_artshow_artistIndex.go
Normal file
119
cmd/internal/dao/artistinfo_artshow_artistIndex.go
Normal file
@ -0,0 +1,119 @@
|
||||
// Package dao -----------------------------
|
||||
// @file : artistinfo_artshow_artistIndex.go
|
||||
// @author : JJXu
|
||||
// @contact : wavingbear@163.com
|
||||
// @time : 2023/3/3 0:20
|
||||
// -------------------------------------------
|
||||
package dao
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/fonchain/fonchain-artistinfo/cmd/model"
|
||||
"github.com/fonchain/fonchain-artistinfo/pb/artistinfoArtshow"
|
||||
db "github.com/fonchain/fonchain-artistinfo/pkg/db"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
var ArtistinfoArtshowArtistIndex = new(artistinfoArtshowArtistIndex)
|
||||
|
||||
type artistinfoArtshowArtistIndex struct{}
|
||||
|
||||
func (a artistinfoArtshowArtistIndex) BatchCreateData(datas []model.ArtshowArtistIndex) error {
|
||||
//return db.DB.Create(&datas).Error
|
||||
tx := db.DB.Begin()
|
||||
for _, v := range datas {
|
||||
err := a.CreateData(&v, tx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
tx.Commit()
|
||||
return nil
|
||||
}
|
||||
func (a artistinfoArtshowArtistIndex) CreateData(data *model.ArtshowArtistIndex, tx ...*gorm.DB) error {
|
||||
var txdb *gorm.DB
|
||||
if tx != nil {
|
||||
txdb = tx[0]
|
||||
} else {
|
||||
txdb = db.DB
|
||||
}
|
||||
var exist = model.ArtshowArtistIndex{}
|
||||
db.DB.Where("artist_uid = ? AND status = 2 AND class= ?", data.ArtistUid, data.Class).Find(&exist)
|
||||
if exist.ID != 0 {
|
||||
return errors.New(fmt.Sprintf("主题[%s]已存在", data.Title))
|
||||
}
|
||||
return txdb.Create(&data).Error
|
||||
}
|
||||
|
||||
func (a artistinfoArtshowArtistIndex) UpdateData(data *model.ArtshowArtistIndex) error {
|
||||
return db.DB.Where("id = ?", data.ID).Updates(&data).Error
|
||||
}
|
||||
|
||||
func (a artistinfoArtshowArtistIndex) DeletedData(id ...int64) (err error) {
|
||||
if len(id) == 1 {
|
||||
err = db.DB.Where("id = ?", id[0]).Delete(&model.ArtshowArtistIndex{}).Error
|
||||
} else if len(id) > 0 {
|
||||
err = db.DB.Where("id = ?", id).Delete(&model.ArtshowArtistIndex{}).Error
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func (a artistinfoArtshowArtistIndex) GetData(id int64) (data *model.ArtshowArtistIndex, err error) {
|
||||
err = db.DB.Where("id = ?", id).First(&data).Error
|
||||
return
|
||||
}
|
||||
|
||||
func (a artistinfoArtshowArtistIndex) GetDataList(req *artistinfoArtshow.GetArtistIndexListRequest) (datas []model.ArtshowArtistIndex, total int64, err error) {
|
||||
datas = []model.ArtshowArtistIndex{}
|
||||
var tx = db.DB.Model(model.ArtshowArtistIndex{})
|
||||
if req.ArtistUid != "" {
|
||||
tx = tx.Where("artist_uid = ?", req.ArtistUid)
|
||||
}
|
||||
if req.LockTime != "" {
|
||||
tx = tx.Where("lock_time = ?", req.LockTime)
|
||||
}
|
||||
if req.Status != 0 {
|
||||
tx = tx.Where("status = ?", req.Status)
|
||||
}
|
||||
if req.AuditStatus != 0 {
|
||||
tx = tx.Where("audit_status = ?", req.AuditStatus)
|
||||
}
|
||||
//if req.AuditMark1 != "" {
|
||||
// tx = tx.Where("audit_mark1 = ?", req.AuditMark1)
|
||||
//}
|
||||
//if req.AuditMark2 != "" {
|
||||
// tx = tx.Where("audit_mark2 = ?", req.AuditMark2)
|
||||
//}
|
||||
err = tx.Count(&total).Scopes(db.Pagination(req.Page, req.PageSize)).Find(&datas).Error
|
||||
return
|
||||
}
|
||||
|
||||
func (a artistinfoArtshowArtistIndex) Audit(auditStatus model.AuditStatus, mark1, mark2 string, ids ...int64) (err error) {
|
||||
tx := db.DB.Begin()
|
||||
err = tx.Model(model.ArtshowArtistIndex{}).Where("id in ?", ids).Update("audit_status", auditStatus).Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = tx.Model(model.ArtshowArtistIndex{}).Where("id in ?", ids).Update("audit_mark1", mark1).Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = tx.Model(model.ArtshowArtistIndex{}).Where("id in ?", ids).Update("audit_mark2", mark2).Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
tx.Commit()
|
||||
return
|
||||
}
|
||||
|
||||
func (a artistinfoArtshowArtistIndex) GetArtistIndexDetail(in *artistinfoArtshow.GetArtistIndexDetailRequest) (rep model.ArtshowArtistIndex, err error) {
|
||||
var tx = db.DB.Model(model.ArtshowArtistIndex{})
|
||||
if in.Id != 0 {
|
||||
tx = tx.Where("id = ?", in.Id)
|
||||
}
|
||||
//var data model.ArtshowArtistIndex
|
||||
err = tx.First(&rep).Error
|
||||
return
|
||||
}
|
119
cmd/internal/dao/artistinfo_artshow_artistSupplement.go
Normal file
119
cmd/internal/dao/artistinfo_artshow_artistSupplement.go
Normal file
@ -0,0 +1,119 @@
|
||||
// Package dao -----------------------------
|
||||
// @file : artistinfo_artshow_artistIndex.go
|
||||
// @author : JJXu
|
||||
// @contact : wavingbear@163.com
|
||||
// @time : 2023/3/3 0:20
|
||||
// -------------------------------------------
|
||||
package dao
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/fonchain/fonchain-artistinfo/cmd/model"
|
||||
"github.com/fonchain/fonchain-artistinfo/pb/artistinfoArtshow"
|
||||
db "github.com/fonchain/fonchain-artistinfo/pkg/db"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
var ArtistSupplement = new(artistSupplement)
|
||||
|
||||
type artistSupplement struct{}
|
||||
|
||||
func (a artistSupplement) BatchCreateData(datas []model.ArtshowArtistSupplement) error {
|
||||
//return db.DB.Create(&datas).Error
|
||||
tx := db.DB.Begin()
|
||||
for _, v := range datas {
|
||||
err := a.CreateData(&v, tx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
tx.Commit()
|
||||
return nil
|
||||
}
|
||||
func (a artistSupplement) CreateData(data *model.ArtshowArtistSupplement, tx ...*gorm.DB) error {
|
||||
var txdb *gorm.DB
|
||||
if tx != nil {
|
||||
txdb = tx[0]
|
||||
} else {
|
||||
txdb = db.DB
|
||||
}
|
||||
var exist = model.ArtshowArtistSupplement{}
|
||||
db.DB.Where("artist_uid = ? AND status = 2", data.ArtistUid).Find(&exist)
|
||||
if exist.ID != 0 {
|
||||
return errors.New(fmt.Sprintf("画家补充信息已存在"))
|
||||
}
|
||||
return txdb.Create(&data).Error
|
||||
}
|
||||
|
||||
func (a artistSupplement) UpdateData(data *model.ArtshowArtistSupplement) error {
|
||||
return db.DB.Updates(&data).Error
|
||||
|
||||
}
|
||||
|
||||
func (a artistSupplement) DeletedData(id ...int64) (err error) {
|
||||
if len(id) == 1 {
|
||||
err = db.DB.Where("id = ?", id[0]).Delete(&model.ArtshowArtistSupplement{}).Error
|
||||
} else if len(id) > 0 {
|
||||
err = db.DB.Where("id = ?", id).Delete(&model.ArtshowArtistSupplement{}).Error
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func (a artistSupplement) GetData(id int64) (data *model.ArtshowArtistSupplement, err error) {
|
||||
err = db.DB.Where("id = ?", id).First(&data).Error
|
||||
return
|
||||
}
|
||||
|
||||
func (a artistSupplement) GetDataList(req *artistinfoArtshow.GetArtistSupplementListRequest) (datas []model.ArtshowArtistSupplement, total int64, err error) {
|
||||
datas = []model.ArtshowArtistSupplement{}
|
||||
var tx = db.DB.Model(model.ArtshowArtistSupplement{})
|
||||
if req.ArtistUid != "" {
|
||||
tx = tx.Where("artist_uid = ?", req.ArtistUid)
|
||||
}
|
||||
if req.LockTime != "" {
|
||||
tx = tx.Where("lock_time = ?", req.LockTime)
|
||||
}
|
||||
if req.Status != 0 {
|
||||
tx = tx.Where("status = ?", req.Status)
|
||||
}
|
||||
if req.AuditStatus != 0 {
|
||||
tx = tx.Where("audit_status = ?", req.AuditStatus)
|
||||
}
|
||||
//if req.AuditMark1 != "" {
|
||||
// tx = tx.Where("audit_mark1 = ?", req.AuditMark1)
|
||||
//}
|
||||
//if req.AuditMark2 != "" {
|
||||
// tx = tx.Where("audit_mark2 = ?", req.AuditMark2)
|
||||
//}
|
||||
err = tx.Count(&total).Scopes(db.Pagination(req.Page, req.PageSize)).Find(&datas).Error
|
||||
return
|
||||
}
|
||||
func (a artistSupplement) Audit(auditStatus model.AuditStatus, mark1, mark2 string, ids ...int64) (err error) {
|
||||
tx := db.DB.Begin()
|
||||
err = tx.Model(model.ArtshowArtistSupplement{}).Where("id in ?", ids).Update("audit_status", auditStatus).Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = tx.Model(model.ArtshowArtistSupplement{}).Where("id in ?", ids).Update("audit_mark1", mark1).Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = tx.Model(model.ArtshowArtistSupplement{}).Where("id in ?", ids).Update("audit_mark2", mark2).Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
tx.Commit()
|
||||
return
|
||||
}
|
||||
|
||||
func (a artistSupplement) GetSupplementDetail(in *artistinfoArtshow.GetArtistSupplementDetailRequest) (rep model.ArtshowArtistSupplement, err error) {
|
||||
var tx = db.DB.Model(model.ArtshowArtistSupplement{})
|
||||
if in.Id != 0 {
|
||||
tx = tx.Where("id = ?", in.Id)
|
||||
}
|
||||
//var data model.ArtshowArtistSupplement
|
||||
err = tx.First(&rep).Error
|
||||
return
|
||||
}
|
134
cmd/internal/dao/artistinfo_artshow_video.go
Normal file
134
cmd/internal/dao/artistinfo_artshow_video.go
Normal file
@ -0,0 +1,134 @@
|
||||
// Package dao -----------------------------
|
||||
// @file : artistinfo_artshow.go
|
||||
// @author : JJXu
|
||||
// @contact : wavingbear@163.com
|
||||
// @time : 2023/3/2 12:06
|
||||
// -------------------------------------------
|
||||
package dao
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"github.com/fonchain/fonchain-artistinfo/cmd/model"
|
||||
"github.com/fonchain/fonchain-artistinfo/pb/artistinfoArtshow"
|
||||
db "github.com/fonchain/fonchain-artistinfo/pkg/db"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
)
|
||||
|
||||
var ArtistinfoArtshowVideo = new(artistinfoArtshowVideo)
|
||||
|
||||
type artistinfoArtshowVideo struct{}
|
||||
|
||||
func (a artistinfoArtshowVideo) BatchCreateData(datas []model.ArtshowVideoRecord) error {
|
||||
//return db.DB.Create(&datas).Error
|
||||
tx := db.DB.Begin()
|
||||
for _, v := range datas {
|
||||
err := a.CreateData(&v, tx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
tx.Commit()
|
||||
return nil
|
||||
}
|
||||
func (a artistinfoArtshowVideo) CreateData(data *model.ArtshowVideoRecord, tx ...*gorm.DB) error {
|
||||
var txdb *gorm.DB
|
||||
if tx != nil {
|
||||
txdb = tx[0]
|
||||
} else {
|
||||
txdb = db.DB
|
||||
}
|
||||
var exist = model.ArtshowVideoRecord{}
|
||||
db.DB.Where("artist_uid = ? AND status = 2", data.ArtistUid).Find(&exist)
|
||||
if exist.ID != 0 {
|
||||
return errors.New("数据已存在")
|
||||
}
|
||||
return txdb.Create(&data).Error
|
||||
}
|
||||
|
||||
func (a artistinfoArtshowVideo) UpdateData(data *model.ArtshowVideoRecord) error {
|
||||
return db.DB.Updates(&data).Error
|
||||
|
||||
}
|
||||
|
||||
func (a artistinfoArtshowVideo) DeletedData(id ...int64) (err error) {
|
||||
if len(id) == 1 {
|
||||
err = db.DB.Where("id = ?", id[0]).Delete(&model.ArtshowVideoRecord{}).Error
|
||||
} else if len(id) > 0 {
|
||||
err = db.DB.Where("id = ?", id).Delete(&model.ArtshowVideoRecord{}).Error
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func (a artistinfoArtshowVideo) GetData(id int64) (data *model.ArtshowVideoRecord, err error) {
|
||||
err = db.DB.Where("id = ?", id).First(data).Error
|
||||
return
|
||||
}
|
||||
|
||||
func (a artistinfoArtshowVideo) GetDataList(req *artistinfoArtshow.GetArtshowVideoListRequst) (datas []model.ArtshowVideoRecord, total int64, err error) {
|
||||
datas = []model.ArtshowVideoRecord{}
|
||||
var tx = db.DB.Model(model.ArtshowVideoRecord{})
|
||||
if req.ArtistUid != "" {
|
||||
tx = tx.Where("artist_uid = ?", req.ArtistUid)
|
||||
}
|
||||
if req.LockTime != "" {
|
||||
tx = tx.Where("lock_time = ?", req.LockTime)
|
||||
}
|
||||
if req.ArtistName != "" {
|
||||
tx = tx.Clauses(clause.Like{
|
||||
Column: "artist_name",
|
||||
Value: "%" + req.ArtistName + "%",
|
||||
})
|
||||
}
|
||||
if req.Status != 0 {
|
||||
tx = tx.Where("status = ?", req.Status)
|
||||
}
|
||||
//if req.VideoUrl != "" {
|
||||
// tx = tx.Where("video_url = ?", req.VideoUrl)
|
||||
//}
|
||||
if req.AuditStatus != 0 {
|
||||
tx = tx.Where("audit_status = ?", req.AuditStatus)
|
||||
}
|
||||
//if req.AuditMark1 != "" {
|
||||
// tx = tx.Where("audit_mark1 = ?", req.AuditMark1)
|
||||
//}
|
||||
//if req.AuditMark2 != "" {
|
||||
// tx = tx.Where("audit_mark2 = ?", req.AuditMark2)
|
||||
//}
|
||||
err = tx.Count(&total).Scopes(db.Pagination(req.Page, req.PageSize)).Find(&datas).Error
|
||||
return
|
||||
}
|
||||
func (a artistinfoArtshowVideo) Audit(auditStatus model.AuditStatus, mark1, mark2 string, ids ...int64) (err error) {
|
||||
tx := db.DB.Begin()
|
||||
err = tx.Model(model.ArtshowVideoRecord{}).Where("id in ?", ids).Update("audit_status", auditStatus).Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = tx.Model(model.ArtshowVideoRecord{}).Where("id in ?", ids).Update("audit_mark1", mark1).Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = tx.Model(model.ArtshowVideoRecord{}).Where("id in ?", ids).Update("audit_mark2", mark2).Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
tx.Commit()
|
||||
return
|
||||
}
|
||||
func (a artistinfoArtshowVideo) GetArtshowVideoDetail(in *artistinfoArtshow.GetArtshowVideoDetailRequest) (rep model.ArtshowVideoRecord, err error) {
|
||||
var tx = db.DB.Model(model.ArtshowVideoRecord{})
|
||||
//if in.ArtistUid != "" {
|
||||
// tx = tx.Where("artist_uid =?", in.ArtistUid)
|
||||
//}
|
||||
//if in.LockTime != "" {
|
||||
// tx = tx.Where("lock_time = ?", in.LockTime)
|
||||
//}
|
||||
//if in.Status != 0 {
|
||||
// tx = tx.Where("status = ?", in.Status)
|
||||
//}
|
||||
if in.Id != 0 {
|
||||
tx = tx.Where("id = ?", in.Id)
|
||||
}
|
||||
err = tx.First(&rep).Error
|
||||
return
|
||||
}
|
305
cmd/internal/dao/artistinfo_artwork.go
Normal file
305
cmd/internal/dao/artistinfo_artwork.go
Normal file
@ -0,0 +1,305 @@
|
||||
// Package dao -----------------------------
|
||||
// @file : artwork.go
|
||||
// @author : JJXu
|
||||
// @contact : wavingbear@163.com
|
||||
// @time : 2023/2/24 18:23
|
||||
// -------------------------------------------
|
||||
package dao
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/fonchain/fonchain-artistinfo/cmd/model"
|
||||
"github.com/fonchain/fonchain-artistinfo/pb/artistInfoArtwork"
|
||||
"github.com/fonchain/fonchain-artistinfo/pb/artwork_query"
|
||||
db "github.com/fonchain/fonchain-artistinfo/pkg/db"
|
||||
"github.com/fonchain/fonchain-artistinfo/pkg/service"
|
||||
"github.com/fonchain/fonchain-artistinfo/pkg/util/stime"
|
||||
"gorm.io/gorm"
|
||||
"time"
|
||||
)
|
||||
|
||||
func CreateArtworkLockRecord(in *model.ArtworkLockRecord) error {
|
||||
var data = model.ArtworkLockRecord{
|
||||
ArtistUid: in.ArtistUid,
|
||||
ArtworkUid: in.ArtworkUid,
|
||||
Status: in.Status,
|
||||
LockTime: in.LockTime,
|
||||
}
|
||||
return db.DB.Create(&data).Error
|
||||
}
|
||||
|
||||
func UpdateArtworkLockRecord(in *model.ArtworkLockRecord) error {
|
||||
var data = model.ArtworkLockRecord{
|
||||
ArtistUid: in.ArtistUid,
|
||||
ArtworkUid: in.ArtworkUid,
|
||||
Status: in.Status,
|
||||
LockTime: in.LockTime,
|
||||
BaseAuditStatus: in.BaseAuditStatus,
|
||||
BaseAuditMark: in.BaseAuditMark,
|
||||
BaseAuditMark2: in.BaseAuditMark2,
|
||||
SupplementAuditStatus: in.SupplementAuditStatus,
|
||||
SupplementAuditMark: in.SupplementAuditMark,
|
||||
SupplementAuditMark2: in.SupplementAuditMark2,
|
||||
}
|
||||
var thisData model.ArtworkLockRecord
|
||||
err := db.DB.Where("artist_uid = ?", in.ArtworkUid).First(&thisData).Error
|
||||
if err != nil {
|
||||
if err != gorm.ErrRecordNotFound {
|
||||
return errors.New("画作数据未找到")
|
||||
} else {
|
||||
return err
|
||||
}
|
||||
}
|
||||
data.Model = model.Model{
|
||||
ID: thisData.ID,
|
||||
CreatedAt: thisData.CreatedAt,
|
||||
}
|
||||
return db.DB.Updates(&data).Error
|
||||
}
|
||||
|
||||
func DeletedArtworkLockRecord(artworkUid ...string) error {
|
||||
if len(artworkUid) == 0 {
|
||||
return nil
|
||||
} else if len(artworkUid) == 1 {
|
||||
return db.DB.Where("artwork_uid = ? AND status != 2 ", artworkUid[0]).Delete(&model.ArtworkLockRecord{}).Error
|
||||
} else {
|
||||
return db.DB.Where("artwork_uid in ? AND status != 2 ", artworkUid).Delete(&model.ArtworkLockRecord{}).Error
|
||||
}
|
||||
}
|
||||
|
||||
func BatchLockArtworks(artistUid string, lockTime string) error {
|
||||
var artworkUids []string
|
||||
db.DB.Model(model.ArtworkLockRecord{}).
|
||||
Where("status = 1 AND lock_time=''").Where(" artist_uid = ?", artistUid).
|
||||
Pluck("artwork_uid", &artworkUids)
|
||||
if artworkUids == nil {
|
||||
return nil
|
||||
}
|
||||
if lockTime == "" {
|
||||
lockTime = stime.TimeToString(time.Now(), stime.Format_Normal_YMDhms)
|
||||
}
|
||||
var updateMap = map[string]any{
|
||||
"status": 2,
|
||||
"lock_time": lockTime,
|
||||
"base_audit_status": model.AuditType_Pending, //基本数据审批
|
||||
"audit_flow_index": 2, //进入基本信息审批流程
|
||||
}
|
||||
return db.DB.Model(model.ArtworkLockRecord{}).Where("artwork_uid in ?", artworkUids).Updates(&updateMap).Error
|
||||
}
|
||||
|
||||
func BatchUnlockArtworks(artistUid string) error {
|
||||
//var artworkUids []string
|
||||
// 查询用户当前锁定的时间点
|
||||
//var nowLockTime string
|
||||
//err := db.DB.Model(model.ArtworkLockRecord{}).Select("MAX(lock_time)").Where("artist_uid = %s AND lock_time !='' AND STATUS =2", artistUid).Scan(&nowLockTime).Error
|
||||
//if err != nil {
|
||||
// return err
|
||||
//}
|
||||
////查询此时间节点内的所有画作
|
||||
//db.DB.Model(model.ArtworkLockRecord{}).
|
||||
// //Where("lock_time = (SELECT MAX(lock_time) FROM artwork_lock_record where artist_uid = %s AND lock_time !='' AND STATUS =2)", artistUid).
|
||||
// //Joins("LEFT JOIN (lock_time = (select max(lock_time) form artwork_lock_record WHERE artist_uid = ?) lt", artistUid).
|
||||
// //Where(fmt.Sprintf("lock_time = (select max(lock_time) form artwork_lock_record WHERE artist_uid = %s)", artistUid)).
|
||||
// Where("status = 2").
|
||||
// Pluck("artwork_uid", &artworkUids)
|
||||
//if artworkUids == nil {
|
||||
// return nil
|
||||
//}
|
||||
return db.DB.Model(model.ArtworkLockRecord{}).Where("artist_uid = ? AND status =2 AND lock_time !=''", artistUid).Update("status", 3).Error
|
||||
}
|
||||
|
||||
func GetArtworkLockDetail(artworkUid string) (data model.ArtworkLockRecord, err error) {
|
||||
err = db.DB.Where("artwork_uid = ?", artworkUid).First(&data).Error
|
||||
return
|
||||
}
|
||||
|
||||
func GetArtworkLockRecords(req *artistInfoArtwork.GetArtworkLockRecordsRequest) (resp *artistInfoArtwork.ArtworkLockList, err error) {
|
||||
var (
|
||||
datas = []model.ArtworkLockRecord{}
|
||||
tx = db.DB.Model(model.ArtworkLockRecord{}).Order("lock_time desc")
|
||||
)
|
||||
resp = &artistInfoArtwork.ArtworkLockList{}
|
||||
if req.ArtistUid != "" {
|
||||
tx = tx.Where("artist_uid = ?", req.ArtistUid)
|
||||
}
|
||||
switch req.QueryType {
|
||||
case artistInfoArtwork.ArtworkQueryMode_NowPreSaveArtwork: //当前暂存的画作
|
||||
tx = tx.Where("status = 1")
|
||||
case artistInfoArtwork.ArtworkQueryMode_NowLockedArtwork: //当前已锁定的画作
|
||||
tx = tx.Where("status = 2")
|
||||
case artistInfoArtwork.ArtworkQueryMode_NowPreSaveAndLocked: //当前暂存和已锁定的画作(也就是用户端画作管理中的数据)
|
||||
tx = tx.Where("status =1 OR status =2")
|
||||
case artistInfoArtwork.ArtworkQueryMode_NowAuditFlowOfBase: //当前处于基本信息审批阶段的画作(包括进入其它流程的画作)
|
||||
tx = tx.Where("status = 2 ") // AND audit_flow_index = 2
|
||||
case artistInfoArtwork.ArtworkQueryMode_NowAuditFlowOfSupplementing: //当前处于补充信息审批阶段的画作
|
||||
tx = tx.Where("status =2 AND audit_flow_index = 3")
|
||||
case artistInfoArtwork.ArtworkQueryMode_AllUnlockArtwork: //所有已解锁的画作(历史画作)
|
||||
tx = tx.Where("status = 3").Order("lock_time desc")
|
||||
//case artistInfoArtwork.ArtworkQueryMode_AllHistoryArtwork: //所有历史画作
|
||||
// tx = tx.Where("status > 1")
|
||||
case artistInfoArtwork.ArtworkQueryMode_AllAuditPassArtwork: //所有审核通过的画作
|
||||
tx = tx.Where("supplement_audit_status = 4").Order("lock_time desc")
|
||||
}
|
||||
if req.AuditStatus != 0 {
|
||||
tx = tx.Where("audit_status = ?", req.AuditStatus)
|
||||
}
|
||||
err = tx.Find(&datas).Error
|
||||
for _, v := range datas {
|
||||
resp.Data = append(resp.Data, &artistInfoArtwork.ArtistLockInfo{
|
||||
ArtistUid: v.ArtistUid,
|
||||
ArtworkUid: v.ArtworkUid,
|
||||
Status: v.Status,
|
||||
LockTime: v.LockTime,
|
||||
BaseAuditStatus: int32(v.BaseAuditStatus),
|
||||
BaseAuditMark: v.BaseAuditMark,
|
||||
BaseAuditMark2: v.BaseAuditMark2,
|
||||
SupplementAuditStatus: int32(v.SupplementAuditStatus),
|
||||
SupplementAuditMark: v.SupplementAuditMark,
|
||||
SupplementAuditMark2: v.SupplementAuditMark2,
|
||||
AuditFlowIndex: int32(v.AuditFlowIndex),
|
||||
CreatedAt: v.CreatedAt.Unix(),
|
||||
UpdatedAt: v.UpdatedAt.Unix(),
|
||||
DeletedAt: int64(v.DeletedAt),
|
||||
})
|
||||
}
|
||||
return
|
||||
}
|
||||
func HasBeenLocked(artistUid string) bool {
|
||||
//检查是否已经被锁定
|
||||
var hasLocked int64
|
||||
db.DB.Model(model.ArtworkLockRecord{}).Where("artist_uid = ? AND status = 2", artistUid).Count(&hasLocked)
|
||||
if hasLocked > 0 {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// UpdateAuditStatus 更新审批状态
|
||||
// flowIndex 2=基本信息审批 3=补充信息审批
|
||||
func UpdateAuditStatus(artworkUid string, auditStatus int64, remark1 string, remark2 string, flowIndex int64) error {
|
||||
var thisData model.ArtworkLockRecord
|
||||
err := db.DB.Model(model.ArtworkLockRecord{}).Where("artwork_uid = ?", artworkUid).First(&thisData).Error
|
||||
if err != nil {
|
||||
if err != gorm.ErrRecordNotFound {
|
||||
return errors.New("画作数据未找到")
|
||||
} else {
|
||||
return err
|
||||
}
|
||||
}
|
||||
switch flowIndex {
|
||||
case 2:
|
||||
thisData.BaseAuditStatus = model.AuditStatus(auditStatus)
|
||||
thisData.BaseAuditMark = remark1
|
||||
thisData.BaseAuditMark2 = remark2
|
||||
case 3:
|
||||
thisData.SupplementAuditStatus = model.AuditStatus(auditStatus)
|
||||
thisData.SupplementAuditMark = remark1
|
||||
thisData.SupplementAuditMark2 = remark2
|
||||
}
|
||||
return db.DB.Save(&thisData).Error
|
||||
}
|
||||
|
||||
func BatchUpdateAuditStatus(artworkUids []string, auditStatus int64, remark1 string, remark2 string, flowIndex int64) error {
|
||||
for _, uid := range artworkUids {
|
||||
if err := UpdateAuditStatus(uid, auditStatus, remark1, remark2, flowIndex); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func GenerateArtworkSupplementInfo(artworkUids []string) error {
|
||||
var datas = []model.ArtworkLockRecord{}
|
||||
db.DB.Where("artwork_uid in ?", artworkUids).Find(&datas)
|
||||
for _, v := range datas {
|
||||
if v.BaseAuditStatus != 4 {
|
||||
return errors.New("存在基本信息未审批通过的画作,操作取消!")
|
||||
}
|
||||
}
|
||||
var updateData = map[string]any{
|
||||
"audit_flow_index": 3,
|
||||
"supplement_audit_status": 5,
|
||||
}
|
||||
return db.DB.Model(model.ArtworkLockRecord{}).Where("artwork_uid in ?", artworkUids).Updates(&updateData).Error
|
||||
}
|
||||
|
||||
func PassedArtworkStatic(request *artistInfoArtwork.ArtistArtworkStaticRequest, uids []string) (res []model.ViewPassedArtworkStatic, err error) {
|
||||
res = []model.ViewPassedArtworkStatic{}
|
||||
var tx = db.DB.Model(&model.ViewPassedArtworkStatic{})
|
||||
err = tx.Where("artist_uid in ?", uids).Scopes(db.Pagination(request.Page, request.PageSize)).Find(&res).Error
|
||||
return
|
||||
}
|
||||
|
||||
// CountArtworkTotalWhichAuditPassed 单个统计画家已通过的画作数量和已通过的平尺数
|
||||
func CountArtworkTotalWhichAuditPassed(artistUid string) (rulerPassedTotal int64, artworkPassedCount int64) {
|
||||
artworkList, err := GetArtworkLockRecords(&artistInfoArtwork.GetArtworkLockRecordsRequest{
|
||||
ArtistUid: artistUid,
|
||||
QueryType: artistInfoArtwork.ArtworkQueryMode_AllAuditPassArtwork,
|
||||
})
|
||||
if err != nil {
|
||||
fmt.Println("service.GrpcArtistInfoArtworkImpl.GetArtworkLockRecords Error:", err.Error())
|
||||
return 0, 0
|
||||
}
|
||||
if len(artworkList.Data) == 0 {
|
||||
fmt.Println("service.GrpcArtistInfoArtworkImpl.GetArtworkLockRecords :画作数量为0")
|
||||
return 0, 0
|
||||
}
|
||||
var artworkUids = []string{}
|
||||
for _, v := range artworkList.Data {
|
||||
artworkUids = append(artworkUids, v.ArtworkUid)
|
||||
}
|
||||
//搜索画作信息
|
||||
var (
|
||||
defultPageSize int32 = 500
|
||||
nowPageIndex int32
|
||||
artworkNumber int32
|
||||
artworkRulerTotal int32
|
||||
artworkTotal int32
|
||||
)
|
||||
for {
|
||||
nowPageIndex++
|
||||
res, err := service.ArtworkQueryImpl.ArtworkPreviewList(context.Background(), &artwork_query.ArtworkPreviewListRequest{
|
||||
Page: nowPageIndex,
|
||||
PageSize: defultPageSize,
|
||||
ArtistUid: artistUid,
|
||||
ArtworkUids: artworkUids,
|
||||
})
|
||||
if err != nil {
|
||||
fmt.Println(err.Error())
|
||||
return 0, 0
|
||||
}
|
||||
if artworkNumber == 0 {
|
||||
artworkNumber = res.Page.Total
|
||||
artworkTotal += res.Page.Total
|
||||
}
|
||||
artworkNumber -= defultPageSize
|
||||
for _, v := range res.Data {
|
||||
artworkRulerTotal += v.Ruler
|
||||
}
|
||||
if artworkNumber <= 0 {
|
||||
break
|
||||
}
|
||||
}
|
||||
return int64(artworkRulerTotal), int64(artworkTotal)
|
||||
}
|
||||
|
||||
// CountAllArtworkTotal 单个统计画家所有的画作数量和平尺数
|
||||
func CountAllArtworkTotal(artistUid string) (artworkTotal int64, artworkRulerTotal int64) {
|
||||
//查询此画家的所有画作
|
||||
artworkList, err := service.ArtworkQueryImpl.ArtworkList(context.Background(), &artwork_query.ArtworkListRequest{
|
||||
Page: 1,
|
||||
PageSize: -1,
|
||||
ArtistUid: artistUid,
|
||||
})
|
||||
if err != nil {
|
||||
fmt.Println("画作列表查询失败", err.Error())
|
||||
return 0, 0
|
||||
}
|
||||
artworkTotal = int64(artworkList.Count)
|
||||
for _, v := range artworkList.Data {
|
||||
artworkRulerTotal += int64(v.Ruler)
|
||||
}
|
||||
return artworkTotal, artworkRulerTotal
|
||||
}
|
162
cmd/internal/dao/artistinfo_statement.go
Normal file
162
cmd/internal/dao/artistinfo_statement.go
Normal file
@ -0,0 +1,162 @@
|
||||
package dao
|
||||
|
||||
// import (
|
||||
// "github.com/fonchain/fonchain-artistinfo/cmd/model"
|
||||
// "github.com/fonchain/fonchain-artistinfo/pb/artistinfoStatement"
|
||||
// db "github.com/fonchain/fonchain-artistinfo/pkg/db"
|
||||
// "gorm.io/gorm/clause"
|
||||
// )
|
||||
//
|
||||
// // =====================================
|
||||
// //
|
||||
// // 对账单批次
|
||||
// func CreateStatementBatch(in *artistinfoStatement.StatementBatchRequest) (res model.StatementBatch, err error) {
|
||||
// res = model.StatementBatch{
|
||||
// StType: in.StType,
|
||||
// ArtistUid: in.ArtistUid,
|
||||
// ArtistRealName: in.ArtistRealName,
|
||||
// FlowStatus: in.FlowStatus,
|
||||
// BatchTime: in.BatchTime,
|
||||
// MinPrice: in.MinPrice,
|
||||
// GuaranteePrice: in.GuaranteePrice,
|
||||
// FileUrl: in.FileUrl,
|
||||
// }
|
||||
// err = db.DB.Clauses(clause.OnConflict{
|
||||
// Columns: []clause.Column{{Name: "st_type"}, {Name: "artist_uid"}, {Name: "batch_time"}},
|
||||
// UpdateAll: true,
|
||||
// }).Create(&res).Error
|
||||
// return
|
||||
// }
|
||||
|
||||
// func BatchCreateStatementBatch(in *artistinfoStatement.BatchCreateStatementBatchRequest) error {
|
||||
// var datas = []model.StatementBatch{}
|
||||
// for _, in := range in.Data {
|
||||
// datas = append(datas, model.StatementBatch{
|
||||
// StType: in.StType,
|
||||
// ArtistUid: in.ArtistUid,
|
||||
// ArtistRealName: in.ArtistRealName,
|
||||
// FlowStatus: in.FlowStatus,
|
||||
// BatchTime: in.BatchTime,
|
||||
// MinPrice: in.MinPrice,
|
||||
// GuaranteePrice: in.GuaranteePrice,
|
||||
// FileUrl: in.FileUrl,
|
||||
// })
|
||||
// }
|
||||
// err := db.DB.Clauses(clause.OnConflict{
|
||||
// Columns: []clause.Column{{Name: "st_type"}, {Name: "artist_uid"}, {Name: "batch_time"}},
|
||||
// UpdateAll: true,
|
||||
// }).Create(&datas).Error
|
||||
// return err
|
||||
// }
|
||||
|
||||
// func GetStatementBatchList(in *artistinfoStatement.GetStatementBatchListRequest) (res []model.StatementBatch, total int64, err error) {
|
||||
// res = []model.StatementBatch{}
|
||||
// var orm = db.DB.Model(model.StatementBatch{}).Order("created_at desc").Preload("ArtworkList")
|
||||
// if in.Condition.StType != 0 {
|
||||
// orm = orm.Where("st_type = ?", in.Condition.StType)
|
||||
// }
|
||||
// if in.Condition.ArtistUid != "" {
|
||||
// orm = orm.Where("artist_uid = ?", in.Condition.ArtistUid)
|
||||
// }
|
||||
// if in.Condition.ArtistRealName != "" {
|
||||
// orm = orm.Where("artist_real_name = ?", in.Condition.ArtistRealName)
|
||||
// }
|
||||
// if in.Condition.FlowStatus != 0 {
|
||||
// orm = orm.Where("flow_status = ?", in.Condition.FlowStatus)
|
||||
// }
|
||||
// if in.Condition.BatchTime != "" {
|
||||
// orm = orm.Where("batch_time = ?", in.Condition.BatchTime)
|
||||
// }
|
||||
// if in.Condition.MinPrice != 0 {
|
||||
// orm = orm.Where("min_price = ?", in.Condition.MinPrice)
|
||||
// }
|
||||
// if in.Condition.GuaranteePrice != 0 {
|
||||
// orm = orm.Where("guarantee_price = ?", in.Condition.GuaranteePrice)
|
||||
// }
|
||||
// if in.Condition.Id != 0 {
|
||||
// orm = orm.Where("id = ?", in.Condition.Id)
|
||||
// }
|
||||
// if in.Condition.FileUrl != "" {
|
||||
// orm = orm.Where("file_url = ?", in.Condition.FileUrl)
|
||||
// }
|
||||
// if len(in.Ids) > 0 {
|
||||
// orm = orm.Where("id in ?", in.Ids)
|
||||
// }
|
||||
// if len(in.BatchTimeList) > 0 {
|
||||
// orm = orm.Where("batch_time in ?", in.BatchTimeList)
|
||||
// }
|
||||
// err = orm.Count(&total).Scopes(db.Pagination(in.Page, in.PageSize)).Find(&res).Error
|
||||
// return
|
||||
// }
|
||||
|
||||
// func GetStatementBatchTimeMenus(in *artistinfoStatement.GetStatementBatchListRequest) (res []string, err error) {
|
||||
// res = []string{}
|
||||
// err = db.DB.Model(model.StatementBatch{}).Pluck("batch_time", &res).Error
|
||||
// return
|
||||
// }
|
||||
|
||||
// //=====================================
|
||||
// // 对账单详情
|
||||
|
||||
// func CreateStatementDetail(in *artistinfoStatement.StatementDetailRequest) (res model.StatementDetail, err error) {
|
||||
// res = model.StatementDetail{
|
||||
// BatchId: in.BatchId,
|
||||
// TfNum: in.TfNum,
|
||||
// ArtworkName: in.ArtworkName,
|
||||
// Ruler: in.Ruler,
|
||||
// SaleNo: in.SaleNo,
|
||||
// CompleteDate: in.CompleteDate,
|
||||
// }
|
||||
// err = db.DB.Clauses(clause.OnConflict{
|
||||
// Columns: []clause.Column{{Name: "tf_num"}, {Name: "batch_id"}},
|
||||
// UpdateAll: true,
|
||||
// }).Create(&res).Error
|
||||
// return
|
||||
// }
|
||||
|
||||
// func BatchCreateStatementDetail(in *artistinfoStatement.BatchCreateStatementDetailRequest) error {
|
||||
// var datas = []model.StatementDetail{}
|
||||
// for _, in := range in.Data {
|
||||
// datas = append(datas, model.StatementDetail{
|
||||
// BatchId: in.BatchId,
|
||||
// TfNum: in.TfNum,
|
||||
// ArtworkName: in.ArtworkName,
|
||||
// Ruler: in.Ruler,
|
||||
// SaleNo: in.SaleNo,
|
||||
// CompleteDate: in.CompleteDate,
|
||||
// })
|
||||
// }
|
||||
// err := db.DB.Clauses(clause.OnConflict{
|
||||
// Columns: []clause.Column{{Name: "tf_num"}, {Name: "batch_id"}},
|
||||
// UpdateAll: true,
|
||||
// }).Create(&datas).Error
|
||||
// return err
|
||||
// }
|
||||
|
||||
// func GetStatementDetailList(in *artistinfoStatement.GetStatementDetailListRequest) (res []model.StatementDetail, total int64, err error) {
|
||||
// res = []model.StatementDetail{}
|
||||
// var orm = db.DB.Model(model.StatementDetail{}).Order("created_at desc")
|
||||
// if in.Condition.BatchId != 0 {
|
||||
// orm = orm.Where("batch_id = ?", in.Condition.BatchId)
|
||||
// }
|
||||
// if in.Condition.TfNum != "" {
|
||||
// orm = orm.Where("tf_num = ?", in.Condition.TfNum)
|
||||
// }
|
||||
// if in.Condition.ArtworkName != "" {
|
||||
// orm = orm.Where("artwork_name like = ?", "%"+in.Condition.ArtworkName+"%")
|
||||
// }
|
||||
// if in.Condition.Ruler != "" {
|
||||
// orm = orm.Where("ruler = ?", in.Condition.Ruler)
|
||||
// }
|
||||
// if in.Condition.SaleNo != "" {
|
||||
// orm = orm.Where("sale_no = ?", in.Condition.SaleNo)
|
||||
// }
|
||||
// if in.Condition.CompleteDate != "" {
|
||||
// orm = orm.Where("complete_date = ?", in.Condition.CompleteDate)
|
||||
// }
|
||||
// if in.Condition.Id != 0 {
|
||||
// orm = orm.Where("id = ?", in.Condition.Id)
|
||||
// }
|
||||
// err = orm.Count(&total).Scopes(db.Pagination(in.Page, in.PageSize)).Find(&res).Error
|
||||
// return
|
||||
// }
|
@ -2,194 +2,446 @@ package dao
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"time"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/fonchain/fonchain-artistinfo/cmd/model"
|
||||
"github.com/fonchain/fonchain-artistinfo/pb/contract"
|
||||
contract "github.com/fonchain/fonchain-artistinfo/pb/contract"
|
||||
db "github.com/fonchain/fonchain-artistinfo/pkg/db"
|
||||
"github.com/fonchain/fonchain-artistinfo/pkg/m"
|
||||
uuid "github.com/satori/go.uuid"
|
||||
"go.uber.org/zap"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
func FinishContract(id string) (err error) {
|
||||
var contracts model.Contract
|
||||
if err = db.DB.Where("transaction_id = ?", id).First(&contracts).Error; err != nil {
|
||||
func GetArtistInfoByArtistUid(artistUid string) (user model.User, err error) {
|
||||
if err = db.DB.Where("mgmt_artist_uid = ?", artistUid).First(&user).Error; err != nil {
|
||||
zap.L().Error("get user info err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func GetMgmtContractByArtistUid(artistUid string, contractType int32) (err error) {
|
||||
var contract model.Contract
|
||||
if err = db.DB.Where("artist_uid = ? AND type = ?", artistUid, contractType).First(&contract).Error; err != nil && err != gorm.ErrRecordNotFound {
|
||||
zap.L().Error("get contract info err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return
|
||||
}
|
||||
|
||||
if err = db.DB.Model(&contracts).Update("state", 3).Error; err != nil {
|
||||
zap.L().Error("user contract failed", zap.Error(err))
|
||||
//err 为空则查询到,返回画作合同已存在的错误
|
||||
if err == nil {
|
||||
err = errors.New(m.ARTWORK_CONTRACT_EXISTS)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func CreateArtistContract(tx *gorm.DB, contract *model.Contract) (err error) {
|
||||
if err = tx.Create(contract).Error; err != nil {
|
||||
zap.L().Error("create contract err", zap.Error(err))
|
||||
err = errors.New(m.CREATE_ERROR)
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func GetMgmtContractByArtworkUid(artworkUid string, artworkType int32) (err error) {
|
||||
//画作有合同类型是2,6的都是 点击过"著作权代理转让服务合同"的
|
||||
var contract model.Contract
|
||||
|
||||
if err = db.DB.Where("artwork_uid LiKE ? AND type = ?", "%"+artworkUid+"%", artworkType).First(&contract).Error; err != nil && err != gorm.ErrRecordNotFound {
|
||||
zap.L().Error("get contract info err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return
|
||||
}
|
||||
|
||||
//err 为空则查询到,返回画作合同已存在的错误
|
||||
if err == nil {
|
||||
err = errors.New(m.ARTWORK_CONTRACT_EXISTS)
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func CreateArtworkContract(tx *gorm.DB, artworkUid []string, artistUid string, contractType int32, latestLockTime string) (err error) {
|
||||
var uid uuid.UUID
|
||||
if uid, err = uuid.NewV4(); err != nil {
|
||||
err = errors.New(m.ERROR_UID)
|
||||
return
|
||||
}
|
||||
|
||||
//将画作切片转换成字符串格式便于保存
|
||||
ArtworkUid := strings.Join(artworkUid, ",")
|
||||
contract := &model.Contract{
|
||||
Uid: uid.String(),
|
||||
ArtistUid: artistUid,
|
||||
ArtworkUid: ArtworkUid,
|
||||
Type: contractType,
|
||||
State: 1,
|
||||
Status: 2,
|
||||
LockTime: latestLockTime,
|
||||
}
|
||||
if err = tx.Create(contract).Error; err != nil {
|
||||
zap.L().Error("create contract err", zap.Error(err))
|
||||
err = errors.New(m.CREATE_ERROR)
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func GetArtistNoByUid(artistUid string) (err error) {
|
||||
var user model.User
|
||||
if err = db.DB.Where("mgmt_artist_uid = ?", artistUid).First(&user).Error; err != nil {
|
||||
zap.L().Error("get user info err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func GetContractList(artistUid string, pageSize, offset int32) (contracts []*contract.Contracts, err error) {
|
||||
|
||||
var contractSlice []model.Contract
|
||||
if err = db.DB.Where("artist_uid = ?", artistUid).Order("ID asc").Limit(int(pageSize)).Offset(int(offset)).Find(&contractSlice).Error; err != nil {
|
||||
zap.L().Error("get contracts info err", zap.Error(err))
|
||||
err = errors.New(m.CREATE_ERROR)
|
||||
return
|
||||
}
|
||||
fmt.Println("第二处")
|
||||
for _, v := range contractSlice {
|
||||
contcontract := &contract.Contracts{
|
||||
ContractUid: v.Uid,
|
||||
ArtistUid: v.ArtistUid,
|
||||
ArtworkUid: v.ArtworkUid,
|
||||
ContractId: v.ContractId,
|
||||
TransactionId: v.TransactionId,
|
||||
Type: v.Type,
|
||||
ViewUrl: v.ViewUrl,
|
||||
DownloadUrl: v.DownloadUrl,
|
||||
State: v.State,
|
||||
Status: int32(v.Status),
|
||||
LockTime: v.LockTime,
|
||||
}
|
||||
|
||||
contracts = append(contracts, contcontract)
|
||||
}
|
||||
|
||||
return
|
||||
|
||||
}
|
||||
|
||||
func GetArtistInfoById(id int32) (user model.User, err error) {
|
||||
if err = db.DB.Where("mgmt_artist_id = ?", id).First(&user).Error; err != nil {
|
||||
zap.L().Error("get user info err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func ContractList(artist_uid string, state int32) (ContractData []*contract.Contracts, err error) {
|
||||
|
||||
if state != 0 {
|
||||
if state == 2 {
|
||||
state = 3
|
||||
}
|
||||
}
|
||||
|
||||
var contracts []model.Contract
|
||||
if err = db.DB.Where("artist_uid = ? AND type != 4 AND state = ?", artist_uid, state).Find(&contracts).Error; err != nil {
|
||||
zap.L().Error("get contracts info err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return
|
||||
}
|
||||
|
||||
for _, v := range contracts {
|
||||
|
||||
Contract := &contract.Contracts{
|
||||
ContractUid: v.Uid,
|
||||
ArtistUid: v.ArtistUid,
|
||||
ArtworkUid: v.ArtworkUid,
|
||||
ContractId: v.ContractId,
|
||||
TransactionId: v.TransactionId,
|
||||
Type: v.Type,
|
||||
ViewUrl: v.ViewUrl,
|
||||
DownloadUrl: v.DownloadUrl,
|
||||
State: v.State,
|
||||
Status: int32(v.Status),
|
||||
LockTime: v.LockTime,
|
||||
SignTime: v.SignTime,
|
||||
}
|
||||
|
||||
ContractData = append(ContractData, Contract)
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func GetContractInfo(contractUid string) (contractInfo model.Contract, err error) {
|
||||
if err = db.DB.Where("uid = ?", contractUid).First(&contractInfo).Error; err != nil {
|
||||
zap.L().Error("get contract info err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func UpdateContract(tx *gorm.DB, artistUid, ViewPdfUrl, DownloadUrl, ContractNo string) (err error) {
|
||||
if err = tx.Model(&model.Contract{}).Where("artist_uid = ?", artistUid).Updates(model.Contract{ViewUrl: ViewPdfUrl, DownloadUrl: DownloadUrl, ContractId: ContractNo}).Error; err != nil {
|
||||
zap.L().Error("update contract info err", zap.Error(err))
|
||||
err = errors.New(m.UPDATE_FAILED)
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func UpdateContractTx(tx *gorm.DB, contractUid, transactionId string) (err error) {
|
||||
if err = tx.Model(&model.Contract{}).Where("artist_uid = ?", contractUid).Updates(model.Contract{TransactionId: transactionId, State: 1}).Error; err != nil {
|
||||
zap.L().Error("update contract info err", zap.Error(err))
|
||||
err = errors.New(m.UPDATE_FAILED)
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func FinishContract(tx *gorm.DB, id string) (contracts *contract.Contracts, err error) {
|
||||
|
||||
var modelContract model.Contract
|
||||
if err = tx.Where("transaction_id = ?", id).First(&modelContract).Error; err != nil {
|
||||
zap.L().Error("get contract info err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return
|
||||
}
|
||||
|
||||
if err = db.DB.Model(&modelContract).Update("state", 3).Error; err != nil {
|
||||
zap.L().Error("update user contract failed", zap.Error(err))
|
||||
err = errors.New(m.UPDATE_FAILED)
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func ContractList(req *contract.ContractListRequest) (rep *contract.ContractListRespond, err error) {
|
||||
rep = &contract.ContractListRespond{}
|
||||
var Data []*contract.ContractData
|
||||
|
||||
var user model.User
|
||||
if err = db.DB.Where("id = ? ", int32(req.ID)).First(&user).Error; err != nil {
|
||||
zap.L().Error("get user info err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return
|
||||
contracts = &contract.Contracts{
|
||||
ArtistUid: modelContract.ArtistUid,
|
||||
ArtworkUid: modelContract.ArtworkUid,
|
||||
ContractUid: modelContract.ContractId,
|
||||
TransactionId: modelContract.TransactionId,
|
||||
Type: modelContract.Type,
|
||||
ViewUrl: modelContract.ViewUrl,
|
||||
DownloadUrl: modelContract.DownloadUrl,
|
||||
State: modelContract.State,
|
||||
Status: modelContract.Status,
|
||||
LockTime: modelContract.LockTime,
|
||||
SignTime: modelContract.SignTime,
|
||||
}
|
||||
|
||||
var realName model.RealName
|
||||
if err = db.DB.Where("id = ? ", user.RealNameID).First(&realName).Error; err != nil {
|
||||
zap.L().Error("get realName info err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return
|
||||
}
|
||||
|
||||
var args []interface{}
|
||||
var sqlWhere = "user_id = ? and type !=4 "
|
||||
args = append(args, req.ID)
|
||||
|
||||
if req.State != 0 {
|
||||
sqlWhere += " and state = ? "
|
||||
if req.State == 2 {
|
||||
req.State = 3
|
||||
}
|
||||
args = append(args, req.State)
|
||||
}
|
||||
|
||||
var contractModel []model.Contract
|
||||
if err = db.DB.Where(sqlWhere, args...).Find(&contractModel).Error; err != nil {
|
||||
zap.L().Error("get contractModels info err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return
|
||||
}
|
||||
|
||||
for _, v := range contractModel {
|
||||
contract := &contract.ContractData{}
|
||||
contract.ID = uint64(v.ID)
|
||||
contract.ContractId = v.ContractId
|
||||
contract.DownloadUrl = v.DownloadUrl
|
||||
contract.MgmtUserId = v.MgmtUserId
|
||||
contract.State = int64(v.State)
|
||||
contract.TransactionId = v.TransactionId
|
||||
contract.Type = int64(v.Type)
|
||||
contract.UserId = int64(v.UserId)
|
||||
contract.ViewUrl = v.ViewUrl
|
||||
contract.ExpirationTime = v.CreatedAt.Add(86400 * time.Second).Format("2006-01-02 15:04:05")
|
||||
contract.SignTime = v.UpdatedAt.Format("2006-01-02")
|
||||
Data = append(Data, contract)
|
||||
}
|
||||
|
||||
rep.Data = Data
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func ContractTxList(req *contract.ContractTxListRequest) (rep *contract.ContractTxListRespond, err error) {
|
||||
rep = &contract.ContractTxListRespond{}
|
||||
var Data []*contract.ContractData
|
||||
|
||||
var user model.User
|
||||
if err = db.DB.Where("id = ? ", int32(req.ID)).First(&user).Error; err != nil {
|
||||
zap.L().Error("get user info err", zap.Error(err))
|
||||
func ContractTxList(uid string, state int32) (contracts []model.Contract, err error) {
|
||||
if err = db.DB.Where("artist_uid = ? AND (type = 4 or type = 7) ADN state = ?", uid, state).Find(&contracts).Error; err != nil {
|
||||
zap.L().Error("get contracts info err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return
|
||||
}
|
||||
|
||||
var realName model.RealName
|
||||
if err = db.DB.Where("id = ? ", user.RealNameID).First(&realName).Error; err != nil {
|
||||
zap.L().Error("get realName info err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return
|
||||
}
|
||||
|
||||
var args []interface{}
|
||||
var sqlWhere = " card_id = ? and (type = 4 or type = 7) "
|
||||
args = append(args, realName.IDNum)
|
||||
if req.State != 0 {
|
||||
sqlWhere += " and state = ? "
|
||||
args = append(args, req.State)
|
||||
}
|
||||
|
||||
var contractModel []model.Contract
|
||||
if err = db.DB.Where(sqlWhere, args...).Find(&contractModel).Error; err != nil {
|
||||
zap.L().Error("get contractModels info err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return
|
||||
}
|
||||
|
||||
for _, v := range contractModel {
|
||||
contractTmp := &contract.ContractData{}
|
||||
contractTmp.ID = uint64(v.ID)
|
||||
contractTmp.ContractId = v.ContractId
|
||||
contractTmp.DownloadUrl = v.DownloadUrl
|
||||
contractTmp.MgmtUserId = v.MgmtUserId
|
||||
contractTmp.State = int64(v.State)
|
||||
contractTmp.TransactionId = v.TransactionId
|
||||
contractTmp.Type = int64(v.Type)
|
||||
var b string
|
||||
if v.Type == 4 {
|
||||
b = "物权"
|
||||
}
|
||||
if v.Type == 7 {
|
||||
b = "版权"
|
||||
}
|
||||
contractTmp.BatchName = b + v.BatchName[0:4] + "年" + v.BatchName[4:6] + "月" + v.BatchName[6:11] + "年" + v.BatchName[11:13] + "月"
|
||||
contractTmp.UserId = int64(v.UserId)
|
||||
contractTmp.ViewUrl = v.ViewUrl
|
||||
contractTmp.ExpirationTime = v.CreatedAt.Add(86400 * time.Second).Format("2006-01-02 15:04:05")
|
||||
contractTmp.SignTime = v.UpdatedAt.Format("2006-01-02")
|
||||
Data = append(Data, contractTmp)
|
||||
}
|
||||
|
||||
rep.Data = Data
|
||||
|
||||
return
|
||||
|
||||
}
|
||||
|
||||
func GetContract(id int32) (rep *contract.ContractData, err error) {
|
||||
var con model.Contract
|
||||
if err = db.DB.Where("id = ? ", id).First(&con).Error; err != nil {
|
||||
zap.L().Error("get contract info err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return
|
||||
}
|
||||
rep.ID = uint64(con.ID)
|
||||
rep.UserId = int64(con.UserId)
|
||||
rep.CardId = con.CardId
|
||||
rep.MgmtUserId = con.MgmtUserId
|
||||
rep.ArtworkId = con.ArtworkId
|
||||
rep.ContractId = con.ContractId
|
||||
rep.TransactionId = con.TransactionId
|
||||
rep.Type = int64(con.Type)
|
||||
rep.BatchName = con.BatchName
|
||||
rep.ViewUrl = con.ViewUrl
|
||||
rep.DownloadUrl = con.DownloadUrl
|
||||
rep.State = int64(con.State)
|
||||
// func UpdateArtworkState(tx *gorm.DB, id int32) (err error) { //无用
|
||||
// var artworkState model.ArtworkState
|
||||
// if err = tx.Where("artwork_id = ? and state = ? ", id, 7).First(&artworkState).Error; err != nil {
|
||||
// if err == gorm.ErrRecordNotFound {
|
||||
// artworkState.ArtworkId = id
|
||||
// artworkState.State = 7
|
||||
// if err = tx.Create(&artworkState).Error; err != nil {
|
||||
// zap.L().Error("create artworkState err", zap.Error(err))
|
||||
// err = errors.New(m.CREATE_ERROR)
|
||||
// return
|
||||
// }
|
||||
// } else {
|
||||
// zap.L().Error("find artworkState info err", zap.Error(err))
|
||||
// err = errors.New(m.ERROR_DATA_NOT_EXISTS)
|
||||
// return
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
return
|
||||
}
|
||||
// if err = tx.Model(&model.Artwork{}).Where("id = ? ", id).Update("flow_state", 7).Error; err != nil {
|
||||
// zap.L().Error("Artwork Update Err", zap.Error(err))
|
||||
// err = errors.New(m.ERROR_DATA_NOT_EXISTS)
|
||||
// return
|
||||
// }
|
||||
|
||||
// 更新交易id
|
||||
func UpdateContract(req *contract.UpdateContractRequest) error {
|
||||
//数据库操作异常
|
||||
var con model.Contract
|
||||
if err := db.DB.Model(&con).Updates(&model.Contract{ContractId: req.ContractId, ViewUrl: req.ViewUrl, DownloadUrl: req.DownloadUrl}).Error; err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
// return
|
||||
// }
|
||||
|
||||
// 更新交易id
|
||||
func UpdateContractTx(txId string, contractId int32) (err error) {
|
||||
var con model.Contract
|
||||
con.ID = contractId
|
||||
if err = db.DB.Model(&con).Update("transaction_id", txId).Error; err != nil {
|
||||
return
|
||||
}
|
||||
if err = db.DB.Model(&con).Update("state", 1).Error; err != nil {
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
// func ContractList(req *contract.ContractListRequest) (rep *contract.ContractListRespond, err error) {
|
||||
// rep = &contract.ContractListRespond{}
|
||||
// var Data []*contract.ContractData
|
||||
|
||||
// var user model.User
|
||||
// if err = db.DB.Where("id = ? ", req.ID).First(&user).Error; err != nil {
|
||||
// zap.L().Error("get user info err", zap.Error(err))
|
||||
// err = errors.New(m.ERROR_SELECT)
|
||||
// return
|
||||
// }
|
||||
|
||||
// var realName model.RealName
|
||||
// if err = db.DB.Where("id = ? ", user.RealNameId).First(&realName).Error; err != nil {
|
||||
// zap.L().Error("get realName info err", zap.Error(err))
|
||||
// err = errors.New(m.ERROR_SELECT)
|
||||
// return
|
||||
// }
|
||||
|
||||
// var args []interface{}
|
||||
// var sqlWhere = "user_id = ? and type !=4 "
|
||||
// args = append(args, req.ID)
|
||||
|
||||
// if req.State != 0 {
|
||||
// sqlWhere += " and state = ? "
|
||||
// if req.State == 2 {
|
||||
// req.State = 3
|
||||
// }
|
||||
// args = append(args, req.State)
|
||||
// }
|
||||
|
||||
// var contractModel []model.Contract
|
||||
// if err = db.DB.Where(sqlWhere, args...).Find(&contractModel).Error; err != nil {
|
||||
// zap.L().Error("get contractModels info err", zap.Error(err))
|
||||
// err = errors.New(m.ERROR_SELECT)
|
||||
// return
|
||||
// }
|
||||
|
||||
// for _, v := range contractModel {
|
||||
// contract := &contract.ContractData{}
|
||||
// contract.ID = uint64(v.ID)
|
||||
// contract.ContractId = v.ContractId
|
||||
// contract.DownloadUrl = v.DownloadUrl
|
||||
// contract.MgmtUserId = v.MgmtUserId
|
||||
// contract.State = int64(v.State)
|
||||
// contract.TransactionId = v.TransactionId
|
||||
// contract.Type = int64(v.Type)
|
||||
// contract.UserId = int64(v.UserId)
|
||||
// contract.ViewUrl = v.ViewUrl
|
||||
// contract.ExpirationTime = v.CreatedAt.Add(86400 * time.Second).Format("2006-01-02 15:04:05")
|
||||
// contract.SignTime = v.UpdatedAt.Format("2006-01-02")
|
||||
// Data = append(Data, contract)
|
||||
// }
|
||||
|
||||
// rep.Data = Data
|
||||
|
||||
// return
|
||||
// }
|
||||
|
||||
// func ContractTxList(req *contract.ContractTxListRequest) (rep *contract.ContractTxListRespond, err error) {
|
||||
// rep = &contract.ContractTxListRespond{}
|
||||
// var Data []*contract.ContractData
|
||||
|
||||
// var user model.User
|
||||
// if err = db.DB.Where("id = ? ", int32(req.ID)).First(&user).Error; err != nil {
|
||||
// zap.L().Error("get user info err", zap.Error(err))
|
||||
// err = errors.New(m.ERROR_SELECT)
|
||||
// return
|
||||
// }
|
||||
// // todo
|
||||
// //var realName model.RealName
|
||||
// //if err = db.DB.Where("id = ? ", user.RealNameID).First(&realName).Error; err != nil {
|
||||
// // zap.L().Error("get realName info err", zap.Error(err))
|
||||
// // err = errors.New(m.ERROR_SELECT)
|
||||
// // return
|
||||
// //}
|
||||
// //
|
||||
// //var args []interface{}
|
||||
// //var sqlWhere = " card_id = ? and (type = 4 or type = 7) "
|
||||
// //args = append(args, realName.IDNum)
|
||||
// //if req.State != 0 {
|
||||
// // sqlWhere += " and state = ? "
|
||||
// // args = append(args, req.State)
|
||||
// //}
|
||||
// //
|
||||
// //var contractModel []model.Contract
|
||||
// //if err = db.DB.Where(sqlWhere, args...).Find(&contractModel).Error; err != nil {
|
||||
// // zap.L().Error("get contractModels info err", zap.Error(err))
|
||||
// // err = errors.New(m.ERROR_SELECT)
|
||||
// // return
|
||||
// //}
|
||||
// //
|
||||
// //for _, v := range contractModel {
|
||||
// // contractTmp := &contract.ContractData{}
|
||||
// // contractTmp.ID = uint64(v.ID)
|
||||
// // contractTmp.ContractId = v.ContractId
|
||||
// // contractTmp.DownloadUrl = v.DownloadUrl
|
||||
// // contractTmp.MgmtUserId = v.MgmtUserId
|
||||
// // contractTmp.State = int64(v.State)
|
||||
// // contractTmp.TransactionId = v.TransactionId
|
||||
// // contractTmp.Type = int64(v.Type)
|
||||
// // var b string
|
||||
// // if v.Type == 4 {
|
||||
// // b = "物权"
|
||||
// // }
|
||||
// // if v.Type == 7 {
|
||||
// // b = "版权"
|
||||
// // }
|
||||
// // contractTmp.BatchName = b + v.BatchName[0:4] + "年" + v.BatchName[4:6] + "月" + v.BatchName[6:11] + "年" + v.BatchName[11:13] + "月"
|
||||
// // contractTmp.UserId = int64(v.UserId)
|
||||
// // contractTmp.ViewUrl = v.ViewUrl
|
||||
// // contractTmp.ExpirationTime = v.CreatedAt.Add(86400 * time.Second).Format("2006-01-02 15:04:05")
|
||||
// // contractTmp.SignTime = v.UpdatedAt.Format("2006-01-02")
|
||||
// // Data = append(Data, contractTmp)
|
||||
// //}
|
||||
|
||||
// rep.Data = Data
|
||||
|
||||
// return
|
||||
// }
|
||||
|
||||
// func GetContract(id int32) (rep *contract.ContractData, err error) {
|
||||
// var con model.Contract
|
||||
// if err = db.DB.Where("id = ? ", id).First(&con).Error; err != nil {
|
||||
// zap.L().Error("get contract info err", zap.Error(err))
|
||||
// err = errors.New(m.ERROR_SELECT)
|
||||
// return
|
||||
// }
|
||||
// rep.ID = uint64(con.ID)
|
||||
// rep.UserId = int64(con.UserId)
|
||||
// rep.CardId = con.CardId
|
||||
// rep.MgmtUserId = con.MgmtUserId
|
||||
// rep.ArtworkId = con.ArtworkId
|
||||
// rep.ContractId = con.ContractId
|
||||
// rep.TransactionId = con.TransactionId
|
||||
// rep.Type = int64(con.Type)
|
||||
// rep.BatchName = con.BatchName
|
||||
// rep.ViewUrl = con.ViewUrl
|
||||
// rep.DownloadUrl = con.DownloadUrl
|
||||
// rep.State = int64(con.State)
|
||||
|
||||
// return
|
||||
// }
|
||||
|
||||
// // 更新交易id
|
||||
// func UpdateContract(req *contract.UpdateContractRequest) error {
|
||||
// //数据库操作异常
|
||||
// var con model.Contract
|
||||
// if err := db.DB.Model(&con).Updates(&model.Contract{ContractId: req.ContractId, ViewUrl: req.ViewUrl, DownloadUrl: req.DownloadUrl}).Error; err != nil {
|
||||
// //在线和下载的链接
|
||||
// return err
|
||||
// }
|
||||
// return nil
|
||||
// }
|
||||
|
||||
// // 更新交易id
|
||||
// func UpdateContractTx(txId string, contractId int32) (err error) {
|
||||
// var con model.Contract
|
||||
// con.ID = contractId
|
||||
// if err = db.DB.Model(&con).Update("transaction_id", txId).Error; err != nil { //改变交易id
|
||||
// return
|
||||
// }
|
||||
// if err = db.DB.Model(&con).Update("state", 1).Error; err != nil { //更新合约状态 // 1:待生成 2 待签署 3 签署完成
|
||||
// return
|
||||
// }
|
||||
// return
|
||||
// }
|
||||
|
@ -1,398 +1,388 @@
|
||||
package dao
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
|
||||
"github.com/fonchain/fonchain-artistinfo/cmd/model"
|
||||
"github.com/fonchain/fonchain-artistinfo/pb/supplyinfo"
|
||||
db "github.com/fonchain/fonchain-artistinfo/pkg/db"
|
||||
"github.com/fonchain/fonchain-artistinfo/pkg/m"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
func GetSupplyInfoList(id, num int32) (rep *supplyinfo.GetSupplyInfoListRespond, err error) {
|
||||
rep = &supplyinfo.GetSupplyInfoListRespond{}
|
||||
var datas []*supplyinfo.GetSupplyInfoData
|
||||
|
||||
var supplyInfoList []model.SupplyInfo
|
||||
if err := db.DB.Where("user_id = ? and types <= ?", id, num).Find(&supplyInfoList).Error; err != nil {
|
||||
zap.L().Error("get supplyInfo infos err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for i, v := range supplyInfoList {
|
||||
supplyInfoList[i].CreateTime = v.CreatedAt.Format("2006-01-02")
|
||||
data := &supplyinfo.GetSupplyInfoData{}
|
||||
data.ID = uint64(supplyInfoList[i].ID)
|
||||
data.ArtworkId = supplyInfoList[i].ArtworkId
|
||||
data.ArtistId = supplyInfoList[i].ArtistId
|
||||
data.UserId = uint64(supplyInfoList[i].UserId)
|
||||
data.Name = supplyInfoList[i].Name
|
||||
data.ModelYear = supplyInfoList[i].ModelYear
|
||||
data.Photo = supplyInfoList[i].Photo
|
||||
data.ArtistPhoto = supplyInfoList[i].ArtistPhoto
|
||||
data.Width = uint64(supplyInfoList[i].Width)
|
||||
data.Height = uint64(supplyInfoList[i].Height)
|
||||
data.Ruler = uint64(supplyInfoList[i].Ruler)
|
||||
data.ExhibitInfo = supplyInfoList[i].ExhibitInfo
|
||||
data.ExhibitPic1 = supplyInfoList[i].ExhibitPic1
|
||||
data.ExhibitPic2 = supplyInfoList[i].ExhibitPic2
|
||||
data.CreateTime = supplyInfoList[i].CreateTime
|
||||
data.Introduct = supplyInfoList[i].Introduct
|
||||
data.NetworkTrace = supplyInfoList[i].NetworkTrace
|
||||
data.CreateAddress = supplyInfoList[i].CreateAddress
|
||||
data.Url = supplyInfoList[i].Url
|
||||
data.Types = supplyInfoList[i].State
|
||||
data.Remark = supplyInfoList[i].Remark
|
||||
data.Remark2 = supplyInfoList[i].Remark2
|
||||
data.Enable = supplyInfoList[i].Enable
|
||||
datas = append(datas, data)
|
||||
}
|
||||
rep.Data = datas
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func GetSupplyInfo(req *supplyinfo.GetSupplyInfoRequest) (rep *supplyinfo.GetSupplyInfoData, err error) {
|
||||
rep = &supplyinfo.GetSupplyInfoData{}
|
||||
|
||||
var supplyInfoTmp model.SupplyInfo
|
||||
if err := db.DB.Where("id = ?", req.Id).Find(&supplyInfoTmp).Error; err != nil {
|
||||
zap.L().Error("get supplyInfo infos err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return nil, err
|
||||
}
|
||||
rep.ID = uint64(supplyInfoTmp.ID)
|
||||
rep.ArtworkId = supplyInfoTmp.ArtworkId
|
||||
rep.ArtistId = supplyInfoTmp.ArtistId
|
||||
rep.UserId = uint64(supplyInfoTmp.UserId)
|
||||
rep.Name = supplyInfoTmp.Name
|
||||
rep.ModelYear = supplyInfoTmp.ModelYear
|
||||
rep.Photo = supplyInfoTmp.Photo
|
||||
rep.ArtistPhoto = supplyInfoTmp.ArtistPhoto
|
||||
rep.Width = uint64(supplyInfoTmp.Width)
|
||||
rep.Height = uint64(supplyInfoTmp.Height)
|
||||
rep.Ruler = uint64(supplyInfoTmp.Ruler)
|
||||
rep.ExhibitInfo = supplyInfoTmp.ExhibitInfo
|
||||
rep.ExhibitPic1 = supplyInfoTmp.ExhibitPic1
|
||||
rep.ExhibitPic2 = supplyInfoTmp.ExhibitPic2
|
||||
rep.CreateTime = supplyInfoTmp.CreateTime
|
||||
rep.Introduct = supplyInfoTmp.Introduct
|
||||
rep.NetworkTrace = supplyInfoTmp.NetworkTrace
|
||||
rep.CreateAddress = supplyInfoTmp.CreateAddress
|
||||
rep.Url = supplyInfoTmp.Url
|
||||
rep.Types = supplyInfoTmp.State
|
||||
rep.Remark = supplyInfoTmp.Remark
|
||||
rep.Remark2 = supplyInfoTmp.Remark2
|
||||
rep.Enable = supplyInfoTmp.Enable
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func UpdateSupplyInfo(req *supplyinfo.UpdateSupplyInfoRequest) (rep *supplyinfo.UpdateSupplyInfoRespond, err error) {
|
||||
var SupplyInfo model.SupplyInfo
|
||||
if err := db.DB.Where("id = ? ", req.ID).Find(&SupplyInfo).Error; err != nil {
|
||||
zap.L().Error("get supplyInfo info err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
SupplyInfo.CreateTime = req.CreateTime
|
||||
SupplyInfo.ModelYear = req.ModelYear
|
||||
SupplyInfo.NetworkTrace = req.NetworkTrace
|
||||
SupplyInfo.Url = req.Url
|
||||
SupplyInfo.Introduct = req.Introduct
|
||||
SupplyInfo.State = req.Types
|
||||
SupplyInfo.ExhibitInfo = req.ExhibitInfo
|
||||
SupplyInfo.ExhibitPic1 = req.ExhibitPic1
|
||||
SupplyInfo.ExhibitPic2 = req.ExhibitPic2
|
||||
|
||||
if err = db.DB.Save(&SupplyInfo).Error; err != nil {
|
||||
zap.L().Error("save supplyInfo info err", zap.Error(err))
|
||||
err = errors.New(m.SAVE_ERROR)
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func GetVideoList(id int32) (rep *supplyinfo.GetVideoListRespond, err error) {
|
||||
rep = &supplyinfo.GetVideoListRespond{}
|
||||
var datas []*supplyinfo.GetVideoListData
|
||||
|
||||
var ExhVideo []model.ExhVideo
|
||||
if err := db.DB.Where("user_id = ? and types <=4", id).Find(&ExhVideo).Error; err != nil {
|
||||
zap.L().Error("get exhVideo infos err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for _, v := range ExhVideo {
|
||||
var data supplyinfo.GetVideoListData
|
||||
data.ID = uint64(v.ID)
|
||||
data.UserId = uint64(v.UserId)
|
||||
data.Url = v.Url
|
||||
data.Types = v.State
|
||||
data.Remark = v.Remark
|
||||
data.Remark2 = v.Remark2
|
||||
data.Enable = v.Enable
|
||||
|
||||
datas = append(datas, &data)
|
||||
}
|
||||
|
||||
rep.Data = datas
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func GetVideo(req *supplyinfo.GetVideoRequest) (rep *supplyinfo.GetVideoListData, err error) {
|
||||
rep = &supplyinfo.GetVideoListData{}
|
||||
|
||||
var ExhVideo model.ExhVideo
|
||||
if err := db.DB.Where("id = ?", req.ID).First(&ExhVideo).Error; err != nil {
|
||||
zap.L().Error("get exhVideo info err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
rep.ID = uint64(ExhVideo.ID)
|
||||
rep.UserId = uint64(ExhVideo.UserId)
|
||||
rep.Url = ExhVideo.Url
|
||||
rep.Types = ExhVideo.State
|
||||
rep.Remark = ExhVideo.Remark
|
||||
rep.Remark2 = ExhVideo.Remark2
|
||||
rep.Enable = ExhVideo.Enable
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func UpdateVideo(req *supplyinfo.UpdateVideoRequest) (rep *supplyinfo.UpdateVideoRespond, err error) {
|
||||
rep = &supplyinfo.UpdateVideoRespond{}
|
||||
|
||||
var ExhVideo model.ExhVideo
|
||||
if err := db.DB.Where("id = ? ", req.ID).First(&ExhVideo).Error; err != nil {
|
||||
zap.L().Error("get exhVideo info err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
ExhVideo.Url = req.Url
|
||||
ExhVideo.State = req.Types
|
||||
|
||||
if err := db.DB.Save(&ExhVideo).Error; err != nil {
|
||||
zap.L().Error("save exhVideo info err", zap.Error(err))
|
||||
err = errors.New(m.SAVE_ERROR)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func GetExam(req *supplyinfo.GetExamRequest) (rep *supplyinfo.GetExamListData, err error) {
|
||||
rep = &supplyinfo.GetExamListData{}
|
||||
|
||||
var ExhExam model.ExhExam
|
||||
if err := db.DB.Where("id = ?", req.ID).First(&ExhExam).Error; err != nil {
|
||||
zap.L().Error("get exhVideo info err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
rep.ID = uint64(ExhExam.ID)
|
||||
rep.UserId = uint64(ExhExam.UserId)
|
||||
rep.Title = ExhExam.Title
|
||||
rep.Class = ExhExam.Class
|
||||
rep.TitleScore = uint64(ExhExam.TitleScore)
|
||||
rep.Score = ExhExam.Score
|
||||
rep.Types = ExhExam.State
|
||||
rep.Remark = ExhExam.Remark
|
||||
rep.Remark2 = ExhExam.Remark2
|
||||
rep.Enable = ExhExam.Enable
|
||||
return
|
||||
}
|
||||
|
||||
func GetExamList(req *supplyinfo.GetExamListRequest) (rep *supplyinfo.GetExamListRespond, err error) {
|
||||
rep = &supplyinfo.GetExamListRespond{}
|
||||
var datas []*supplyinfo.GetExamListData
|
||||
|
||||
var ExhExam []model.ExhExam
|
||||
if err := db.DB.Where("user_id = ? and types <=4", req.ID).Find(&ExhExam).Error; err != nil {
|
||||
zap.L().Error("get exhVideo infos err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for _, v := range ExhExam {
|
||||
var data supplyinfo.GetExamListData
|
||||
|
||||
data.ID = uint64(v.ID)
|
||||
data.UserId = uint64(v.UserId)
|
||||
data.Title = v.Title
|
||||
data.Class = v.Class
|
||||
data.TitleScore = uint64(v.TitleScore)
|
||||
data.Score = v.Score
|
||||
data.Types = v.State
|
||||
data.Remark = v.Remark
|
||||
data.Remark2 = v.Remark2
|
||||
data.Enable = v.Enable
|
||||
|
||||
datas = append(datas, &data)
|
||||
}
|
||||
|
||||
rep.Data = datas
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func UpdateExam(req *supplyinfo.UpdateExamRequest) (rep *supplyinfo.UpdateExamRespond, err error) {
|
||||
rep = &supplyinfo.UpdateExamRespond{}
|
||||
|
||||
var ExhExam model.ExhExam
|
||||
if err := db.DB.Where("id = ? ", req.ID).First(&ExhExam).Error; err != nil {
|
||||
zap.L().Error("get exhVideo info err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
ExhExam.Score = req.Score
|
||||
ExhExam.Class = req.Class
|
||||
ExhExam.State = req.Types
|
||||
ExhExam.Title = req.Title
|
||||
ExhExam.Class = req.Class
|
||||
ExhExam.TitleScore = uint(req.TitleScore)
|
||||
ExhExam.Score = req.Score
|
||||
ExhExam.State = req.Types
|
||||
ExhExam.Remark = req.Remark
|
||||
ExhExam.Remark2 = req.Remark2
|
||||
|
||||
var score map[string]int32
|
||||
var titleScore int32
|
||||
|
||||
json.Unmarshal([]byte(req.Score), &score)
|
||||
|
||||
for _, v := range score {
|
||||
titleScore = titleScore + v
|
||||
}
|
||||
|
||||
ExhExam.TitleScore = uint(titleScore)
|
||||
|
||||
if err = db.DB.Save(&ExhExam).Error; err != nil {
|
||||
zap.L().Error("save supplyInfo info err", zap.Error(err))
|
||||
err = errors.New(m.SAVE_ERROR)
|
||||
return
|
||||
}
|
||||
|
||||
if req.Types == "2" {
|
||||
type titleScore struct {
|
||||
UserId uint
|
||||
Score int
|
||||
}
|
||||
|
||||
var tmp []model.ExhExam
|
||||
if err = db.DB.Where("class = ?", req.Class).Order("title_score desc").Find(&tmp).Error; err != nil {
|
||||
zap.L().Error("get exhExam infos err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var ranking int
|
||||
for k, v := range tmp {
|
||||
if v.UserId == uint(req.UserId) {
|
||||
ranking = k
|
||||
}
|
||||
}
|
||||
|
||||
percent := (ranking + 1) / len(tmp) * 100
|
||||
rep.Percent = int32(percent)
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func GetArtistInfoList(id int32) (rep *supplyinfo.GetArtistInfoListRespond, err error) {
|
||||
rep = &supplyinfo.GetArtistInfoListRespond{}
|
||||
var datas []*supplyinfo.GetArtistInfoListData
|
||||
|
||||
var artistInfoTmp []model.ArtistInfo
|
||||
if err = db.DB.Where("user_id = ? and state <=4 ", id).Find(&artistInfoTmp).Error; err != nil {
|
||||
zap.L().Error("get artistInfo infos err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for k, v := range artistInfoTmp {
|
||||
artistInfoTmp[k].Model.ID = uint(v.ID)
|
||||
data := &supplyinfo.GetArtistInfoListData{}
|
||||
|
||||
data.ID = uint64(artistInfoTmp[k].ID)
|
||||
data.UserId = uint64(artistInfoTmp[k].UserId)
|
||||
data.ArtistId = artistInfoTmp[k].ArtistId
|
||||
data.BankAccount = artistInfoTmp[k].BankAccount
|
||||
data.BankName = artistInfoTmp[k].BankName
|
||||
data.Introduct = artistInfoTmp[k].Introduct
|
||||
data.CountryArtLevel = artistInfoTmp[k].CountryArtLevel
|
||||
data.ArtistCertPic = artistInfoTmp[k].ArtistCertPic
|
||||
data.Remark = artistInfoTmp[k].Remark
|
||||
data.Remark2 = artistInfoTmp[k].Remark2
|
||||
data.State = uint64(artistInfoTmp[k].State)
|
||||
|
||||
datas = append(datas, data)
|
||||
}
|
||||
|
||||
rep.Data = datas
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func GetArtistInfo(req *supplyinfo.GetArtistInfoRequest) (rep *supplyinfo.GetArtistInfoListData, err error) {
|
||||
rep = &supplyinfo.GetArtistInfoListData{}
|
||||
|
||||
var artistInfoTmp model.ArtistInfo
|
||||
if err := db.DB.Where("id = ?", req.ID).Find(&artistInfoTmp).Error; err != nil {
|
||||
zap.L().Error("get artistInfo info err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return nil, err
|
||||
}
|
||||
rep.ID = uint64(artistInfoTmp.ID)
|
||||
rep.UserId = uint64(artistInfoTmp.UserId)
|
||||
rep.ArtistId = artistInfoTmp.ArtistId
|
||||
rep.BankAccount = artistInfoTmp.BankAccount
|
||||
rep.BankName = artistInfoTmp.BankName
|
||||
rep.Introduct = artistInfoTmp.Introduct
|
||||
rep.CountryArtLevel = artistInfoTmp.CountryArtLevel
|
||||
rep.ArtistCertPic = artistInfoTmp.ArtistCertPic
|
||||
rep.Remark = artistInfoTmp.Remark
|
||||
rep.Remark2 = artistInfoTmp.Remark2
|
||||
rep.State = uint64(artistInfoTmp.State)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func UpdateArtistInfo(req *supplyinfo.UpdateArtistInfoRequest) (rep *supplyinfo.UpdateArtistInfoRespond, err error) {
|
||||
rep = &supplyinfo.UpdateArtistInfoRespond{}
|
||||
|
||||
var artistInfoTmp model.ArtistInfo
|
||||
if err := db.DB.Where("id = ? ", req.ID).Find(&artistInfoTmp).Error; err != nil {
|
||||
zap.L().Error("get artistInfo info err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
artistInfoTmp.BankAccount = req.BankAccount
|
||||
artistInfoTmp.BankName = req.BankName
|
||||
artistInfoTmp.Introduct = req.Introduct
|
||||
artistInfoTmp.State = uint(req.State)
|
||||
artistInfoTmp.CountryArtLevel = req.CountryArtLevel
|
||||
artistInfoTmp.ArtistCertPic = req.ArtistCertPic
|
||||
|
||||
if err = db.DB.Save(&artistInfoTmp).Error; err != nil {
|
||||
zap.L().Error("save supplyInfo info err", zap.Error(err))
|
||||
err = errors.New(m.SAVE_ERROR)
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
//
|
||||
//func GetSupplyInfoList(id, num int32) (rep *supplyinfo.GetSupplyInfoListRespond, err error) {
|
||||
// rep = &supplyinfo.GetSupplyInfoListRespond{}
|
||||
// var datas []*supplyinfo.GetSupplyInfoData
|
||||
//
|
||||
// var supplyInfoList []model.SupplyInfo
|
||||
// if err := db.DB.Where("user_id = ? and types <= ?", id, num).Find(&supplyInfoList).Error; err != nil {
|
||||
// zap.L().Error("get supplyInfo infos err", zap.Error(err))
|
||||
// err = errors.New(m.ERROR_SELECT)
|
||||
// return nil, err
|
||||
// }
|
||||
//
|
||||
// for i, v := range supplyInfoList {
|
||||
// supplyInfoList[i].CreateTime = v.CreatedAt.Format("2006-01-02")
|
||||
// data := &supplyinfo.GetSupplyInfoData{}
|
||||
// data.ID = uint64(supplyInfoList[i].ID)
|
||||
// data.ArtworkId = supplyInfoList[i].ArtworkId
|
||||
// data.ArtistId = supplyInfoList[i].ArtistId
|
||||
// data.UserId = uint64(supplyInfoList[i].UserId)
|
||||
// data.Name = supplyInfoList[i].Name
|
||||
// data.ModelYear = supplyInfoList[i].ModelYear
|
||||
// data.Photo = supplyInfoList[i].Photo
|
||||
// data.ArtistPhoto = supplyInfoList[i].ArtistPhoto
|
||||
// data.Width = uint64(supplyInfoList[i].Width)
|
||||
// data.Height = uint64(supplyInfoList[i].Height)
|
||||
// data.Ruler = uint64(supplyInfoList[i].Ruler)
|
||||
// data.ExhibitInfo = supplyInfoList[i].ExhibitInfo
|
||||
// data.ExhibitPic1 = supplyInfoList[i].ExhibitPic1
|
||||
// data.ExhibitPic2 = supplyInfoList[i].ExhibitPic2
|
||||
// data.CreateTime = supplyInfoList[i].CreateTime
|
||||
// data.Introduct = supplyInfoList[i].Introduct
|
||||
// data.NetworkTrace = supplyInfoList[i].NetworkTrace
|
||||
// data.CreateAddress = supplyInfoList[i].CreateAddress
|
||||
// data.Url = supplyInfoList[i].Url
|
||||
// data.Types = supplyInfoList[i].State
|
||||
// data.Remark = supplyInfoList[i].Remark
|
||||
// data.Remark2 = supplyInfoList[i].Remark2
|
||||
// data.Enable = supplyInfoList[i].Enable
|
||||
// datas = append(datas, data)
|
||||
// }
|
||||
// rep.Data = datas
|
||||
//
|
||||
// return
|
||||
//}
|
||||
//
|
||||
//func GetSupplyInfo(req *supplyinfo.GetSupplyInfoRequest) (rep *supplyinfo.GetSupplyInfoData, err error) {
|
||||
// rep = &supplyinfo.GetSupplyInfoData{}
|
||||
//
|
||||
// var supplyInfoTmp model.SupplyInfo
|
||||
// if err := db.DB.Where("id = ?", req.Id).Find(&supplyInfoTmp).Error; err != nil {
|
||||
// zap.L().Error("get supplyInfo infos err", zap.Error(err))
|
||||
// err = errors.New(m.ERROR_SELECT)
|
||||
// return nil, err
|
||||
// }
|
||||
// rep.ID = uint64(supplyInfoTmp.ID)
|
||||
// rep.ArtworkId = supplyInfoTmp.ArtworkId
|
||||
// rep.ArtistId = supplyInfoTmp.ArtistId
|
||||
// rep.UserId = uint64(supplyInfoTmp.UserId)
|
||||
// rep.Name = supplyInfoTmp.Name
|
||||
// rep.ModelYear = supplyInfoTmp.ModelYear
|
||||
// rep.Photo = supplyInfoTmp.Photo
|
||||
// rep.ArtistPhoto = supplyInfoTmp.ArtistPhoto
|
||||
// rep.Width = uint64(supplyInfoTmp.Width)
|
||||
// rep.Height = uint64(supplyInfoTmp.Height)
|
||||
// rep.Ruler = uint64(supplyInfoTmp.Ruler)
|
||||
// rep.ExhibitInfo = supplyInfoTmp.ExhibitInfo
|
||||
// rep.ExhibitPic1 = supplyInfoTmp.ExhibitPic1
|
||||
// rep.ExhibitPic2 = supplyInfoTmp.ExhibitPic2
|
||||
// rep.CreateTime = supplyInfoTmp.CreateTime
|
||||
// rep.Introduct = supplyInfoTmp.Introduct
|
||||
// rep.NetworkTrace = supplyInfoTmp.NetworkTrace
|
||||
// rep.CreateAddress = supplyInfoTmp.CreateAddress
|
||||
// rep.Url = supplyInfoTmp.Url
|
||||
// rep.Types = supplyInfoTmp.State
|
||||
// rep.Remark = supplyInfoTmp.Remark
|
||||
// rep.Remark2 = supplyInfoTmp.Remark2
|
||||
// rep.Enable = supplyInfoTmp.Enable
|
||||
//
|
||||
// return
|
||||
//}
|
||||
//
|
||||
//func UpdateSupplyInfo(req *supplyinfo.UpdateSupplyInfoRequest) (rep *supplyinfo.UpdateSupplyInfoRespond, err error) {
|
||||
// var SupplyInfo model.SupplyInfo
|
||||
// if err := db.DB.Where("id = ? ", req.ID).Find(&SupplyInfo).Error; err != nil {
|
||||
// zap.L().Error("get supplyInfo info err", zap.Error(err))
|
||||
// err = errors.New(m.ERROR_SELECT)
|
||||
// return nil, err
|
||||
// }
|
||||
//
|
||||
// SupplyInfo.CreateTime = req.CreateTime
|
||||
// SupplyInfo.ModelYear = req.ModelYear
|
||||
// SupplyInfo.NetworkTrace = req.NetworkTrace
|
||||
// SupplyInfo.Url = req.Url
|
||||
// SupplyInfo.Introduct = req.Introduct
|
||||
// SupplyInfo.State = req.Types
|
||||
// SupplyInfo.ExhibitInfo = req.ExhibitInfo
|
||||
// SupplyInfo.ExhibitPic1 = req.ExhibitPic1
|
||||
// SupplyInfo.ExhibitPic2 = req.ExhibitPic2
|
||||
//
|
||||
// if err = db.DB.Save(&SupplyInfo).Error; err != nil {
|
||||
// zap.L().Error("save supplyInfo info err", zap.Error(err))
|
||||
// err = errors.New(m.SAVE_ERROR)
|
||||
// return
|
||||
// }
|
||||
//
|
||||
// return
|
||||
//}
|
||||
//
|
||||
//func GetVideoList(id int32) (rep *supplyinfo.GetVideoListRespond, err error) {
|
||||
// rep = &supplyinfo.GetVideoListRespond{}
|
||||
// var datas []*supplyinfo.GetVideoListData
|
||||
//
|
||||
// var ExhVideo []model.ExhVideo
|
||||
// if err := db.DB.Where("user_id = ? and types <=4", id).Find(&ExhVideo).Error; err != nil {
|
||||
// zap.L().Error("get exhVideo infos err", zap.Error(err))
|
||||
// err = errors.New(m.ERROR_SELECT)
|
||||
// return nil, err
|
||||
// }
|
||||
//
|
||||
// for _, v := range ExhVideo {
|
||||
// var data supplyinfo.GetVideoListData
|
||||
// data.ID = uint64(v.ID)
|
||||
// data.UserId = uint64(v.UserId)
|
||||
// data.Url = v.Url
|
||||
// data.Types = v.State
|
||||
// data.Remark = v.Remark
|
||||
// data.Remark2 = v.Remark2
|
||||
// data.Enable = v.Enable
|
||||
//
|
||||
// datas = append(datas, &data)
|
||||
// }
|
||||
//
|
||||
// rep.Data = datas
|
||||
//
|
||||
// return
|
||||
//}
|
||||
//
|
||||
//func GetVideo(req *supplyinfo.GetVideoRequest) (rep *supplyinfo.GetVideoListData, err error) {
|
||||
// rep = &supplyinfo.GetVideoListData{}
|
||||
//
|
||||
// var ExhVideo model.ExhVideo
|
||||
// if err := db.DB.Where("id = ?", req.ID).First(&ExhVideo).Error; err != nil {
|
||||
// zap.L().Error("get exhVideo info err", zap.Error(err))
|
||||
// err = errors.New(m.ERROR_SELECT)
|
||||
// return nil, err
|
||||
// }
|
||||
//
|
||||
// rep.ID = uint64(ExhVideo.ID)
|
||||
// rep.UserId = uint64(ExhVideo.UserId)
|
||||
// rep.Url = ExhVideo.Url
|
||||
// rep.Types = ExhVideo.State
|
||||
// rep.Remark = ExhVideo.Remark
|
||||
// rep.Remark2 = ExhVideo.Remark2
|
||||
// rep.Enable = ExhVideo.Enable
|
||||
//
|
||||
// return
|
||||
//}
|
||||
//
|
||||
//func UpdateVideo(req *supplyinfo.UpdateVideoRequest) (rep *supplyinfo.UpdateVideoRespond, err error) {
|
||||
// rep = &supplyinfo.UpdateVideoRespond{}
|
||||
//
|
||||
// var ExhVideo model.ExhVideo
|
||||
// if err := db.DB.Where("id = ? ", req.ID).First(&ExhVideo).Error; err != nil {
|
||||
// zap.L().Error("get exhVideo info err", zap.Error(err))
|
||||
// err = errors.New(m.ERROR_SELECT)
|
||||
// return nil, err
|
||||
// }
|
||||
//
|
||||
// ExhVideo.Url = req.Url
|
||||
// ExhVideo.State = req.Types
|
||||
//
|
||||
// if err := db.DB.Save(&ExhVideo).Error; err != nil {
|
||||
// zap.L().Error("save exhVideo info err", zap.Error(err))
|
||||
// err = errors.New(m.SAVE_ERROR)
|
||||
// return nil, err
|
||||
// }
|
||||
//
|
||||
// return
|
||||
//}
|
||||
//
|
||||
//func GetExam(req *supplyinfo.GetExamRequest) (rep *supplyinfo.GetExamListData, err error) {
|
||||
// rep = &supplyinfo.GetExamListData{}
|
||||
//
|
||||
// var ExhExam model.ExhExam
|
||||
// if err := db.DB.Where("id = ?", req.ID).First(&ExhExam).Error; err != nil {
|
||||
// zap.L().Error("get exhVideo info err", zap.Error(err))
|
||||
// err = errors.New(m.ERROR_SELECT)
|
||||
// return nil, err
|
||||
// }
|
||||
//
|
||||
// rep.ID = uint64(ExhExam.ID)
|
||||
// rep.UserId = uint64(ExhExam.UserId)
|
||||
// rep.Title = ExhExam.Title
|
||||
// rep.Class = ExhExam.Class
|
||||
// rep.TitleScore = uint64(ExhExam.TitleScore)
|
||||
// rep.Score = ExhExam.Score
|
||||
// rep.Types = ExhExam.State
|
||||
// rep.Remark = ExhExam.Remark
|
||||
// rep.Remark2 = ExhExam.Remark2
|
||||
// rep.Enable = ExhExam.Enable
|
||||
// return
|
||||
//}
|
||||
//
|
||||
//func GetExamList(req *supplyinfo.GetExamListRequest) (rep *supplyinfo.GetExamListRespond, err error) {
|
||||
// rep = &supplyinfo.GetExamListRespond{}
|
||||
// var datas []*supplyinfo.GetExamListData
|
||||
//
|
||||
// var ExhExam []model.ExhExam
|
||||
// if err := db.DB.Where("user_id = ? and types <=4", req.ID).Find(&ExhExam).Error; err != nil {
|
||||
// zap.L().Error("get exhVideo infos err", zap.Error(err))
|
||||
// err = errors.New(m.ERROR_SELECT)
|
||||
// return nil, err
|
||||
// }
|
||||
//
|
||||
// for _, v := range ExhExam {
|
||||
// var data supplyinfo.GetExamListData
|
||||
//
|
||||
// data.ID = uint64(v.ID)
|
||||
// data.UserId = uint64(v.UserId)
|
||||
// data.Title = v.Title
|
||||
// data.Class = v.Class
|
||||
// data.TitleScore = uint64(v.TitleScore)
|
||||
// data.Score = v.Score
|
||||
// data.Types = v.State
|
||||
// data.Remark = v.Remark
|
||||
// data.Remark2 = v.Remark2
|
||||
// data.Enable = v.Enable
|
||||
//
|
||||
// datas = append(datas, &data)
|
||||
// }
|
||||
//
|
||||
// rep.Data = datas
|
||||
//
|
||||
// return
|
||||
//}
|
||||
//
|
||||
//func UpdateExam(req *supplyinfo.UpdateExamRequest) (rep *supplyinfo.UpdateExamRespond, err error) {
|
||||
// rep = &supplyinfo.UpdateExamRespond{}
|
||||
//
|
||||
// var ExhExam model.ExhExam
|
||||
// if err := db.DB.Where("id = ? ", req.ID).First(&ExhExam).Error; err != nil {
|
||||
// zap.L().Error("get exhVideo info err", zap.Error(err))
|
||||
// err = errors.New(m.ERROR_SELECT)
|
||||
// return nil, err
|
||||
// }
|
||||
//
|
||||
// ExhExam.Score = req.Score
|
||||
// ExhExam.Class = req.Class
|
||||
// ExhExam.State = req.Types
|
||||
// ExhExam.Title = req.Title
|
||||
// ExhExam.Class = req.Class
|
||||
// ExhExam.TitleScore = uint(req.TitleScore)
|
||||
// ExhExam.Score = req.Score
|
||||
// ExhExam.State = req.Types
|
||||
// ExhExam.Remark = req.Remark
|
||||
// ExhExam.Remark2 = req.Remark2
|
||||
//
|
||||
// var score map[string]int32
|
||||
// var titleScore int32
|
||||
//
|
||||
// json.Unmarshal([]byte(req.Score), &score)
|
||||
//
|
||||
// for _, v := range score {
|
||||
// titleScore = titleScore + v
|
||||
// }
|
||||
//
|
||||
// ExhExam.TitleScore = uint(titleScore)
|
||||
//
|
||||
// if err = db.DB.Save(&ExhExam).Error; err != nil {
|
||||
// zap.L().Error("save supplyInfo info err", zap.Error(err))
|
||||
// err = errors.New(m.SAVE_ERROR)
|
||||
// return
|
||||
// }
|
||||
//
|
||||
// if req.Types == "2" {
|
||||
// type titleScore struct {
|
||||
// UserId uint
|
||||
// Score int
|
||||
// }
|
||||
//
|
||||
// var tmp []model.ExhExam
|
||||
// if err = db.DB.Where("class = ?", req.Class).Order("title_score desc").Find(&tmp).Error; err != nil {
|
||||
// zap.L().Error("get exhExam infos err", zap.Error(err))
|
||||
// err = errors.New(m.ERROR_SELECT)
|
||||
// return nil, err
|
||||
// }
|
||||
//
|
||||
// var ranking int
|
||||
// for k, v := range tmp {
|
||||
// if v.UserId == uint(req.UserId) {
|
||||
// ranking = k
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// percent := (ranking + 1) / len(tmp) * 100
|
||||
// rep.Percent = int32(percent)
|
||||
// return
|
||||
// }
|
||||
//
|
||||
// return
|
||||
//}
|
||||
//
|
||||
//func GetArtistInfoList(id int32) (rep *supplyinfo.GetArtistInfoListRespond, err error) {
|
||||
// rep = &supplyinfo.GetArtistInfoListRespond{}
|
||||
// var datas []*supplyinfo.GetArtistInfoListData
|
||||
//
|
||||
// var artistInfoTmp []old.ArtistInfo
|
||||
// if err = db.DB.Where("user_id = ? and state <=4 ", id).Find(&artistInfoTmp).Error; err != nil {
|
||||
// zap.L().Error("get artistInfo infos err", zap.Error(err))
|
||||
// err = errors.New(m.ERROR_SELECT)
|
||||
// return nil, err
|
||||
// }
|
||||
//
|
||||
// for k, v := range artistInfoTmp {
|
||||
// artistInfoTmp[k].Model.ID = v.ID
|
||||
// data := &supplyinfo.GetArtistInfoListData{}
|
||||
//
|
||||
// data.ID = uint64(artistInfoTmp[k].ID)
|
||||
// data.UserId = uint64(artistInfoTmp[k].UserId)
|
||||
// data.ArtistId = artistInfoTmp[k].ArtistId
|
||||
// data.BankAccount = artistInfoTmp[k].BankAccount
|
||||
// data.BankName = artistInfoTmp[k].BankName
|
||||
// data.Introduct = artistInfoTmp[k].Introduct
|
||||
// data.CountryArtLevel = artistInfoTmp[k].CountryArtLevel
|
||||
// data.ArtistCertPic = artistInfoTmp[k].ArtistCertPic
|
||||
// data.Remark = artistInfoTmp[k].Remark
|
||||
// data.Remark2 = artistInfoTmp[k].Remark2
|
||||
// data.State = uint64(artistInfoTmp[k].State)
|
||||
//
|
||||
// datas = append(datas, data)
|
||||
// }
|
||||
//
|
||||
// rep.Data = datas
|
||||
//
|
||||
// return
|
||||
//}
|
||||
//
|
||||
//func GetArtistInfo(req *supplyinfo.GetArtistInfoRequest) (rep *supplyinfo.GetArtistInfoListData, err error) {
|
||||
// rep = &supplyinfo.GetArtistInfoListData{}
|
||||
//
|
||||
// var artistInfoTmp old.ArtistInfo
|
||||
// if err := db.DB.Where("id = ?", req.ID).Find(&artistInfoTmp).Error; err != nil {
|
||||
// zap.L().Error("get artistInfo info err", zap.Error(err))
|
||||
// err = errors.New(m.ERROR_SELECT)
|
||||
// return nil, err
|
||||
// }
|
||||
// rep.ID = uint64(artistInfoTmp.ID)
|
||||
// rep.UserId = uint64(artistInfoTmp.UserId)
|
||||
// rep.ArtistId = artistInfoTmp.ArtistId
|
||||
// rep.BankAccount = artistInfoTmp.BankAccount
|
||||
// rep.BankName = artistInfoTmp.BankName
|
||||
// rep.Introduct = artistInfoTmp.Introduct
|
||||
// rep.CountryArtLevel = artistInfoTmp.CountryArtLevel
|
||||
// rep.ArtistCertPic = artistInfoTmp.ArtistCertPic
|
||||
// rep.Remark = artistInfoTmp.Remark
|
||||
// rep.Remark2 = artistInfoTmp.Remark2
|
||||
// rep.State = uint64(artistInfoTmp.State)
|
||||
//
|
||||
// return
|
||||
//}
|
||||
//
|
||||
//func UpdateArtistInfo(req *supplyinfo.UpdateArtistInfoRequest) (rep *supplyinfo.UpdateArtistInfoRespond, err error) {
|
||||
// rep = &supplyinfo.UpdateArtistInfoRespond{}
|
||||
//
|
||||
// var artistInfoTmp old.ArtistInfo
|
||||
// if err := db.DB.Where("id = ? ", req.ID).Find(&artistInfoTmp).Error; err != nil {
|
||||
// zap.L().Error("get artistInfo info err", zap.Error(err))
|
||||
// err = errors.New(m.ERROR_SELECT)
|
||||
// return nil, err
|
||||
// }
|
||||
//
|
||||
// artistInfoTmp.BankAccount = req.BankAccount
|
||||
// artistInfoTmp.BankName = req.BankName
|
||||
// artistInfoTmp.Introduct = req.Introduct
|
||||
// artistInfoTmp.State = uint(req.State)
|
||||
// artistInfoTmp.CountryArtLevel = req.CountryArtLevel
|
||||
// artistInfoTmp.ArtistCertPic = req.ArtistCertPic
|
||||
//
|
||||
// if err = db.DB.Save(&artistInfoTmp).Error; err != nil {
|
||||
// zap.L().Error("save supplyInfo info err", zap.Error(err))
|
||||
// err = errors.New(m.SAVE_ERROR)
|
||||
// return
|
||||
// }
|
||||
//
|
||||
// return
|
||||
//}
|
||||
|
@ -1,80 +0,0 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/fonchain/fonchain-artistinfo/cmd/internal/dao"
|
||||
"github.com/fonchain/fonchain-artistinfo/pb/artistinfo"
|
||||
)
|
||||
|
||||
type IArtistInfo interface {
|
||||
RegisterUser(req *artistinfo.RegisterUserRequest) (rep *artistinfo.RegisterUserRespond, err error)
|
||||
GetUserById(req *artistinfo.GetUserByIdRequest) (rep *artistinfo.GetUserByIdRespond, err error)
|
||||
GetUser(req *artistinfo.GetUserRequest) (rep *artistinfo.GetUserRespond, err error)
|
||||
CreateUserInfo(req *artistinfo.CreateUserInfoRequest) (rep *artistinfo.CreateUserInfoRespond, err error)
|
||||
UpdateRealName(req *artistinfo.UpdateRealNameRequest) (rep *artistinfo.UpdateRealNameRespond, err error)
|
||||
FinishVerify(req *artistinfo.FinishVerifyRequest) (rep *artistinfo.FinishVerifyRespond, err error)
|
||||
CheckUserLock(req *artistinfo.CheckUserLockRequest) (rep *artistinfo.CheckUserLockRespond, err error)
|
||||
ArtistSupplyList(req *artistinfo.ArtistSupplyListRequest) (rep *artistinfo.ArtistSupplyListRespond, err error)
|
||||
}
|
||||
|
||||
func NewArtistInfo() IArtistInfo {
|
||||
return &ArtistInfo{}
|
||||
}
|
||||
|
||||
type ArtistInfo struct{}
|
||||
|
||||
func (a *ArtistInfo) GetUser(req *artistinfo.GetUserRequest) (rep *artistinfo.GetUserRespond, err error) {
|
||||
rep, err = dao.GetUser(req)
|
||||
return
|
||||
}
|
||||
|
||||
func (a *ArtistInfo) RegisterUser(req *artistinfo.RegisterUserRequest) (rep *artistinfo.RegisterUserRespond, err error) {
|
||||
rep, err = dao.RegisterUser(req)
|
||||
return
|
||||
}
|
||||
func (a *ArtistInfo) CreateUserInfo(req *artistinfo.CreateUserInfoRequest) (rep *artistinfo.CreateUserInfoRespond, err error) {
|
||||
fmt.Println("第二处")
|
||||
rep, err = dao.CreateUserInfo(req)
|
||||
return
|
||||
}
|
||||
func (a *ArtistInfo) GetUserById(req *artistinfo.GetUserByIdRequest) (rep *artistinfo.GetUserByIdRespond, err error) {
|
||||
rep, err = dao.GetUserById(req)
|
||||
return
|
||||
}
|
||||
|
||||
func (a *ArtistInfo) UpdateRealName(req *artistinfo.UpdateRealNameRequest) (rep *artistinfo.UpdateRealNameRespond, err error) {
|
||||
rep, err = dao.UpdateRealName(req)
|
||||
return
|
||||
}
|
||||
|
||||
func (a *ArtistInfo) FinishVerify(req *artistinfo.FinishVerifyRequest) (rep *artistinfo.FinishVerifyRespond, err error) {
|
||||
rep, err = dao.FinishVerify(req)
|
||||
return
|
||||
}
|
||||
|
||||
func (a *ArtistInfo) CheckUserLock(req *artistinfo.CheckUserLockRequest) (rep *artistinfo.CheckUserLockRespond, err error) {
|
||||
err = dao.CheckUserLock(int64(req.ID))
|
||||
return
|
||||
}
|
||||
func (a *ArtistInfo) ArtistSupplyList(req *artistinfo.ArtistSupplyListRequest) (rep *artistinfo.ArtistSupplyListRespond, err error) {
|
||||
rep, err = dao.ArtistSupplyList(req)
|
||||
return
|
||||
}
|
||||
func (a *ArtistInfo) UserLock(req *artistinfo.UserLockRequest) (rep *artistinfo.UserLockRespond, err error) {
|
||||
rep, err = dao.UserLock(req)
|
||||
return
|
||||
}
|
||||
func (a *ArtistInfo) CheckInvitedCode(req *artistinfo.CheckInvitedCodeRequest) (rep *artistinfo.GetUserRespond, err error) {
|
||||
rep, err = dao.CheckInvitedCode(req)
|
||||
return
|
||||
}
|
||||
|
||||
func (a *ArtistInfo) UnFinishList(req *artistinfo.UnFinishListRequest) (rep *artistinfo.UnFinishListRespond, err error) {
|
||||
rep, err = dao.UnFinishList(req)
|
||||
return
|
||||
}
|
||||
|
||||
func (a *ArtistInfo) GetUserMsg(req *artistinfo.GetUserMsgRequest) (rep *artistinfo.GetUserMsgRespond, err error) {
|
||||
rep, err = dao.GetUserMsg(req)
|
||||
return
|
||||
}
|
207
cmd/internal/logic/artistInfo_user.go
Normal file
207
cmd/internal/logic/artistInfo_user.go
Normal file
@ -0,0 +1,207 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/fonchain/fonchain-artistinfo/cmd/internal/dao"
|
||||
"github.com/fonchain/fonchain-artistinfo/pb/artist"
|
||||
"github.com/fonchain/fonchain-artistinfo/pb/artistInfoUser"
|
||||
"github.com/fonchain/fonchain-artistinfo/pkg/service"
|
||||
"github.com/fonchain/fonchain-artistinfo/pkg/util/stime"
|
||||
)
|
||||
|
||||
type IArtistInfo interface {
|
||||
RegisterUser(req *artistInfoUser.RegisterUserRequest) (rep *artistInfoUser.RegisterUserRespond, err error)
|
||||
GetUserById(req *artistInfoUser.GetUserByIdRequest) (rep *artistInfoUser.GetUserByIdRespond, err error)
|
||||
GetUser(req *artistInfoUser.GetUserRequest) (rep *artistInfoUser.GetUserRespond, err error)
|
||||
// CreateUserInfo(req *artistInfoUser.CreateUserInfoRequest) (rep *artistInfoUser.CreateUserInfoRespond, err error)
|
||||
// UpdateRealName(req *artistInfoUser.UpdateRealNameRequest) (rep *artistInfoUser.UpdateRealNameRespond, err error)
|
||||
FinishVerify(req *artistInfoUser.FinishVerifyRequest) (rep *artistInfoUser.FinishVerifyRespond, err error)
|
||||
CheckUserLock(req *artistInfoUser.CheckUserLockRequest) (rep *artistInfoUser.CheckUserLockRespond, err error)
|
||||
ArtistSupplyList(req *artistInfoUser.ArtistSupplyListRequest) (rep *artistInfoUser.ArtistSupplyListRespond, err error)
|
||||
FindUser(req *artistInfoUser.FindUserRequest) (rep *artistInfoUser.UserInfo, err error)
|
||||
UpdateUserData(req *artistInfoUser.UserInfo) (rep *artistInfoUser.CommonNoParams, err error)
|
||||
}
|
||||
|
||||
func NewArtistInfo() IArtistInfo {
|
||||
return &ArtistInfoUser{}
|
||||
}
|
||||
|
||||
type ArtistInfoUser struct{}
|
||||
|
||||
func (a *ArtistInfoUser) GetUser(req *artistInfoUser.GetUserRequest) (rep *artistInfoUser.GetUserRespond, err error) {
|
||||
rep, err = dao.GetUser(req)
|
||||
return
|
||||
}
|
||||
|
||||
func (a *ArtistInfoUser) RegisterUser(req *artistInfoUser.RegisterUserRequest) (rep *artistInfoUser.RegisterUserRespond, err error) {
|
||||
rep, err = dao.RegisterUser(req)
|
||||
return
|
||||
}
|
||||
func (a *ArtistInfoUser) CreateUserInfo(req *artistInfoUser.CreateUserInfoRequest) (rep *artistInfoUser.CreateUserInfoRespond, err error) {
|
||||
fmt.Println("第二处")
|
||||
rep, err = dao.CreateUserInfo(req)
|
||||
return
|
||||
}
|
||||
|
||||
func (a *ArtistInfoUser) GetUserById(req *artistInfoUser.GetUserByIdRequest) (userInfo *artistInfoUser.GetUserByIdRespond, err error) {
|
||||
userInfo, err = dao.GetUserById(req)
|
||||
return
|
||||
}
|
||||
|
||||
//func (a *ArtistInfoUser) UpdateRealName(req *artistInfoUser.UpdateRealNameRequest) (rep *artistInfoUser.UpdateRealNameRespond, err error) {
|
||||
// rep, err = dao.UpdateRealName(req)
|
||||
// return
|
||||
//}
|
||||
|
||||
func (a *ArtistInfoUser) FinishVerify(req *artistInfoUser.FinishVerifyRequest) (rep *artistInfoUser.FinishVerifyRespond, err error) {
|
||||
rep, err = dao.FinishVerify(req)
|
||||
return
|
||||
}
|
||||
|
||||
func (a *ArtistInfoUser) CheckUserLock(req *artistInfoUser.CheckUserLockRequest) (rep *artistInfoUser.CheckUserLockRespond, err error) {
|
||||
err = dao.CheckUserLock(int64(req.Id))
|
||||
return
|
||||
}
|
||||
func (a *ArtistInfoUser) ArtistSupplyList(req *artistInfoUser.ArtistSupplyListRequest) (rep *artistInfoUser.ArtistSupplyListRespond, err error) {
|
||||
rep, err = dao.ArtistSupplyList(req)
|
||||
return
|
||||
}
|
||||
func (a *ArtistInfoUser) UserLock(req *artistInfoUser.UserLockRequest) (rep *artistInfoUser.UserLockRespond, err error) {
|
||||
rep, err = dao.UserLock(req)
|
||||
return
|
||||
}
|
||||
func (a *ArtistInfoUser) CheckInvitedCode(req *artistInfoUser.CheckInvitedCodeRequest) (rep *artistInfoUser.GetUserRespond, err error) {
|
||||
rep, err = dao.CheckInvitedCode(req)
|
||||
return
|
||||
}
|
||||
|
||||
func (a *ArtistInfoUser) UnFinishList(req *artistInfoUser.UnFinishListRequest) (rep *artistInfoUser.UnFinishListRespond, err error) {
|
||||
rep, err = dao.UnFinishList(req)
|
||||
return
|
||||
}
|
||||
|
||||
func (a *ArtistInfoUser) GetUserMsg(req *artistInfoUser.GetUserMsgRequest) (rep *artistInfoUser.GetUserMsgRespond, err error) {
|
||||
rep, err = dao.GetUserMsg(req)
|
||||
return
|
||||
}
|
||||
|
||||
func (a *ArtistInfoUser) FindUser(req *artistInfoUser.FindUserRequest) (rep *artistInfoUser.UserInfo, err error) {
|
||||
return dao.FindUser(req)
|
||||
}
|
||||
|
||||
func (a *ArtistInfoUser) FindUserList(req *artistInfoUser.FindUsersRequest) (rep *artistInfoUser.FindUsersResponse, err error) {
|
||||
res, total, err := dao.FindUserList(req)
|
||||
rep = &artistInfoUser.FindUsersResponse{Data: res, Page: &artistInfoUser.UserCommonPageInfo{
|
||||
Page: req.Page,
|
||||
PageSize: req.PageSize,
|
||||
Total: total,
|
||||
}}
|
||||
return
|
||||
}
|
||||
func (a *ArtistInfoUser) FindUsersUserView(req *artistInfoUser.FindUsersRequest) (rep *artistInfoUser.FindUsersUserViewResponse, err error) {
|
||||
res, total, err := dao.GetViewUserList(req)
|
||||
var returnData []*artistInfoUser.UserView
|
||||
var artistUidList = []string{}
|
||||
|
||||
for _, v := range res {
|
||||
if v.ArtistUid != "" {
|
||||
artistUidList = append(artistUidList, v.ArtistUid)
|
||||
}
|
||||
returnData = append(returnData, &artistInfoUser.UserView{
|
||||
UserId: v.UserId,
|
||||
AccId: v.AccId,
|
||||
ArtistUid: v.ArtistUid,
|
||||
TelNum: v.TelNum,
|
||||
InviteCode: v.InviteCode,
|
||||
Account: v.Account,
|
||||
Photo: v.Photo,
|
||||
IsRealName: v.IsRealName,
|
||||
FddState: v.FddState,
|
||||
IsRead: v.IsRead,
|
||||
IsLock: v.IsLock,
|
||||
RealName: v.RealName,
|
||||
IdNum: v.IdNum,
|
||||
Sex: string(v.Sex),
|
||||
Age: v.Age,
|
||||
//Address: v.RealAddress,
|
||||
IdcardBack: v.IdcardBack,
|
||||
IdcardFront: v.IdcardFront,
|
||||
InviterInviteCode: v.InviterInviteCode,
|
||||
InviterRealName: v.InviterRealName,
|
||||
JoinAssoTime: v.JoinAssoTime,
|
||||
DeletedAt: v.DeletedAt,
|
||||
UpdatedAt: stime.TimeToString(v.UpdatedAt, stime.Format_Normal_YMDhms),
|
||||
CreatedAt: stime.TimeToString(v.CreatedAt, stime.Format_Normal_YMDhms),
|
||||
CertificateNum: v.CertificateNum,
|
||||
CertificateImg: v.CertificateImg,
|
||||
LatestLockTime: v.LatestLockTime,
|
||||
WxAccount: v.WxAccount,
|
||||
//BankName: v.BankName,
|
||||
//BankNum: v.BankNum,
|
||||
//PenName: "",
|
||||
//StageName: "",
|
||||
})
|
||||
}
|
||||
if artistUidList != nil {
|
||||
var artistDatas *artist.ArtistListResponse
|
||||
artistDatas, err = service.GrpcArtistImpl.ArtistList(context.Background(), &artist.ArtistListRequest{
|
||||
Page: 1,
|
||||
PageSize: int32(len(artistUidList)),
|
||||
Uids: artistUidList,
|
||||
Gender: -1,
|
||||
})
|
||||
if err != nil {
|
||||
fmt.Println("错误:GrpcArtistImpl.GetInfoByUuids ", err.Error())
|
||||
return nil, err
|
||||
}
|
||||
for _, artistValue := range artistDatas.Data {
|
||||
for i, user := range returnData {
|
||||
if artistValue.Uid == user.ArtistUid {
|
||||
returnData[i].CertificateNum = artistValue.CaaCertNum
|
||||
returnData[i].BankNum = artistValue.BankNum
|
||||
returnData[i].BankName = artistValue.BankName
|
||||
returnData[i].PenName = artistValue.PenName
|
||||
returnData[i].StageName = artistValue.StageName
|
||||
returnData[i].Address = strings.Split(artistValue.Address, ",")
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
rep = &artistInfoUser.FindUsersUserViewResponse{Data: returnData, Page: &artistInfoUser.UserCommonPageInfo{
|
||||
Page: req.Page,
|
||||
PageSize: req.PageSize,
|
||||
Total: total,
|
||||
}}
|
||||
return
|
||||
}
|
||||
func (a *ArtistInfoUser) UpdateUserData(req *artistInfoUser.UserInfo) (rep *artistInfoUser.CommonNoParams, err error) {
|
||||
rep, err = dao.UpdateUserData(req)
|
||||
return
|
||||
}
|
||||
func (a *ArtistInfoUser) PreSaveArtistInfo(in *artistInfoUser.PreSaveArtistInfoData) (rep *artistInfoUser.CommonNoParams, err error) {
|
||||
rep, err = dao.PreSaveArtistInfo(in)
|
||||
return
|
||||
}
|
||||
func (a *ArtistInfoUser) GetPreSaveArtistInfo(in *artistInfoUser.GetPreSaveArtistInfoRequest) (res *artistInfoUser.PreSaveArtistInfoData, err error) {
|
||||
res, err = dao.GetPreSaveArtistInfo(in)
|
||||
return
|
||||
}
|
||||
|
||||
func (a *ArtistInfoUser) GetInvitedUserList(in *artistInfoUser.GetInvitedUserListRequest) (res *artistInfoUser.GetInvitedUserListResponse, err error) {
|
||||
res, err = dao.GetInvitedUserList(in)
|
||||
return
|
||||
}
|
||||
|
||||
func (a *ArtistInfoUser) GetInviterUserList(in *artistInfoUser.GetInviterUserListRequest) (res *artistInfoUser.GetInvitedUserListResponse, err error) {
|
||||
res, err = dao.GetInviterUserList(in)
|
||||
return
|
||||
}
|
||||
func (a *ArtistInfoUser) GetInviteStaticList(in *artistInfoUser.GetInviteStaticListRequest) (res *artistInfoUser.GetInviteStaticListResponse, err error) {
|
||||
res, err = dao.GetInviteStaticList(in)
|
||||
return
|
||||
}
|
205
cmd/internal/logic/artistinfo_artshow.go
Normal file
205
cmd/internal/logic/artistinfo_artshow.go
Normal file
@ -0,0 +1,205 @@
|
||||
// Package logic -----------------------------
|
||||
// @file : artistinfo_artshow.go
|
||||
// @author : JJXu
|
||||
// @contact : wavingbear@163.com
|
||||
// @time : 2023/3/7 15:55
|
||||
// -------------------------------------------
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/fonchain/fonchain-artistinfo/cmd/model"
|
||||
"github.com/fonchain/fonchain-artistinfo/pb/artistinfoArtshow"
|
||||
"github.com/fonchain/fonchain-artistinfo/pb/artwork_query"
|
||||
db "github.com/fonchain/fonchain-artistinfo/pkg/db"
|
||||
"github.com/fonchain/fonchain-artistinfo/pkg/service"
|
||||
"github.com/fonchain/fonchain-artistinfo/pkg/util/stime"
|
||||
"time"
|
||||
)
|
||||
|
||||
type ArtshowLogic struct{}
|
||||
|
||||
func (a ArtshowLogic) GetArtshowHistroyList(request *artistinfoArtshow.GetArtshowHistroyListRequest) (data *artistinfoArtshow.GetArtshowHistroyListResponse, err error) {
|
||||
data = &artistinfoArtshow.GetArtshowHistroyListResponse{}
|
||||
|
||||
//查询数据
|
||||
var (
|
||||
//画家补充信息
|
||||
artistSupplementList = []model.ArtshowArtistSupplement{}
|
||||
//画家指数
|
||||
artistIndexList = []model.ArtshowArtistIndex{}
|
||||
//画展视频资料
|
||||
artshowVideoList = []model.ArtshowVideoRecord{}
|
||||
//画作补充信息基本列表
|
||||
artworBaseList = []model.ArtworkLockRecord{}
|
||||
//画作补充信息列表
|
||||
artworkSupplementList = []*artwork_query.ArtworkPreviewResponse{}
|
||||
)
|
||||
var (
|
||||
//画家补充信息
|
||||
db_artistSupplement = db.DB.Model(&model.ArtshowArtistSupplement{}).Where("status = 3 AND artist_uid = ?", request.ArtistUid).Order("lock_time desc")
|
||||
//画家指数
|
||||
db_artistIndex = db.DB.Model(&model.ArtshowArtistIndex{}).Where("status = 3 AND artist_uid = ?", request.ArtistUid).Order("lock_time desc")
|
||||
//画展视频资料
|
||||
db_artshowVideo = db.DB.Model(&model.ArtshowVideoRecord{}).Where("status = 3 AND artist_uid = ?", request.ArtistUid).Order("lock_time desc")
|
||||
//画作补充信息基本列表
|
||||
db_artworBase = db.DB.Model(&model.ArtworkLockRecord{}).Where("status = 3 AND artist_uid = ?", request.ArtistUid).Order("lock_time desc")
|
||||
)
|
||||
if request.AuditStatus != 0 {
|
||||
db_artistSupplement = db_artistSupplement.Where("audit_status = ?", request.AuditStatus)
|
||||
db_artistIndex = db_artistIndex.Where("audit_status = ?", request.AuditStatus)
|
||||
db_artshowVideo = db_artshowVideo.Where("audit_status = ?", request.AuditStatus)
|
||||
db_artworBase = db_artworBase.Where("supplement_audit_status = ?", request.AuditStatus)
|
||||
}
|
||||
|
||||
err = db_artistSupplement.Find(&artistSupplementList).Error
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
err = db_artistIndex.Find(&artistIndexList).Error
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
err = db_artshowVideo.Find(&artshowVideoList).Error
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
err = db_artworBase.Find(&artworBaseList).Error
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// 查询画作补充信息
|
||||
artworkUidList := []string{}
|
||||
for _, v := range artworBaseList {
|
||||
artworkUidList = append(artworkUidList, v.ArtworkUid)
|
||||
}
|
||||
artworkSupplementRes, err := service.ArtworkQueryImpl.ArtworkPreviewList(context.Background(), &artwork_query.ArtworkPreviewListRequest{
|
||||
Page: 1,
|
||||
PageSize: -1,
|
||||
ArtworkUids: artworkUidList,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
artworkSupplementList = artworkSupplementRes.Data
|
||||
|
||||
// 使用画家补充信息的锁定时间进行分组,然后补充剩余数据
|
||||
var dataGroups = []*artistinfoArtshow.TimeGroup{}
|
||||
var thisTime = ""
|
||||
var thisIndex = -1
|
||||
for count, v := range artistSupplementList {
|
||||
if thisTime == "" || v.LockTime != thisTime {
|
||||
thisTime = v.LockTime
|
||||
thisIndex++
|
||||
}
|
||||
var isAdd = true
|
||||
if request.PageSize > -1 {
|
||||
if int64(count) >= request.PageSize*(request.Page-1) && int64(count) < request.PageSize*request.Page {
|
||||
isAdd = true
|
||||
} else {
|
||||
isAdd = false
|
||||
}
|
||||
}
|
||||
if isAdd {
|
||||
dataGroups = append(dataGroups, &artistinfoArtshow.TimeGroup{
|
||||
Time: thisTime,
|
||||
ArtworkSupplementList: []*artistinfoArtshow.ArtworkSupplementData{},
|
||||
ArtistSupplementList: []*artistinfoArtshow.ArtistSupplementData{},
|
||||
ArtistIndexList: []*artistinfoArtshow.ArtistIndexData{},
|
||||
ArtistVideoList: []*artistinfoArtshow.ArtistVideoData{},
|
||||
})
|
||||
|
||||
dataGroups[thisIndex].ArtistSupplementList = append(dataGroups[thisIndex].ArtistSupplementList, &artistinfoArtshow.ArtistSupplementData{
|
||||
ArtistUid: v.ArtistUid,
|
||||
Status: v.Status,
|
||||
LockTime: v.LockTime,
|
||||
AuditStatus: int64(v.AuditStatus),
|
||||
AuditMark1: v.AuditMark1,
|
||||
AuditMark2: v.AuditMark2,
|
||||
ArtistName: v.ArtistName,
|
||||
ArtistProfile: v.ArtistProfile,
|
||||
CountryArtLevel: v.CountryArtLevel,
|
||||
ArtistCertPic: v.ArtistCertPic,
|
||||
BankNum: v.BankNum,
|
||||
BankName: v.BankName,
|
||||
Id: v.ID,
|
||||
CreatedAt: stime.TimeToString(v.CreatedAt, stime.Format_Normal_YMDhms),
|
||||
UpdatedAt: stime.TimeToString(v.CreatedAt, stime.Format_Normal_YMDhms),
|
||||
DeletedAt: stime.TimeToString(time.Unix(v.CreatedAt.Unix(), 0), stime.Format_Normal_YMDhms),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
for i, group := range dataGroups {
|
||||
//补充画家指数
|
||||
for _, v := range artistIndexList {
|
||||
if v.LockTime == group.Time {
|
||||
dataGroups[i].ArtistIndexList = append(dataGroups[i].ArtistIndexList, &artistinfoArtshow.ArtistIndexData{
|
||||
ArtistUid: v.ArtistUid,
|
||||
Title: v.Title,
|
||||
Class: v.Class,
|
||||
TitleScore: v.TitleScore,
|
||||
Score: v.Score,
|
||||
Types: v.Types,
|
||||
Status: v.Status,
|
||||
LockTime: v.LockTime,
|
||||
AuditMark1: v.AuditMark1,
|
||||
AuditMark2: v.AuditMark2,
|
||||
AuditStatus: int64(v.AuditStatus),
|
||||
Id: v.ID,
|
||||
CreatedAt: stime.TimeToString(v.CreatedAt, stime.Format_Normal_YMDhms),
|
||||
UpdatedAt: stime.TimeToString(v.CreatedAt, stime.Format_Normal_YMDhms),
|
||||
DeletedAt: fmt.Sprintf("%d", v.DeletedAt),
|
||||
})
|
||||
}
|
||||
}
|
||||
//补充视频信息
|
||||
for _, v := range artshowVideoList {
|
||||
if v.LockTime == group.Time {
|
||||
dataGroups[i].ArtistVideoList = append(dataGroups[i].ArtistVideoList, &artistinfoArtshow.ArtistVideoData{
|
||||
Id: v.ID,
|
||||
ArtistUid: v.ArtistUid,
|
||||
LockTime: v.LockTime,
|
||||
VideoUrl: v.VideoUrl,
|
||||
AuditStatus: int64(v.AuditStatus),
|
||||
AuditMark1: v.AuditMark1,
|
||||
AuditMark2: v.AuditMark2,
|
||||
ArtistName: v.ArtistName,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
for _, v := range artworBaseList {
|
||||
if v.LockTime == group.Time {
|
||||
for _, artowrkSupplement := range artworkSupplementList {
|
||||
if v.ArtworkUid == artowrkSupplement.ArtworkUid {
|
||||
dataGroups[i].ArtworkSupplementList = append(dataGroups[i].ArtworkSupplementList, &artistinfoArtshow.ArtworkSupplementData{
|
||||
ArtistUid: v.ArtistUid,
|
||||
Status: v.Status,
|
||||
LockTime: v.LockTime,
|
||||
AuditStatus: int64(v.SupplementAuditStatus),
|
||||
AuditMark1: v.SupplementAuditMark,
|
||||
AuditMark2: v.SupplementAuditMark2,
|
||||
ArtworkName: artowrkSupplement.ArtworkName,
|
||||
CreatedDate: artowrkSupplement.CreateDate,
|
||||
CreatedAddress: artowrkSupplement.CreatedAddress,
|
||||
CreatedAt: stime.TimeToString(v.CreatedAt, stime.Format_Normal_YMDhms),
|
||||
UpdatedAt: stime.TimeToString(v.CreatedAt, stime.Format_Normal_YMDhms),
|
||||
DeletedAt: int64(v.DeletedAt),
|
||||
ArtworkUuid: artowrkSupplement.ArtworkUid,
|
||||
Length: artowrkSupplement.Length,
|
||||
Width: artowrkSupplement.Width,
|
||||
Ruler: artowrkSupplement.Ruler,
|
||||
HdPic: artowrkSupplement.HdPic,
|
||||
ArtistPhoto: artowrkSupplement.ArtistPhoto,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
data.Data = dataGroups
|
||||
fmt.Printf("%+v\n", dataGroups)
|
||||
return
|
||||
}
|
144
cmd/internal/logic/artistinfo_artshowArtistIndex.go
Normal file
144
cmd/internal/logic/artistinfo_artshowArtistIndex.go
Normal file
@ -0,0 +1,144 @@
|
||||
// Package logic -----------------------------
|
||||
// @file : artistinfo_artshowVideo.go
|
||||
// @author : JJXu
|
||||
// @contact : wavingbear@163.com
|
||||
// @time : 2023/3/2 11:51
|
||||
// -------------------------------------------
|
||||
package logic
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/fonchain/fonchain-artistinfo/cmd/internal/dao"
|
||||
"github.com/fonchain/fonchain-artistinfo/cmd/model"
|
||||
"github.com/fonchain/fonchain-artistinfo/pb/artistInfoUser"
|
||||
"github.com/fonchain/fonchain-artistinfo/pb/artistinfoArtshow"
|
||||
"github.com/fonchain/fonchain-artistinfo/pkg/util/stime"
|
||||
"google.golang.org/protobuf/types/known/emptypb"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type ArtshowArtistIndexLogic struct{}
|
||||
|
||||
func (a ArtshowArtistIndexLogic) BatchCreateArtistIndex(request *artistinfoArtshow.BatchCreateArtistIndexRequest) error {
|
||||
var datas = []model.ArtshowArtistIndex{}
|
||||
for _, v := range request.ArtistUids {
|
||||
userInfo, err := NewArtistInfo().FindUser(&artistInfoUser.FindUserRequest{
|
||||
MgmtArtistUid: v,
|
||||
IsArtist: true,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if userInfo.Id == 0 {
|
||||
return errors.New(fmt.Sprintf("用户%s不存在", v))
|
||||
}
|
||||
datas = append(datas,
|
||||
//Status=2(锁定) AuditStatus=5(待补充)
|
||||
model.ArtshowArtistIndex{LockTime: userInfo.LatestLockTime, ArtistUid: v, Class: "exhibition", Title: "艺术家-展览", Types: "2", Status: 2, AuditStatus: 5},
|
||||
model.ArtshowArtistIndex{LockTime: userInfo.LatestLockTime, ArtistUid: v, Class: "seniority", Title: "艺术家-资历", Types: "1", Status: 2, AuditStatus: 5},
|
||||
model.ArtshowArtistIndex{LockTime: userInfo.LatestLockTime, ArtistUid: v, Class: "specialized", Title: "艺术家-专业", Types: "1", Status: 2, AuditStatus: 5},
|
||||
model.ArtshowArtistIndex{LockTime: userInfo.LatestLockTime, ArtistUid: v, Class: "Influence", Title: "艺术家-影响力", Types: "1", Status: 2, AuditStatus: 5},
|
||||
model.ArtshowArtistIndex{LockTime: userInfo.LatestLockTime, ArtistUid: v, Class: "collect", Title: "艺术家-收藏", Types: "1", Status: 2, AuditStatus: 5},
|
||||
)
|
||||
}
|
||||
return dao.ArtistinfoArtshowArtistIndex.BatchCreateData(datas)
|
||||
}
|
||||
|
||||
func (a ArtshowArtistIndexLogic) CreateArtistIndex(request *artistinfoArtshow.ArtistIndexInfo) error {
|
||||
return dao.ArtistinfoArtshowArtistIndex.CreateData(&model.ArtshowArtistIndex{
|
||||
LockTime: request.LockTime,
|
||||
ArtistUid: request.ArtistUid,
|
||||
Class: request.Class,
|
||||
Title: request.Title,
|
||||
Types: request.Types,
|
||||
Status: 2,
|
||||
})
|
||||
}
|
||||
func (a ArtshowArtistIndexLogic) GetArtistIndexDetail(request *artistinfoArtshow.GetArtistIndexDetailRequest) (rep *artistinfoArtshow.ArtistIndexInfo, err error) {
|
||||
data, err := dao.ArtistinfoArtshowArtistIndex.GetData(request.Id)
|
||||
if err != nil {
|
||||
if gorm.ErrRecordNotFound == err {
|
||||
err = errors.New("找不到数据")
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
rep = &artistinfoArtshow.ArtistIndexInfo{
|
||||
ArtistUid: data.ArtistUid,
|
||||
Title: data.Title,
|
||||
Class: data.Class,
|
||||
TitleScore: data.TitleScore,
|
||||
Score: data.Score,
|
||||
Types: data.Types,
|
||||
Status: data.Status,
|
||||
LockTime: data.LockTime,
|
||||
AuditMark1: data.AuditMark1,
|
||||
AuditMark2: data.AuditMark2,
|
||||
AuditStatus: int64(data.AuditStatus),
|
||||
Id: data.ID,
|
||||
CreatedAt: stime.TimeToString(data.CreatedAt, stime.Format_Normal_YMDhms),
|
||||
UpdatedAt: stime.TimeToString(data.UpdatedAt, stime.Format_Normal_YMDhms),
|
||||
DeletedAt: int64(data.DeletedAt),
|
||||
Editable: data.Editable(),
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (a ArtshowArtistIndexLogic) GetArtistIndexList(request *artistinfoArtshow.GetArtistIndexListRequest) (res *artistinfoArtshow.GetArtistIndexListResponse, err error) {
|
||||
res = &artistinfoArtshow.GetArtistIndexListResponse{}
|
||||
datas, total, err := dao.ArtistinfoArtshowArtistIndex.GetDataList(request)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
res.Page = &artistinfoArtshow.VideoPagination{
|
||||
Page: request.Page,
|
||||
PageSize: request.PageSize,
|
||||
Total: total,
|
||||
}
|
||||
for _, v := range datas {
|
||||
res.Data = append(res.Data, &artistinfoArtshow.ArtistIndexInfo{
|
||||
ArtistUid: v.ArtistUid,
|
||||
Title: v.Title,
|
||||
Class: v.Class,
|
||||
TitleScore: v.TitleScore,
|
||||
Score: v.Score,
|
||||
Types: v.Types,
|
||||
Status: v.Status,
|
||||
LockTime: v.LockTime,
|
||||
AuditMark1: v.AuditMark1,
|
||||
AuditMark2: v.AuditMark2,
|
||||
AuditStatus: int64(v.AuditStatus),
|
||||
Id: v.ID,
|
||||
CreatedAt: stime.TimeToString(v.CreatedAt, stime.Format_Normal_YMDhms),
|
||||
UpdatedAt: stime.TimeToString(v.UpdatedAt, stime.Format_Normal_YMDhms),
|
||||
DeletedAt: int64(v.DeletedAt),
|
||||
})
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (a ArtshowArtistIndexLogic) AuditArtistIndex(request *artistinfoArtshow.AuditArtistIndexRequest) (*emptypb.Empty, error) {
|
||||
err := dao.ArtistinfoArtshowArtistIndex.Audit(model.AuditStatus(request.AuditStatus), request.AuditMark1, request.AuditMark2, request.ArtistIndexIds...)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
func (a ArtshowArtistIndexLogic) UpdateArtistIndex(request *artistinfoArtshow.UpdateArtistIndexRequest) (*emptypb.Empty, error) {
|
||||
err := dao.ArtistinfoArtshowArtistIndex.UpdateData(&model.ArtshowArtistIndex{
|
||||
Model: model.Model{ID: request.Id},
|
||||
TitleScore: request.TitleScore,
|
||||
Score: request.Score,
|
||||
AuditStatus: model.AuditType_Pending,
|
||||
})
|
||||
return nil, err
|
||||
}
|
||||
|
||||
func (a ArtshowArtistIndexLogic) DeletedArtistIndex(request *artistinfoArtshow.DeletedArtistIndexRequest) (*emptypb.Empty, error) {
|
||||
var ids = []int64{}
|
||||
if request.Id != 0 {
|
||||
ids = append(ids, request.Id)
|
||||
} else if len(request.Ids) > 0 {
|
||||
ids = append(ids, request.Ids...)
|
||||
}
|
||||
err := dao.ArtistinfoArtshowArtistIndex.DeletedData(ids...)
|
||||
return nil, err
|
||||
}
|
148
cmd/internal/logic/artistinfo_artshowArtistSupplement.go
Normal file
148
cmd/internal/logic/artistinfo_artshowArtistSupplement.go
Normal file
@ -0,0 +1,148 @@
|
||||
// Package logic -----------------------------
|
||||
// @file : artistinfo_artshowVideo.go
|
||||
// @author : JJXu
|
||||
// @contact : wavingbear@163.com
|
||||
// @time : 2023/3/2 11:51
|
||||
// -------------------------------------------
|
||||
package logic
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/fonchain/fonchain-artistinfo/cmd/internal/dao"
|
||||
"github.com/fonchain/fonchain-artistinfo/cmd/model"
|
||||
"github.com/fonchain/fonchain-artistinfo/pb/artistInfoUser"
|
||||
"github.com/fonchain/fonchain-artistinfo/pb/artistinfoArtshow"
|
||||
"github.com/fonchain/fonchain-artistinfo/pkg/util/stime"
|
||||
"google.golang.org/protobuf/types/known/emptypb"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type ArtshowArtistSupplementLogic struct{}
|
||||
|
||||
func (a ArtshowArtistSupplementLogic) BatchCreateSupplement(request *artistinfoArtshow.BatchCreateArtistSupplementRequest) error {
|
||||
var datas = []model.ArtshowArtistSupplement{}
|
||||
for _, v := range request.ArtistUids {
|
||||
userInfo, err := NewArtistInfo().FindUser(&artistInfoUser.FindUserRequest{
|
||||
MgmtArtistUid: v,
|
||||
IsArtist: true,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if userInfo.Id == 0 {
|
||||
return errors.New(fmt.Sprintf("用户%s不存在", v))
|
||||
}
|
||||
datas = append(datas,
|
||||
model.ArtshowArtistSupplement{LockTime: userInfo.LatestLockTime, ArtistUid: v, ArtistName: userInfo.RealName.Name, Status: 2, AuditStatus: 5},
|
||||
)
|
||||
}
|
||||
return dao.ArtistSupplement.BatchCreateData(datas)
|
||||
}
|
||||
|
||||
func (a ArtshowArtistSupplementLogic) CreateSupplement(request *artistinfoArtshow.ArtistSupplementInfo) error {
|
||||
return dao.ArtistSupplement.CreateData(&model.ArtshowArtistSupplement{
|
||||
ArtistUid: request.ArtistUid,
|
||||
Status: 2, //锁定
|
||||
AuditStatus: 5, //待补充
|
||||
LockTime: request.LockTime,
|
||||
ArtistName: request.ArtistName,
|
||||
ArtistProfile: request.ArtistProfile,
|
||||
CountryArtLevel: request.CountryArtLevel,
|
||||
ArtistCertPic: request.ArtistCertPic,
|
||||
BankNum: request.BankNum,
|
||||
BankName: request.BankName,
|
||||
})
|
||||
}
|
||||
func (a ArtshowArtistSupplementLogic) GetSupplementDetail(request *artistinfoArtshow.GetArtistSupplementDetailRequest) (rep *artistinfoArtshow.ArtistSupplementInfo, err error) {
|
||||
data, err := dao.ArtistSupplement.GetData(request.Id)
|
||||
if err != nil {
|
||||
if gorm.ErrRecordNotFound == err {
|
||||
err = errors.New("找不到数据")
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
rep = &artistinfoArtshow.ArtistSupplementInfo{
|
||||
ArtistUid: data.ArtistUid,
|
||||
Status: data.Status,
|
||||
LockTime: data.LockTime,
|
||||
AuditStatus: int64(data.AuditStatus),
|
||||
AuditMark1: data.AuditMark1,
|
||||
AuditMark2: data.AuditMark2,
|
||||
ArtistName: data.ArtistName,
|
||||
ArtistProfile: data.ArtistProfile,
|
||||
CountryArtLevel: data.CountryArtLevel,
|
||||
ArtistCertPic: data.ArtistCertPic,
|
||||
BankNum: data.BankNum,
|
||||
BankName: data.BankName,
|
||||
Id: data.ID,
|
||||
CreatedAt: stime.TimeToString(data.CreatedAt, stime.Format_Normal_YMDhms),
|
||||
UpdatedAt: stime.TimeToString(data.UpdatedAt, stime.Format_Normal_YMDhms),
|
||||
DeletedAt: int64(data.DeletedAt),
|
||||
Editable: data.Editable(),
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (a ArtshowArtistSupplementLogic) GetSupplementList(request *artistinfoArtshow.GetArtistSupplementListRequest) (res *artistinfoArtshow.GetArtistSupplementListResponse, err error) {
|
||||
res = &artistinfoArtshow.GetArtistSupplementListResponse{}
|
||||
datas, total, err := dao.ArtistSupplement.GetDataList(request)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
res.Page = &artistinfoArtshow.VideoPagination{
|
||||
Page: request.Page,
|
||||
PageSize: request.PageSize,
|
||||
Total: total,
|
||||
}
|
||||
for _, v := range datas {
|
||||
res.Data = append(res.Data, &artistinfoArtshow.ArtistSupplementInfo{
|
||||
ArtistUid: v.ArtistUid,
|
||||
ArtistName: v.ArtistName,
|
||||
ArtistProfile: v.ArtistProfile,
|
||||
CountryArtLevel: v.CountryArtLevel,
|
||||
ArtistCertPic: v.ArtistCertPic,
|
||||
BankNum: v.BankNum,
|
||||
BankName: v.BankName,
|
||||
Status: v.Status,
|
||||
LockTime: v.LockTime,
|
||||
AuditMark1: v.AuditMark1,
|
||||
AuditMark2: v.AuditMark2,
|
||||
AuditStatus: int64(v.AuditStatus),
|
||||
Id: v.ID,
|
||||
CreatedAt: stime.TimeToString(v.CreatedAt, stime.Format_Normal_YMDhms),
|
||||
UpdatedAt: stime.TimeToString(v.UpdatedAt, stime.Format_Normal_YMDhms),
|
||||
DeletedAt: int64(v.DeletedAt),
|
||||
})
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (a ArtshowArtistSupplementLogic) AuditSupplement(request *artistinfoArtshow.AuditArtistSupplementRequest) (*emptypb.Empty, error) {
|
||||
err := dao.ArtistSupplement.Audit(model.AuditStatus(request.AuditStatus), request.AuditMark1, request.AuditMark2, request.ArtistSupplementIds...)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
func (a ArtshowArtistSupplementLogic) UpdateSupplement(request *artistinfoArtshow.UpdateArtistSupplementRequest) (*emptypb.Empty, error) {
|
||||
err := dao.ArtistSupplement.UpdateData(&model.ArtshowArtistSupplement{
|
||||
Model: model.Model{ID: request.Id},
|
||||
ArtistProfile: request.ArtistProfile,
|
||||
CountryArtLevel: request.CountryArtLevel,
|
||||
ArtistCertPic: request.ArtistCertPic,
|
||||
BankNum: request.BankNum,
|
||||
BankName: request.BankName,
|
||||
AuditStatus: model.AuditType_Pending,
|
||||
})
|
||||
return nil, err
|
||||
}
|
||||
|
||||
func (a ArtshowArtistSupplementLogic) DeletedSupplement(request *artistinfoArtshow.DeletedArtistSupplementRequest) (*emptypb.Empty, error) {
|
||||
var ids = []int64{}
|
||||
if request.Id != 0 {
|
||||
ids = append(ids, request.Id)
|
||||
} else if len(request.Ids) > 0 {
|
||||
ids = append(ids, request.Ids...)
|
||||
}
|
||||
err := dao.ArtistSupplement.DeletedData(ids...)
|
||||
return nil, err
|
||||
}
|
134
cmd/internal/logic/artistinfo_artshowVideo.go
Normal file
134
cmd/internal/logic/artistinfo_artshowVideo.go
Normal file
@ -0,0 +1,134 @@
|
||||
// Package logic -----------------------------
|
||||
// @file : artistinfo_artshowVideo.go
|
||||
// @author : JJXu
|
||||
// @contact : wavingbear@163.com
|
||||
// @time : 2023/3/2 11:51
|
||||
// -------------------------------------------
|
||||
package logic
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/fonchain/fonchain-artistinfo/cmd/internal/dao"
|
||||
"github.com/fonchain/fonchain-artistinfo/cmd/model"
|
||||
"github.com/fonchain/fonchain-artistinfo/pb/artistinfoArtshow"
|
||||
"github.com/fonchain/fonchain-artistinfo/pkg/util/stime"
|
||||
"google.golang.org/protobuf/types/known/emptypb"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type ArtshowVideoLogic struct{}
|
||||
|
||||
func (a ArtshowVideoLogic) BatchCreateArtshowVideo(request *artistinfoArtshow.BatchCreateArtshowVideoRequest) error {
|
||||
var datas = []model.ArtshowVideoRecord{}
|
||||
for _, v := range request.Data {
|
||||
datas = append(datas, model.ArtshowVideoRecord{
|
||||
ArtistUid: v.ArtistUid,
|
||||
LockTime: v.LockTime,
|
||||
ArtistName: v.ArtistName,
|
||||
VideoUrl: v.VideoUrl,
|
||||
AuditStatus: model.AuditStatus(v.AuditStatus),
|
||||
AuditMark1: v.AuditMark1,
|
||||
AuditMark2: v.AuditMark2,
|
||||
Status: v.Status,
|
||||
})
|
||||
}
|
||||
return dao.ArtistinfoArtshowVideo.BatchCreateData(datas)
|
||||
}
|
||||
func (a ArtshowVideoLogic) CreateArtshowVideo(request *artistinfoArtshow.ArtshowVideoInfo) error {
|
||||
return dao.ArtistinfoArtshowVideo.CreateData(&model.ArtshowVideoRecord{
|
||||
ArtistUid: request.ArtistUid,
|
||||
LockTime: request.LockTime,
|
||||
ArtistName: request.ArtistName,
|
||||
VideoUrl: request.VideoUrl,
|
||||
AuditStatus: model.AuditStatus(request.AuditStatus),
|
||||
AuditMark1: request.AuditMark1,
|
||||
AuditMark2: request.AuditMark2,
|
||||
Status: request.Status,
|
||||
})
|
||||
}
|
||||
func (a ArtshowVideoLogic) GetArtshowVideoDetail(request *artistinfoArtshow.GetArtshowVideoDetailRequest) (rep *artistinfoArtshow.ArtshowVideoInfo, err error) {
|
||||
data, err := dao.ArtistinfoArtshowVideo.GetArtshowVideoDetail(request)
|
||||
if err != nil {
|
||||
if gorm.ErrRecordNotFound == err {
|
||||
err = errors.New("找不到数据")
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
rep = &artistinfoArtshow.ArtshowVideoInfo{
|
||||
Id: data.ID,
|
||||
ArtistUid: data.ArtistUid,
|
||||
LockTime: data.LockTime,
|
||||
VideoUrl: data.VideoUrl,
|
||||
AuditStatus: int64(data.AuditStatus),
|
||||
AuditMark1: data.AuditMark1,
|
||||
AuditMark2: data.AuditMark2,
|
||||
CreatedAt: stime.TimeToString(data.CreatedAt, stime.Format_Normal_YMDhms),
|
||||
UpdatedAt: stime.TimeToString(data.UpdatedAt, stime.Format_Normal_YMDhms),
|
||||
DeletedAt: int64(data.DeletedAt),
|
||||
ArtistName: data.ArtistName,
|
||||
Status: data.Status,
|
||||
Editable: data.Editable(),
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (a ArtshowVideoLogic) GetArtshowVideoList(request *artistinfoArtshow.GetArtshowVideoListRequst) (res *artistinfoArtshow.GetArtshowVideoListResponse, err error) {
|
||||
res = &artistinfoArtshow.GetArtshowVideoListResponse{}
|
||||
datas, total, err := dao.ArtistinfoArtshowVideo.GetDataList(request)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
res.Page = &artistinfoArtshow.VideoPagination{
|
||||
Page: request.Page,
|
||||
PageSize: request.PageSize,
|
||||
Total: total,
|
||||
}
|
||||
for _, v := range datas {
|
||||
res.Data = append(res.Data, &artistinfoArtshow.ArtshowVideoInfo{
|
||||
Id: v.ID,
|
||||
ArtistUid: v.ArtistUid,
|
||||
LockTime: v.LockTime,
|
||||
VideoUrl: v.VideoUrl,
|
||||
AuditStatus: int64(v.AuditStatus),
|
||||
AuditMark1: v.AuditMark1,
|
||||
AuditMark2: v.AuditMark2,
|
||||
CreatedAt: stime.TimeToString(v.CreatedAt, stime.Format_Normal_YMDhms),
|
||||
UpdatedAt: stime.TimeToString(v.UpdatedAt, stime.Format_Normal_YMDhms),
|
||||
DeletedAt: int64(v.DeletedAt),
|
||||
Status: v.Status,
|
||||
ArtistName: v.ArtistName,
|
||||
})
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (a ArtshowVideoLogic) AuditArtshowVideo(request *artistinfoArtshow.AuditArtshowVideoRequest) (*emptypb.Empty, error) {
|
||||
err := dao.ArtistinfoArtshowVideo.Audit(model.AuditStatus(request.AuditStatus), request.AuditMark1, request.AuditMark2, request.ArtshowVideoIds...)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
func (a ArtshowVideoLogic) UpdateArtshowVideo(request *artistinfoArtshow.UpdateArtshowVideoRequest) (*emptypb.Empty, error) {
|
||||
err := dao.ArtistinfoArtshowVideo.UpdateData(&model.ArtshowVideoRecord{
|
||||
Model: model.Model{ID: request.Id},
|
||||
ArtistUid: request.ArtistUid,
|
||||
LockTime: request.LockTime,
|
||||
ArtistName: request.ArtistName,
|
||||
VideoUrl: request.VideoUrl,
|
||||
AuditStatus: model.AuditStatus(request.AuditStatus),
|
||||
AuditMark1: request.AuditMark1,
|
||||
AuditMark2: request.AuditMark2,
|
||||
})
|
||||
return nil, err
|
||||
}
|
||||
|
||||
func (a ArtshowVideoLogic) DeletedArtshowVideo(request *artistinfoArtshow.DeletedArtshowVideoRequest) (*emptypb.Empty, error) {
|
||||
var ids = []int64{}
|
||||
if request.Id != 0 {
|
||||
ids = append(ids, request.Id)
|
||||
} else if len(request.Ids) > 0 {
|
||||
ids = append(ids, request.Ids...)
|
||||
}
|
||||
err := dao.ArtistinfoArtshowVideo.DeletedData(ids...)
|
||||
return nil, err
|
||||
}
|
297
cmd/internal/logic/artistinfo_artwork.go
Normal file
297
cmd/internal/logic/artistinfo_artwork.go
Normal file
@ -0,0 +1,297 @@
|
||||
// Package logic -----------------------------
|
||||
// @file : artistinfo_artwork.go
|
||||
// @author : JJXu
|
||||
// @contact : wavingbear@163.com
|
||||
// @time : 2023/2/24 22:26
|
||||
// -------------------------------------------
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/fonchain/fonchain-artistinfo/cmd/internal/dao"
|
||||
"github.com/fonchain/fonchain-artistinfo/cmd/model"
|
||||
"github.com/fonchain/fonchain-artistinfo/pb/artist"
|
||||
"github.com/fonchain/fonchain-artistinfo/pb/artistInfoArtwork"
|
||||
"github.com/fonchain/fonchain-artistinfo/pb/artistInfoUser"
|
||||
"github.com/fonchain/fonchain-artistinfo/pb/artwork_query"
|
||||
"github.com/fonchain/fonchain-artistinfo/pkg/m"
|
||||
"github.com/fonchain/fonchain-artistinfo/pkg/service"
|
||||
"github.com/fonchain/fonchain-artistinfo/pkg/util/stime"
|
||||
"google.golang.org/protobuf/types/known/emptypb"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type IArtistInfoArtwork interface {
|
||||
GetArtworkLockDetail(request *artistInfoArtwork.GetArtworkLockDetailRequest) (res *artistInfoArtwork.ArtistLockInfo, err error)
|
||||
CreateArtworkLockRecord(req *artistInfoArtwork.CreateArtworkLockRecordReq) (res *artistInfoArtwork.ArtworkCommonNoParams, err error)
|
||||
ArtworkLockAction(req *artistInfoArtwork.ArtworkLockActionRequest) (res *artistInfoArtwork.ArtworkCommonNoParams, err error)
|
||||
GetArtworkLockRecords(req *artistInfoArtwork.GetArtworkLockRecordsRequest) (res *artistInfoArtwork.ArtworkLockList, err error)
|
||||
GetArtworkLockHistoryGroup(request *artistInfoArtwork.GetArtworkLockHistoryRequest) (res *artistInfoArtwork.GetArtworkLockHistoryResponse, err error)
|
||||
DeleteArtworkRecord(req *artistInfoArtwork.DeleteArtworkRecordRequest) (res *artistInfoArtwork.ArtworkCommonNoParams, err error)
|
||||
}
|
||||
|
||||
var _ IArtistInfoArtwork = new(ArtistInfoArtworkLogic)
|
||||
|
||||
type ArtistInfoArtworkLogic struct{}
|
||||
|
||||
func (a ArtistInfoArtworkLogic) GetArtworkLockDetail(request *artistInfoArtwork.GetArtworkLockDetailRequest) (res *artistInfoArtwork.ArtistLockInfo, err error) {
|
||||
data, err := dao.GetArtworkLockDetail(request.ArtworkUid)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
res = &artistInfoArtwork.ArtistLockInfo{
|
||||
ArtistUid: data.ArtistUid,
|
||||
ArtworkUid: data.ArtworkUid,
|
||||
Status: data.Status,
|
||||
LockTime: data.LockTime,
|
||||
CreatedAt: data.CreatedAt.Unix(),
|
||||
UpdatedAt: data.UpdatedAt.Unix(),
|
||||
DeletedAt: int64(data.DeletedAt),
|
||||
BaseAuditStatus: int32(data.BaseAuditStatus),
|
||||
BaseAuditMark: data.BaseAuditMark,
|
||||
BaseAuditMark2: data.BaseAuditMark2,
|
||||
SupplementAuditStatus: int32(data.SupplementAuditStatus),
|
||||
SupplementAuditMark: data.SupplementAuditMark,
|
||||
SupplementAuditMark2: data.SupplementAuditMark2,
|
||||
AuditFlowIndex: int32(data.AuditFlowIndex),
|
||||
BaseEditable: data.BaseEditable(),
|
||||
SupplementEditable: data.SupplementEditable(),
|
||||
}
|
||||
return
|
||||
}
|
||||
func (ArtistInfoArtworkLogic) CreateArtworkLockRecord(req *artistInfoArtwork.CreateArtworkLockRecordReq) (res *artistInfoArtwork.ArtworkCommonNoParams, err error) {
|
||||
err = dao.CreateArtworkLockRecord(&model.ArtworkLockRecord{
|
||||
ArtistUid: req.ArtistUid,
|
||||
ArtworkUid: req.ArtworkUid,
|
||||
Status: req.Status,
|
||||
LockTime: req.LockTime,
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (ArtistInfoArtworkLogic) ArtworkLockAction(req *artistInfoArtwork.ArtworkLockActionRequest) (res *artistInfoArtwork.ArtworkCommonNoParams, err error) {
|
||||
switch req.Lock {
|
||||
case 2:
|
||||
err = dao.BatchLockArtworks(req.ArtistUid, req.LockTime)
|
||||
case 3:
|
||||
err = dao.BatchUnlockArtworks(req.ArtistUid)
|
||||
default:
|
||||
err = errors.New("lock值错误")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (ArtistInfoArtworkLogic) GetArtworkLockRecords(req *artistInfoArtwork.GetArtworkLockRecordsRequest) (res *artistInfoArtwork.ArtworkLockList, err error) {
|
||||
res = &artistInfoArtwork.ArtworkLockList{}
|
||||
res, err = dao.GetArtworkLockRecords(req)
|
||||
return
|
||||
}
|
||||
|
||||
func (a ArtistInfoArtworkLogic) GetArtworkLockHistoryGroup(request *artistInfoArtwork.GetArtworkLockHistoryRequest) (res *artistInfoArtwork.GetArtworkLockHistoryResponse, err error) {
|
||||
// 查询解锁的画作
|
||||
unlockArtworkList, err := dao.GetArtworkLockRecords(&artistInfoArtwork.GetArtworkLockRecordsRequest{
|
||||
ArtistUid: request.ArtistUid,
|
||||
QueryType: artistInfoArtwork.ArtworkQueryMode_AllUnlockArtwork,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if len(unlockArtworkList.Data) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
res = &artistInfoArtwork.GetArtworkLockHistoryResponse{}
|
||||
var artworkUidList []string
|
||||
for _, v := range unlockArtworkList.Data {
|
||||
artworkUidList = append(artworkUidList, v.ArtworkUid)
|
||||
}
|
||||
fmt.Println("artworkUidList", artworkUidList)
|
||||
//查询画作预览列表
|
||||
previewListRes, err := service.ArtworkQueryImpl.ArtworkPreviewList(context.Background(), &artwork_query.ArtworkPreviewListRequest{
|
||||
Page: 1,
|
||||
PageSize: -1,
|
||||
ArtworkUids: artworkUidList,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
fmt.Println("previewListRes count", len(previewListRes.Data))
|
||||
var thisLockTime = ""
|
||||
var groupIndex = -1
|
||||
for _, v := range unlockArtworkList.Data {
|
||||
var newGroup bool
|
||||
if thisLockTime != v.LockTime {
|
||||
thisLockTime = v.LockTime
|
||||
newGroup = true
|
||||
groupIndex++
|
||||
} else {
|
||||
continue
|
||||
}
|
||||
if newGroup {
|
||||
res.GroupList = append(res.GroupList, &artistInfoArtwork.ArtworkLockRecord{
|
||||
LockGroup: v.LockTime,
|
||||
DataList: []*artistInfoArtwork.ArtworkPreviewInfo{},
|
||||
})
|
||||
}
|
||||
for _, artwork := range previewListRes.Data {
|
||||
res.GroupList[groupIndex].DataList = append(res.GroupList[groupIndex].DataList, &artistInfoArtwork.ArtworkPreviewInfo{
|
||||
ArtistUuid: artwork.ArtistUuid,
|
||||
ArtworkName: artwork.ArtworkName,
|
||||
Length: artwork.Length,
|
||||
Width: artwork.Width,
|
||||
Ruler: artwork.Ruler,
|
||||
CreatedAddress: strings.Split(artwork.CreatedAddress, ","),
|
||||
ArtistPhoto: artwork.ArtistPhoto,
|
||||
HdPic: artwork.HdPic,
|
||||
ArtworkUid: artwork.ArtworkUid,
|
||||
CreatedDate: artwork.CreateDate,
|
||||
LockStatus: int32(v.Status),
|
||||
BaseAuditStatus: v.BaseAuditStatus,
|
||||
BaseAuditMark: v.BaseAuditMark,
|
||||
BaseAuditMark2: v.BaseAuditMark2,
|
||||
SupplementAuditStatus: v.SupplementAuditStatus,
|
||||
SupplementAuditMark: v.SupplementAuditMark,
|
||||
SupplementAuditMark2: v.SupplementAuditMark2,
|
||||
AuditFlowIndex: v.AuditFlowIndex,
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
DeletedAt: v.DeletedAt,
|
||||
})
|
||||
}
|
||||
}
|
||||
fmt.Println("previewListRes count", len(previewListRes.Data))
|
||||
return
|
||||
}
|
||||
|
||||
func (ArtistInfoArtworkLogic) DeleteArtworkRecord(req *artistInfoArtwork.DeleteArtworkRecordRequest) (res *artistInfoArtwork.ArtworkCommonNoParams, err error) {
|
||||
//检查画作锁定情况
|
||||
for _, v := range req.ArtworkUids {
|
||||
if dao.HasBeenLocked(v) {
|
||||
return nil, errors.New(m.ERROR_ISLOCK)
|
||||
}
|
||||
}
|
||||
err = dao.DeletedArtworkLockRecord(req.ArtworkUids...)
|
||||
return
|
||||
}
|
||||
|
||||
func (a ArtistInfoArtworkLogic) UpdateArtworkAuditStatus(request *artistInfoArtwork.UpdateArtworkAuditStatusRequest) (res *artistInfoArtwork.ArtworkCommonNoParams, err error) {
|
||||
if request.ArtworkUid != "" {
|
||||
err = dao.UpdateAuditStatus(request.ArtworkUid, request.AuditStatus, request.AuditMark, request.AuditMark2, request.FlowIndex)
|
||||
|
||||
} else if request.ArtworkUids != nil && len(request.ArtworkUids) > 0 {
|
||||
err = dao.BatchUpdateAuditStatus(request.ArtworkUids, request.AuditStatus, request.AuditMark, request.AuditMark2, request.FlowIndex)
|
||||
} else {
|
||||
return nil, errors.New("画作uid不能为空")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// CheckArtworkEditable 检查画作的可编辑状态
|
||||
// followIndex 2:基本信息审核 3补充信息审核
|
||||
func (a ArtistInfoArtworkLogic) CheckArtworkEditable(request *artistInfoArtwork.ArtworkUidRequest, followIndex int) (res *artistInfoArtwork.CheckArtworkEditableResponse, err error) {
|
||||
res = &artistInfoArtwork.CheckArtworkEditableResponse{}
|
||||
lockDetail, err := dao.GetArtworkLockDetail(request.ArtworkUid)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if followIndex == 2 {
|
||||
res.Editable = lockDetail.BaseEditable()
|
||||
} else if followIndex == 3 {
|
||||
res.Editable = lockDetail.SupplementEditable()
|
||||
}
|
||||
return
|
||||
}
|
||||
func (a ArtistInfoArtworkLogic) GenerateArtworkSupplementInfo(request *artistInfoArtwork.ArtworkUidsRequest) (*emptypb.Empty, error) {
|
||||
//更新画作流程
|
||||
err := dao.GenerateArtworkSupplementInfo(request.ArtworkUids)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
func (a ArtistInfoArtworkLogic) ArtworkStatic(request *artistInfoArtwork.ArtistArtworkStaticRequest) (res *artistInfoArtwork.ArtistArtworkStaticResponse, err error) {
|
||||
//查询画家宝中认证成功的用户
|
||||
userList, _, err := dao.GetViewUserList(&artistInfoUser.FindUsersRequest{
|
||||
ArtistRealName: request.ArtistKeyWords,
|
||||
Page: int32(request.Page),
|
||||
PageSize: int32(request.PageSize),
|
||||
IsArtist: true,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if userList == nil || len(userList) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
var artistUids []string
|
||||
for _, v := range userList {
|
||||
artistUids = append(artistUids, v.ArtistUid)
|
||||
}
|
||||
//查询对应的画家信息
|
||||
var gender int32 = -1
|
||||
if request.ArtistGender == 1 {
|
||||
gender = 0
|
||||
} else if request.ArtistGender == 2 {
|
||||
gender = 1
|
||||
}
|
||||
//查询匹配的画家数据列表
|
||||
artistList, err := service.GrpcArtistImpl.ArtistList(context.Background(), &artist.ArtistListRequest{
|
||||
Keyword: request.ArtistKeyWords,
|
||||
Page: 1,
|
||||
PageSize: -1,
|
||||
Gender: gender,
|
||||
Uids: artistUids,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
fmt.Println("\n artistUids:", artistUids, "\n")
|
||||
fmt.Printf("\n\n artistList.Data: %+v\n\n", artistList.Data)
|
||||
|
||||
//查询这些画家审核通过的画作数据统计
|
||||
res = &artistInfoArtwork.ArtistArtworkStaticResponse{
|
||||
Page: int64(artistList.Count),
|
||||
PageSize: int64(artistList.Page),
|
||||
Total: request.PageSize,
|
||||
}
|
||||
viewDatas, err := dao.PassedArtworkStatic(request, artistUids)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for i, v := range viewDatas {
|
||||
var (
|
||||
penName string
|
||||
stageName string
|
||||
artworkTotal int64
|
||||
rulerTotal int64
|
||||
passedRulerTotal int64
|
||||
passedArtworkTotal int64
|
||||
)
|
||||
//统计画家素有画作的总数和总平尺数
|
||||
artworkTotal, rulerTotal = dao.CountAllArtworkTotal(v.ArtistUid)
|
||||
//统计审核通过的画作总数和平尺总数
|
||||
passedArtworkTotal, passedRulerTotal = dao.CountArtworkTotalWhichAuditPassed(v.ArtistUid)
|
||||
//补充画家信息
|
||||
for _, artistData := range artistList.Data {
|
||||
if artistData.Uid == v.ArtistUid {
|
||||
penName = artistData.PenName
|
||||
stageName = artistData.StageName
|
||||
}
|
||||
}
|
||||
//补充画作信息
|
||||
res.Data = append(res.Data, &artistInfoArtwork.ArtistArtworkStaticStaticData{
|
||||
Idx: int64(i + 1),
|
||||
IsLock: v.IsLock,
|
||||
ArtistUid: v.ArtistUid,
|
||||
LatestLockTime: v.LatestLockTime,
|
||||
LatestUpdatedAt: stime.TimeToString(v.LatestUpdatedAt, stime.Format_Normal_YMDhms),
|
||||
RealName: v.RealName,
|
||||
PenName: penName,
|
||||
StageName: stageName,
|
||||
ArtworkTotal: artworkTotal,
|
||||
RulerTotal: rulerTotal,
|
||||
PassedRulerTotal: passedRulerTotal,
|
||||
PassedArtworkTotal: passedArtworkTotal,
|
||||
})
|
||||
}
|
||||
return
|
||||
}
|
95
cmd/internal/logic/artistinfo_statement.go
Normal file
95
cmd/internal/logic/artistinfo_statement.go
Normal file
@ -0,0 +1,95 @@
|
||||
package logic
|
||||
|
||||
// import (
|
||||
// "github.com/fonchain/fonchain-artistinfo/cmd/internal/dao"
|
||||
// "github.com/fonchain/fonchain-artistinfo/pb/artistinfoStatement"
|
||||
// "github.com/fonchain/fonchain-artistinfo/pkg/util/stime"
|
||||
// "google.golang.org/protobuf/types/known/emptypb"
|
||||
// )
|
||||
|
||||
// type StatementServerLogic struct{}
|
||||
|
||||
// func (s *StatementServerLogic) CreateStatementBatch(in *artistinfoStatement.StatementBatchRequest) (res *artistinfoStatement.CreateStatementBatchResponse, err error) {
|
||||
// res = &artistinfoStatement.CreateStatementBatchResponse{}
|
||||
// data, err := dao.CreateStatementBatch(in)
|
||||
// res.Id = data.ID
|
||||
// return
|
||||
// }
|
||||
|
||||
// func (s *StatementServerLogic) BatchCreateStatementBatch(in *artistinfoStatement.BatchCreateStatementBatchRequest) (*emptypb.Empty, error) {
|
||||
// return nil, dao.BatchCreateStatementBatch(in)
|
||||
// }
|
||||
|
||||
// func (s *StatementServerLogic) GetStatementBatchList(in *artistinfoStatement.GetStatementBatchListRequest) (res *artistinfoStatement.GetStatementBatchListResponse, err error) {
|
||||
// datas, total, err := dao.GetStatementBatchList(in)
|
||||
|
||||
// res = &artistinfoStatement.GetStatementBatchListResponse{
|
||||
// Page: &artistinfoStatement.StatementPageInfo{
|
||||
// Page: in.Page,
|
||||
// PageSize: in.PageSize,
|
||||
// Total: total,
|
||||
// },
|
||||
// Data: []*artistinfoStatement.StatementBatchRequest{},
|
||||
// }
|
||||
// for _, v := range datas {
|
||||
// res.Data = append(res.Data, &artistinfoStatement.StatementBatchRequest{
|
||||
// StType: v.StType,
|
||||
// ArtistUid: v.ArtistUid,
|
||||
// ArtistRealName: v.ArtistRealName,
|
||||
// FlowStatus: v.FlowStatus,
|
||||
// BatchTime: v.BatchTime,
|
||||
// MinPrice: v.MinPrice,
|
||||
// GuaranteePrice: v.GuaranteePrice,
|
||||
// Id: v.ID,
|
||||
// CreatedAt: stime.TimeToString(v.CreatedAt, stime.Format_Normal_YMDhms),
|
||||
// UpdatedAt: stime.TimeToString(v.UpdatedAt, stime.Format_Normal_YMDhms),
|
||||
// DeletedAt: int64(v.DeletedAt),
|
||||
// FileUrl: v.FileUrl,
|
||||
// })
|
||||
// }
|
||||
// return
|
||||
// }
|
||||
|
||||
// func (s *StatementServerLogic) CreateStatementDetail(in *artistinfoStatement.StatementDetailRequest) (res *artistinfoStatement.CreateStatementDetailResponse, err error) {
|
||||
// res = &artistinfoStatement.CreateStatementDetailResponse{}
|
||||
// data, err := dao.CreateStatementDetail(in)
|
||||
// res.Id = data.ID
|
||||
// return
|
||||
// }
|
||||
|
||||
// func (s *StatementServerLogic) BatchCreateStatementDetail(in *artistinfoStatement.BatchCreateStatementDetailRequest) (*emptypb.Empty, error) {
|
||||
// return nil, dao.BatchCreateStatementDetail(in)
|
||||
// }
|
||||
|
||||
// func (s *StatementServerLogic) GetStatementDetailList(in *artistinfoStatement.GetStatementDetailListRequest) (res *artistinfoStatement.GetStatementDetailListResponse, err error) {
|
||||
// datas, total, err := dao.GetStatementDetailList(in)
|
||||
// res = &artistinfoStatement.GetStatementDetailListResponse{
|
||||
// Data: []*artistinfoStatement.StatementDetailRequest{},
|
||||
// Page: &artistinfoStatement.StatementPageInfo{
|
||||
// Page: in.Page,
|
||||
// PageSize: in.PageSize,
|
||||
// Total: total,
|
||||
// },
|
||||
// }
|
||||
// for _, v := range datas {
|
||||
// res.Data = append(res.Data, &artistinfoStatement.StatementDetailRequest{
|
||||
// BatchId: v.BatchId,
|
||||
// TfNum: v.TfNum,
|
||||
// ArtworkName: v.ArtworkName,
|
||||
// Ruler: v.Ruler,
|
||||
// SaleNo: v.SaleNo,
|
||||
// CompleteDate: v.CompleteDate,
|
||||
// Id: v.ID,
|
||||
// CreatedAt: stime.TimeToString(v.CreatedAt, stime.Format_Normal_YMDhms),
|
||||
// UpdatedAt: stime.TimeToString(v.UpdatedAt, stime.Format_Normal_YMDhms),
|
||||
// DeletedAt: int64(v.DeletedAt),
|
||||
// })
|
||||
// }
|
||||
// return
|
||||
// }
|
||||
|
||||
// func (s *StatementServerLogic) GetStatementBatchTimeMenus(in *artistinfoStatement.GetStatementBatchListRequest) (res *artistinfoStatement.GetStatementBatchTimeMenusResponse, err error) {
|
||||
// res = &artistinfoStatement.GetStatementBatchTimeMenusResponse{}
|
||||
// res.Data, err = dao.GetStatementBatchTimeMenus(in)
|
||||
// return
|
||||
// }
|
@ -1,17 +1,38 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/fonchain/fonchain-artistinfo/cmd/internal/dao"
|
||||
"github.com/fonchain/fonchain-artistinfo/pb/contract"
|
||||
"github.com/fonchain/fonchain-artistinfo/cmd/model"
|
||||
"github.com/fonchain/fonchain-artistinfo/pb/artist"
|
||||
"github.com/fonchain/fonchain-artistinfo/pb/artwork"
|
||||
contract "github.com/fonchain/fonchain-artistinfo/pb/contract"
|
||||
contractMicroservice "github.com/fonchain/fonchain-artistinfo/pb/contract_microservice"
|
||||
db "github.com/fonchain/fonchain-artistinfo/pkg/db"
|
||||
"github.com/fonchain/fonchain-artistinfo/pkg/m"
|
||||
"github.com/fonchain/fonchain-artistinfo/pkg/service"
|
||||
uuid "github.com/satori/go.uuid"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type IContract interface {
|
||||
FinishContract(req *contract.FinishContractRequest) (rep *contract.FinishContractRespond, err error)
|
||||
CreateContract(req *contract.CreateContractRequest) (rep *contract.CreateContractRespond, err error)
|
||||
ContractListMgmt(req *contract.ContractListMgmtRequest) (rep *contract.ContractListMgmtRespond, err error)
|
||||
ContractList(req *contract.ContractListRequest) (rep *contract.ContractListRespond, err error)
|
||||
ContractTxList(req *contract.ContractTxListRequest) (rep *contract.ContractTxListRespond, err error)
|
||||
UpdateContract(req *contract.UpdateContractRequest) (rep *contract.UpdateContractRespond, err error)
|
||||
UpdateContractTx(req *contract.UpdateContractTxRequest) (rep *contract.UpdateContractTxRespond, err error)
|
||||
GetContract(req *contract.GetContractRequest) (rep *contract.ContractData, err error)
|
||||
SignContract(req *contract.SignContractRequest) (rep *contract.SignContractRespond, err error)
|
||||
FinishContract(req *contract.FinishContractRequest) (rep *contract.FinishContractRespond, err error)
|
||||
// ContractTxList(req *contract.ContractTxListRequest) (rep *contract.ContractTxListRespond, err error)
|
||||
|
||||
// ContractList(req *contract.ContractListRequest) (rep *contract.ContractListRespond, err error)
|
||||
// UpdateContract(req *contract.UpdateContractRequest) (rep *contract.UpdateContractRespond, err error)
|
||||
// UpdateContractTx(req *contract.UpdateContractTxRequest) (rep *contract.UpdateContractTxRespond, err error)
|
||||
// GetContract(req *contract.GetContractRequest) (rep *contract.ContractData, err error)
|
||||
}
|
||||
|
||||
func NewContract() IContract {
|
||||
@ -21,47 +42,687 @@ func NewContract() IContract {
|
||||
type Contract struct {
|
||||
}
|
||||
|
||||
func (a *Contract) FinishContract(req *contract.FinishContractRequest) (rep *contract.FinishContractRespond, err error) {
|
||||
rep = &contract.FinishContractRespond{}
|
||||
func (a *Contract) CreateContract(req *contract.CreateContractRequest) (rep *contract.CreateContractRespond, err error) {
|
||||
rep = &contract.CreateContractRespond{}
|
||||
|
||||
err = dao.FinishContract(req.TransactionId)
|
||||
//遇到错误数据库回滚
|
||||
tx := db.DB.Begin()
|
||||
|
||||
userInfo, err := dao.GetArtistInfoByArtistUid(req.ArtistUid)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println("第二处111111111111111")
|
||||
switch req.Type {
|
||||
//1 画家合同(不涉及画家的画作)
|
||||
case 1:
|
||||
|
||||
//查看画家合同是否已经存在,不存在继续
|
||||
if err = dao.GetMgmtContractByArtistUid(req.ArtistUid, req.Type); err == gorm.ErrRecordNotFound {
|
||||
var uid uuid.UUID
|
||||
if uid, err = uuid.NewV4(); err != nil {
|
||||
err = errors.New(m.ERROR_UID)
|
||||
return
|
||||
}
|
||||
|
||||
//创建画家合同
|
||||
contract := &model.Contract{
|
||||
Uid: uid.String(),
|
||||
ArtistUid: req.ArtistUid,
|
||||
Type: 1,
|
||||
State: 1,
|
||||
Status: 2,
|
||||
LockTime: userInfo.LatestLockTime,
|
||||
}
|
||||
|
||||
if err = dao.CreateArtistContract(tx, contract); err != nil {
|
||||
return
|
||||
}
|
||||
} else {
|
||||
return
|
||||
}
|
||||
|
||||
case 2:
|
||||
for _, v := range req.ArtworkUid {
|
||||
//查看画作合同是否已经存在,不存在继续,类型2、6
|
||||
if err = dao.GetMgmtContractByArtworkUid(v, 2); err == gorm.ErrRecordNotFound {
|
||||
} else {
|
||||
return
|
||||
}
|
||||
|
||||
if err = dao.GetMgmtContractByArtworkUid(v, 6); err == gorm.ErrRecordNotFound {
|
||||
|
||||
} else {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
//创建画家画作合同,类型2,如果批次选择多个画作的话,那么多个画在一个合同中
|
||||
if err = dao.CreateArtworkContract(tx, req.ArtworkUid, req.ArtistUid, 2, userInfo.LatestLockTime); err != nil {
|
||||
tx.Rollback()
|
||||
return
|
||||
}
|
||||
|
||||
//创建画家画作合同,类型6
|
||||
if err = dao.CreateArtworkContract(tx, req.ArtworkUid, req.ArtistUid, 6, userInfo.LatestLockTime); err != nil {
|
||||
tx.Rollback()
|
||||
return
|
||||
}
|
||||
|
||||
case 3:
|
||||
for _, v := range req.ArtworkUid {
|
||||
//查看画作合同是否已经存在,不存在继续,类型3
|
||||
if err = dao.GetMgmtContractByArtworkUid(v, 3); err == gorm.ErrRecordNotFound {
|
||||
} else {
|
||||
return
|
||||
}
|
||||
}
|
||||
//创建画家画作合同,类型3
|
||||
if err = dao.CreateArtworkContract(tx, req.ArtworkUid, req.ArtistUid, 3, userInfo.LatestLockTime); err != nil {
|
||||
tx.Rollback()
|
||||
return
|
||||
}
|
||||
|
||||
case 5:
|
||||
for _, v := range req.ArtworkUid {
|
||||
//查看画作合同是否已经存在,不存在继续,类型5
|
||||
if err = dao.GetMgmtContractByArtworkUid(v, 5); err == gorm.ErrRecordNotFound {
|
||||
} else {
|
||||
return
|
||||
}
|
||||
}
|
||||
//创建画家画作合同,类型3
|
||||
if err = dao.CreateArtworkContract(tx, req.ArtworkUid, req.ArtistUid, 5, userInfo.LatestLockTime); err != nil {
|
||||
tx.Rollback()
|
||||
return
|
||||
}
|
||||
|
||||
default:
|
||||
err = errors.New("type值出错!")
|
||||
return rep, err
|
||||
}
|
||||
|
||||
tx.Commit()
|
||||
return
|
||||
}
|
||||
|
||||
func (a *Contract) ContractListMgmt(req *contract.ContractListMgmtRequest) (rep *contract.ContractListMgmtRespond, err error) {
|
||||
rep = &contract.ContractListMgmtRespond{}
|
||||
|
||||
//查看是否有该画家
|
||||
_, err = dao.GetArtistInfoByArtistUid(req.ArtistUid)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
//合同分页查询操作
|
||||
if req.Page < 1 {
|
||||
req.Page = 1
|
||||
}
|
||||
if req.Num < 1 {
|
||||
req.Num = 15
|
||||
}
|
||||
offset := (req.Page - 1) * req.Num
|
||||
|
||||
//获取该用户的所有合同
|
||||
contracts, err := dao.GetContractList(req.ArtistUid, req.Num, offset)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
rep.Data = contracts
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func (a *Contract) ContractList(req *contract.ContractListRequest) (rep *contract.ContractListRespond, err error) {
|
||||
|
||||
rep, err = dao.ContractList(req)
|
||||
//查看是否有该画家
|
||||
user, err := dao.GetArtistInfoById(req.ID)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
ContractData, err := dao.ContractList(user.MgmtArtistUid, req.State)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
rep = &contract.ContractListRespond{
|
||||
Data: ContractData,
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func (a *Contract) GetContract(req *contract.GetContractRequest) (rep *contract.ContractData, err error) {
|
||||
func (a *Contract) SignContract(req *contract.SignContractRequest) (rep *contract.SignContractRespond, err error) {
|
||||
rep = &contract.SignContractRespond{}
|
||||
|
||||
rep, err = dao.GetContract(int32(req.Id))
|
||||
//遇到错误数据库回滚
|
||||
tx := db.DB.Begin()
|
||||
|
||||
//根据合同uid获取具体合同信息
|
||||
contractInfo, err := dao.GetContractInfo(req.ContractUid)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
//根据画家id获取画家具体信息
|
||||
artistDetailResponse, customerId, err := GetArtistInfoById(req.ID)
|
||||
if err != nil {
|
||||
return rep, err
|
||||
}
|
||||
|
||||
if contractInfo.Type != 4 && contractInfo.Type != 7 {
|
||||
|
||||
switch contractInfo.Type {
|
||||
case 1:
|
||||
var ContractNo = fmt.Sprintf("TF_%d", time.Now().UnixNano())
|
||||
endTime := time.Now().AddDate(1, 0, -1)
|
||||
parameterMap := make((map[string]string), 0)
|
||||
|
||||
// 一、 模板填充
|
||||
parameterMap["PartyAName"] = artistDetailResponse.ProfileInfo.Name
|
||||
parameterMap["PartyAAddress"] = artistDetailResponse.ProfileInfo.Address
|
||||
parameterMap["PartyAIdentityCard"] = artistDetailResponse.ProfileInfo.CardId
|
||||
parameterMap["PartyATelNum"] = artistDetailResponse.ProfileInfo.Phone
|
||||
parameterMap["PartyBRule"] = "240"
|
||||
parameterMap["SettleNum"] = "2"
|
||||
parameterMap["SettleSec"] = "100"
|
||||
parameterMap["ActivityNum"] = "2"
|
||||
parameterMap["SettlerTypeFour"] = "2"
|
||||
parameterMap["PowerDay"] = "5"
|
||||
parameterMap["EffectStartYear"] = fmt.Sprintf("%d", time.Now().Year())
|
||||
parameterMap["EffectStartMonth"] = fmt.Sprintf("%d", time.Now().Month())
|
||||
parameterMap["EffectStartDay"] = fmt.Sprintf("%d", time.Now().Day())
|
||||
parameterMap["EffectEndYear"] = fmt.Sprintf("%d", endTime.Year())
|
||||
parameterMap["EffectEndMonth"] = fmt.Sprintf("%d", endTime.Month())
|
||||
parameterMap["EffectEndDay"] = fmt.Sprintf("%d", endTime.Day())
|
||||
parameterMap["PartyBLegal"] = "胡婷"
|
||||
|
||||
//将map转换为string类型
|
||||
parameterMapType, err := json.Marshal(parameterMap)
|
||||
if err != nil {
|
||||
return rep, err
|
||||
}
|
||||
|
||||
generateContractRequest := &contractMicroservice.GenerateContractRequest{
|
||||
TemplateId: "一手画市场18",
|
||||
ContractId: ContractNo,
|
||||
ParameterMap: string(parameterMapType),
|
||||
}
|
||||
generateContractResponse, err := service.ContractImpl.GenerateContract(context.Background(), generateContractRequest)
|
||||
if err != nil {
|
||||
return rep, err
|
||||
}
|
||||
|
||||
//二、 自动签署
|
||||
extSignAutoRequest := &contractMicroservice.ExtSignAutoRequest{
|
||||
TransactionId: fmt.Sprintf("TFAU_%d", time.Now().UnixNano()),
|
||||
ContractId: ContractNo,
|
||||
CustomerId: "1A958BFD01E6551D06381DA6C0B19259",
|
||||
DocTitle: fmt.Sprintf("TFAU_%d", time.Now().UnixNano()),
|
||||
SignKeyword: "受托方(乙方)",
|
||||
SignatureId: "1668589742383450",
|
||||
KeyX: "120",
|
||||
KeyY: "0",
|
||||
}
|
||||
|
||||
_, err = service.ContractImpl.ExtSignAuto(context.Background(), extSignAutoRequest)
|
||||
if err != nil {
|
||||
return rep, err
|
||||
}
|
||||
|
||||
//更新合同表,将合同的下载、在线、id保存
|
||||
err = dao.UpdateContract(tx, contractInfo.Uid, generateContractResponse.ViewPdfUrl, generateContractResponse.DownloadUrl, ContractNo)
|
||||
if err != nil {
|
||||
return rep, err
|
||||
}
|
||||
|
||||
case 2:
|
||||
|
||||
var ContractNo = fmt.Sprintf("TF_%d", time.Now().UnixNano())
|
||||
var parameterMap = make(map[string]string)
|
||||
endTime := time.Now().AddDate(1, 0, -1)
|
||||
parameterMap["ContractNo"] = ContractNo
|
||||
parameterMap["PartyAName"] = artistDetailResponse.ProfileInfo.Name
|
||||
parameterMap["PartyAAddress"] = artistDetailResponse.ProfileInfo.Address
|
||||
parameterMap["PartyAIdentityCard"] = artistDetailResponse.ProfileInfo.CardId
|
||||
parameterMap["PartyATelNum"] = artistDetailResponse.ProfileInfo.Phone
|
||||
parameterMap["SettleNum"] = "2"
|
||||
parameterMap["SettleSecOne"] = "0"
|
||||
parameterMap["SettleSecTwo"] = "100"
|
||||
parameterMap["ActivityNum"] = "2"
|
||||
parameterMap["SettlerTypeFour"] = "2"
|
||||
parameterMap["PowerDay"] = "5"
|
||||
parameterMap["EffectStartYear"] = fmt.Sprintf("%d", time.Now().Year())
|
||||
parameterMap["EffectStartMonth"] = fmt.Sprintf("%d", time.Now().Month())
|
||||
parameterMap["EffectStartDay"] = fmt.Sprintf("%d", time.Now().Day())
|
||||
parameterMap["EffectEndYear"] = fmt.Sprintf("%d", endTime.Year())
|
||||
parameterMap["EffectEndMonth"] = fmt.Sprintf("%d", endTime.Month())
|
||||
parameterMap["EffectEndDay"] = fmt.Sprintf("%d", endTime.Day())
|
||||
parameterMap["PartyBLegal"] = "邬侨华"
|
||||
|
||||
//将map转换为string类型
|
||||
parameterMapType, err := json.Marshal(parameterMap)
|
||||
if err != nil {
|
||||
return rep, err
|
||||
}
|
||||
|
||||
generateContractRequest := &contractMicroservice.GenerateContractRequest{
|
||||
TemplateId: "著作权代理转让服务合同20",
|
||||
ContractId: ContractNo,
|
||||
ParameterMap: string(parameterMapType),
|
||||
}
|
||||
generateContractResponse, err := service.ContractImpl.GenerateContract(context.Background(), generateContractRequest)
|
||||
if err != nil {
|
||||
return rep, err
|
||||
}
|
||||
|
||||
//二、 自动签署
|
||||
extSignAutoRequest := &contractMicroservice.ExtSignAutoRequest{
|
||||
TransactionId: fmt.Sprintf("TFAU_%d", time.Now().UnixNano()),
|
||||
ContractId: ContractNo,
|
||||
CustomerId: "F49C748A0C06431BC620354F4491BD37",
|
||||
DocTitle: fmt.Sprintf("TFAU_%d", time.Now().UnixNano()),
|
||||
SignKeyword: "受托方(乙方)",
|
||||
SignatureId: "1668589763366246",
|
||||
KeyX: "120",
|
||||
KeyY: "0",
|
||||
}
|
||||
|
||||
_, err = service.ContractImpl.ExtSignAuto(context.Background(), extSignAutoRequest)
|
||||
if err != nil {
|
||||
return rep, err
|
||||
}
|
||||
|
||||
//更新合同表,将合同的下载、在线、id保存
|
||||
err = dao.UpdateContract(tx, contractInfo.Uid, generateContractResponse.ViewPdfUrl, generateContractResponse.DownloadUrl, ContractNo)
|
||||
if err != nil {
|
||||
return rep, err
|
||||
}
|
||||
|
||||
case 3:
|
||||
var ContractNo = fmt.Sprintf("TF_%d", time.Now().UnixNano())
|
||||
|
||||
//获取画作信息
|
||||
artworkDetailResponse, err := GetArtworkProfileByArtworkUid(contractInfo.ArtworkUid)
|
||||
if err != nil {
|
||||
return rep, err
|
||||
}
|
||||
|
||||
var parameterMap = make(map[string]string)
|
||||
parameterMap["PartyAName"] = artistDetailResponse.ProfileInfo.Name
|
||||
parameterMap["PartyAIdCard"] = artistDetailResponse.ProfileInfo.CardId
|
||||
parameterMap["ArtworkName"] = artworkDetailResponse.ProfileInfo.ArtworkName
|
||||
parameterMap["Year"] = fmt.Sprintf("%d", time.Now().Year())
|
||||
parameterMap["Month"] = fmt.Sprintf("%d", time.Now().Month())
|
||||
parameterMap["Day"] = fmt.Sprintf("%d", time.Now().Day())
|
||||
|
||||
//将map转换为string类型
|
||||
parameterMapType, err := json.Marshal(parameterMap)
|
||||
if err != nil {
|
||||
return rep, err
|
||||
}
|
||||
|
||||
generateContractRequest := &contractMicroservice.GenerateContractRequest{
|
||||
TemplateId: "登记授权委托书18",
|
||||
ContractId: ContractNo,
|
||||
ParameterMap: string(parameterMapType),
|
||||
}
|
||||
generateContractResponse, err := service.ContractImpl.GenerateContract(context.Background(), generateContractRequest)
|
||||
if err != nil {
|
||||
return rep, err
|
||||
}
|
||||
|
||||
//更新合同表,将合同的下载、在线、id保存
|
||||
err = dao.UpdateContract(tx, contractInfo.Uid, generateContractResponse.ViewPdfUrl, generateContractResponse.DownloadUrl, ContractNo)
|
||||
if err != nil {
|
||||
return rep, err
|
||||
}
|
||||
|
||||
case 5:
|
||||
|
||||
//获取画作信息
|
||||
artworkDetailResponse, err := GetArtworkProfileByArtworkUid(contractInfo.ArtworkUid)
|
||||
if err != nil {
|
||||
return rep, err
|
||||
}
|
||||
|
||||
var ContractNo = fmt.Sprintf("TF_%d", time.Now().UnixNano())
|
||||
|
||||
var parameterMap = make(map[string]string)
|
||||
parameterMap["ArtworkName"] = artworkDetailResponse.ProfileInfo.ArtworkName
|
||||
parameterMap["Year"] = fmt.Sprintf("%d", time.Now().Year())
|
||||
parameterMap["Month"] = fmt.Sprintf("%d", time.Now().Month())
|
||||
parameterMap["Day"] = fmt.Sprintf("%d", time.Now().Day())
|
||||
|
||||
//将map转换为string类型
|
||||
parameterMapType, err := json.Marshal(parameterMap)
|
||||
if err != nil {
|
||||
return rep, err
|
||||
}
|
||||
|
||||
generateContractRequest := &contractMicroservice.GenerateContractRequest{
|
||||
TemplateId: "作品登记承诺书16",
|
||||
ContractId: ContractNo,
|
||||
ParameterMap: string(parameterMapType),
|
||||
}
|
||||
generateContractResponse, err := service.ContractImpl.GenerateContract(context.Background(), generateContractRequest)
|
||||
if err != nil {
|
||||
return rep, err
|
||||
}
|
||||
|
||||
//更新合同表,将合同的下载、在线、id保存
|
||||
err = dao.UpdateContract(tx, contractInfo.Uid, generateContractResponse.ViewPdfUrl, generateContractResponse.DownloadUrl, ContractNo)
|
||||
if err != nil {
|
||||
return rep, err
|
||||
}
|
||||
|
||||
case 6:
|
||||
ArtistUids := strings.Split(contractInfo.ArtistUid, ",")
|
||||
|
||||
type dynamic struct {
|
||||
InsertWay int `json:"insertWay"`
|
||||
Keyword string `json:"keyword"`
|
||||
CellHeight float64 `json:"cellHeight"`
|
||||
ColWidthPercent []int `json:"colWidthPercent"`
|
||||
TheFirstHeader string `json:"theFirstHeader"`
|
||||
CellHorizontalAlignment int `json:"cellHorizontalAlignment"`
|
||||
CellVerticalAlignment int `json:"cellVerticalAlignment"`
|
||||
Headers []string `json:"headers"`
|
||||
Datas [][]string `json:"datas"`
|
||||
}
|
||||
var dynamicList []dynamic
|
||||
var dynamicOne dynamic
|
||||
|
||||
dynamicOne.InsertWay = 1
|
||||
dynamicOne.Keyword = "附表 1"
|
||||
dynamicOne.CellHeight = 16.0
|
||||
dynamicOne.ColWidthPercent = []int{6, 6, 20, 10, 10}
|
||||
// dynamicOne.TheFirstHeader =
|
||||
dynamicOne.CellHorizontalAlignment = 1
|
||||
dynamicOne.CellVerticalAlignment = 5
|
||||
dynamicOne.Headers = []string{"序号", "作品名称", "哈希值", "著作权取得方式(原始/继受)", "继受取得的证明文件"}
|
||||
|
||||
for k, v := range ArtistUids {
|
||||
//获取画作信息
|
||||
artworkDetailResponse, err := GetArtworkProfileByArtworkUid(v)
|
||||
if err != nil {
|
||||
return rep, err
|
||||
}
|
||||
|
||||
var tmps []string
|
||||
tmps = append(tmps, fmt.Sprintf("%d", k+1))
|
||||
tmps = append(tmps, artworkDetailResponse.ProfileInfo.ArtistName) //获取画作名字
|
||||
tmps = append(tmps, artworkDetailResponse.DigiInfo.CopyrightHash) //获取版权hash
|
||||
tmps = append(tmps, "原始")
|
||||
tmps = append(tmps, "")
|
||||
dynamicOne.Datas = append(dynamicOne.Datas, tmps)
|
||||
}
|
||||
|
||||
dynamicList = append(dynamicList, dynamicOne)
|
||||
|
||||
dyByte, err := json.Marshal(dynamicList)
|
||||
if err != nil {
|
||||
return rep, err
|
||||
}
|
||||
|
||||
ContractNo := fmt.Sprintf("TF_%d", time.Now().UnixNano()+1000)
|
||||
|
||||
//一、 模板填充
|
||||
var parameterMap = make(map[string]string)
|
||||
parameterMap["PartyBLegal"] = artistDetailResponse.ProfileInfo.Name
|
||||
|
||||
//将map转换为string类型
|
||||
parameterMapType, err := json.Marshal(parameterMap)
|
||||
if err != nil {
|
||||
return rep, err
|
||||
}
|
||||
|
||||
var viewPdfUrl string
|
||||
var downloadUrl string
|
||||
|
||||
generateContractRequest := &contractMicroservice.GenerateContractRequest{
|
||||
ContractId: ContractNo,
|
||||
ParameterMap: string(parameterMapType),
|
||||
DynamicTables: string(dyByte),
|
||||
}
|
||||
|
||||
if len(ArtistUids) > 30 {
|
||||
|
||||
return rep, errors.New("选择画作条数过多")
|
||||
|
||||
} else if len(ArtistUids) <= 15 {
|
||||
generateContractRequest.TemplateId = "著作权代理转让服务合同——附表152"
|
||||
generateContractResponse, err := service.ContractImpl.GenerateContract(context.Background(), generateContractRequest)
|
||||
if err != nil {
|
||||
return rep, err
|
||||
}
|
||||
|
||||
viewPdfUrl = generateContractResponse.ViewPdfUrl
|
||||
downloadUrl = generateContractResponse.DownloadUrl
|
||||
|
||||
} else {
|
||||
generateContractRequest.TemplateId = "著作权代理转让服务合同——附表302"
|
||||
generateContractResponse, err := service.ContractImpl.GenerateContract(context.Background(), generateContractRequest)
|
||||
if err != nil {
|
||||
return rep, err
|
||||
}
|
||||
|
||||
viewPdfUrl = generateContractResponse.ViewPdfUrl
|
||||
downloadUrl = generateContractResponse.DownloadUrl
|
||||
}
|
||||
|
||||
//二、 自动签署
|
||||
extSignAutoRequest := &contractMicroservice.ExtSignAutoRequest{
|
||||
TransactionId: fmt.Sprintf("TFAU_%d", time.Now().UnixNano()+1000),
|
||||
ContractId: ContractNo,
|
||||
CustomerId: "F49C748A0C06431BC620354F4491BD37",
|
||||
DocTitle: fmt.Sprintf("TFAU_%d", time.Now().UnixNano()),
|
||||
SignKeyword: "受托方(乙方)",
|
||||
SignatureId: "1668589763366246",
|
||||
KeyX: "120",
|
||||
KeyY: "0",
|
||||
}
|
||||
|
||||
_, err = service.ContractImpl.ExtSignAuto(context.Background(), extSignAutoRequest)
|
||||
if err != nil {
|
||||
return rep, err
|
||||
}
|
||||
|
||||
//更新合同表,将合同的下载、在线、id保存
|
||||
err = dao.UpdateContract(tx, contractInfo.Uid, viewPdfUrl, downloadUrl, ContractNo)
|
||||
if err != nil {
|
||||
tx.Rollback()
|
||||
return rep, err
|
||||
}
|
||||
default:
|
||||
return rep, errors.New("type出错")
|
||||
}
|
||||
}
|
||||
|
||||
//上面数据库没有错误就执行,上面修改的值下面会使用到
|
||||
tx.Commit()
|
||||
|
||||
transactionId := fmt.Sprintf("TFTX_%d", time.Now().UnixNano())
|
||||
|
||||
var signKeyword string
|
||||
|
||||
//从新根据合同id获取具体合同信息
|
||||
contractInfo, err = dao.GetContractInfo(req.ContractUid)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if contractInfo.Type == 1 || contractInfo.Type == 2 || contractInfo.Type == 6 {
|
||||
|
||||
signKeyword = "委托方(甲方)"
|
||||
}
|
||||
if contractInfo.Type == 3 {
|
||||
signKeyword = "委托人签字:"
|
||||
}
|
||||
if contractInfo.Type == 4 {
|
||||
signKeyword = "画家签字:"
|
||||
}
|
||||
if contractInfo.Type == 5 {
|
||||
signKeyword = "申请人(签章):"
|
||||
}
|
||||
signShowTime := "1"
|
||||
if contractInfo.Type == 5 || contractInfo.Type == 3 || contractInfo.Type == 6 {
|
||||
signShowTime = "2"
|
||||
}
|
||||
|
||||
// 手动签署
|
||||
extSignRequest := &contractMicroservice.ExtSignRequest{
|
||||
TransactionId: transactionId,
|
||||
ContractId: contractInfo.ContractId,
|
||||
CustomerId: customerId,
|
||||
ReturnUrl: fmt.Sprintf("%v/contractwrite?htmltype=%s&envtype=%s&token= %s", "192.168.10.7", req.HtmlType, req.EnvType, req.Token),
|
||||
DocTitle: contractInfo.ContractId,
|
||||
OpenEnvironment: "0",
|
||||
MobileSignType: "2",
|
||||
SignKeyword: signKeyword,
|
||||
Keyx: "100",
|
||||
Keyy: "-5",
|
||||
SignatureShowTime: signShowTime,
|
||||
PcHandSignature: "2",
|
||||
}
|
||||
|
||||
jumpCommonResponse, err := service.ContractImpl.ExtSign(context.Background(), extSignRequest)
|
||||
if err != nil {
|
||||
return rep, err
|
||||
}
|
||||
|
||||
err = dao.UpdateContractTx(tx, contractInfo.Uid, transactionId)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
rep.JumpUrl = jumpCommonResponse.JumpUrl
|
||||
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func (a *Contract) FinishContract(req *contract.FinishContractRequest) (rep *contract.FinishContractRespond, err error) {
|
||||
rep = &contract.FinishContractRespond{}
|
||||
|
||||
tx := db.DB.Begin()
|
||||
//更新合同状态并获取合同信息
|
||||
contract, err := dao.FinishContract(tx, req.TransactionId)
|
||||
if err != nil {
|
||||
tx.Rollback()
|
||||
return nil, err
|
||||
}
|
||||
|
||||
rep.Contract = contract
|
||||
|
||||
tx.Commit()
|
||||
return
|
||||
}
|
||||
func (a *Contract) ContractTxList(req *contract.ContractTxListRequest) (rep *contract.ContractTxListRespond, err error) {
|
||||
|
||||
rep, err = dao.ContractTxList(req)
|
||||
// func (a *Contract) ContractTxList(req *contract.ContractTxListRequest) (rep *contract.ContractTxListRespond, err error) {
|
||||
|
||||
// rep = &contract.ContractTxListRespond{}
|
||||
// var datas []*contract.Contracts
|
||||
|
||||
// artistDetailResponse, _, err := GetArtistInfoById(req.ID)
|
||||
// if err != nil {
|
||||
// return
|
||||
// }
|
||||
|
||||
// contracts, err := dao.ContractTxList(artistDetailResponse.ProfileInfo.Uid, req.State)
|
||||
// if err != nil {
|
||||
// return
|
||||
// }
|
||||
|
||||
// data := &contract.Contracts{}
|
||||
// for _, v := range contracts {
|
||||
// data.ArtistUid = v.ArtistUid
|
||||
// data.ArtworkUid = v.ArtworkUid
|
||||
// data.ContractId = v.ContractId
|
||||
// data.TransactionId = v.TransactionId
|
||||
// data.Type = v.Type
|
||||
// data.ViewUrl = v.ViewUrl
|
||||
// data.DownloadUrl = v.DownloadUrl
|
||||
// //时间戳转时间
|
||||
// data.ExpirationTime = time.Unix(int64(v.CreatedAt), 0).Format("2006/01/02 15:04:05")
|
||||
// data.SignTime = v.SignTime
|
||||
// datas = append(datas, data)
|
||||
|
||||
// }
|
||||
|
||||
// rep.Data = datas
|
||||
|
||||
// return
|
||||
// }
|
||||
|
||||
// 根据画作uid获取画作信息
|
||||
func GetArtworkProfileByArtworkUid(artworkUid string) (artworkProfileInfo *artwork.ArtworkDetailResponse, err error) {
|
||||
artworkProfileInfo = &artwork.ArtworkDetailResponse{}
|
||||
|
||||
artworkDetailRequest := &artwork.ArtworkDetailRequest{
|
||||
ArtworkUuid: artworkUid,
|
||||
Type: "1",
|
||||
}
|
||||
artworkDetailResponse, err := service.ArtworkImpl.ArtworkDetail(context.Background(), artworkDetailRequest)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
return artworkDetailResponse, nil
|
||||
}
|
||||
|
||||
// 根据画家id获取画家具体信息
|
||||
func GetArtistInfoById(id int32) (artistDetailResponse *artist.DetailResponse, customerId string, err error) {
|
||||
artistDetailResponse = &artist.DetailResponse{}
|
||||
|
||||
artistInfo, err := dao.GetArtistInfoById(id)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
detailRequest := &artist.DetailRequest{
|
||||
Uid: artistInfo.MgmtArtistUid,
|
||||
}
|
||||
artistDetailResponse, err = service.GrpcArtistImpl.ArtistDetail(context.Background(), detailRequest)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
customerId = artistInfo.CustomerId
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func (a *Contract) UpdateContract(req *contract.UpdateContractRequest) (rep *contract.UpdateContractRespond, err error) {
|
||||
rep = &contract.UpdateContractRespond{}
|
||||
err = dao.UpdateContract(req)
|
||||
// func (a *Contract) ContractList(req *contract.ContractListRequest) (rep *contract.ContractListRespond, err error) {
|
||||
|
||||
return
|
||||
}
|
||||
// rep, err = dao.ContractList(req)
|
||||
|
||||
func (a *Contract) UpdateContractTx(req *contract.UpdateContractTxRequest) (rep *contract.UpdateContractTxRespond, err error) {
|
||||
rep = &contract.UpdateContractTxRespond{}
|
||||
err = dao.UpdateContractTx(req.TransactionId, int32(req.ID))
|
||||
// return
|
||||
// }
|
||||
|
||||
return
|
||||
}
|
||||
// func (a *Contract) GetContract(req *contract.GetContractRequest) (rep *contract.ContractData, err error) {
|
||||
|
||||
// rep, err = dao.GetContract(int32(req.Id))
|
||||
|
||||
// return
|
||||
// }
|
||||
// func (a *Contract) ContractTxList(req *contract.ContractTxListRequest) (rep *contract.ContractTxListRespond, err error) {
|
||||
|
||||
// rep, err = dao.ContractTxList(req)
|
||||
|
||||
// return
|
||||
// }
|
||||
|
||||
// func (a *Contract) UpdateContract(req *contract.UpdateContractRequest) (rep *contract.UpdateContractRespond, err error) {
|
||||
// rep = &contract.UpdateContractRespond{}
|
||||
// err = dao.UpdateContract(req)
|
||||
|
||||
// return
|
||||
// }
|
||||
|
||||
// func (a *Contract) UpdateContractTx(req *contract.UpdateContractTxRequest) (rep *contract.UpdateContractTxRespond, err error) {
|
||||
// rep = &contract.UpdateContractTxRespond{}
|
||||
// err = dao.UpdateContractTx(req.TransactionId, int32(req.ID))
|
||||
|
||||
// return
|
||||
// }
|
||||
|
@ -1,88 +1,84 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"github.com/fonchain/fonchain-artistinfo/cmd/internal/dao"
|
||||
"github.com/fonchain/fonchain-artistinfo/pb/supplyinfo"
|
||||
)
|
||||
|
||||
type ISupply interface {
|
||||
GetSupplyInfoList(req *supplyinfo.GetSupplyInfoListRequest) (rep *supplyinfo.GetSupplyInfoListRespond, err error)
|
||||
GetSupplyInfo(req *supplyinfo.GetSupplyInfoRequest) (rep *supplyinfo.GetSupplyInfoData, err error)
|
||||
UpdateSupplyInfo(req *supplyinfo.UpdateSupplyInfoRequest) (rep *supplyinfo.UpdateSupplyInfoRespond, err error)
|
||||
GetVideoList(req *supplyinfo.GetVideoListRequest) (rep *supplyinfo.GetVideoListRespond, err error)
|
||||
GetVideo(req *supplyinfo.GetVideoRequest) (rep *supplyinfo.GetVideoListData, err error)
|
||||
UpdateVideo(req *supplyinfo.UpdateVideoRequest) (rep *supplyinfo.UpdateVideoRespond, err error)
|
||||
GetExam(req *supplyinfo.GetExamRequest) (rep *supplyinfo.GetExamListData, err error)
|
||||
GetExamList(req *supplyinfo.GetExamListRequest) (rep *supplyinfo.GetExamListRespond, err error)
|
||||
UpdateExam(req *supplyinfo.UpdateExamRequest) (rep *supplyinfo.UpdateExamRespond, err error)
|
||||
GetArtistInfoList(req *supplyinfo.GetArtistInfoListRequest) (rep *supplyinfo.GetArtistInfoListRespond, err error)
|
||||
GetArtistInfo(req *supplyinfo.GetArtistInfoRequest) (rep *supplyinfo.GetArtistInfoListData, err error)
|
||||
UpdateArtistInfo(req *supplyinfo.UpdateArtistInfoRequest) (rep *supplyinfo.UpdateArtistInfoRespond, err error)
|
||||
}
|
||||
|
||||
func NewSupply() ISupply {
|
||||
return &Supply{}
|
||||
}
|
||||
|
||||
type Supply struct {
|
||||
}
|
||||
|
||||
func (a *Supply) GetSupplyInfoList(req *supplyinfo.GetSupplyInfoListRequest) (rep *supplyinfo.GetSupplyInfoListRespond, err error) {
|
||||
rep, err = dao.GetSupplyInfoList(int32(req.ArtistId), int32(req.Types))
|
||||
return
|
||||
}
|
||||
|
||||
func (a *Supply) GetSupplyInfo(req *supplyinfo.GetSupplyInfoRequest) (rep *supplyinfo.GetSupplyInfoData, err error) {
|
||||
rep, err = dao.GetSupplyInfo(req)
|
||||
return
|
||||
}
|
||||
|
||||
func (a *Supply) UpdateSupplyInfo(req *supplyinfo.UpdateSupplyInfoRequest) (rep *supplyinfo.UpdateSupplyInfoRespond, err error) {
|
||||
rep, err = dao.UpdateSupplyInfo(req)
|
||||
return
|
||||
}
|
||||
|
||||
func (a *Supply) GetVideoList(req *supplyinfo.GetVideoListRequest) (rep *supplyinfo.GetVideoListRespond, err error) {
|
||||
rep, err = dao.GetVideoList(int32(req.UserId))
|
||||
return
|
||||
}
|
||||
|
||||
func (a *Supply) GetVideo(req *supplyinfo.GetVideoRequest) (rep *supplyinfo.GetVideoListData, err error) {
|
||||
rep, err = dao.GetVideo(req)
|
||||
return
|
||||
}
|
||||
|
||||
func (a *Supply) UpdateVideo(req *supplyinfo.UpdateVideoRequest) (rep *supplyinfo.UpdateVideoRespond, err error) {
|
||||
rep, err = dao.UpdateVideo(req)
|
||||
return
|
||||
}
|
||||
|
||||
func (a *Supply) GetExam(req *supplyinfo.GetExamRequest) (rep *supplyinfo.GetExamListData, err error) {
|
||||
rep, err = dao.GetExam(req)
|
||||
return
|
||||
}
|
||||
|
||||
func (a *Supply) GetExamList(req *supplyinfo.GetExamListRequest) (rep *supplyinfo.GetExamListRespond, err error) {
|
||||
rep, err = dao.GetExamList(req)
|
||||
return
|
||||
}
|
||||
|
||||
func (a *Supply) UpdateExam(req *supplyinfo.UpdateExamRequest) (rep *supplyinfo.UpdateExamRespond, err error) {
|
||||
rep, err = dao.UpdateExam(req)
|
||||
return
|
||||
}
|
||||
|
||||
func (a *Supply) GetArtistInfoList(req *supplyinfo.GetArtistInfoListRequest) (rep *supplyinfo.GetArtistInfoListRespond, err error) {
|
||||
rep, err = dao.GetArtistInfoList(int32(req.UserId))
|
||||
return
|
||||
}
|
||||
|
||||
func (a *Supply) GetArtistInfo(req *supplyinfo.GetArtistInfoRequest) (rep *supplyinfo.GetArtistInfoListData, err error) {
|
||||
rep, err = dao.GetArtistInfo(req)
|
||||
return
|
||||
}
|
||||
|
||||
func (a *Supply) UpdateArtistInfo(req *supplyinfo.UpdateArtistInfoRequest) (rep *supplyinfo.UpdateArtistInfoRespond, err error) {
|
||||
rep, err = dao.UpdateArtistInfo(req)
|
||||
return
|
||||
}
|
||||
//
|
||||
//type ISupply interface {
|
||||
// GetSupplyInfoList(req *supplyinfo.GetSupplyInfoListRequest) (rep *supplyinfo.GetSupplyInfoListRespond, err error)
|
||||
// GetSupplyInfo(req *supplyinfo.GetSupplyInfoRequest) (rep *supplyinfo.GetSupplyInfoData, err error)
|
||||
// UpdateSupplyInfo(req *supplyinfo.UpdateSupplyInfoRequest) (rep *supplyinfo.UpdateSupplyInfoRespond, err error)
|
||||
// GetVideoList(req *supplyinfo.GetVideoListRequest) (rep *supplyinfo.GetVideoListRespond, err error)
|
||||
// GetVideo(req *supplyinfo.GetVideoRequest) (rep *supplyinfo.GetVideoListData, err error)
|
||||
// UpdateVideo(req *supplyinfo.UpdateVideoRequest) (rep *supplyinfo.UpdateVideoRespond, err error)
|
||||
// GetExam(req *supplyinfo.GetExamRequest) (rep *supplyinfo.GetExamListData, err error)
|
||||
// GetExamList(req *supplyinfo.GetExamListRequest) (rep *supplyinfo.GetExamListRespond, err error)
|
||||
// UpdateExam(req *supplyinfo.UpdateExamRequest) (rep *supplyinfo.UpdateExamRespond, err error)
|
||||
// GetArtistInfoList(req *supplyinfo.GetArtistInfoListRequest) (rep *supplyinfo.GetArtistInfoListRespond, err error)
|
||||
// GetArtistInfo(req *supplyinfo.GetArtistInfoRequest) (rep *supplyinfo.GetArtistInfoListData, err error)
|
||||
// UpdateArtistInfo(req *supplyinfo.UpdateArtistInfoRequest) (rep *supplyinfo.UpdateArtistInfoRespond, err error)
|
||||
//}
|
||||
//
|
||||
//func NewSupply() ISupply {
|
||||
// return &Supply{}
|
||||
//}
|
||||
//
|
||||
//type Supply struct {
|
||||
//}
|
||||
//
|
||||
//func (a *Supply) GetSupplyInfoList(req *supplyinfo.GetSupplyInfoListRequest) (rep *supplyinfo.GetSupplyInfoListRespond, err error) {
|
||||
// rep, err = dao.GetSupplyInfoList(int32(req.ArtistId), int32(req.Types))
|
||||
// return
|
||||
//}
|
||||
//
|
||||
//func (a *Supply) GetSupplyInfo(req *supplyinfo.GetSupplyInfoRequest) (rep *supplyinfo.GetSupplyInfoData, err error) {
|
||||
// rep, err = dao.GetSupplyInfo(req)
|
||||
// return
|
||||
//}
|
||||
//
|
||||
//func (a *Supply) UpdateSupplyInfo(req *supplyinfo.UpdateSupplyInfoRequest) (rep *supplyinfo.UpdateSupplyInfoRespond, err error) {
|
||||
// rep, err = dao.UpdateSupplyInfo(req)
|
||||
// return
|
||||
//}
|
||||
//
|
||||
//func (a *Supply) GetVideoList(req *supplyinfo.GetVideoListRequest) (rep *supplyinfo.GetVideoListRespond, err error) {
|
||||
// rep, err = dao.GetVideoList(int32(req.UserId))
|
||||
// return
|
||||
//}
|
||||
//
|
||||
//func (a *Supply) GetVideo(req *supplyinfo.GetVideoRequest) (rep *supplyinfo.GetVideoListData, err error) {
|
||||
// rep, err = dao.GetVideo(req)
|
||||
// return
|
||||
//}
|
||||
//
|
||||
//func (a *Supply) UpdateVideo(req *supplyinfo.UpdateVideoRequest) (rep *supplyinfo.UpdateVideoRespond, err error) {
|
||||
// rep, err = dao.UpdateVideo(req)
|
||||
// return
|
||||
//}
|
||||
//
|
||||
//func (a *Supply) GetExam(req *supplyinfo.GetExamRequest) (rep *supplyinfo.GetExamListData, err error) {
|
||||
// rep, err = dao.GetExam(req)
|
||||
// return
|
||||
//}
|
||||
//
|
||||
//func (a *Supply) GetExamList(req *supplyinfo.GetExamListRequest) (rep *supplyinfo.GetExamListRespond, err error) {
|
||||
// rep, err = dao.GetExamList(req)
|
||||
// return
|
||||
//}
|
||||
//
|
||||
//func (a *Supply) UpdateExam(req *supplyinfo.UpdateExamRequest) (rep *supplyinfo.UpdateExamRespond, err error) {
|
||||
// rep, err = dao.UpdateExam(req)
|
||||
// return
|
||||
//}
|
||||
//
|
||||
//func (a *Supply) GetArtistInfoList(req *supplyinfo.GetArtistInfoListRequest) (rep *supplyinfo.GetArtistInfoListRespond, err error) {
|
||||
// rep, err = dao.GetArtistInfoList(int32(req.UserId))
|
||||
// return
|
||||
//}
|
||||
//
|
||||
//func (a *Supply) GetArtistInfo(req *supplyinfo.GetArtistInfoRequest) (rep *supplyinfo.GetArtistInfoListData, err error) {
|
||||
// rep, err = dao.GetArtistInfo(req)
|
||||
// return
|
||||
//}
|
||||
//
|
||||
//func (a *Supply) UpdateArtistInfo(req *supplyinfo.UpdateArtistInfoRequest) (rep *supplyinfo.UpdateArtistInfoRespond, err error) {
|
||||
// rep, err = dao.UpdateArtistInfo(req)
|
||||
// return
|
||||
//}
|
||||
|
@ -3,17 +3,16 @@ package controller
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/fonchain/fonchain-artistinfo/cmd/internal/logic"
|
||||
"github.com/fonchain/fonchain-artistinfo/pb/artwork"
|
||||
"github.com/fonchain/fonchain-artistinfo/cmd/internal/old/logic"
|
||||
artwork2 "github.com/fonchain/fonchain-artistinfo/pb/old/artwork"
|
||||
)
|
||||
|
||||
type ArtWorkProvider struct {
|
||||
artwork.UnimplementedArtworkServer
|
||||
artwork2.UnimplementedArtworkServer
|
||||
artWorkLogic *logic.Artwork
|
||||
}
|
||||
|
||||
func (a *ArtWorkProvider) ArtworkAdd(ctx context.Context, req *artwork.ArtworkAddRequest) (rep *artwork.ArtworkAddRespond, err error) {
|
||||
func (a *ArtWorkProvider) ArtworkAdd(ctx context.Context, req *artwork2.ArtworkAddRequest) (rep *artwork2.ArtworkAddRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
if rep, err = a.artWorkLogic.ArtworkAdd(req); err != nil {
|
||||
return nil, err
|
||||
@ -21,7 +20,7 @@ func (a *ArtWorkProvider) ArtworkAdd(ctx context.Context, req *artwork.ArtworkAd
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func (a *ArtWorkProvider) UpdateArtwork(ctx context.Context, req *artwork.UpdateArtworkRequest) (rep *artwork.UpdateArtworkRespond, err error) {
|
||||
func (a *ArtWorkProvider) UpdateArtwork(ctx context.Context, req *artwork2.UpdateArtworkRequest) (rep *artwork2.UpdateArtworkRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
if rep, err = a.artWorkLogic.UpdateArtwork(req); err != nil {
|
||||
return nil, err
|
||||
@ -29,7 +28,7 @@ func (a *ArtWorkProvider) UpdateArtwork(ctx context.Context, req *artwork.Update
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func (a *ArtWorkProvider) DelArtwork(ctx context.Context, req *artwork.DelArtworkRequest) (rep *artwork.DelArtworkRespond, err error) {
|
||||
func (a *ArtWorkProvider) DelArtwork(ctx context.Context, req *artwork2.DelArtworkRequest) (rep *artwork2.DelArtworkRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
if rep, err = a.artWorkLogic.DelArtwork(req); err != nil {
|
||||
return nil, err
|
||||
@ -37,7 +36,7 @@ func (a *ArtWorkProvider) DelArtwork(ctx context.Context, req *artwork.DelArtwor
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func (a *ArtWorkProvider) GetArtworkList(ctx context.Context, req *artwork.GetArtworkListRequest) (rep *artwork.GetArtworkListRespond, err error) {
|
||||
func (a *ArtWorkProvider) GetArtworkList(ctx context.Context, req *artwork2.GetArtworkListRequest) (rep *artwork2.GetArtworkListRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
if rep, err = a.artWorkLogic.GetArtworkList(req); err != nil {
|
||||
return nil, err
|
||||
@ -45,7 +44,7 @@ func (a *ArtWorkProvider) GetArtworkList(ctx context.Context, req *artwork.GetAr
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func (a *ArtWorkProvider) GetArtwork(ctx context.Context, req *artwork.GetArtworkRequest) (rep *artwork.GetArtworkRespond, err error) {
|
||||
func (a *ArtWorkProvider) GetArtwork(ctx context.Context, req *artwork2.GetArtworkRequest) (rep *artwork2.GetArtworkRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
if rep, err = a.artWorkLogic.GetArtwork(req); err != nil {
|
||||
return nil, err
|
||||
@ -53,14 +52,15 @@ func (a *ArtWorkProvider) GetArtwork(ctx context.Context, req *artwork.GetArtwor
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func (a *ArtWorkProvider) UploadArtwork(ctx context.Context, req *artwork.UploadArtworkRequest) (rep *artwork.UploadArtworkRespond, err error) {
|
||||
func (a *ArtWorkProvider) UploadArtwork(ctx context.Context, req *artwork2.UploadArtworkRequest) (rep *artwork2.UploadArtworkRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
if rep, err = a.artWorkLogic.UploadArtwork(req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rep, nil
|
||||
}
|
||||
func (a *ArtWorkProvider) ApproveArtwork(ctx context.Context, req *artwork.ApproveArtworkRequest) (rep *artwork.ApproveArtworkRespond, err error) {
|
||||
|
||||
func (a *ArtWorkProvider) ApproveArtwork(ctx context.Context, req *artwork2.ApproveArtworkRequest) (rep *artwork2.ApproveArtworkRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
if rep, err = a.artWorkLogic.ApproveArtwork(req); err != nil {
|
||||
return nil, err
|
@ -4,9 +4,10 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/fonchain/fonchain-artistinfo/cmd/model/old"
|
||||
"github.com/fonchain/fonchain-artistinfo/pb/old/artwork"
|
||||
|
||||
"github.com/fonchain/fonchain-artistinfo/cmd/model"
|
||||
"github.com/fonchain/fonchain-artistinfo/pb/artwork"
|
||||
db "github.com/fonchain/fonchain-artistinfo/pkg/db"
|
||||
"github.com/fonchain/fonchain-artistinfo/pkg/m"
|
||||
"go.uber.org/zap"
|
||||
@ -19,7 +20,7 @@ func ArtworkAdd(res *artwork.ArtworkAddRequest) (req *artwork.ArtworkAddRespond,
|
||||
err = errors.New(m.ERROR_MARSHAL)
|
||||
return
|
||||
}
|
||||
artwork := &model.Artwork{
|
||||
artwork := &old.Artwork{
|
||||
ArtistId: res.ArtistId,
|
||||
Name: res.Name,
|
||||
ModelYear: res.ModelYear,
|
||||
@ -45,26 +46,8 @@ func ArtworkAdd(res *artwork.ArtworkAddRequest) (req *artwork.ArtworkAddRespond,
|
||||
return
|
||||
}
|
||||
|
||||
func CheckUserLock(id int64) (err error) {
|
||||
var user model.User
|
||||
if err = db.DB.Where("id = ? ", id).First(&user).Error; err != nil {
|
||||
zap.L().Error("get user info err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return
|
||||
}
|
||||
fmt.Printf("%+v\n", user)
|
||||
if user.IsLock {
|
||||
fmt.Println(user.IsLock)
|
||||
fmt.Println("22222")
|
||||
zap.L().Error("user is lock")
|
||||
return errors.New(m.ERROR_ISLOCK)
|
||||
}
|
||||
fmt.Println("333333")
|
||||
return nil
|
||||
}
|
||||
|
||||
func UpdateArtwork(data *artwork.UpdateArtworkRequest) (err error) {
|
||||
var artwork model.Artwork
|
||||
var artwork old.Artwork
|
||||
artwork.ID = int32(data.ID)
|
||||
if err = db.DB.First(&artwork).Error; err != nil {
|
||||
zap.L().Error("get artwork info err", zap.Error(err))
|
||||
@ -79,7 +62,7 @@ func UpdateArtwork(data *artwork.UpdateArtworkRequest) (err error) {
|
||||
}
|
||||
CreataAddByte, _ := json.Marshal(data.CreateAddress)
|
||||
artwork.ID = int32(data.ID)
|
||||
artwork.ArtistId = userId
|
||||
artwork.ArtistId = uint64(userId)
|
||||
artwork.Name = data.Name
|
||||
artwork.ModelYear = data.ModelYear
|
||||
artwork.Photo = data.Photo
|
||||
@ -104,7 +87,7 @@ func UpdateArtwork(data *artwork.UpdateArtworkRequest) (err error) {
|
||||
}
|
||||
|
||||
func DelArtwork(id int32) (err error) {
|
||||
if err = db.DB.Where("id = ?", id).Delete(&model.Artwork{}).Error; err != nil {
|
||||
if err = db.DB.Where("id = ?", id).Delete(&old.Artwork{}).Error; err != nil {
|
||||
zap.L().Error("delete artwork info err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_DELETE)
|
||||
return
|
||||
@ -114,7 +97,7 @@ func DelArtwork(id int32) (err error) {
|
||||
}
|
||||
func ApproveArtwork(req *artwork.ApproveArtworkRequest) (rep *artwork.ApproveArtworkRespond, err error) {
|
||||
|
||||
var artwork model.Artwork
|
||||
var artwork old.Artwork
|
||||
artwork.ID = req.ArtworkId
|
||||
var state int32
|
||||
if req.IsApprove {
|
||||
@ -122,7 +105,7 @@ func ApproveArtwork(req *artwork.ApproveArtworkRequest) (rep *artwork.ApproveArt
|
||||
} else {
|
||||
state = 4
|
||||
}
|
||||
if err = db.DB.Model(&artwork).Updates(model.Artwork{State: state, Remark: req.Remark, Remark2: req.Remark2, ArtworkId: req.MgmtArtworkId}).Where("id", req.ArtworkId).Error; err != nil {
|
||||
if err = db.DB.Model(&artwork).Updates(old.Artwork{State: state, Remark: req.Remark, Remark2: req.Remark2, ArtworkId: req.MgmtArtworkId}).Where("id", req.ArtworkId).Error; err != nil {
|
||||
zap.L().Error("get artwork info err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
return
|
||||
@ -133,7 +116,7 @@ func GetArtworkList(req *artwork.GetArtworkListRequest) (rep *artwork.GetArtwork
|
||||
rep = &artwork.GetArtworkListRespond{}
|
||||
var datas []*artwork.UpdateArtworkRequest
|
||||
fmt.Println("111")
|
||||
var artworkList []model.Artwork
|
||||
var artworkList []old.Artwork
|
||||
//找到用户 p[]
|
||||
if err = db.DB.Order("created_at desc").Where("artist_id = ?", req.ID).Find(&artworkList).Error; err != nil {
|
||||
fmt.Println("222")
|
||||
@ -172,7 +155,7 @@ func GetArtworkList(req *artwork.GetArtworkListRequest) (rep *artwork.GetArtwork
|
||||
func GetArtwork(id int32) (rep *artwork.GetArtworkRespond, err error) {
|
||||
rep = &artwork.GetArtworkRespond{}
|
||||
|
||||
var artworkRes model.Artwork
|
||||
var artworkRes old.Artwork
|
||||
if err = db.DB.Where("id = ?", id).First(&artworkRes).Error; err != nil {
|
||||
zap.L().Error("get artwork info err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
@ -205,7 +188,7 @@ func GetArtwork(id int32) (rep *artwork.GetArtworkRespond, err error) {
|
||||
}
|
||||
|
||||
func UploadArtwork(Id uint64) (err error) {
|
||||
var artwork model.Artwork
|
||||
var artwork old.Artwork
|
||||
if err = db.DB.Find(&artwork, "id = ?", Id).Error; err != nil {
|
||||
zap.L().Error("get artwork info err", zap.Error(err))
|
||||
err = errors.New(m.ERROR_SELECT)
|
||||
@ -256,7 +239,7 @@ func GetMgmtArtworkList(req *artwork.GetMgmtArtworkListRequest) (rep *artwork.Ge
|
||||
return
|
||||
}
|
||||
rep.Count = uint64(artworkCount)
|
||||
var artworkList []model.Artwork
|
||||
var artworkList []old.Artwork
|
||||
//找到用户
|
||||
sqlWhere = sqlWhere + " limit ?,? "
|
||||
args = append(args, (req.Page-1)*req.PageSize)
|
||||
@ -285,7 +268,7 @@ func GetMgmtArtworkList(req *artwork.GetMgmtArtworkListRequest) (rep *artwork.Ge
|
||||
return
|
||||
}
|
||||
|
||||
func GetUserId(artistId string) (uint64, error) {
|
||||
func GetUserId(artistId string) (int64, error) {
|
||||
var user model.User
|
||||
if err := db.DB.First(&user, "id = ?", artistId).Error; err != nil {
|
||||
|
@ -1,8 +1,14 @@
|
||||
// Package logic -----------------------------
|
||||
// @file : artwork.go
|
||||
// @author : JJXu
|
||||
// @contact : wavingbear@163.com
|
||||
// @time : 2023/2/25 0:12
|
||||
// -------------------------------------------
|
||||
package logic
|
||||
|
||||
import (
|
||||
"github.com/fonchain/fonchain-artistinfo/cmd/internal/dao"
|
||||
"github.com/fonchain/fonchain-artistinfo/pb/artwork"
|
||||
"github.com/fonchain/fonchain-artistinfo/cmd/internal/old/dao"
|
||||
"github.com/fonchain/fonchain-artistinfo/pb/old/artwork"
|
||||
)
|
||||
|
||||
type IArtWork interface {
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
36
cmd/model/artshow_artistIndex.go
Normal file
36
cmd/model/artshow_artistIndex.go
Normal file
@ -0,0 +1,36 @@
|
||||
// Package model -----------------------------
|
||||
// @file : artshow_artistIndex.go
|
||||
// @author : JJXu
|
||||
// @contact : wavingbear@163.com
|
||||
// @time : 2023/3/2 23:11
|
||||
// -------------------------------------------
|
||||
package model
|
||||
|
||||
// 画家指数
|
||||
type ArtshowArtistIndex struct {
|
||||
Model
|
||||
ArtistUid string `gorm:"column:artist_uid;comment:画家uid" json:"artistUid"`
|
||||
Title string `gorm:"column:title;comment:" json:"title"` //艺术家-展览(exhibition) 、 艺术家-资历(seniority) 、艺术家-专业(specialized) 、艺术家-影响力(Influence)、艺术家-收藏(collect)
|
||||
Class string `gorm:"column:class;comment:指数类别" json:"class"` //exhibition 、seniority 、specialized 、Influence 、collect
|
||||
TitleScore float32 `gorm:"column:title_score;comment:总分" json:"titleScore"`
|
||||
Score string `gorm:"column:score;comment:前端定义的分数列表" json:"score"` //
|
||||
Types string `gorm:"column:types;comment:" json:"types"`
|
||||
Status int64 `json:"status" gorm:"column:status;default:2;comment:2=锁定 3=解锁"` //跟随用户的锁定和解锁状态,用于控制数据的展示
|
||||
LockTime string `json:"lockTime" gorm:"column:lock_time;comment:锁定时间"`
|
||||
AuditStatus AuditStatus `json:"auditStatus" gorm:"column:audit_status;default:5;comment:审核状态:2= 待审核,3= 审核失败,4= 审核通过,5= 待补充"`
|
||||
AuditMark1 string `json:"auditMark1" gorm:"column:audit_mark1;comment:审核备注1"`
|
||||
AuditMark2 string `json:"auditMark2" gorm:"column:audit_mark2;comment:审核备注2"`
|
||||
}
|
||||
|
||||
func (a ArtshowArtistIndex) TableName() string {
|
||||
return "artshow_artist_index"
|
||||
}
|
||||
func (a *ArtshowArtistIndex) Editable() bool {
|
||||
if a.Status == 1 {
|
||||
return true
|
||||
}
|
||||
if a.Status == 2 && (a.AuditStatus == AuditType_Failed || a.AuditStatus == AuditType_Pending || a.AuditStatus == AuditType_Supplemented) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
40
cmd/model/artshow_artist_supplement.go
Normal file
40
cmd/model/artshow_artist_supplement.go
Normal file
@ -0,0 +1,40 @@
|
||||
// Package model -----------------------------
|
||||
// @file : artshow.go
|
||||
// @author : JJXu
|
||||
// @contact : wavingbear@163.com
|
||||
// @time : 2023/3/2 9:32
|
||||
// -------------------------------------------
|
||||
package model
|
||||
|
||||
type ArtshowArtistSupplement struct {
|
||||
Model
|
||||
//通过这两个字段弱关联 artwork_lock_record表中对应的画作
|
||||
ArtistUid string `json:"artistUid" gorm:"column:artist_uid;comment:"`
|
||||
Status int64 `json:"status" gorm:"column:status;default:2;comment:2=锁定 3=解锁"` //跟随用户的锁定和解锁状态,用于控制数据的展示
|
||||
LockTime string `json:"lockTime" gorm:"column:lock_time;comment:"`
|
||||
|
||||
//审批字段
|
||||
AuditStatus AuditStatus `json:"auditStatus" gorm:"column:audit_status;comment:审核状态:2= 待审核,3= 审核失败,4= 审核通过,5= 待补充"`
|
||||
AuditMark1 string `json:"auditMark1" gorm:"column:audit_mark1;comment:审核备注1"`
|
||||
AuditMark2 string `json:"auditMark2" gorm:"column:audit_mark2;comment:审核备注2"`
|
||||
|
||||
ArtistName string `json:"artistName" gorm:"column:artist_name;comment:"`
|
||||
ArtistProfile string `json:"artistProfile" gorm:"column:artist_profile;comment:个人简介"`
|
||||
CountryArtLevel int64 `json:"countryArtLevel" gorm:"column:country_art_level;default:1;comment:国家美术师级别: 1=无 2=1级 3=2级"`
|
||||
ArtistCertPic string `json:"artistCertPic" gorm:"column:artist_cert_pic;comment:国家美术师证书"`
|
||||
BankNum string `json:"bank_num" gorm:"column:bank_num;comment:开户行"`
|
||||
BankName string `json:"bank_name" gorm:"column:bank_name;comment:银行卡账号"`
|
||||
}
|
||||
|
||||
func (a ArtshowArtistSupplement) TableName() string {
|
||||
return "artshow_artist_supplement"
|
||||
}
|
||||
func (a *ArtshowArtistSupplement) Editable() bool {
|
||||
if a.Status == 1 {
|
||||
return true
|
||||
}
|
||||
if a.Status == 2 && (a.AuditStatus == AuditType_Failed || a.AuditStatus == AuditType_Pending || a.AuditStatus == AuditType_Supplemented) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
37
cmd/model/artshow_video.go
Normal file
37
cmd/model/artshow_video.go
Normal file
@ -0,0 +1,37 @@
|
||||
// Package model -----------------------------
|
||||
// @file : artshow.go
|
||||
// @author : JJXu
|
||||
// @contact : wavingbear@163.com
|
||||
// @time : 2023/3/2 9:32
|
||||
// -------------------------------------------
|
||||
package model
|
||||
|
||||
type ArtshowVideoRecord struct {
|
||||
Model
|
||||
//通过这两个字段弱关联 artwork_lock_record表中对应的画作
|
||||
ArtistUid string `json:"artistUid" gorm:"column:artist_uid;comment:"`
|
||||
Status int64 `json:"status" gorm:"column:status;default:2;comment:2=锁定 3=解锁"` //跟随用户的锁定和解锁状态,用于控制数据的展示
|
||||
LockTime string `json:"lockTime" gorm:"column:lock_time;comment:"`
|
||||
|
||||
//AccountId int64 `json:"accountId" gorm:"column:account_id;comment:"`
|
||||
ArtistName string `json:"artistName" gorm:"column:artist_name;comment:"`
|
||||
VideoUrl string `json:"videoUrl" gorm:"column:video_url;comment:"`
|
||||
|
||||
//审批字段
|
||||
AuditStatus AuditStatus `json:"auditStatus" gorm:"column:audit_status;comment:审核状态:2= 待审核,3= 审核失败,4= 审核通过,5= 待补充"`
|
||||
AuditMark1 string `json:"auditMark1" gorm:"column:audit_mark1;comment:审核备注1"`
|
||||
AuditMark2 string `json:"auditMark2" gorm:"column:audit_mark2;comment:审核备注2"`
|
||||
}
|
||||
|
||||
func (a ArtshowVideoRecord) TableName() string {
|
||||
return "artshow_video_record"
|
||||
}
|
||||
func (a *ArtshowVideoRecord) Editable() bool {
|
||||
if a.Status == 1 {
|
||||
return true
|
||||
}
|
||||
if a.Status == 2 && (a.AuditStatus == AuditType_Failed || a.AuditStatus == AuditType_Pending || a.AuditStatus == AuditType_Supplemented) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
71
cmd/model/artworkEx.go
Normal file
71
cmd/model/artworkEx.go
Normal file
@ -0,0 +1,71 @@
|
||||
// Package model -----------------------------
|
||||
// @file : artworkEx.go
|
||||
// @author : JJXu
|
||||
// @contact : wavingbear@163.com
|
||||
// @time : 2023/2/28 8:58
|
||||
// -------------------------------------------
|
||||
package model
|
||||
|
||||
import "fmt"
|
||||
|
||||
// 画展补充信息审批表
|
||||
//type ArtExhibitionAudit struct {
|
||||
// Model
|
||||
// //ArtworkUid string `json:"artworkUid" gorm:"column:artwork_uid;comment:画作uid"`
|
||||
// //ArtistUid string `json:"artistUid" gorm:"column:artist_uid;comment:画家uid"`
|
||||
// //UserId int64 `json:"userId" gorm:"column:user_id;comment:画家宝用户id"`
|
||||
// LockTime string `json:"lockTime" gorm:"column:lock_time;comment:锁定时间"`
|
||||
// AuditType auditType `json:"auditType" gorm:"column:audit_type;comment:审批类型"`
|
||||
// AuditModel
|
||||
//}
|
||||
//
|
||||
//func (a ArtExhibitionAudit) TableName() string {
|
||||
// return "art_exhibition_audit"
|
||||
//}
|
||||
|
||||
//// 画作信息补充审批
|
||||
//type AuditArtworkExt struct {
|
||||
// AuditInfo ArtExhibitionAudit `json:"AuditInfo" gorm:"polymorphic:Owner;polymorphicValue:AuditType_ArtworkExt"`
|
||||
//}
|
||||
//
|
||||
//// 画家视频资料补充审批
|
||||
//type AuditArtistVideo struct {
|
||||
// ArtworkId
|
||||
// AuditInfo ArtExhibitionAudit `json:"AuditInfo" gorm:"polymorphic:Owner;polymorphicValue:AuditType_ArtistVideo"`
|
||||
//}
|
||||
//
|
||||
//// 画家信息补充审批
|
||||
//type AuditArtistExt struct {
|
||||
// AuditInfo ArtExhibitionAudit `json:"AuditInfo" gorm:"polymorphic:Owner;polymorphicValue:AuditType_ArtistExt"`
|
||||
//}
|
||||
//
|
||||
//// 画家指数补充审批
|
||||
//type AuditArtistIndex struct {
|
||||
// AuditInfo ArtExhibitionAudit `json:"AuditInfo" gorm:"polymorphic:Owner;polymorphicValue:AuditType_ArtistIndex"`
|
||||
//}
|
||||
|
||||
// ======================================
|
||||
// auditType 审批类型
|
||||
type auditType int
|
||||
|
||||
const (
|
||||
AuditType_ArtworkExt auditType = iota + 1
|
||||
AuditType_ArtistVideo
|
||||
AuditType_ArtistIndex
|
||||
AuditType_ArtistExt
|
||||
)
|
||||
|
||||
var auditTypeMapper = map[auditType]string{
|
||||
AuditType_ArtworkExt: "画作信息补充审批",
|
||||
AuditType_ArtistVideo: "画家视频资料补充审批",
|
||||
AuditType_ArtistIndex: "画家指数补充审批",
|
||||
AuditType_ArtistExt: "画家信息补充审批",
|
||||
}
|
||||
|
||||
func (a auditType) String() string {
|
||||
if str, ok := auditTypeMapper[a]; ok {
|
||||
return str
|
||||
} else {
|
||||
return fmt.Sprintf("未知的审批类型:%d", int(a))
|
||||
}
|
||||
}
|
51
cmd/model/artworkStatement.go
Normal file
51
cmd/model/artworkStatement.go
Normal file
@ -0,0 +1,51 @@
|
||||
package model
|
||||
|
||||
// 对账单委托画作批次
|
||||
type StatementBatch struct {
|
||||
Model
|
||||
// StType int32 `gorm:"column:st_type;unqiueIndex:sttype_uid_batchtime_idx;comment:对账单类型 1=版权 2=物权;"`
|
||||
ArtistUid string `gorm:"column:artist_uid;unqiueIndex:sttype_uid_batchtime_idx;comment:画家uid"`
|
||||
// ArtistRealName string `gorm:"column:artist_real_name;comment:画家真实姓名;"`
|
||||
BatchTime string `gorm:"column:batch_time;unqiueIndex:sttype_uid_batchtime_idx;comment:批次时间;"`
|
||||
FlowStatus int32 `gorm:"column:flow_status;default:1;comment:流程状态 1=未生成 2=已生成未签署 3=已签署"`
|
||||
FileUrl string `gorm:"column:file_url,comment:对账单文件地址;"`
|
||||
|
||||
EntrustList []ArtworkEntrustDetail `gorm:"foreignKey:BatchId"`
|
||||
SalesList []ArtworkSalesDetail `gorm:"foreignKey:BatchId"`
|
||||
}
|
||||
|
||||
func (StatementBatch) TableName() string {
|
||||
return "statement_batch"
|
||||
}
|
||||
|
||||
// 对账单画作委托详情
|
||||
type ArtworkEntrustDetail struct {
|
||||
Model
|
||||
BatchId int64 `gorm:"column:batch_id;unqiueIndex:batchid_tfnum_idx;comment:批次id;"`
|
||||
TfNum string `gorm:"column:tf_num;unqiueIndex:batchid_tfnum_idx;comment:"泰丰画作编号"`
|
||||
ArtworkName string `gorm:"column:artwork_name;comment:画作名称"`
|
||||
Ruler string `gorm:"column:ruler;comment:平尺"`
|
||||
SaleNo string `gorm:"column:sale_no;comment:销售单号"`
|
||||
CompleteDate string `gorm:"column:complete_date;comment:成交日期"`
|
||||
MinPrice float32 `gorm:"column:min_price;comment:委托销售底价"`
|
||||
GuaranteePrice float32 `gorm:"column:guarantee_price;comment:已收取保证金;"`
|
||||
}
|
||||
|
||||
func (ArtworkEntrustDetail) TableName() string {
|
||||
return "artwork_entrust_detail"
|
||||
}
|
||||
|
||||
//对账单画作销售详情
|
||||
type ArtworkSalesDetail struct {
|
||||
Model
|
||||
BatchId int64 `gorm:"column:batch_id;unqiueIndex:batchid_tfnum_idx;comment:批次id;"`
|
||||
TfNum string `gorm:"column:tf_num;unqiueIndex:batchid_tfnum_idx;comment:"泰丰画作编号"`
|
||||
ArtworkName string `gorm:"column:artwork_name;comment:画作名称"`
|
||||
Ruler string `gorm:"column:ruler;comment:平尺"`
|
||||
SaleNo string `gorm:"column:sale_no;comment:销售单号"`
|
||||
CompleteDate string `gorm:"column:complete_date;comment:成交日期"`
|
||||
}
|
||||
|
||||
func (ArtworkSalesDetail) TableName() string {
|
||||
return "artwork_sales_detail"
|
||||
}
|
93
cmd/model/artwork_main_lockRecord.go
Normal file
93
cmd/model/artwork_main_lockRecord.go
Normal file
@ -0,0 +1,93 @@
|
||||
package model
|
||||
|
||||
type AuditStatus int64
|
||||
|
||||
const (
|
||||
AuditType_preSave AuditStatus = 1 //1= 暂存
|
||||
AuditType_Pending AuditStatus = 2 //2= 待审核
|
||||
AuditType_Failed AuditStatus = 3 //3= 审核失败
|
||||
AuditType_Pass AuditStatus = 4 //4= 审核通过
|
||||
AuditType_Supplemented AuditStatus = 5 //5= 待补充
|
||||
)
|
||||
|
||||
var auditStatusMaper = map[AuditStatus]string{
|
||||
AuditType_preSave: "暂存",
|
||||
AuditType_Pending: "待审核",
|
||||
AuditType_Failed: "审核失败",
|
||||
AuditType_Pass: "审核通过",
|
||||
AuditType_Supplemented: "待补充",
|
||||
}
|
||||
|
||||
func (a AuditStatus) String() string {
|
||||
if a == 0 {
|
||||
return "无"
|
||||
}
|
||||
str, ok := auditStatusMaper[a]
|
||||
if !ok {
|
||||
return "未知"
|
||||
}
|
||||
return str
|
||||
}
|
||||
|
||||
// 此表作为画家宝中的画作中间表的主表(画作主要数据保存在画作微服务中),请悉知
|
||||
type ArtworkLockRecord struct {
|
||||
Model
|
||||
ArtistUid string `json:"artistUid" gorm:"column:artist_uid;type:varchar(191);comment:画家uid"`
|
||||
ArtworkUid string `json:"artworkUid" gorm:"column:artwork_uid;type:varchar(191);comment:画作uid"`
|
||||
Status int64 `json:"status" gorm:"column:status;default:1;comment:1=准备/暂存 2=锁定 3=解锁"` //这个锁的目的是配合下面的LockTime 对画作进行历史记录查询时的分组
|
||||
LockTime string `json:"lockTime" gorm:"column:lock_time;comment:锁定时间"`
|
||||
|
||||
//用户锁定后(Status=2)才能进入流程.
|
||||
AuditFlowIndex int64 `json:"auditFlowIndex" gorm:"column:audit_flow_index;default:1;comment:当前的审批流程 1:无 2:基本信息审核 3补充信息审核"`
|
||||
// 画作基本信息审批
|
||||
// -- 画作上传,审核状态为[暂存1] -- 后台锁定用户,所有Status为1的画作设置为[锁定2],并生成锁定时间 ,审核状态为 [待审核3] -- 后台审批不通过,审核状态改为[不通过3] -- 用户修改画作后,状态再次改为[待审核2]直至审批通过
|
||||
BaseAuditStatus AuditStatus `json:"baseAuditStatus" gorm:"column:base_audit_status;default:1;comment:画作基本信息审核状态 1:暂存 2:待审核 3:审核不通过 4:审核通过"`
|
||||
BaseAuditMark string `json:"baseAuditMark" gorm:"column:base_audit_mark;comment:画作基本信息审核审核备注1"`
|
||||
BaseAuditMark2 string `json:"baseAuditMark2" gorm:"column:base_audit_mark2;comment:画作基本信息审核审核备注2"`
|
||||
// ↓
|
||||
// 画作基本信息审批通过后,后台点击[生成补充信息按钮] AuditFlowIndex字段变为3 , 进入画作补充信息审批
|
||||
// ↓
|
||||
//画作补充信息审批记录
|
||||
// 后台点击[生成补充信息按钮],审核状态为[待补充5]-- 用户更新补充信息,状态改为[待审核2] -- 后台审批不通过,审核状态改为[不通过3] -- 用户修改画作后,状态再次改为[待审核2]直至审批通过
|
||||
SupplementAuditStatus AuditStatus `json:"supplementAuditStatus" gorm:"column:supplement_audit_status;default:0;comment:补充信息审核状态 0无 5待补充 2.待审核 3:审核不通过 4:审核通过"` // 注意没有暂存状态
|
||||
SupplementAuditMark string `json:"supplementAuditMark" gorm:"column:supplement_audit_mark;comment:补充信息审核备注1"`
|
||||
SupplementAuditMark2 string `json:"supplementAuditMark2" gorm:"column:supplement_audit_mark2;comment:补充信息审核备注2"`
|
||||
//UserInfo User `gorm:"foreignKey:ArtistUid;reference:MgmtArtistUid"`
|
||||
}
|
||||
|
||||
func (a *ArtworkLockRecord) TableName() string {
|
||||
return "artwork_lock_record"
|
||||
}
|
||||
|
||||
//func (a *ArtworkLockRecord) BeforeUpdate(tx *gorm.DB) (err error) {
|
||||
// var thisData ArtworkLockRecord
|
||||
// tx.Where("artwork_uid = ?", a.ArtworkUid).First(&thisData)
|
||||
// //如果是审核状态不通过的情况下更新画作信息,则自动变为待审核
|
||||
// if thisData.BaseAuditStatus == 3 && a.BaseAuditStatus == 0 && a.SupplementAuditStatus == 0 {
|
||||
// a.BaseAuditStatus = 2
|
||||
// }
|
||||
// if thisData.SupplementAuditStatus == 3 && a.BaseAuditStatus == 0 && a.SupplementAuditStatus == 0 {
|
||||
// a.SupplementAuditStatus = 2
|
||||
// }
|
||||
// return
|
||||
//}
|
||||
|
||||
// 基本信息是否可编辑
|
||||
func (a *ArtworkLockRecord) BaseEditable() bool {
|
||||
if a.Status == 1 {
|
||||
return true
|
||||
}
|
||||
if a.Status == 2 && (a.BaseAuditStatus == AuditType_Failed || a.BaseAuditStatus == AuditType_Pending || a.BaseAuditStatus == AuditType_Supplemented) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// 补充信息是否可编辑
|
||||
func (a *ArtworkLockRecord) SupplementEditable() bool {
|
||||
//&& a.BaseAuditStatus == AuditType_Pass todo 是否要流程通过基本信息
|
||||
if a.Status == 2 && (a.SupplementAuditStatus == AuditType_Supplemented || a.SupplementAuditStatus == AuditType_Failed || a.SupplementAuditStatus == AuditType_Pending) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
//考核 用户模型
|
||||
type ArtworkState struct {
|
||||
gorm.Model
|
||||
ID int32 `gorm:"not null"`
|
||||
ArtworkId int32 `gorm:"default:0"`
|
||||
State int32 `gorm:"default:0"`
|
||||
Pic string `gorm:"type:varchar(256) default ''"`
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
//User 用户模型
|
||||
type Bank struct {
|
||||
gorm.Model
|
||||
ID int32 `gorm:"not null"`
|
||||
UserId int32 `gorm:" not null"`
|
||||
BankAccount string `gorm:"type:varchar(25) not null"`
|
||||
BankName string `gorm:"type:varchar(25) not null"`
|
||||
Enable bool `gorm:"not null"`
|
||||
}
|
@ -1,102 +1,25 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
import "gorm.io/plugin/soft_delete"
|
||||
|
||||
// Contract 用户模型
|
||||
type Contract struct {
|
||||
gorm.Model
|
||||
ID int32 `gorm:"not null"`
|
||||
UserId int32 `gorm:"not null"`
|
||||
CardId string `gorm:"type:varchar(256) default ''"`
|
||||
MgmtUserId string `gorm:"not null"`
|
||||
ArtworkId string `gorm:"type:varchar(256) default ''"`
|
||||
ContractId string `gorm:"type:varchar(256) default ''"`
|
||||
TransactionId string `gorm:"type:varchar(256) default '' "`
|
||||
Type int32 `gorm:"not null"`
|
||||
BatchId int32 `gorm:"not null"`
|
||||
BatchName string `gorm:"type:varchar(256) default '' "`
|
||||
ViewUrl string `gorm:"type:varchar(256) default ''"`
|
||||
DownloadUrl string `gorm:"type:varchar(256) default ''"`
|
||||
State int32 `gorm:"not null"`
|
||||
}
|
||||
|
||||
type Reply struct {
|
||||
Code int `json:"state"`
|
||||
Message string `json:"message"`
|
||||
Data interface{} `json:"data"`
|
||||
}
|
||||
|
||||
type ArtistInfoRes struct {
|
||||
Uid string `json:"uid"`
|
||||
Seqnum int64 `json:"seqnum"` // 序列号
|
||||
Tnum string `json:"tnum"` //ex.T240
|
||||
Num int `json:"num"` // 编号
|
||||
Name string `json:"name"`
|
||||
CardId string `json:"cardId"`
|
||||
PhoneNum string `json:"phone"`
|
||||
Gender string `json:"gender"` // 性别
|
||||
Belong int `json:"belong"` // 画家归属,1-泰丰,2-丰链
|
||||
RecentPhoto string `json:"recentPhoto"` // 画家近照url
|
||||
AccountBank string `json:"bank"` // 开户银行
|
||||
Account string `json:"account"` // 开户账号
|
||||
Video []string `json:"artistVideo"` // 视频资料
|
||||
ArtshowTimes int64 `json:"artshowTimes"` // 参加画展次数
|
||||
Age int64 `json:"age"`
|
||||
Address string `json:"address"`
|
||||
Resume string `json:"resume"`
|
||||
CardPicFace string `json:"cardPicFace"`
|
||||
CardPicBack string `json:"cardPicBack"`
|
||||
CertificatePic string `json:"certificatePic"`
|
||||
CertificateNum string `json:"certificateNum"`
|
||||
// Priority int64 `json:"priority"`
|
||||
Agent string `json:"agent"`
|
||||
PenName string `json:"penName"` // 笔名
|
||||
Comment string `json:"comment"`
|
||||
WtchainHash string `json:"wtchainHash"`
|
||||
BaiduchainHash string `json:"baiduchanHash"`
|
||||
ChengchainHash string `json:"chengchainHash"`
|
||||
ChengChainCertUrl string `json:"chengChainCertUrl"`
|
||||
BaiduChainCertUrl string `json:"baiduChainCertUrl"`
|
||||
ChengChainCertOssUrl string `json:"chengChainCertOssUrl"`
|
||||
Baiduchaincertossurl string `json:"baiduchaincertossurl"`
|
||||
IsArtshow bool `json:"isArtshow"` // 是否参加过画展,1参加过,2未参加过
|
||||
CurrentPosition string `json:"currentPosition"` //现任职务
|
||||
Email string `json:"email"`
|
||||
TeaRela string `json:"teaRela"` //师
|
||||
StuRela string `json:"stuRela"` //徒
|
||||
GradSchoolStudyTour string `json:"gradSchoolStudyTour"` //毕业院校及游学经历
|
||||
NaTittle string `json:"naTittle"` //国家级头衔
|
||||
ProTittle string `json:"proTittle"` //省级头衔
|
||||
MunTittle string `json:"munTittle"` //市级头衔
|
||||
CouTittle string `json:"couTittle"` //区县级头衔
|
||||
OtherTittle string `json:"otherTittle"` //其他头衔
|
||||
PastCooForms string `json:"pastCooForms"` //过往合作平台
|
||||
ExhibiInfo string `json:"exhibiInfo"` //参展信息
|
||||
KeyAchi string `json:"keyAchi"` //主要成就
|
||||
Works string `json:"works"` //作品集
|
||||
PicAlbum string `json:"picAlbum"` //画册
|
||||
|
||||
// AwardInfo []AwardInfo `json:"awardInfo"` //获奖信息
|
||||
// Publish []Publish `json:"publish"` //出版
|
||||
// AcadePub []AcadePub `json:"acadePub"` //学术发表
|
||||
// ThirdComment []ThirdComment `json:"thirdComment"` //第三方或策展人评论
|
||||
CreaDirect string `json:"creaDirect"` //创作方向(科目)
|
||||
ArtStyle string `json:"artStyle"` //艺术风格
|
||||
PenInkSkill string `json:"penInkSkill"` //笔墨技法
|
||||
DrawThink string `json:"drawThink"` //绘画思想
|
||||
AcadeValue string `json:"acadeValue"` //学术价值
|
||||
|
||||
ArtName string `json:"artName"` // 艺名
|
||||
JoinClubTime string `json:"joinClubTime"` // 入会时间
|
||||
ArtistStamp string `json:"artistStamp"` // 画家印章
|
||||
}
|
||||
|
||||
type CreateContractRes struct {
|
||||
Code string `json:"code"`
|
||||
Download_url string `json:"download_url"`
|
||||
Msg string `json:"msg"`
|
||||
Result string `json:"result"`
|
||||
Viewpdf_url string `json:"viewpdf_url"`
|
||||
ID int32 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"`
|
||||
Uid string `gorm:"column:uid;type:varchar(100);comment:合同表的唯一表示;NOT NULL" json:"uid"`
|
||||
ArtistUid string `gorm:"column:artist_uid;type:varchar(100);comment:画家uid;NOT NULL" json:"artist_uid"`
|
||||
ArtworkUid string `gorm:"column:artwork_uid;type:varchar(100);comment:画作uid" json:"artwork_uid"`
|
||||
ContractId string `gorm:"column:contract_id;type:varchar(100);comment:合同id" json:"contract_id"`
|
||||
TransactionId string `gorm:"column:transaction_id;type:varchar(100);comment:交易id" json:"transaction_id"`
|
||||
Type int32 `gorm:"column:type;type:int(1);comment:合同类型;NOT NULL" json:"type"`
|
||||
ViewUrl string `gorm:"column:view_url;type:varchar(500);comment:在线查看合同链接" json:"view_url"`
|
||||
DownloadUrl string `gorm:"column:download_url;type:varchar(500);comment:合同下载链接" json:"download_url"`
|
||||
State int32 `gorm:"column:state;type:int(1);comment:合同状态;NOT NULL" json:"state"` //1 未签署
|
||||
Status int32 `gorm:"column:status;default:2;comment:2=锁定 3=解锁" json:"status" ` //跟随用户的锁定和解锁状态,用于控制数据的展示
|
||||
LockTime string `gorm:"column:lock_time;comment:锁定时间" json:"lockTime"`
|
||||
SignTime string `gorm:"column:sign_time;comment:签署时间" json:"sign_time"`
|
||||
BatchId int32 `gorm:"column:batch_id;comment:批次ID" json:"batch_id"`
|
||||
BatchName string `gorm:"column:batch_name;comment:批次名" json:"batch_name"`
|
||||
CreatedAt int32 `gorm:"column:created_at;autoCreateTime"`
|
||||
UpdatedAt int32 `gorm:"column:updated_at;autoCreateTime"`
|
||||
DeletedAt soft_delete.DeletedAt
|
||||
}
|
||||
|
@ -1,21 +0,0 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
//考核 用户模型
|
||||
type ExhExam struct {
|
||||
gorm.Model
|
||||
ID uint `gorm:"not null"`
|
||||
UserId uint `gorm:"default:0"`
|
||||
Title string `gorm:"type:varchar(64) default ''"`
|
||||
Class string `gorm:"type:varchar(25) default ''"`
|
||||
TitleScore uint `gorm:"default:0"`
|
||||
Score string `gorm:"type:varchar(1024) default ''"`
|
||||
State string `gorm:"type:varchar(25) default ''"`
|
||||
Remark string `gorm:"type:varchar(1024) default ''" json:"remark"`
|
||||
Remark2 string `gorm:"type:varchar(1024) default ''" json:"remark2"`
|
||||
|
||||
Enable bool `gorm:"default:0"`
|
||||
}
|
@ -1,15 +1,17 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// User 用户模型
|
||||
type Invite struct {
|
||||
gorm.Model
|
||||
ID int32 `gorm:"not null default 0"`
|
||||
UserId int32 `gorm:"not null default 0"`
|
||||
InvitedId int32 `gorm:"not null default 0"`
|
||||
Model
|
||||
UserId int32 `gorm:"column:user_id;comment:邀请人账号id"`
|
||||
UserInfo *User `gorm:"foreignKey:id;reference:UserId"`
|
||||
InvitedId int32 `gorm:"column:invited_id;default:0;comment:受邀请画家宝用户id"`
|
||||
InviteCode string `gorm:"column:invite_code;type:varchar(191);comment:邀请人的邀请码"`
|
||||
InvitedCode string `gorm:"column:invited_code;type:varchar(191);comment:受邀请人的邀请码"`
|
||||
}
|
||||
|
||||
func (i Invite) TableName() string {
|
||||
return "invite"
|
||||
}
|
||||
|
||||
type InvitedCodeService struct {
|
||||
|
19
cmd/model/model.go
Normal file
19
cmd/model/model.go
Normal file
@ -0,0 +1,19 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"gorm.io/plugin/soft_delete"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Model struct {
|
||||
ID int64 `gorm:"primarykey;" json:"id" form:"id"`
|
||||
CreatedAt time.Time `gorm:"column:created_at" json:"createdAt"`
|
||||
UpdatedAt time.Time `gorm:"column:updated_at" json:"updatedAt"`
|
||||
DeletedAt soft_delete.DeletedAt `gorm:"column:deleted_at;type:bigint" json:"deletedAt"`
|
||||
}
|
||||
|
||||
type AuditModel struct {
|
||||
AuditStatus int64 `json:"auditStatus" gorm:"column:audit_status;default:1;comment:审核状态 1:待审核/暂存 2:审核通过 3:审核不通过"`
|
||||
AuditMark string `json:"auditMark" gorm:"column:audit_mark;comment:审核备注"`
|
||||
AuditMark2 string `json:"auditMark2" gorm:"column:audit_mark2;comment:审核备注2"`
|
||||
}
|
@ -1,13 +1,10 @@
|
||||
package model
|
||||
package old
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
import "github.com/fonchain/fonchain-artistinfo/cmd/model"
|
||||
|
||||
//User 用户模型
|
||||
// User 用户模型
|
||||
type ArtistInfo struct {
|
||||
gorm.Model
|
||||
ID uint `gorm:"not null" json:"id"`
|
||||
model.Model
|
||||
UserId uint `gorm:"not null default:0" json:"userId"`
|
||||
ArtistId string `gorm:"type:varchar(256) default ''" json:"artistId"`
|
||||
BankAccount string `gorm:"type:varchar(25) not null" json:"bankAccount"`
|
||||
@ -19,3 +16,7 @@ type ArtistInfo struct {
|
||||
Remark2 string `gorm:"type:varchar(256) default ''" json:"remark2"`
|
||||
State uint `gorm:"not null default:0" json:"state"`
|
||||
}
|
||||
|
||||
func (a ArtistInfo) TableName() string {
|
||||
return "sys_artist_info"
|
||||
}
|
@ -1,12 +1,10 @@
|
||||
package model
|
||||
package old
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
import "github.com/fonchain/fonchain-artistinfo/cmd/model"
|
||||
|
||||
// User 用户模型
|
||||
type Artwork struct {
|
||||
gorm.Model
|
||||
model.Model
|
||||
ID int32 `gorm:"not null" json:"id"`
|
||||
ArtistId uint64 `gorm:"not null" json:"artistId"`
|
||||
Name string `gorm:"type:varchar(256) not null" json:"name"`
|
||||
@ -118,7 +116,6 @@ type ArtworkList struct {
|
||||
BatchState string `json:"batchState"` //画作已入库图片
|
||||
DigitizationState string `json:"digitizationState"` //画作已数字化图片
|
||||
AuthenticateState string `json:"authenticateState"` //已鉴证
|
||||
|
||||
}
|
||||
|
||||
type NetworkTrace struct {
|
22
cmd/model/old/artwork_ex_exam.go
Normal file
22
cmd/model/old/artwork_ex_exam.go
Normal file
@ -0,0 +1,22 @@
|
||||
package old
|
||||
|
||||
import "github.com/fonchain/fonchain-artistinfo/cmd/model"
|
||||
|
||||
// 画家指数
|
||||
type ArtworkExExam struct {
|
||||
model.Model
|
||||
UserId uint `gorm:"column:user_id;default:0;comment:账号id" json:"userId"`
|
||||
ArtistUid string `json:"artistUid" gorm:"column:artist_uid;comment:"`
|
||||
Title string `gorm:"column:title;type:varchar(64);default:''" json:"title"`
|
||||
Class string `gorm:"column:class;type:varchar(25);default:''" json:"class"`
|
||||
TitleScore uint `gorm:"column:title_score;default:0" json:"titleScore"`
|
||||
Score string `gorm:"column:score;type:varchar(1024);default:''" json:"score"`
|
||||
State string `gorm:"column:state;type:varchar(25);default:''" json:"state"`
|
||||
Remark string `gorm:"column:remark;type:varchar(1024);default:''" json:"remark"`
|
||||
Remark2 string `gorm:"column:remark2;type:varchar(1024);default:''" json:"remark2"`
|
||||
Enable bool `gorm:"column:enable;default:0" json:"enable"`
|
||||
}
|
||||
|
||||
func (e ArtworkExExam) TableName() string {
|
||||
return "artwork_ex_exam"
|
||||
}
|
@ -1,13 +1,10 @@
|
||||
package model
|
||||
package old
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
import "github.com/fonchain/fonchain-artistinfo/cmd/model"
|
||||
|
||||
//User 用户模型
|
||||
// ExhVideo 视频资料
|
||||
type ExhVideo struct {
|
||||
gorm.Model
|
||||
ID uint `gorm:"not null "`
|
||||
model.Model
|
||||
UserId uint `gorm:"not null default:0"`
|
||||
Url string `gorm:"type:varchar(256) default ''"`
|
||||
State string `gorm:"type:varchar(25) default ''"`
|
@ -1,12 +1,10 @@
|
||||
package model
|
||||
package old
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
import "github.com/fonchain/fonchain-artistinfo/cmd/model"
|
||||
|
||||
//User 用户模型
|
||||
// User 用户模型
|
||||
type ArtworkBatch struct {
|
||||
gorm.Model
|
||||
model.Model
|
||||
ID int32 `gorm:"not null"`
|
||||
BatchId int32 `gorm:"not null"`
|
||||
ArtistId int32 `gorm:"not null"`
|
12
cmd/model/old/artworkstate.go
Normal file
12
cmd/model/old/artworkstate.go
Normal file
@ -0,0 +1,12 @@
|
||||
package old
|
||||
|
||||
import "github.com/fonchain/fonchain-artistinfo/cmd/model"
|
||||
|
||||
// 考核 用户模型
|
||||
type ArtworkState struct {
|
||||
model.Model
|
||||
ID int32 `gorm:"not null"`
|
||||
ArtworkId int32 `gorm:"default:0"`
|
||||
State int32 `gorm:"default:0"`
|
||||
Pic string `gorm:"type:varchar(256) default ''"`
|
||||
}
|
13
cmd/model/old/bank.go
Normal file
13
cmd/model/old/bank.go
Normal file
@ -0,0 +1,13 @@
|
||||
package old
|
||||
|
||||
import "github.com/fonchain/fonchain-artistinfo/cmd/model"
|
||||
|
||||
// User 用户模型
|
||||
type Bank struct {
|
||||
model.Model
|
||||
ID int32 `gorm:"not null"`
|
||||
UserId int32 `gorm:" not null"`
|
||||
BankAccount string `gorm:"type:varchar(25) not null"`
|
||||
BankName string `gorm:"type:varchar(25) not null"`
|
||||
Enable bool `gorm:"not null"`
|
||||
}
|
20
cmd/model/old/contract.go
Normal file
20
cmd/model/old/contract.go
Normal file
@ -0,0 +1,20 @@
|
||||
package old
|
||||
|
||||
import "gorm.io/plugin/soft_delete"
|
||||
|
||||
// Contract 用户模型
|
||||
type Contract struct {
|
||||
ID int32 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"`
|
||||
Uid string `gorm:"column:uid;type:varchar(100);comment:合同表的唯一表示;NOT NULL" json:"uid"`
|
||||
ArtistUid string `gorm:"column:artist_uid;type:varchar(100);comment:画家uid;NOT NULL" json:"artist_uid"`
|
||||
ArtworkUid string `gorm:"column:artwork_uid;type:varchar(100);comment:画作uid" json:"artwork_uid"`
|
||||
ContractId string `gorm:"column:contract_id;type:varchar(100);comment:合同id" json:"contract_id"`
|
||||
TransactionId string `gorm:"column:transaction_id;type:varchar(100);comment:交易id" json:"transaction_id"`
|
||||
Type int32 `gorm:"column:type;type:int(1);comment:合同类型;NOT NULL" json:"type"`
|
||||
ViewUrl string `gorm:"column:view_url;type:varchar(500);comment:在线查看合同链接" json:"view_url"`
|
||||
DownloadUrl string `gorm:"column:download_url;type:varchar(500);comment:合同下载链接" json:"download_url"`
|
||||
State int32 `gorm:"column:state;type:int(1);comment:合同状态;NOT NULL" json:"state"`
|
||||
CreatedAt int32 `gorm:"column:created_at;autoCreateTime"`
|
||||
UpdatedAt int32 `gorm:"column:updated_at;autoCreateTime"`
|
||||
DeletedAt soft_delete.DeletedAt
|
||||
}
|
@ -1,12 +1,10 @@
|
||||
package model
|
||||
package old
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
import "github.com/fonchain/fonchain-artistinfo/cmd/model"
|
||||
|
||||
//User 用户模型
|
||||
// SupplyInfo 画作信息补充
|
||||
type SupplyInfo struct {
|
||||
gorm.Model
|
||||
model.Model
|
||||
ID uint `gorm:"not null"`
|
||||
ArtworkId string `gorm:"type:varchar(256) default ''"`
|
||||
ArtistId string `gorm:"type:varchar(256) default ''"`
|
@ -1,15 +1,33 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
//实名认证模型
|
||||
// 实名认证模型
|
||||
type RealName struct {
|
||||
gorm.Model
|
||||
Name string `gorm:"not null"`
|
||||
IDNum string `gorm:"type:varchar(18) not null"`
|
||||
TelNum string `gorm:"type:varchar(11) not null"`
|
||||
IdcardFront string `gorm:"type:varchar(256) not null"`
|
||||
IdcardBack string `gorm:"type:varchar(256) not null"`
|
||||
Model
|
||||
Name string `gorm:"not null"`
|
||||
IdNum string `gorm:"type:varchar(18) not null"`
|
||||
TelNum string `gorm:"type:varchar(11) not null"`
|
||||
IdCardFront string `gorm:"column:idcard_front;comment:身份证正面"`
|
||||
IdCardBack string `gorm:"column:idcard_back;comment:身份证反面"`
|
||||
Age int `gorm:"column:age"`
|
||||
Sex SexType `gorm:"column:sex"`
|
||||
Birthday string `gorm:"column:birthday"`
|
||||
Address string `gorm:"column:address"`
|
||||
}
|
||||
|
||||
func (r RealName) TableName() string {
|
||||
return "real_name"
|
||||
}
|
||||
|
||||
type SexType string
|
||||
|
||||
func (s SexType) ConvertInt32() int32 {
|
||||
switch s {
|
||||
case "男":
|
||||
return 1
|
||||
case "女":
|
||||
return 2
|
||||
default: //其它
|
||||
return 3
|
||||
}
|
||||
|
||||
}
|
||||
|
55
cmd/model/temp_artwork_ext_data.go
Normal file
55
cmd/model/temp_artwork_ext_data.go
Normal file
@ -0,0 +1,55 @@
|
||||
// Package model -----------------------------
|
||||
// @file : temp_artwork_ext_data.go
|
||||
// @author : JJXu
|
||||
// @contact : wavingbear@163.com
|
||||
// @time : 2023/2/28 11:51
|
||||
// -------------------------------------------
|
||||
package model
|
||||
|
||||
import (
|
||||
"gorm.io/plugin/soft_delete"
|
||||
"time"
|
||||
)
|
||||
|
||||
type ArtworkExtData struct {
|
||||
Id int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"Id"` //type:int32 comment:
|
||||
ArtworkId int32 `gorm:"column:artwork_id" json:"ArtworkId"` //type:int32
|
||||
ArtworkUuid string `gorm:"column:artwork_uuid" json:"ArtworkUuid"` //type:string comment:画作的uuid
|
||||
ArtType int32 `gorm:"column:art_type" json:"ArtType"` //type:string comment:艺术类别
|
||||
ArtTitle int32 `gorm:"column:art_title" json:"ArtTitle"` //type:string comment:艺术主题
|
||||
ArtStyle int32 `gorm:"column:art_style" json:"ArtStyle"` //type:string comment:风格
|
||||
Color int32 `gorm:"column:color" json:"Color"` //type:string comment:颜色
|
||||
PenTechniques string `gorm:"column:pen_techniques" json:"PenTechniques"` //type:string comment:笔墨技法
|
||||
ArtIdea string `gorm:"column:art_idea" json:"ArtIdea"` //type:string comment:绘画思想
|
||||
ExpressIdea string `gorm:"column:express_idea" json:"ExpressIdea"` //type:string comment:表达思想
|
||||
ArtStory string `gorm:"column:art_story" json:"ArtStory"` //type:string comment:创作背景故事
|
||||
FirstPublish string `gorm:"column:first_publish" json:"FirstPublish"` //type:string comment:首次发表
|
||||
FirstPublishImg string `gorm:"column:first_publish_img" json:"FirstPublishImg"` //type:string comment:首次发表截图
|
||||
FirstName string `gorm:"column:first_name" json:"FirstName"` //type:string comment:首次命名
|
||||
FirstNameImg string `gorm:"column:first_name_img" json:"FirstNameImg"` //type:string comment:首次命名截图
|
||||
CopyrightHash string `gorm:"column:copyright_hash" json:"CopyrightHash"` //type:string comment:版权哈希
|
||||
RealrightHash string `gorm:"column:realright_hash" json:"RealrightHash"` //type:string comment:物权哈希
|
||||
SprayPosition string `gorm:"column:spray_position" json:"SprayPosition"` //type:string comment:喷涂位置
|
||||
SprayRemark string `gorm:"column:spray_remark" json:"SprayRemark"` //type:string comment:喷涂备注
|
||||
AuthDataHash string `gorm:"column:auth_data_hash" json:"AuthData"` //type:string comment:鉴证数据
|
||||
DigiShootDate string `gorm:"column:digi_shoot_date" json:"DigiShootDate"` //type:string comment:数字化拍摄时间
|
||||
DigiMakeDate string `gorm:"column:digi_make_date" json:"DigiMakeDate"` //type:string comment:数字化后期制作时间
|
||||
DigiArtImg string `gorm:"column:digi_art_img" json:"DigiArtImg"` //type:string comment:数字化画作图
|
||||
DigiArtCopyrightImg string `gorm:"column:digi_art_copyright_img" json:"DigiArtCopyrightImg"` //type:string comment:数字化画作版权图
|
||||
DigiCopyrightInfo string `gorm:"column:digi_copyright_info" json:"DigiCopyrightInfo"` //type:string comment:数字化画作版权信息
|
||||
DigiCopyrightFile string `gorm:"column:digi_copyright_file" json:"DigiCopyrightFile"` //type:string comment:数字化画作版权文件
|
||||
Tags string `gorm:"column:tags" json:"Tags"` //type:string comment:选择标签
|
||||
ThirdComment string `gorm:"column:third_comment" json:"ThirdComment"` //type:string comment:第三方评价
|
||||
AuthTime string `gorm:"column:auth_time;comment:鉴证时间" json:"auth_time"`
|
||||
AuthImg string `gorm:"column:auth_img" json:"AuthImg"` //type:string comment:鉴证图
|
||||
Status int32 `gorm:"column:status;type:tinyint(4);default:1;comment:状态 正常 2 删除;NOT NULL" json:"status"`
|
||||
CreatedAt time.Time `gorm:"column:created_at" json:"CreatedAt"` //type:int32 comment:
|
||||
UpdatedAt time.Time `gorm:"column:updated_at" json:"UpdatedAt"` //type:int32 comment:
|
||||
DeletedAt soft_delete.DeletedAt //type:int32 comment:
|
||||
}
|
||||
|
||||
// TableName 表名:artwork_ext_data,画作补充数据。
|
||||
// 说明:
|
||||
func (ArtworkExtData) TableName() string {
|
||||
return "artwork_ext_data"
|
||||
}
|
25
cmd/model/tmpArtistInfo.go
Normal file
25
cmd/model/tmpArtistInfo.go
Normal file
@ -0,0 +1,25 @@
|
||||
package model
|
||||
|
||||
// 此表用于在创建用户是临时存储艺术家信息,等法大大认证通过后再进行创建
|
||||
type TempArtistInfo struct {
|
||||
MgmtAccId int64 `gorm:"column:mgmt_acc_id;comment:关联sys_user表的MgmtAccId"`
|
||||
UserInfo *User `gorm:"foreignKey:MgmtAccId;comment:"`
|
||||
Name string `gorm:"column:name;comment:"`
|
||||
CardId string `gorm:"column:card_id;comment:"`
|
||||
Gender int32 `gorm:"column:gender;comment:"`
|
||||
Age int32 `gorm:"column:age;comment:"`
|
||||
NativePlace string `gorm:"column:native_place;comment:"`
|
||||
PenName string `gorm:"column:pen_name;comment:"`
|
||||
Phone string `gorm:"column:phone;comment:"`
|
||||
Address string `gorm:"column:address;comment:"`
|
||||
StageName string `gorm:"column:stage_name;comment:"`
|
||||
CaaCertNum string `gorm:"column:caa_cert_num;comment:"`
|
||||
CaaJoinTime string `gorm:"column:caa_join_time;comment:"`
|
||||
JoinShow int32 `gorm:"column:join_show;comment:"`
|
||||
WxAccount string `gorm:"column:wx_account;comment:微信账号"`
|
||||
InviterCode string `gorm:"column:inviter_code;comment:邀请人的二维码"`
|
||||
}
|
||||
|
||||
func (t TempArtistInfo) TableName() string {
|
||||
return "temp_artist_info"
|
||||
}
|
@ -1,44 +1,57 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// User 用户模型
|
||||
type User struct {
|
||||
gorm.Model
|
||||
ID uint64 `gorm:"not null"`
|
||||
MgmtUserId uint64 `gorm:"not null"`
|
||||
MgmtArtistId string `gorm:"type:varchar(256) not null"`
|
||||
Account string `gorm:"type:varchar(256) not null"`
|
||||
MnemonicWords string `gorm:"type:varchar(256) not null"`
|
||||
TelNum string `gorm:"type:varchar(20) not null"`
|
||||
Name string `gorm:"type:varchar(20) not null"`
|
||||
PenName string `gorm:"type:varchar(20) not null"`
|
||||
StageName string `gorm:"type:varchar(20) not null"`
|
||||
JoinAssoTime string `gorm:"type:varchar(64) not null"`
|
||||
CertificateNum string `gorm:"type:varchar(16) not null"`
|
||||
CertificateImg string `gorm:"type:varchar(512) not null"`
|
||||
Key string `gorm:"type:varchar(16) not null"`
|
||||
RealNameID int32 `gorm:"not null"`
|
||||
IDNum string `gorm:"type:varchar(18) not null"`
|
||||
Sex int32 `gorm:"not null"`
|
||||
Ruler int64 `gorm:"not null"`
|
||||
OpenId string `gorm:"type:varchar(2048) not null"`
|
||||
CustomerId string `gorm:"type:varchar(2048) not null"`
|
||||
Age int32 `gorm:"not null"`
|
||||
Introduct string `gorm:"type:varchar(2048) not null"`
|
||||
CreateAt int64 `gorm:"not null"`
|
||||
ConAddress string `gorm:"type:varchar(2048) not null"`
|
||||
Photo string `gorm:"type:varchar(2048) not null"`
|
||||
Video string `gorm:"type:varchar(256) not null"`
|
||||
IsRealName int64 `gorm:"not null"`
|
||||
IsFdd int64 `gorm:"not null"`
|
||||
FddState int64 `gorm:"not null"`
|
||||
WxAccount string `gorm:"type:varchar(256) not null"`
|
||||
IsLock bool `gorm:"not null"`
|
||||
InvitedCode string `gorm:"type:varchar(16) default ''"`
|
||||
IsRead int32 `gorm:"not null"`
|
||||
IsImport int32 `gorm:"not null"`
|
||||
Enable bool `gorm:"not null"`
|
||||
Model
|
||||
MgmtAccId int64 `gorm:"column:mgmt_acc_id;not null;uniqueIndex:mgmt_acc_mgmt_artist_idx;comment:账号id"`
|
||||
MgmtArtistId int64 `gorm:"column:mgmt_artist_id;not null;uniqueIndex:mgmt_acc_mgmt_artist_idx;comment:艺术家id"`
|
||||
MgmtArtistUid string `gorm:"column:mgmt_artist_uid;type:varchar(256);comment:艺术家uid"`
|
||||
TelNum string `gorm:"column:tel_num;type:varchar(20);not null;电话号码"`
|
||||
InviteCode string `gorm:"column:invited_code;type:varchar(16);default:'';comment:个人邀请码"`
|
||||
InvitedBy *Invite `gorm:"foreignKey:InvitedId"` //邀请者的相关信息
|
||||
Account string `gorm:"column:account;varchar(191);comment:账号"`
|
||||
CertificateNum string `gorm:"column:certificate_num;type:varchar(16);comment:中美协会证书编号"`
|
||||
CertificateImg string `gorm:"column:certificate_img;type:varchar(512);comment:中美协会证书url"`
|
||||
JoinAssoTime string `json:"joinAssoTime" gorm:"column:join_asso_time;comment:入会时间"`
|
||||
Photo string `gorm:"column:photo;type:varchar(255);comment:个人近照"`
|
||||
|
||||
// 实名认证
|
||||
IsRealName int64 `gorm:"column:is_real_name;default:0;是否实名认证:0未认证 1已认证"`
|
||||
RealNameId int64 `gorm:"column:real_name_id;comment:实名认证id"`
|
||||
RealNameInfo *RealName `gorm:"foreignKey:RealNameId;references:ID"`
|
||||
// 法大大认证
|
||||
FddState int64 `gorm:"column:fdd_state;not null;comment:法大大认证状态0未认证 2已认证"`
|
||||
CustomerId string `gorm:"column:costumer_id;type:varchar(2048);not null;comment:法大大客户id"`
|
||||
OpenId string `gorm:"openId"`
|
||||
|
||||
//用户状态
|
||||
IsRead int64 `gorm:"column:is_read;not null;comment:条款阅读状态"`
|
||||
IsLock bool `gorm:"column:is_lock;not null;comment:画家锁定状态"`
|
||||
LatestLockTime string `json:"latestLockTime" gorm:"column:latest_lock_time;comment:最新锁定时间"`
|
||||
//ConAddress string `json:"conAddress" gorm:"column:con_address;comment:"`
|
||||
WxAccount string `json:"wxAccount" gorm:"column:wx_account;comment:"`
|
||||
//前端参数,提交实名认证后生成
|
||||
Htmltype string `gorm:"html_type" json:"htmltype"`
|
||||
Envtype string `gorm:"env_type" json:"envtype"`
|
||||
|
||||
//IsFdd int64 `gorm:"column:is_fdd;not null;comment:"`
|
||||
//Account string `gorm:"type:varchar(256) not null"`
|
||||
//Name string `gorm:"type:varchar(20) not null"`
|
||||
//MnemonicWords string `gorm:"type:varchar(256) not null"`
|
||||
//PenName string `gorm:"type:varchar(20) not null"`
|
||||
//StageName string `gorm:"type:varchar(20) not null"`
|
||||
//JoinAssoTime string `gorm:"type:varchar(64) not null"`
|
||||
//Key string `gorm:"type:varchar(16) not null"`
|
||||
//RealNameID int32 `gorm:"not null"`
|
||||
//IDNum string `gorm:"type:varchar(18) not null"`
|
||||
//Sex int32 `gorm:"not null"`
|
||||
//OpenId string `gorm:"type:varchar(2048) not null"`
|
||||
//Age int32 `gorm:"not null"`
|
||||
//Introduct string `gorm:"type:varchar(2048) not null"`
|
||||
//Photo string `gorm:"type:varchar(2048) not null"`
|
||||
//Video string `gorm:"type:varchar(256) not null"`
|
||||
}
|
||||
|
||||
func (u User) TableName() string {
|
||||
return "sys_user"
|
||||
}
|
||||
|
@ -1,14 +1,15 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
//User 用户模型
|
||||
// User 用户模型
|
||||
type UserInvited struct {
|
||||
gorm.Model
|
||||
ID int32 `gorm:"not null"`
|
||||
UserId int32 `gorm:"type:int not null"`
|
||||
InvitedUserId int32 `gorm:"type:int not null"`
|
||||
Count int32 `gorm:"type:int not null"`
|
||||
Model
|
||||
UserId int32 `gorm:"column:user_id;type:int;not null;comment:邀请人id"`
|
||||
InviteCode string `gorm:"column:invite_code;comment:邀请人的邀请码"`
|
||||
InvitedCode string `gorm:"column:invited_code;comment:受邀请人的邀请码"`
|
||||
InvitedUserId int32 `gorm:"column:invited_user_id;type:int;not null;comment:受邀请人画家宝用户id"`
|
||||
Count int32 `gorm:"column:count;type:int;default:1;邀请次数统计"`
|
||||
}
|
||||
|
||||
func (UserInvited) TableName() string {
|
||||
return "user_invited"
|
||||
}
|
||||
|
53
cmd/model/view_passed_artwork_static.go
Normal file
53
cmd/model/view_passed_artwork_static.go
Normal file
@ -0,0 +1,53 @@
|
||||
// Package model -----------------------------
|
||||
// @file : view_passed_artwork_static.go
|
||||
// @author : JJXu
|
||||
// @contact : wavingbear@163.com
|
||||
// @time : 2023/3/11 11:13
|
||||
// -------------------------------------------
|
||||
package model
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
"time"
|
||||
)
|
||||
|
||||
type ViewPassedArtworkStatic struct {
|
||||
ArtistUid string `json:"artistUid" gorm:"column:artist_uid;comment:画家uid"`
|
||||
IsLock bool `json:"isLock" gorm:"column:is_lock;comment:是否锁定"`
|
||||
LatestLockTime string `json:"latestLockTime" gorm:"column:latest_lock_time;comment:最近一次锁定时间"`
|
||||
PasswdArtworkNumber int64 `json:"passwdArtworkNumber" gorm:"column:passwd_artwork_number;comment:审核通过的画作总数"`
|
||||
LatestUpdatedAt time.Time `json:"latestUpdatedAt" gorm:"column:latest_updated_at;comment:最近一次更新时间"`
|
||||
RealName string `json:"realName" gorm:"column:real_name;comment:真实姓名"`
|
||||
//---补充字段,转到pb文件
|
||||
//Idx int64 `json:"idx" gorm:"-"`
|
||||
//PenName string `json:"penName" gorm:"-"`
|
||||
//StageName string `json:"stageName" gorm:"-"`
|
||||
//ArtworkTotal string `json:"artworkTotal" gorm:"-"`
|
||||
//RulerTotal int64 `json:"rulerTotal" gorm:"-"`
|
||||
//PassedRulerTotal int64 `json:"passedRulerTotal" gorm:"-"`
|
||||
}
|
||||
|
||||
func (p ViewPassedArtworkStatic) TableName() string {
|
||||
return "view_passed_artwork_static"
|
||||
}
|
||||
|
||||
func CreateViewPassedArtworkStatic(db *gorm.DB) error {
|
||||
// 已通过画作统计
|
||||
var sql = `
|
||||
CREATE OR REPLACE VIEW view_passed_artwork_static AS
|
||||
-- 查询审核通过的画作数量以及相关数据
|
||||
SELECT
|
||||
su.mgmt_artist_uid artist_uid
|
||||
,MAX(su.is_lock) is_lock
|
||||
,max(su.latest_lock_time) latest_lock_time
|
||||
,count(alr.artwork_uid) passed_artwork_number
|
||||
,MAX(alr.updated_at) latest_updated_at
|
||||
,MAX(rn.name) real_name
|
||||
FROM sys_user su
|
||||
LEFT JOIN artwork_lock_record alr ON alr.artist_uid = su.mgmt_artist_uid AND alr.audit_flow_index=3 AND alr.supplement_audit_status=4 AND alr.deleted_at = 0
|
||||
LEFT JOIN real_name rn ON rn.id = su.real_name_id
|
||||
GROUP BY su.mgmt_artist_uid HAVING su.mgmt_artist_uid !=''
|
||||
`
|
||||
db.Exec(sql)
|
||||
return nil
|
||||
}
|
100
cmd/model/view_user.go
Normal file
100
cmd/model/view_user.go
Normal file
@ -0,0 +1,100 @@
|
||||
// Package model -----------------------------
|
||||
// @file : view_user.go
|
||||
// @author : JJXu
|
||||
// @contact : wavingbear@163.com
|
||||
// @time : 2023/2/27 13:51
|
||||
// -------------------------------------------
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type UserView struct {
|
||||
UserId int64 `json:"userId" gorm:"column:user_id;comment:用户表id"`
|
||||
AccId int64 `json:"accId" gorm:"column:mgmt_acc_id;comment:账号id"`
|
||||
ArtistUid string `json:"artistUid" gorm:"column:mgmt_artist_uid;comment:账号id"`
|
||||
TelNum string `json:"telNum" gorm:"column:tel_num;comment:电话号码"`
|
||||
InviteCode string `json:"inviteCode" gorm:"column:invited_code;comment:邀请码"`
|
||||
Account string `json:"account" gorm:"column:account;comment:账号"`
|
||||
Photo string `json:"photo" gorm:"column:photo;comment:个人近照"`
|
||||
IsRealName int64 `json:"isRealName" gorm:"column:is_real_name;comment:是否实名认证"`
|
||||
FddState int64 `json:"fddState" gorm:"column:fdd_state;comment:法大大状态"`
|
||||
IsRead int64 `json:"isRead" gorm:"column:is_read;comment:是否已读 0未读 1已读"`
|
||||
IsLock bool `json:"isLock" gorm:"column:is_lock;comment:是否锁定"`
|
||||
LatestLockTime string `json:"latestLockTime" gorm:"column:latest_lock_time;comment:"`
|
||||
RealName string `json:"realName" gorm:"column:real_name;comment:真实姓名"`
|
||||
IdNum string `json:"idNum" gorm:"column:id_num;comment:证件号码"`
|
||||
Sex SexType `json:"sex" gorm:"column:sex;comment:性别"`
|
||||
Age int64 `json:"age" gorm:"column:age;comment:年龄"`
|
||||
RealAddress string `json:"address" gorm:"column:real_address;comment:真实地址"`
|
||||
IdcardBack string `json:"idcardBack" gorm:"column:idcard_back;comment:身份证背面"`
|
||||
IdcardFront string `json:"idcardFront" gorm:"column:idcard_front;comment:身份证反面"`
|
||||
JoinAssoTime string `json:"joinAssoTime" gorm:"column:join_asso_time;comment:入会时间"`
|
||||
InviterInviteCode string `json:"inviterInviteCode" gorm:"column:inviter_invite_code;comment:邀请人的邀请码"`
|
||||
InviterRealName string `json:"inviterRealName" gorm:"column:inviter_name;comment:邀请人的真实姓名"`
|
||||
CreatedAt time.Time `json:"createdAt" gorm:"column:created_at;comment:"`
|
||||
UpdatedAt time.Time `json:"updatedAt" gorm:"column:updated_at;comment:"`
|
||||
DeletedAt int64 `json:"deletedAt" gorm:"column:deleted_at;comment:"`
|
||||
CertificateNum string `json:"certificateNum" gorm:"column:certificate_num;comment:"`
|
||||
CertificateImg string `json:"certificateImg" gorm:"column:certificate_img;comment:"`
|
||||
BankName string `json:"bankName" gorm:"column:bank_name;comment:"`
|
||||
BankNum string `json:"bankNum" gorm:"column:bank_num;comment:"`
|
||||
WxAccount string `json:"wxAccount" gorm:"column:wx_account;comment:企业微信账号"`
|
||||
}
|
||||
|
||||
func (u UserView) TableName() string {
|
||||
return "user_view"
|
||||
}
|
||||
func CreateUserView(db *gorm.DB) error {
|
||||
var sql = `
|
||||
CREATE OR REPLACE VIEW user_view AS
|
||||
SELECT
|
||||
su.id user_id,
|
||||
su.mgmt_acc_id,
|
||||
su.mgmt_artist_uid,
|
||||
su.tel_num,
|
||||
su.invited_code,
|
||||
su.account,
|
||||
su.photo,
|
||||
su.is_real_name,
|
||||
su.fdd_state,
|
||||
su.is_read,
|
||||
su.is_lock,
|
||||
rn.name real_name,
|
||||
rn.idcard_front,
|
||||
rn.idcard_back,
|
||||
rn.address real_address,
|
||||
rn.id_num,
|
||||
rn.sex,
|
||||
rn.age,
|
||||
su.created_at,
|
||||
su.updated_at,
|
||||
su.deleted_at,
|
||||
inviter.invited_code inviter_invite_code,
|
||||
inviter_rn.name inviter_name,
|
||||
su.latest_lock_time,
|
||||
su.join_asso_time,
|
||||
su.certificate_num,
|
||||
su.certificate_img,
|
||||
su.wx_account,
|
||||
aas.bank_name,
|
||||
aas.bank_num
|
||||
|
||||
FROM sys_user su
|
||||
LEFT JOIN real_name rn ON rn.id = su.real_name_id
|
||||
-- 邀请者信息
|
||||
LEFT JOIN invite ON invite.invited_id = su.id
|
||||
LEFT JOIN sys_user inviter ON inviter.invited_code = invite.invite_code
|
||||
LEFT JOIN real_name inviter_rn ON inviter_rn.id = inviter.real_name_id
|
||||
LEFT JOIN artshow_artist_supplement aas ON aas.artist_uid = su.mgmt_artist_uid AND aas.lock_time = (
|
||||
select MAX(lock_time) from artshow_artist_supplement WHERE artist_uid = su.mgmt_artist_uid
|
||||
)
|
||||
WHERE
|
||||
su.deleted_at = 0
|
||||
`
|
||||
db.Exec(sql)
|
||||
return nil
|
||||
}
|
@ -3,18 +3,17 @@ mode = dev #正式prod #测试dev
|
||||
|
||||
[mysql]
|
||||
Db = mysql
|
||||
DbHost = mysql
|
||||
DbHost = 127.0.0.1
|
||||
DbPort = 3306
|
||||
DbUser = root
|
||||
DbPassWord = 123456
|
||||
DbName = artistmgmttest
|
||||
|
||||
[redis]
|
||||
|
||||
RedisDB = 2
|
||||
RedisAddr = 172.16.100.99:9008
|
||||
RedisPW = "nDCTrfTtBu3Pw"
|
||||
RedisDBNAme =
|
||||
RedisAddr = 127.0.0.1:6379
|
||||
#RedisPW = "nDCTrfTtBu3Pw"
|
||||
#RedisDBNAme =
|
||||
|
||||
[chain]
|
||||
IP=127.0.0.1:37101
|
||||
|
@ -7,7 +7,7 @@ DbHost = 127.0.0.1
|
||||
DbPort = 3306
|
||||
DbUser = dyb
|
||||
DbPassWord = rootdyb
|
||||
DbArtist = artist
|
||||
DbArtist = artistmgmtDev
|
||||
|
||||
[redis]
|
||||
RedisDB = 2
|
||||
|
@ -15,18 +15,60 @@ dubbo:
|
||||
port: 20050
|
||||
provider:
|
||||
services:
|
||||
ArtistInfoProvider:
|
||||
ArtistInfoUserProvider:
|
||||
interface: com.fontree.microservices.common.ArtistInfoUser
|
||||
retries: 100
|
||||
ArtistInfoArtworkProvider:
|
||||
interface: com.fontree.microservices.common.ArtistInfoArtwork
|
||||
retries: 100
|
||||
ArtistInfoArtshowProvider:
|
||||
interface: com.fontree.microservices.common.ArtistInfoArtshow
|
||||
retries: 100
|
||||
ArtistInfoContractProvider:
|
||||
interface: com.fontree.microservices.common.ArtistInfoContract
|
||||
retries: 100
|
||||
#ContractProvider:
|
||||
# interface: com.fontree.microservices.common.Contract
|
||||
# retries: 0
|
||||
#ArtWorkProvider:
|
||||
# interface: com.fontree.microservices.common.ArtWork
|
||||
# retries: 0
|
||||
#SupplyProvider:
|
||||
# interface: com.fontree.microservices.common.Supply
|
||||
# retries: 0
|
||||
consumer:
|
||||
request-timeout: 120s
|
||||
references:
|
||||
AccountClientImpl:
|
||||
protocol: tri
|
||||
interface: com.fontree.microservices.common.Account
|
||||
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
|
||||
params:
|
||||
.accessKeyId: "Accountksl"
|
||||
.secretAccessKey: "BSDY-FDF1-Fontree_account"
|
||||
ArtistClientImpl:
|
||||
protocol: tri
|
||||
interface: com.fontree.microservices.common.Artist
|
||||
ArtistInfoClientImpl:
|
||||
protocol: tri
|
||||
interface: com.fontree.microservices.common.ArtistInfo
|
||||
retries: 0
|
||||
ContractProvider:
|
||||
interface: com.fontree.microservices.common.Contract
|
||||
retries: 0
|
||||
ArtWorkProvider:
|
||||
interface: com.fontree.microservices.common.ArtWork
|
||||
retries: 0
|
||||
SupplyProvider:
|
||||
ContractClientImpl:
|
||||
timeout: 15s
|
||||
protocol: tri
|
||||
interface: com.fontree.microservices.common.contract
|
||||
filter: cshutdown,sign
|
||||
params:
|
||||
.accessKeyId: "SYD8-Chain-04"
|
||||
.secretAccessKey: "Al-Chain-FDF112"
|
||||
ArtworkClientImpl:
|
||||
protocol: tri
|
||||
interface: com.fontree.microservices.common.Artwork
|
||||
ArtworkQueryClientImpl:
|
||||
protocol: tri
|
||||
interface: com.fontree.microservices.common.ArtworkQuery
|
||||
SupplyClientImpl:
|
||||
protocol: tri
|
||||
interface: com.fontree.microservices.common.Supply
|
||||
retries: 0
|
||||
logger:
|
||||
zap-config:
|
||||
level: info # 日志级别
|
||||
|
@ -8,10 +8,10 @@ dubbo:
|
||||
demoZK:
|
||||
protocol: zookeeper
|
||||
timeout: 120s
|
||||
# address: 127.0.0.1:2181
|
||||
address: 127.0.0.1:2181
|
||||
# address: 121.229.45.214:9004
|
||||
# address: 114.218.158.24:2181
|
||||
address: zookeeper:2181
|
||||
# address: zookeeper:2181
|
||||
protocols:
|
||||
triple: #triple
|
||||
name: tri
|
||||
@ -19,18 +19,60 @@ dubbo:
|
||||
port: 20050
|
||||
provider:
|
||||
services:
|
||||
ArtistInfoProvider:
|
||||
ArtistInfoUserProvider:
|
||||
interface: com.fontree.microservices.common.ArtistInfoUser
|
||||
retries: 100
|
||||
ArtistInfoArtworkProvider:
|
||||
interface: com.fontree.microservices.common.ArtistInfoArtwork
|
||||
retries: 100
|
||||
ArtistInfoArtshowProvider:
|
||||
interface: com.fontree.microservices.common.ArtistInfoArtshow
|
||||
retries: 100
|
||||
ArtistInfoContractProvider:
|
||||
interface: com.fontree.microservices.common.ArtistInfoContract
|
||||
retries: 100
|
||||
#ContractProvider:
|
||||
# interface: com.fontree.microservices.common.Contract
|
||||
# retries: 0
|
||||
#ArtWorkProvider:
|
||||
# interface: com.fontree.microservices.common.ArtWork
|
||||
# retries: 0
|
||||
#SupplyProvider:
|
||||
# interface: com.fontree.microservices.common.Supply
|
||||
# retries: 0
|
||||
consumer:
|
||||
request-timeout: 120s
|
||||
references:
|
||||
AccountClientImpl:
|
||||
protocol: tri
|
||||
interface: com.fontree.microservices.common.Account
|
||||
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
|
||||
params:
|
||||
.accessKeyId: "Accountksl"
|
||||
.secretAccessKey: "BSDY-FDF1-Fontree_account"
|
||||
ArtistClientImpl:
|
||||
protocol: tri
|
||||
interface: com.fontree.microservices.common.Artist
|
||||
ArtistInfoClientImpl:
|
||||
protocol: tri
|
||||
interface: com.fontree.microservices.common.ArtistInfo
|
||||
# retries: 100
|
||||
ContractProvider:
|
||||
interface: com.fontree.microservices.common.Contract
|
||||
# retries: 0
|
||||
ArtWorkProvider:
|
||||
interface: com.fontree.microservices.common.ArtWork
|
||||
# retries: 0
|
||||
SupplyProvider:
|
||||
ContractClientImpl:
|
||||
timeout: 15s
|
||||
protocol: tri
|
||||
interface: com.fontree.microservices.common.contract
|
||||
filter: cshutdown,sign
|
||||
params:
|
||||
.accessKeyId: "SYD8-Chain-04"
|
||||
.secretAccessKey: "Al-Chain-FDF112"
|
||||
ArtworkClientImpl:
|
||||
protocol: tri
|
||||
interface: com.fontree.microservices.common.Artwork
|
||||
ArtworkQueryClientImpl:
|
||||
protocol: tri
|
||||
interface: com.fontree.microservices.common.ArtworkQuery
|
||||
SupplyClientImpl:
|
||||
protocol: tri
|
||||
interface: com.fontree.microservices.common.Supply
|
||||
# retries: 0
|
||||
logger:
|
||||
zap-config:
|
||||
level: info # 日志级别
|
||||
|
@ -7,7 +7,7 @@ DbHost = mysql
|
||||
DbPort = 3306
|
||||
DbUser = fonchain
|
||||
DbPassWord = C250PflXIWv2SQm
|
||||
DbName = artistmgmt
|
||||
DbName = artistmgmtProd
|
||||
|
||||
[redis]
|
||||
RedisDB = 2
|
||||
|
@ -11,7 +11,7 @@ dubbo:
|
||||
# address: 127.0.0.1:2181
|
||||
# address: 121.229.45.214:9004
|
||||
# address: 114.218.158.24:2181
|
||||
address: 172.16.100.93:2181
|
||||
address: zookeeper:2181
|
||||
protocols:
|
||||
triple: #triple
|
||||
name: tri
|
||||
|
@ -3,15 +3,14 @@ mode = dev #正式prod #测试dev
|
||||
|
||||
[mysql]
|
||||
Db = mysql
|
||||
DbHost = mysql
|
||||
DbPort = 3306
|
||||
DbUser = root
|
||||
DbPassWord = 123456
|
||||
DbName = artistmgmttest
|
||||
DbHost = 172.16.100.99 #214
|
||||
DbPort = 9007
|
||||
DbUser = artuser
|
||||
DbPassWord = "C250PflXIWv2SQm8"
|
||||
DbName = artistmgmtDev
|
||||
|
||||
[redis]
|
||||
|
||||
RedisDB = 2
|
||||
RedisDB = 3
|
||||
RedisAddr = 172.16.100.99:9008
|
||||
RedisPW = "nDCTrfTtBu3Pw"
|
||||
RedisDBNAme =
|
||||
|
@ -8,10 +8,10 @@ dubbo:
|
||||
demoZK:
|
||||
protocol: zookeeper
|
||||
timeout: 120s
|
||||
# address: 127.0.0.1:2181
|
||||
# address: 127.0.0.1:2181
|
||||
# address: 121.229.45.214:9004
|
||||
# address: 114.218.158.24:2181
|
||||
address: zookeeper:2181
|
||||
address: 172.16.100.93:2181
|
||||
protocols:
|
||||
triple: #triple
|
||||
name: tri
|
||||
@ -19,18 +19,60 @@ dubbo:
|
||||
port: 20050
|
||||
provider:
|
||||
services:
|
||||
ArtistInfoProvider:
|
||||
ArtistInfoUserProvider:
|
||||
interface: com.fontree.microservices.common.ArtistInfoUser
|
||||
retries: 100
|
||||
ArtistInfoArtworkProvider:
|
||||
interface: com.fontree.microservices.common.ArtistInfoArtwork
|
||||
retries: 100
|
||||
ArtistInfoArtshowProvider:
|
||||
interface: com.fontree.microservices.common.ArtistInfoArtshow
|
||||
retries: 100
|
||||
ArtistInfoContractProvider:
|
||||
interface: com.fontree.microservices.common.ArtistInfoContract
|
||||
retries: 100
|
||||
#ContractProvider:
|
||||
# interface: com.fontree.microservices.common.Contract
|
||||
# retries: 0
|
||||
#ArtWorkProvider:
|
||||
# interface: com.fontree.microservices.common.ArtWork
|
||||
# retries: 0
|
||||
#SupplyProvider:
|
||||
# interface: com.fontree.microservices.common.Supply
|
||||
# retries: 0
|
||||
consumer:
|
||||
request-timeout: 120s
|
||||
references:
|
||||
AccountClientImpl:
|
||||
protocol: tri
|
||||
interface: com.fontree.microservices.common.Account
|
||||
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
|
||||
params:
|
||||
.accessKeyId: "Accountksl"
|
||||
.secretAccessKey: "BSDY-FDF1-Fontree_account"
|
||||
ArtistClientImpl:
|
||||
protocol: tri
|
||||
interface: com.fontree.microservices.common.Artist
|
||||
ArtistInfoClientImpl:
|
||||
protocol: tri
|
||||
interface: com.fontree.microservices.common.ArtistInfo
|
||||
# retries: 100
|
||||
ContractProvider:
|
||||
interface: com.fontree.microservices.common.Contract
|
||||
# retries: 0
|
||||
ArtWorkProvider:
|
||||
interface: com.fontree.microservices.common.ArtWork
|
||||
# retries: 0
|
||||
SupplyProvider:
|
||||
ContractClientImpl:
|
||||
timeout: 15s
|
||||
protocol: tri
|
||||
interface: com.fontree.microservices.common.contract
|
||||
filter: cshutdown,sign
|
||||
params:
|
||||
.accessKeyId: "SYD8-Chain-04"
|
||||
.secretAccessKey: "Al-Chain-FDF112"
|
||||
ArtworkClientImpl:
|
||||
protocol: tri
|
||||
interface: com.fontree.microservices.common.Artwork
|
||||
ArtworkQueryClientImpl:
|
||||
protocol: tri
|
||||
interface: com.fontree.microservices.common.ArtworkQuery
|
||||
SupplyClientImpl:
|
||||
protocol: tri
|
||||
interface: com.fontree.microservices.common.Supply
|
||||
# retries: 0
|
||||
logger:
|
||||
zap-config:
|
||||
level: info # 日志级别
|
||||
|
29
conf/xjjdev/conf.ini
Normal file
29
conf/xjjdev/conf.ini
Normal file
@ -0,0 +1,29 @@
|
||||
[system]
|
||||
mode = dev #正式prod #测试dev
|
||||
|
||||
[mysql]
|
||||
Db = mysql
|
||||
DbHost = 127.0.0.1
|
||||
DbPort = 3306
|
||||
DbUser = root
|
||||
DbPassWord = 123456
|
||||
DbName = artistmgmttest
|
||||
|
||||
[redis]
|
||||
RedisDB = 2
|
||||
RedisAddr = 127.0.0.1:6379
|
||||
#RedisPW = "nDCTrfTtBu3Pw"
|
||||
#RedisDBNAme =
|
||||
|
||||
[chain]
|
||||
IP=127.0.0.1:37101
|
||||
MnemonicWords=知 睡 迷 纤 纲 耀 镜 婆 渡 考 拔 百
|
||||
ContractAccount=XC8214684261867838@xuper
|
||||
ContractName=fp001
|
||||
|
||||
[zap_log]
|
||||
level: "info"
|
||||
filename: "logs/artist_server.log"
|
||||
max_size: 200
|
||||
max_age: 30
|
||||
max_backups: 7
|
119
conf/xjjdev/dubbogo.yaml
Normal file
119
conf/xjjdev/dubbogo.yaml
Normal file
@ -0,0 +1,119 @@
|
||||
dubbo:
|
||||
metrics:
|
||||
enable: true # default is true
|
||||
path: /metrics # default is /metrics
|
||||
port: 9091 # default is 9090
|
||||
namespace: dubboArtist # default is dubbo 作为数据上报 metrics 的前
|
||||
registries:
|
||||
demoZK:
|
||||
protocol: zookeeper
|
||||
timeout: 120s
|
||||
address: 127.0.0.1:2181
|
||||
# address: 121.229.45.214:9004
|
||||
# address: 114.218.158.24:2181
|
||||
# address: zookeeper:2181
|
||||
protocols:
|
||||
triple: #triple
|
||||
name: tri
|
||||
# ip: 121.229.45.214
|
||||
port: 20050
|
||||
provider:
|
||||
services:
|
||||
ArtistInfoUserProvider:
|
||||
interface: com.fontree.microservices.common.ArtistInfoUser
|
||||
retries: 100
|
||||
ArtistInfoArtworkProvider:
|
||||
interface: com.fontree.microservices.common.ArtistInfoArtwork
|
||||
retries: 100
|
||||
ArtistInfoArtshowProvider:
|
||||
interface: com.fontree.microservices.common.ArtistInfoArtshow
|
||||
retries: 100
|
||||
ArtistInfoContractProvider:
|
||||
interface: com.fontree.microservices.common.ArtistInfoContract
|
||||
retries: 100
|
||||
#ContractProvider:
|
||||
# interface: com.fontree.microservices.common.Contract
|
||||
# retries: 0
|
||||
#ArtWorkProvider:
|
||||
# interface: com.fontree.microservices.common.ArtWork
|
||||
# retries: 0
|
||||
#SupplyProvider:
|
||||
# interface: com.fontree.microservices.common.Supply
|
||||
# retries: 0
|
||||
consumer:
|
||||
request-timeout: 120s
|
||||
references:
|
||||
AccountClientImpl:
|
||||
protocol: tri
|
||||
interface: com.fontree.microservices.common.Account
|
||||
filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
|
||||
params:
|
||||
.accessKeyId: "Accountksl"
|
||||
.secretAccessKey: "BSDY-FDF1-Fontree_account"
|
||||
ArtistClientImpl:
|
||||
protocol: tri
|
||||
interface: com.fontree.microservices.common.Artist
|
||||
ArtistInfoClientImpl:
|
||||
protocol: tri
|
||||
interface: com.fontree.microservices.common.ArtistInfo
|
||||
ContractClientImpl:
|
||||
timeout: 15s
|
||||
protocol: tri
|
||||
interface: com.fontree.microservices.common.contract
|
||||
filter: cshutdown,sign
|
||||
params:
|
||||
.accessKeyId: "SYD8-Chain-04"
|
||||
.secretAccessKey: "Al-Chain-FDF112"
|
||||
ArtworkClientImpl:
|
||||
protocol: tri
|
||||
interface: com.fontree.microservices.common.Artwork
|
||||
ArtworkQueryClientImpl:
|
||||
protocol: tri
|
||||
interface: com.fontree.microservices.common.ArtworkQuery
|
||||
SupplyClientImpl:
|
||||
protocol: tri
|
||||
interface: com.fontree.microservices.common.Supply
|
||||
logger:
|
||||
zap-config:
|
||||
level: info # 日志级别
|
||||
development: false
|
||||
disableCaller: false
|
||||
disableStacktrace: false
|
||||
encoding: "json"
|
||||
# zap encoder 配置
|
||||
encoderConfig:
|
||||
messageKey: "message"
|
||||
levelKey: "level"
|
||||
timeKey: "time"
|
||||
nameKey: "logger"
|
||||
callerKey: "caller"
|
||||
stacktraceKey: "stacktrace"
|
||||
lineEnding: ""
|
||||
levelEncoder: "capitalColor"
|
||||
timeEncoder: "iso8601"
|
||||
durationEncoder: "seconds"
|
||||
callerEncoder: "short"
|
||||
nameEncoder: ""
|
||||
EncodeTime: zapcore.TimeEncoderOfLayout("2006-01-02 15:04:05.000"),
|
||||
EncodeDuration: zapcore.SecondsDurationEncoder,
|
||||
outputPaths:
|
||||
- "stderr"
|
||||
errorOutputPaths:
|
||||
- "stderr"
|
||||
lumberjack-config:
|
||||
# 写日志的文件名称
|
||||
filename: "logs/artist_server.log"
|
||||
# 每个日志文件长度的最大大小,单位是 MiB。默认 100MiB
|
||||
maxSize: 10
|
||||
# 日志保留的最大天数(只保留最近多少天的日志)
|
||||
maxAge: 15
|
||||
# 只保留最近多少个日志文件,用于控制程序总日志的大小
|
||||
maxBackups: 10
|
||||
# 是否使用本地时间,默认使用 UTC 时间
|
||||
localTime: true
|
||||
# 是否压缩日志文件,压缩方法 gzip
|
||||
compress: false
|
||||
|
||||
|
||||
|
||||
|
18
conf/xjjdev/sdk.real.yaml
Normal file
18
conf/xjjdev/sdk.real.yaml
Normal file
@ -0,0 +1,18 @@
|
||||
# endorseService Info
|
||||
# testNet addrs
|
||||
endorseServiceHost: "39.156.69.83:37100"
|
||||
complianceCheck:
|
||||
# 是否需要进行合规性背书
|
||||
isNeedComplianceCheck: false
|
||||
# 是否需要支付合规性背书费用
|
||||
isNeedComplianceCheckFee: false
|
||||
# 合规性背书费用
|
||||
complianceCheckEndorseServiceFee: 400
|
||||
# 支付合规性背书费用的收款地址
|
||||
complianceCheckEndorseServiceFeeAddr: aB2hpHnTBDxko3UoP2BpBZRujwhdcAFoT
|
||||
# 如果通过合规性检查,签发认证签名的地址
|
||||
complianceCheckEndorseServiceAddr: jknGxa6eyum1JrATWvSJKW3thJ9GKHA9n
|
||||
#创建平行链所需要的最低费用
|
||||
minNewChainAmount: "100"
|
||||
crypto: "xchain"
|
||||
txVersion: 1
|
18
conf/xjjdev/sdk.test.yaml
Normal file
18
conf/xjjdev/sdk.test.yaml
Normal file
@ -0,0 +1,18 @@
|
||||
# endorseService Info
|
||||
# testNet addrs
|
||||
endorseServiceHost: "14.215.179.74:37101"
|
||||
complianceCheck:
|
||||
# 是否需要进行合规性背书
|
||||
isNeedComplianceCheck: true
|
||||
# 是否需要支付合规性背书费用
|
||||
isNeedComplianceCheckFee: true
|
||||
# 合规性背书费用
|
||||
complianceCheckEndorseServiceFee: 100
|
||||
# 支付合规性背书费用的收款地址
|
||||
complianceCheckEndorseServiceFeeAddr: cHvBK1TTB52GYtVxHK7HnW8N9RTqkN99R
|
||||
# 如果通过合规性检查,签发认证签名的地址
|
||||
complianceCheckEndorseServiceAddr: XDxkpQkfLwG6h56e896f3vBHhuN5g6M9u
|
||||
#创建平行链所需要的最低费用
|
||||
minNewChainAmount: "100"
|
||||
crypto: "xchain"
|
||||
txVersion: 1
|
18
conf/xjjdev/sdk.yaml
Normal file
18
conf/xjjdev/sdk.yaml
Normal file
@ -0,0 +1,18 @@
|
||||
# endorseService Info
|
||||
# testNet addrs
|
||||
# endorseServiceHost: "120.48.24.223:37101"
|
||||
endorseServiceHost: "127.0.0.1:37101"
|
||||
complianceCheck:
|
||||
# 是否需要进行合规性背书
|
||||
isNeedComplianceCheck: false
|
||||
# 是否需要支付合规性背书费用
|
||||
isNeedComplianceCheckFee: false
|
||||
# 合规性背书费用
|
||||
complianceCheckEndorseServiceFee: 400
|
||||
# 支付合规性背书费用的收款地址
|
||||
complianceCheckEndorseServiceFeeAddr: WwLgfAatHyKx2mCJruRaML4oVf7Chzp42
|
||||
# 如果通过合规性检查,签发认证签名的地址
|
||||
complianceCheckEndorseServiceAddr: WwLgfAatHyKx2mCJruRaML4oVf7Chzp42
|
||||
#创建平行链所需要的最低费用
|
||||
minNewChainAmount: "100"
|
||||
crypto: "xchain"
|
Binary file not shown.
Binary file not shown.
131
go.mod
131
go.mod
@ -1,9 +1,9 @@
|
||||
module github.com/fonchain/fonchain-artistinfo
|
||||
|
||||
go 1.16
|
||||
go 1.19
|
||||
|
||||
replace (
|
||||
github.com/fonchain/electronic-contract => ../electronic-contract
|
||||
//github.com/fonchain/electronic-contract => ../electronic-contract
|
||||
github.com/fonchain/utils/objstorage => ../utils/objstorage
|
||||
github.com/fonchain/utils/utils => ../utils/utils
|
||||
github.com/fonchain_enterprise/utils/aes => ../utils/aes
|
||||
@ -15,26 +15,149 @@ replace (
|
||||
|
||||
require (
|
||||
dubbo.apache.org/dubbo-go/v3 v3.0.1
|
||||
github.com/alibaba/sentinel-golang v1.0.4
|
||||
github.com/dubbogo/grpc-go v1.42.9
|
||||
github.com/dubbogo/triple v1.1.8
|
||||
github.com/envoyproxy/protoc-gen-validate v0.9.1
|
||||
github.com/fonchain/utils/objstorage v0.0.0-00010101000000-000000000000
|
||||
github.com/fonchain/utils/utils v0.0.0-00010101000000-000000000000
|
||||
github.com/fonchain_enterprise/utils/aes v0.0.0-00010101000000-000000000000
|
||||
github.com/gin-gonic/gin v1.8.1
|
||||
github.com/go-redis/redis v6.15.9+incompatible
|
||||
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0
|
||||
github.com/golang/protobuf v1.5.2
|
||||
github.com/mwitkow/go-proto-validators v0.3.2
|
||||
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646
|
||||
github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b
|
||||
go.uber.org/zap v1.21.0
|
||||
golang.org/x/image v0.0.0-20190802002840-cff245a6509b
|
||||
google.golang.org/protobuf v1.28.0
|
||||
google.golang.org/protobuf v1.28.1
|
||||
gopkg.in/ini.v1 v1.66.4
|
||||
gorm.io/driver/mysql v1.4.4
|
||||
gorm.io/gorm v1.24.1
|
||||
gorm.io/plugin/soft_delete v1.2.0
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/alibaba/sentinel-golang v1.0.4
|
||||
contrib.go.opencensus.io/exporter/prometheus v0.4.0 // indirect
|
||||
github.com/RoaringBitmap/roaring v0.7.1 // indirect
|
||||
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect
|
||||
github.com/Workiva/go-datastructures v1.0.52 // indirect
|
||||
github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5 // indirect
|
||||
github.com/aliyun/alibaba-cloud-sdk-go v1.61.18 // indirect
|
||||
github.com/aliyun/aliyun-oss-go-sdk v2.2.4+incompatible // indirect
|
||||
github.com/apache/dubbo-getty v1.4.7 // indirect
|
||||
github.com/apache/dubbo-go-hessian2 v1.11.0 // indirect
|
||||
github.com/baidubce/bce-sdk-go v0.9.138 // indirect
|
||||
github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f // indirect
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/bits-and-blooms/bitset v1.2.0 // indirect
|
||||
github.com/boombuler/barcode v1.0.1 // indirect
|
||||
github.com/buger/jsonparser v1.1.1 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.1.2 // indirect
|
||||
github.com/coreos/go-semver v0.3.0 // indirect
|
||||
github.com/coreos/go-systemd/v22 v22.3.2 // indirect
|
||||
github.com/creasty/defaults v1.5.2 // indirect
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/dubbogo/go-zookeeper v1.0.4-0.20211212162352-f9d2183d89d5 // indirect
|
||||
github.com/dubbogo/gost v1.11.22 // indirect
|
||||
github.com/emicklei/go-restful/v3 v3.7.3 // indirect
|
||||
github.com/fsnotify/fsnotify v1.5.1 // indirect
|
||||
github.com/ghodss/yaml v1.0.0 // indirect
|
||||
github.com/gin-contrib/sse v0.1.0 // indirect
|
||||
github.com/go-co-op/gocron v1.18.0 // indirect
|
||||
github.com/go-errors/errors v1.0.1 // indirect
|
||||
github.com/go-kit/log v0.1.0 // indirect
|
||||
github.com/go-logfmt/logfmt v0.5.0 // indirect
|
||||
github.com/go-logr/logr v0.4.0 // indirect
|
||||
github.com/go-ole/go-ole v1.2.4 // indirect
|
||||
github.com/go-playground/locales v0.14.0 // indirect
|
||||
github.com/go-playground/universal-translator v0.18.0 // indirect
|
||||
github.com/go-playground/validator/v10 v10.10.0 // indirect
|
||||
github.com/go-resty/resty/v2 v2.7.0 // indirect
|
||||
github.com/go-sql-driver/mysql v1.6.0 // indirect
|
||||
github.com/goccy/go-json v0.9.7 // indirect
|
||||
github.com/gogo/protobuf v1.3.2 // indirect
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||
github.com/golang/mock v1.4.4 // indirect
|
||||
github.com/golang/snappy v0.0.4 // indirect
|
||||
github.com/google/go-cmp v0.5.7 // indirect
|
||||
github.com/google/gofuzz v1.1.0 // indirect
|
||||
github.com/google/uuid v1.3.0 // indirect
|
||||
github.com/gorilla/websocket v1.4.2 // indirect
|
||||
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 // indirect
|
||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||
github.com/hashicorp/vault/sdk v0.3.0 // indirect
|
||||
github.com/jinzhu/copier v0.3.5 // indirect
|
||||
github.com/jinzhu/inflection v1.0.0 // indirect
|
||||
github.com/jinzhu/now v1.1.5 // indirect
|
||||
github.com/jmespath/go-jmespath v0.4.0 // indirect
|
||||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
github.com/k0kubun/pp v3.0.1+incompatible // indirect
|
||||
github.com/knadh/koanf v1.4.0 // indirect
|
||||
github.com/leodido/go-urn v1.2.1 // indirect
|
||||
github.com/magiconair/properties v1.8.6 // indirect
|
||||
github.com/mattn/go-colorable v0.1.12 // indirect
|
||||
github.com/mattn/go-isatty v0.0.14 // indirect
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
|
||||
github.com/mitchellh/copystructure v1.2.0 // indirect
|
||||
github.com/mitchellh/go-homedir v1.1.0 // indirect
|
||||
github.com/mitchellh/mapstructure v1.4.3 // indirect
|
||||
github.com/mitchellh/reflectwalk v1.0.2 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
github.com/mschoch/smat v0.2.0 // indirect
|
||||
github.com/nacos-group/nacos-sdk-go v1.1.0 // indirect
|
||||
github.com/natefinch/lumberjack v2.0.0+incompatible // indirect
|
||||
github.com/opentracing/opentracing-go v1.2.0 // indirect
|
||||
github.com/pelletier/go-toml v1.9.4 // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.0.1 // indirect
|
||||
github.com/pierrec/lz4 v2.5.2+incompatible // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/polarismesh/polaris-go v1.0.1 // indirect
|
||||
github.com/prometheus/client_golang v1.12.1 // indirect
|
||||
github.com/prometheus/client_model v0.2.0 // indirect
|
||||
github.com/prometheus/common v0.32.1 // indirect
|
||||
github.com/prometheus/procfs v0.7.3 // indirect
|
||||
github.com/prometheus/statsd_exporter v0.21.0 // indirect
|
||||
github.com/robfig/cron/v3 v3.0.1 // indirect
|
||||
github.com/shirou/gopsutil v3.20.11+incompatible // indirect
|
||||
github.com/shirou/gopsutil/v3 v3.21.6 // indirect
|
||||
github.com/spaolacci/murmur3 v1.1.0 // indirect
|
||||
github.com/spf13/afero v1.9.2 // indirect
|
||||
github.com/spf13/cast v1.4.1 // indirect
|
||||
github.com/spf13/jwalterweatherman v1.1.0 // indirect
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
github.com/spf13/viper v1.11.0 // indirect
|
||||
github.com/subosito/gotenv v1.2.0 // indirect
|
||||
github.com/tklauser/go-sysconf v0.3.6 // indirect
|
||||
github.com/tklauser/numcpus v0.2.2 // indirect
|
||||
github.com/toolkits/concurrent v0.0.0-20150624120057-a4371d70e3e3 // indirect
|
||||
github.com/uber/jaeger-client-go v2.29.1+incompatible // indirect
|
||||
github.com/uber/jaeger-lib v2.4.1+incompatible // indirect
|
||||
github.com/ugorji/go/codec v1.2.7 // indirect
|
||||
github.com/zouyx/agollo/v3 v3.4.5 // indirect
|
||||
go.etcd.io/etcd/api/v3 v3.5.2 // indirect
|
||||
go.etcd.io/etcd/client/pkg/v3 v3.5.2 // indirect
|
||||
go.etcd.io/etcd/client/v3 v3.5.2 // indirect
|
||||
go.opencensus.io v0.23.0 // indirect
|
||||
go.uber.org/atomic v1.9.0 // indirect
|
||||
go.uber.org/multierr v1.6.0 // indirect
|
||||
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 // indirect
|
||||
golang.org/x/net v0.2.0 // indirect
|
||||
golang.org/x/sync v0.1.0 // indirect
|
||||
golang.org/x/sys v0.2.0 // indirect
|
||||
golang.org/x/text v0.4.0 // indirect
|
||||
golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9 // indirect
|
||||
google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac // indirect
|
||||
google.golang.org/grpc v1.45.0 // indirect
|
||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
k8s.io/apimachinery v0.22.4 // indirect
|
||||
k8s.io/klog/v2 v2.9.0 // indirect
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.1.2 // indirect
|
||||
)
|
||||
|
207
go.sum
207
go.sum
@ -17,31 +17,15 @@ cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHOb
|
||||
cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI=
|
||||
cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk=
|
||||
cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY=
|
||||
cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg=
|
||||
cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8=
|
||||
cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0=
|
||||
cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY=
|
||||
cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM=
|
||||
cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY=
|
||||
cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ=
|
||||
cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI=
|
||||
cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4=
|
||||
cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc=
|
||||
cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA=
|
||||
cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A=
|
||||
cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
|
||||
cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE=
|
||||
cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc=
|
||||
cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg=
|
||||
cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc=
|
||||
cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ=
|
||||
cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow=
|
||||
cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM=
|
||||
cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M=
|
||||
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
|
||||
cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk=
|
||||
cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk=
|
||||
cloud.google.com/go/firestore v1.6.1/go.mod h1:asNXNOzBdyVQmEU+ggO8UPodTkEVFW5Qx+rwHnAz+EY=
|
||||
cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
|
||||
cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw=
|
||||
cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA=
|
||||
@ -117,7 +101,6 @@ github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb
|
||||
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
|
||||
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
|
||||
github.com/armon/go-metrics v0.3.9/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc=
|
||||
github.com/armon/go-metrics v0.3.10/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc=
|
||||
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
|
||||
github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
|
||||
github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A=
|
||||
@ -161,7 +144,6 @@ github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QH
|
||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||
github.com/certifi/gocertifi v0.0.0-20191021191039-0944d244cd40/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA=
|
||||
github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA=
|
||||
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
|
||||
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
|
||||
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE=
|
||||
@ -193,7 +175,6 @@ github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3Ee
|
||||
github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM=
|
||||
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
|
||||
github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
|
||||
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e h1:Wf6HqHfScWJN9/ZjdUKyjop4mf3Qdd+1TvvltAvM3m8=
|
||||
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
|
||||
github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk=
|
||||
github.com/coreos/go-systemd/v22 v22.3.2 h1:D9/bQk5vlXQFZ6Kwuu6zaiXJ9oTPe68++AzAJc1DzSI=
|
||||
@ -244,7 +225,6 @@ github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaB
|
||||
github.com/elazarl/go-bindata-assetfs v1.0.1/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4=
|
||||
github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc=
|
||||
github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc=
|
||||
github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633 h1:H2pdYOb3KQ1/YsqVWoWNLQO+fusocsw354rqGTZtAgw=
|
||||
github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
|
||||
github.com/emicklei/go-restful/v3 v3.7.3 h1:06a5brwUhivED9WAFB3Q1JZDhirpnHlCdEVhGz3PSfc=
|
||||
github.com/emicklei/go-restful/v3 v3.7.3/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
|
||||
@ -259,14 +239,14 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.m
|
||||
github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0=
|
||||
github.com/envoyproxy/go-control-plane v0.10.0/go.mod h1:AY7fTTXNdv/aJ2O5jwpxAPOWUZ7hQAEvzN5Pf27BkQQ=
|
||||
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
||||
github.com/envoyproxy/protoc-gen-validate v0.9.1 h1:PS7VIOgmSVhWUEeZwTe7z7zouA22Cr590PzXKbZHOVY=
|
||||
github.com/envoyproxy/protoc-gen-validate v0.9.1/go.mod h1:OKNgG7TCp5pF4d6XftA0++PMirau2/yoOwVac3AbF2w=
|
||||
github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
|
||||
github.com/evanphx/json-patch v4.11.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
|
||||
github.com/evanphx/json-patch/v5 v5.5.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4=
|
||||
github.com/fastly/go-utils v0.0.0-20180712184237-d95a45783239/go.mod h1:Gdwt2ce0yfBxPvZrHkprdPPTTS3N5rwmLE8T22KBXlw=
|
||||
github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc=
|
||||
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
|
||||
github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
|
||||
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
|
||||
github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M=
|
||||
github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
|
||||
github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k=
|
||||
@ -291,8 +271,9 @@ github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR
|
||||
github.com/glycerine/go-unsnap-stream v0.0.0-20181221182339-f9677308dec2/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE=
|
||||
github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24=
|
||||
github.com/go-asn1-ber/asn1-ber v1.3.1/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0=
|
||||
github.com/go-co-op/gocron v1.9.0 h1:+V+DDenw3ryB7B+tK1bAIC5p0ruw4oX9IqAsdRnGIf0=
|
||||
github.com/go-co-op/gocron v1.9.0/go.mod h1:DbJm9kdgr1sEvWpHCA7dFFs/PGHPMil9/97EXCRPr4k=
|
||||
github.com/go-co-op/gocron v1.18.0 h1:SxTyJ5xnSN4byCq7b10LmmszFdxQlSQJod8s3gbnXxA=
|
||||
github.com/go-co-op/gocron v1.18.0/go.mod h1:sD/a0Aadtw5CpflUJ/lpP9Vfdk979Wl1Sg33HPHg0FY=
|
||||
github.com/go-errors/errors v1.0.1 h1:LUHzmkK3GUKUrL/1gfBUxAHzcev3apQlezX/+O7ma6w=
|
||||
github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q=
|
||||
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
|
||||
@ -349,6 +330,7 @@ github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7a
|
||||
github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
||||
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
|
||||
github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
|
||||
github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
|
||||
github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
|
||||
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
|
||||
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
|
||||
@ -370,10 +352,8 @@ github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFU
|
||||
github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
|
||||
github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
|
||||
github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
|
||||
github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc=
|
||||
github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
|
||||
github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8=
|
||||
github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=
|
||||
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
|
||||
github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
@ -395,7 +375,6 @@ github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw
|
||||
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
|
||||
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/gonum/blas v0.0.0-20181208220705-f22b278b28ac/go.mod h1:P32wAyui1PQ58Oce/KYkOqQv8cVw1zAapXOl+dRFGbc=
|
||||
@ -430,7 +409,6 @@ github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/
|
||||
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
|
||||
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
|
||||
github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
|
||||
github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk=
|
||||
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
||||
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
||||
github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||
@ -441,11 +419,6 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf
|
||||
github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||
github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||
github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||
github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||
github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||
github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||
github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
|
||||
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
@ -454,10 +427,6 @@ github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
|
||||
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
|
||||
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
|
||||
github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0=
|
||||
github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM=
|
||||
github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM=
|
||||
github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM=
|
||||
github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY=
|
||||
github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU=
|
||||
github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA=
|
||||
@ -489,28 +458,22 @@ github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 h1
|
||||
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645/go.mod h1:6iZfnjpejD4L/4DwD7NryNaJyCQdzwWwH2MWhCA90Kw=
|
||||
github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q=
|
||||
github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE=
|
||||
github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0=
|
||||
github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8=
|
||||
github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8=
|
||||
github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms=
|
||||
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
|
||||
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
|
||||
github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=
|
||||
github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI=
|
||||
github.com/hashicorp/go-hclog v0.8.0/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ=
|
||||
github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ=
|
||||
github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ=
|
||||
github.com/hashicorp/go-hclog v0.16.2/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ=
|
||||
github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ=
|
||||
github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
|
||||
github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
|
||||
github.com/hashicorp/go-kms-wrapping/entropy v0.1.0/go.mod h1:d1g9WGtAunDNpek8jUIEJnBlbgKS1N2Q61QkHiZyR1g=
|
||||
github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM=
|
||||
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
|
||||
github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA=
|
||||
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
|
||||
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
|
||||
github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY=
|
||||
@ -519,7 +482,6 @@ github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es
|
||||
github.com/hashicorp/go-retryablehttp v0.5.4/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs=
|
||||
github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU=
|
||||
github.com/hashicorp/go-rootcerts v1.0.1/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8=
|
||||
github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8=
|
||||
github.com/hashicorp/go-secure-stdlib/base62 v0.1.1/go.mod h1:EdWO6czbmthiwZ3/PUsDV+UD1D5IRU4ActiaWGwt0Yw=
|
||||
github.com/hashicorp/go-secure-stdlib/mlock v0.1.1/go.mod h1:zq93CJChV6L9QTfGKtfBxKqD7BqqXx5O04A/ns2p5+I=
|
||||
github.com/hashicorp/go-secure-stdlib/parseutil v0.1.1/go.mod h1:QmrqtbKuxxSWTN3ETMPuB+VtEiBJ/A9XhoYGv8E1uD8=
|
||||
@ -542,12 +504,8 @@ github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
|
||||
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
|
||||
github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64=
|
||||
github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ=
|
||||
github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc=
|
||||
github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I=
|
||||
github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE=
|
||||
github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc=
|
||||
github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4=
|
||||
github.com/hashicorp/serf v0.9.7/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4=
|
||||
github.com/hashicorp/vault/api v1.0.4/go.mod h1:gDcqh3WGcR1cpF5AJz/B1UFheUEneMoIospckxBxk6Q=
|
||||
github.com/hashicorp/vault/sdk v0.1.13/go.mod h1:B+hVj7TpuQY1Y/GPbCpffmgd+tSEwvhkWnjtSYCaS2M=
|
||||
github.com/hashicorp/vault/sdk v0.3.0 h1:kR3dpxNkhh/wr6ycaJYqp6AFT/i2xaftbfnwZduTKEY=
|
||||
@ -568,6 +526,7 @@ github.com/jinzhu/copier v0.3.5 h1:GlvfUwHk62RokgqVNvYsku0TATCF7bAHVwEXoBh3iJg=
|
||||
github.com/jinzhu/copier v0.3.5/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S8hyyg=
|
||||
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
|
||||
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
|
||||
github.com/jinzhu/now v1.1.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
|
||||
github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
|
||||
github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
|
||||
github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
|
||||
@ -648,25 +607,22 @@ github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaO
|
||||
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
|
||||
github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||
github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||
github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40=
|
||||
github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
|
||||
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
|
||||
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
|
||||
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
|
||||
github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84=
|
||||
github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE=
|
||||
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
||||
github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y=
|
||||
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
|
||||
github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
|
||||
github.com/mattn/go-sqlite3 v1.14.3 h1:j7a/xn1U6TKA/PHHxqZuzh64CdtRc7rU9M+AvkOl5bA=
|
||||
github.com/mattn/go-sqlite3 v1.14.3/go.mod h1:WVKg1VTActs4Qso6iwGbiFih2UIHo0ENGwNd0Lj+XmI=
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
|
||||
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
|
||||
github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso=
|
||||
github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI=
|
||||
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
|
||||
github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI=
|
||||
github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw=
|
||||
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
|
||||
github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
|
||||
@ -702,6 +658,8 @@ github.com/mschoch/smat v0.2.0/go.mod h1:kc9mz7DoBKqDyiRL7VZN8KvXQMWeTaVnttLRXOl
|
||||
github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
|
||||
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
|
||||
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
|
||||
github.com/mwitkow/go-proto-validators v0.3.2 h1:qRlmpTzm2pstMKKzTdvwPCF5QfBNURSlAgN/R+qbKos=
|
||||
github.com/mwitkow/go-proto-validators v0.3.2/go.mod h1:ej0Qp0qMgHN/KtDyUt+Q1/tA7a5VarXUOUxD+oeD30w=
|
||||
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
|
||||
github.com/nacos-group/nacos-sdk-go v1.0.8/go.mod h1:hlAPn3UdzlxIlSILAyOXKxjFSvDJ9oLzTJ9hLAK1KzA=
|
||||
github.com/nacos-group/nacos-sdk-go v1.1.0 h1:6ESrAegx2pqp3Vi8mqDi7s2Vq+I+u0oYLn646K4wx6o=
|
||||
@ -757,7 +715,6 @@ github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/9
|
||||
github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE=
|
||||
github.com/pelletier/go-toml v1.9.4 h1:tjENF6MfZAg8e4ZmZTeWaWiT2vXtsoO6+iuOjFhECwM=
|
||||
github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
|
||||
github.com/pelletier/go-toml/v2 v2.0.0-beta.8/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo=
|
||||
github.com/pelletier/go-toml/v2 v2.0.1 h1:8e3L2cCQzLFi2CR4g7vGFuFxX7Jl1kKX8gW+iV0GUKU=
|
||||
github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo=
|
||||
github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac=
|
||||
@ -780,7 +737,6 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
|
||||
github.com/polarismesh/polaris-go v1.0.1 h1:Zqr8ZtxsJQsxt0MGyC/fFsF861ogoJCz16yWFJ/t54Q=
|
||||
github.com/polarismesh/polaris-go v1.0.1/go.mod h1:3NOqn3QquPdEdY6YhPrsWGvBVCpKhPBGt0Hspq3yEqY=
|
||||
github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI=
|
||||
github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s=
|
||||
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
|
||||
github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs=
|
||||
github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso=
|
||||
@ -840,7 +796,6 @@ github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD
|
||||
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
|
||||
github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
|
||||
github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc=
|
||||
github.com/sagikazarmark/crypt v0.5.0/go.mod h1:l+nzl7KWh51rpzp2h7t4MZWyiEWdhNpOAnclKvg+mdA=
|
||||
github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E=
|
||||
github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b h1:gQZ0qzfKHQIybLANtM3mBXNUtOfsCFXeTsnBqCsx1KM=
|
||||
github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
|
||||
@ -870,8 +825,8 @@ github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0b
|
||||
github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
|
||||
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
|
||||
github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
|
||||
github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo=
|
||||
github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo=
|
||||
github.com/spf13/afero v1.9.2 h1:j49Hj62F0n+DaZ1dDCvhABaPNSGNkt32oRFxI33IEMw=
|
||||
github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y=
|
||||
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
|
||||
github.com/spf13/cast v1.4.1 h1:s0hze+J0196ZfEMTs80N7UlFt0BDuQ7Q+JDnHiMWKdA=
|
||||
github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
|
||||
@ -905,8 +860,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P
|
||||
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY=
|
||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
|
||||
github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=
|
||||
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
|
||||
github.com/tebeka/strftime v0.1.3/go.mod h1:7wJm3dZlpr4l/oVK0t1HYIc4rMzQ2XJlOMIUJUJH6XQ=
|
||||
@ -929,7 +884,6 @@ github.com/uber/jaeger-client-go v2.29.1+incompatible/go.mod h1:WVhlPFC8FDjOFMMW
|
||||
github.com/uber/jaeger-lib v2.4.1+incompatible h1:td4jdvLcExb4cBISKIpHuGoVXh+dVKhn2Um6rjCsSsg=
|
||||
github.com/uber/jaeger-lib v2.4.1+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U=
|
||||
github.com/ugorji/go v1.2.6/go.mod h1:anCg0y61KIhDlPZmnH+so+RQbysYVyDko0IMgJv0Nn0=
|
||||
github.com/ugorji/go v1.2.7 h1:qYhyWUUd6WbiM+C6JZAUkIJt/1WrjzNHY9+KCIjVqTo=
|
||||
github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M=
|
||||
github.com/ugorji/go/codec v1.2.6/go.mod h1:V6TCNZ4PHqoHGFZuSG1W8nrCzzdgA2DozYxWFFpvxTw=
|
||||
github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0=
|
||||
@ -1035,7 +989,6 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk
|
||||
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
@ -1109,7 +1062,6 @@ golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLL
|
||||
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
@ -1134,23 +1086,15 @@ golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwY
|
||||
golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc=
|
||||
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
|
||||
golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8=
|
||||
golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20210917221730-978cfadd31cf/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20211029224645-99673261e6eb/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20211105192438-b53810dc28af/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
|
||||
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
|
||||
golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
|
||||
golang.org/x/net v0.0.0-20220412020605-290c469a71a5 h1:bRb386wvrE+oBNdF1d/Xh9mQrfQ4ecYhW5qJ5GvTGT4=
|
||||
golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
|
||||
golang.org/x/net v0.2.0 h1:sZfSu1wtKLGlWI4ZZayP0ck9Y73K1ynO6gqzTdBVdPU=
|
||||
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
@ -1160,18 +1104,9 @@ golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ
|
||||
golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||
golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||
golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||
golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||
golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||
golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||
golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||
golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||
golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc=
|
||||
golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc=
|
||||
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 h1:OSnWWcOd/CtWQC2cYSBgbTSJv3ciqd8r54ySIW2y3RE=
|
||||
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
@ -1182,8 +1117,9 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ
|
||||
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=
|
||||
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
@ -1209,8 +1145,6 @@ golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7w
|
||||
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
@ -1223,7 +1157,6 @@ golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7w
|
||||
golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
@ -1250,44 +1183,26 @@ golang.org/x/sys v0.0.0-20201223074533-0d417f636930/go.mod h1:h1NjWce9XRLGQEsW7w
|
||||
golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20211106132015-ebca88c72f68/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20211117180635-dee7805ff2e1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad h1:ntjMns5wyP/fN65tdBD4g8J5w8n015+iIIs9rtjXkY0=
|
||||
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.2.0 h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A=
|
||||
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.2.0 h1:z85xZCsEl7bi/KwbNADeBYoOP0++7W1ipu+aGnpwzRM=
|
||||
golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
@ -1298,8 +1213,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg=
|
||||
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
@ -1329,7 +1244,6 @@ golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgw
|
||||
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||
golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||
golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
@ -1373,17 +1287,13 @@ golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4f
|
||||
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
|
||||
golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||
golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||
golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||
golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f h1:GGU+dLjvlC3qDwqYgL6UgRmHXhOOgns0bZu2Ty5mm6U=
|
||||
golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk=
|
||||
gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo=
|
||||
gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0=
|
||||
gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw=
|
||||
@ -1408,23 +1318,6 @@ google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz513
|
||||
google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg=
|
||||
google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE=
|
||||
google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8=
|
||||
google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU=
|
||||
google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94=
|
||||
google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo=
|
||||
google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4=
|
||||
google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw=
|
||||
google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU=
|
||||
google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k=
|
||||
google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE=
|
||||
google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE=
|
||||
google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI=
|
||||
google.golang.org/api v0.59.0/go.mod h1:sT2boj7M9YJxZzgeZqXogmhfmRWDtPzT31xkieUbuZU=
|
||||
google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I=
|
||||
google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo=
|
||||
google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g=
|
||||
google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA=
|
||||
google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8=
|
||||
google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs=
|
||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||
google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
@ -1477,42 +1370,9 @@ google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6D
|
||||
google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20210106152847-07624b53cd92/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A=
|
||||
google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A=
|
||||
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
|
||||
google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
|
||||
google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
|
||||
google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24=
|
||||
google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k=
|
||||
google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k=
|
||||
google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48=
|
||||
google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48=
|
||||
google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w=
|
||||
google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
|
||||
google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
|
||||
google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
|
||||
google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
|
||||
google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
|
||||
google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
|
||||
google.golang.org/genproto v0.0.0-20211008145708-270636b82663/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
|
||||
google.golang.org/genproto v0.0.0-20211028162531-8db9c33dc351/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
|
||||
google.golang.org/genproto v0.0.0-20211104193956-4c6863e31247/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
|
||||
google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
|
||||
google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
|
||||
google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
|
||||
google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
|
||||
google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
|
||||
google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
|
||||
google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI=
|
||||
google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI=
|
||||
google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI=
|
||||
google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI=
|
||||
google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E=
|
||||
google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac h1:qSNTkEN+L2mvWcLgJOR+8bdHX9rN/IdU3A1Ghpfb1Rg=
|
||||
google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo=
|
||||
google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
|
||||
@ -1542,19 +1402,13 @@ google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv
|
||||
google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8=
|
||||
google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
|
||||
google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
|
||||
google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
|
||||
google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
|
||||
google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
|
||||
google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
|
||||
google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE=
|
||||
google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE=
|
||||
google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34=
|
||||
google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34=
|
||||
google.golang.org/grpc v1.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k=
|
||||
google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU=
|
||||
google.golang.org/grpc v1.45.0 h1:NEpgUqV3Z+ZjkqMsxMg11IaDrXY4RY6CQukSGK0uI1M=
|
||||
google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ=
|
||||
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw=
|
||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
||||
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
||||
@ -1568,8 +1422,9 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw=
|
||||
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
||||
google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w=
|
||||
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
||||
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
|
||||
gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
@ -1610,13 +1465,20 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
||||
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
|
||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gorm.io/driver/mysql v1.4.4 h1:MX0K9Qvy0Na4o7qSC/YI7XxqUw5KDw01umqgID+svdQ=
|
||||
gorm.io/driver/mysql v1.4.4/go.mod h1:BCg8cKI+R0j/rZRQxeKis/forqRwRSYOR8OM3Wo6hOM=
|
||||
gorm.io/driver/sqlite v1.1.3 h1:BYfdVuZB5He/u9dt4qDpZqiqDJ6KhPqs5QUqsr/Eeuc=
|
||||
gorm.io/driver/sqlite v1.1.3/go.mod h1:AKDgRWk8lcSQSw+9kxCJnX/yySj8G3rdwYlU57cB45c=
|
||||
gorm.io/gorm v1.20.1/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw=
|
||||
gorm.io/gorm v1.23.0/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk=
|
||||
gorm.io/gorm v1.23.8/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk=
|
||||
gorm.io/gorm v1.24.1 h1:CgvzRniUdG67hBAzsxDGOAuq4Te1osVMYsa1eQbd4fs=
|
||||
gorm.io/gorm v1.24.1/go.mod h1:DVrVomtaYTbqs7gB/x2uVvqnXzv0nqjB396B8cG4dBA=
|
||||
gorm.io/plugin/soft_delete v1.2.0 h1:txWHRMqLPqfXUFytXCdxb/jthRe3CrG4R5XOdagut6Q=
|
||||
gorm.io/plugin/soft_delete v1.2.0/go.mod h1:Zv7vQctOJTGOsJ/bWgrN1n3od0GBAZgnLjEx+cApLGk=
|
||||
gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
|
||||
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
@ -1650,7 +1512,6 @@ rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8
|
||||
rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
|
||||
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
|
||||
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
|
||||
sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e h1:4Z09Hglb792X0kfOBBJUPFEyvVfQWrYT/l8h5EKA6JQ=
|
||||
sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI=
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw=
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.1.2 h1:Hr/htKFmJEbtMgS/UD0N+gtgctAqz81t3nu+sPzynno=
|
||||
|
37
makefile
Normal file
37
makefile
Normal file
@ -0,0 +1,37 @@
|
||||
.PHONY: all build run gotool help
|
||||
|
||||
BINARY="artisrService"
|
||||
|
||||
all: gotool build
|
||||
|
||||
build:
|
||||
go env -w GOOS=linux
|
||||
go build -ldflags "-s -w" -o ./build/${BINARY} ./cmd/app.go
|
||||
|
||||
pushTest:
|
||||
DockerBuildTest.bat
|
||||
pushProd:
|
||||
DockerBuildProd.bat
|
||||
|
||||
run:
|
||||
@go run ./cmd/app.go
|
||||
|
||||
gotool:
|
||||
go fmt ./
|
||||
go vet ./
|
||||
|
||||
#protoc:
|
||||
#protoc --go_out=./pb/artist --go-triple_out=./pb/artist --validate_out="lang=go:./pb/artist" ./pb/artist/artist.proto
|
||||
#protoc --go_out=./pb/artist --go-grpc_out=./pb/artist --go-triple_out=./pb/artist --validate_out="lang=go:./pb/artist" ./pb/artist/artist.proto
|
||||
protoc:
|
||||
protoc --proto_path=. --go_out=./pb --go-triple_out=./pb --govalidators_out="lang=go:./pb" ./pb/artist.proto
|
||||
protoc --proto_path=. --go_out=./pb --go-triple_out=./pb --govalidators_out="lang=go:./pb" ./pb/artist_third_party.proto
|
||||
all_protoc:
|
||||
protoc --go_out=./pb/artist --go-grpc_out=./pb/artist --go-triple_out=./pb/artist --govalidators_out=./pb/artist ./pb/artist/artist.proto
|
||||
|
||||
help:
|
||||
@echo "make - 格式化 Go 代码, 并编译生成二进制文件"
|
||||
@echo "make build - 编译 Go 代码, 生成二进制文件"
|
||||
@echo "make run - 直接运行 Go 代码"
|
||||
@echo "make gotool - 运行 Go 工具 'fmt' and 'vet'"
|
||||
@echo "make protoc - 解析proto文件"
|
3444
pb/account/account.pb.go
Normal file
3444
pb/account/account.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
294
pb/account/account.proto
Normal file
294
pb/account/account.proto
Normal file
@ -0,0 +1,294 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
syntax = "proto3";
|
||||
package account;
|
||||
import "github.com/mwitkow/go-proto-validators@v0.3.2/validator.proto";
|
||||
|
||||
option go_package = "./;account";
|
||||
|
||||
service Account {
|
||||
rpc Login (LoginRequest) returns (TokenInfo) {}
|
||||
rpc Logout (DecryptJwtRequest) returns (CommonResponse) {}
|
||||
rpc OffLine (CommonRequest) returns (CommonResponse) {}
|
||||
rpc OnlineLog (LoginInfosByUserIdRequest) returns (LoginLogsResponse) {}//根据用户id获取登录的信息
|
||||
rpc OnlineLogById (OnlineLogByIdRequest) returns (LoginLog) {}//根据用户id获取登录的信息
|
||||
rpc CheckPwd (CheckPwdRequest) returns (UpdateResponse) {}//检测密码是否正确
|
||||
rpc Register (RegistRequest) returns (RequestStatus) {}
|
||||
rpc SendMsg (SendMsgRequest) returns (SendMsgStatusResponse) {}
|
||||
rpc SendCustomMsg (SendCustomMsgRequest) returns (SendMsgStatusResponse) {}
|
||||
rpc SendMsgRegister (SendMsgRequest) returns (SendMsgStatusResponse) {}
|
||||
rpc CheckMsg (CheckMsgRequest) returns (SendMsgStatusResponse) {}
|
||||
rpc SendNewTelNumMsg (SendNewTelNumMsgRequest) returns (SendMsgStatusResponse) {}//发送新账号验证码,不携带新号码
|
||||
rpc UpdateTelNum (SendNewTelNumMsgRequest) returns (SendMsgStatusResponse) {}//更新新手机号,校验新号码验证码
|
||||
rpc Authentication (AuthenticationRequest) returns (RequestStatus) {}
|
||||
rpc DecryptJwt (DecryptJwtRequest) returns (DecryptJwtResponse) {}//最好放在调用方
|
||||
rpc Info (InfoRequest) returns (InfoResponse) {}
|
||||
rpc List (ListRequest) returns (ListResponse) {}
|
||||
rpc RandList (ListRequest) returns (ListResponse) {}
|
||||
rpc ListByIDs (ListByIDsRequest) returns (ListResponse) {}
|
||||
rpc Remove (RemoveRequest) returns (RemoveResponse) {}
|
||||
rpc Update (UpdateRequest) returns (UpdateResponse) {}
|
||||
rpc PrivacyInfo (PrivacyInfoRequest) returns (AccountInfo) {}
|
||||
rpc UsersByTel (UsersByTelRequest) returns (ListResponse) {}
|
||||
rpc UserByTel (UserByTelRequest) returns (InfoResponse) {}
|
||||
}
|
||||
|
||||
message CommonRequest {
|
||||
uint64 ID = 1 [json_name = "ID"];
|
||||
}
|
||||
|
||||
message LoginLogsResponse {
|
||||
repeated LoginLog Data = 1 [json_name = "data"];
|
||||
}
|
||||
|
||||
message LoginLog {
|
||||
string Domain = 1 [json_name = "domain"];
|
||||
uint64 ID = 2 [json_name = "ID"];
|
||||
uint64 UserId = 3 [json_name = "userId"];
|
||||
string Ip = 4 [json_name = "ip"];
|
||||
string Token = 5 [json_name = "token"];
|
||||
uint64 Status = 6 [json_name = "status"];
|
||||
string ExpireDate = 7 [json_name = "expireDate"];
|
||||
string LastDate = 8 [json_name = "lastDate"];
|
||||
string LogoutDate = 9 [json_name = "logoutDate"];
|
||||
string CreatedAt = 10 [json_name = "createdAt"];
|
||||
string Address = 11 [json_name = "address"];
|
||||
}
|
||||
|
||||
message OnlineLogByIdRequest {
|
||||
string Domain = 1 [json_name = "domain"];
|
||||
uint64 ID = 2 [json_name = "ID"];
|
||||
}
|
||||
|
||||
message LoginInfosByUserIdRequest {
|
||||
string Domain = 1 [json_name = "domain"];
|
||||
uint64 UserId = 2 [json_name = "userId"];
|
||||
}
|
||||
|
||||
message SendNewTelNumMsgRequest {
|
||||
string Domain = 1 [json_name = "domain",(validator.field) = {string_not_empty: true,human_error: "70001"} ];
|
||||
uint64 ID = 2 [json_name = "ID",(validator.field) = {string_not_empty: true,human_error: "缺少参数"} ];
|
||||
string NewTelNum = 3 [json_name = "newTelNum"];
|
||||
string Code = 4 [json_name = "code"];
|
||||
string Project = 5 [json_name = "project"];
|
||||
}
|
||||
|
||||
message UserByTelRequest {
|
||||
string Domain = 1 [json_name = "domain",(validator.field) = {string_not_empty: true,human_error: "70001"} ];
|
||||
string Tel =2 [json_name = "tel"];
|
||||
}
|
||||
|
||||
message CommonResponse {
|
||||
}
|
||||
|
||||
message UsersByTelRequest {
|
||||
string Domain = 1 [json_name = "domain",(validator.field) = {string_not_empty: true,human_error: "70001"} ];
|
||||
repeated string Tels =2 [json_name = "tels"];
|
||||
}
|
||||
|
||||
message ListByIDsRequest {
|
||||
string Domain = 1 [json_name = "domain",(validator.field) = {string_not_empty: true,human_error: "70001"} ];
|
||||
repeated uint64 IDs = 2 [json_name = "IDs"];
|
||||
uint64 OrderType = 3 [json_name = "OrderType"];
|
||||
uint64 Page = 4 [json_name = "page"];
|
||||
uint64 PageSize = 5 [json_name = "pageSize"];
|
||||
string NickName = 6 [json_name = "nickName"];
|
||||
repeated string InvitationCode = 7 [json_name = "invitationCode"];
|
||||
|
||||
}
|
||||
|
||||
message SendMsgRequest {
|
||||
string Domain = 1 [json_name = "domain",(validator.field) = {string_not_empty: true,human_error: "70001"} ];
|
||||
string TelNum = 2 [json_name = "telNum",(validator.field) = {regex: "^1\\d{10}$",human_error: "70002"}];
|
||||
string Project = 3 [json_name = "telNum"];
|
||||
}
|
||||
|
||||
message SendCustomMsgRequest {
|
||||
string Domain = 1 [json_name = "domain",(validator.field) = {string_not_empty: true,human_error: "70001"} ];
|
||||
string TelNum = 2 [json_name = "telNum",(validator.field) = {regex: "^1\\d{10}$",human_error: "70002"}];
|
||||
string Project = 3 [json_name = "telNum"];
|
||||
string Url = 4 [json_name = "Url"];
|
||||
uint64 ID = 5 [json_name = "ID"];
|
||||
uint64 MId = 6 [json_name = "mId"];
|
||||
uint64 Location = 7 [json_name = "location"];
|
||||
}
|
||||
|
||||
message CheckMsgRequest {
|
||||
string Domain = 1 [json_name = "domain",(validator.field) = {string_not_empty: true,human_error: "70001"} ];
|
||||
string TelNum = 2 [json_name = "telNum",(validator.field) = {regex: "^1\\d{10}$",human_error: "70002"}];
|
||||
string Code = 3 [json_name = "code",(validator.field) = {string_not_empty: true,human_error: "70003"} ];
|
||||
}
|
||||
|
||||
message SendMsgStatusResponse {
|
||||
}
|
||||
|
||||
message RemoveRequest {
|
||||
string Domain = 1 [json_name = "domain",(validator.field) = {string_not_empty: true,human_error: "70001"} ];
|
||||
uint64 ID = 2 [json_name = "ID",(validator.field) = {int_gt: 0,human_error: "70004"} ];
|
||||
}
|
||||
|
||||
message RemoveResponse {
|
||||
}
|
||||
|
||||
message UpdateRequest {
|
||||
uint64 ID = 1 [json_name = "ID"]; //ID
|
||||
string Domain = 2 [json_name = "domain",(validator.field) = {string_not_empty: true,human_error: "70001"} ];
|
||||
string NickName = 3 [json_name = "nickName"];
|
||||
string Password = 4 [json_name = "password"]; //密码
|
||||
string Avatar = 5 [json_name = "avatar"]; //头像
|
||||
string Status = 7 [json_name = "status"];
|
||||
string TelNum = 8 [json_name = "telNum"];
|
||||
string EnterDate = 14 [json_name = "enterDate"];
|
||||
Extend Extend = 17 [json_name = "extend"];
|
||||
string Title = 18 [json_name = "title"];
|
||||
string JobNum = 19 [json_name = "jobNum"];
|
||||
string BirthDate = 20 [json_name = "birthDate"];
|
||||
uint64 Sex = 21 [json_name = "sex"];
|
||||
string IdNum = 22 [json_name = "idNum"];
|
||||
string RealName = 23 [json_name = "realName"];
|
||||
}
|
||||
|
||||
message UpdateResponse {
|
||||
}
|
||||
|
||||
message PrivacyInfoRequest {
|
||||
uint64 ID = 1 [json_name = "ID"]; //ID
|
||||
string Domain = 2 [json_name = "domain",(validator.field) = {string_not_empty: true,human_error: "70001"} ];
|
||||
}
|
||||
|
||||
message ListRequest {
|
||||
string Domain = 1 [json_name = "domain",(validator.field) = {string_not_empty: true,human_error: "70001"} ];
|
||||
uint64 PageSize = 2 [json_name = "pageSize"];
|
||||
uint64 Page = 3 [json_name = "page"];
|
||||
}
|
||||
|
||||
message ListResponse {
|
||||
string Status = 1 [json_name = "status"];
|
||||
uint64 Count = 2 [json_name = "count"];
|
||||
repeated AccountInfo Data = 3 [json_name = "data"];
|
||||
uint64 AllCount = 4 [json_name = "allCount"];
|
||||
}
|
||||
|
||||
message InfoRequest {
|
||||
string Domain = 1 [json_name = "domain",(validator.field) = {string_not_empty: true,human_error: "70001"} ];
|
||||
uint64 ID = 2 [json_name = "id"];
|
||||
}
|
||||
|
||||
message InfoResponse {
|
||||
string Status = 1 [json_name = "status"];
|
||||
AccountInfo Info = 2 [json_name = "accountInfo"];
|
||||
bool IsExist = 3 [json_name = "isExist"];
|
||||
}
|
||||
|
||||
message DecryptJwtResponse {
|
||||
string Domain = 1 [json_name = "status"];
|
||||
uint64 ID = 2 [json_name = "id"];
|
||||
string Account = 3 [json_name = "account"];
|
||||
string NickName = 4 [json_name = "nickName"];
|
||||
bool IsOffline = 5 [json_name = "isOffline"];
|
||||
}
|
||||
|
||||
message DecryptJwtRequest {
|
||||
string token = 1 [json_name = "token"];
|
||||
string Domain = 2 [json_name = "Domain"];
|
||||
}
|
||||
|
||||
message CheckPwdRequest {
|
||||
string Token = 1 [json_name = "token"];
|
||||
string Password = 2 [json_name = "password"];
|
||||
}
|
||||
|
||||
message AuthenticationRequest {
|
||||
string Name = 1 [json_name = "name"];
|
||||
string IDNum = 2 [json_name = "idNum",(validator.field) = {length_eq: 18,human_error: "70006"}];
|
||||
string Token = 3 [json_name = "token"];
|
||||
}
|
||||
|
||||
message RequestStatus {
|
||||
string Status = 1 [json_name = "status"];
|
||||
uint64 ID = 2 [json_name = "ID"];
|
||||
}
|
||||
|
||||
message RegistRequest {
|
||||
string Domain = 1 [json_name = "domain",(validator.field) = {string_not_empty: true,human_error: "70001"}];
|
||||
string NickName = 2 [json_name = "nickName",(validator.field) = {length_lt: 20,string_not_empty: true,human_error: "70005"}];
|
||||
string TelNum = 3 [json_name = "telNum",(validator.field) = {regex: "^1\\d{10}$",human_error: "70002"}];
|
||||
string Password = 4 [json_name = "password",(validator.field) = {length_gt: 5,human_error: "70007"}]; //密码
|
||||
string Avatar = 5 [json_name = "avatar"]; //头像
|
||||
string EnterDate = 14 [json_name = "enterDate"];
|
||||
Extend Extend = 15 [json_name = "extend"];
|
||||
string JobNum = 16 [json_name = "JobNum"]; //工号
|
||||
string Code = 17 [json_name = "code"]; //工号
|
||||
string IdNum = 18 [json_name = "idNum"]; //年龄
|
||||
string RealName = 19 [json_name = "realName"]; //
|
||||
}
|
||||
|
||||
message LoginRequest {
|
||||
string Domain = 1 [json_name = "domain",(validator.field) = {string_not_empty: true,human_error: "70001"} ];
|
||||
string TelNum = 2 [json_name = "telNum",(validator.field) = {regex: "^1\\d{10}$",human_error: "70002"}];
|
||||
string Code = 3 [json_name = "code"];
|
||||
string Password = 4 [json_name = "password"];
|
||||
string Ip = 5 [json_name = "ip"];
|
||||
}
|
||||
|
||||
message TokenInfo {
|
||||
AccountInfo AccountInfo = 1 [json_name = "accountInfo"];
|
||||
string Token = 2 [json_name = "token"];
|
||||
bool IsSampleAddress = 3 [json_name = "isSampleAddress"];
|
||||
}
|
||||
|
||||
message Extend {
|
||||
string JumpTo = 1 [json_name = "jumpTo"];
|
||||
string Lang = 2 [json_name = "lang"];
|
||||
}
|
||||
|
||||
message Department {
|
||||
uint64 ID = 1 [json_name = "ID"];
|
||||
string Name = 2 [json_name = "name"];
|
||||
}
|
||||
|
||||
// The response message containing the greetings
|
||||
message AccountInfo {
|
||||
uint64 ID = 1 [json_name = "id"];
|
||||
string Account = 2 [json_name = "account"];
|
||||
string NickName = 3 [json_name = "nickName"];
|
||||
int64 Type = 4 [json_name = "type"];
|
||||
string TelNum = 5 [json_name = "telNum"];
|
||||
string Status = 6 [json_name = "status"];
|
||||
string Avatar = 7 [json_name = "avatar"];
|
||||
string CreateAt = 8 [json_name = "createAt"];
|
||||
uint64 RealNameID = 9 [json_name = "realNameID"];
|
||||
string RealName = 10 [json_name = "realName"];
|
||||
string IDNum = 11 [json_name = "iDNum"];
|
||||
string MnemonicWords = 12 [json_name = "mnemonicWords"];
|
||||
uint64 IsNeedChange = 13 [json_name = "isNeedChange"];
|
||||
string EnterDate = 14 [json_name = "enterDate"];
|
||||
float WorkYear = 15 [json_name = "workYear"];
|
||||
string Domain = 16 [json_name = "domain"];
|
||||
Extend Extend = 17 [json_name = "extend"];
|
||||
string JobNum = 18 [json_name = "jobNum"];
|
||||
string BirthDate = 19 [json_name = "birth_date"];
|
||||
uint64 Age = 20 [json_name = "age"];
|
||||
uint64 Sex = 21 [json_name = "sex"];
|
||||
string Title = 22 [json_name = "title"];
|
||||
repeated Department Departments = 23 [json_name = "departments"];
|
||||
string Ip = 24 [json_name = "ip"];
|
||||
string LoginDate = 25 [json_name = "loginDate"];
|
||||
string InvitationCode = 26 [json_name = "invitationCode"];
|
||||
uint64 NowLogId = 27 [json_name = "nowLogId"];
|
||||
}
|
257
pb/account/account.validator.pb.go
Normal file
257
pb/account/account.validator.pb.go
Normal file
@ -0,0 +1,257 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: api/account/account.proto
|
||||
|
||||
package account
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
math "math"
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
_ "github.com/mwitkow/go-proto-validators"
|
||||
regexp "regexp"
|
||||
github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
func (this *CommonRequest) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *LoginLogsResponse) Validate() error {
|
||||
for _, item := range this.Data {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *LoginLog) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *OnlineLogByIdRequest) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *LoginInfosByUserIdRequest) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *SendNewTelNumMsgRequest) Validate() error {
|
||||
if this.Domain == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Domain", fmt.Errorf(`70001`))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *UserByTelRequest) Validate() error {
|
||||
if this.Domain == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Domain", fmt.Errorf(`70001`))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *CommonResponse) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *UsersByTelRequest) Validate() error {
|
||||
if this.Domain == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Domain", fmt.Errorf(`70001`))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *ListByIDsRequest) Validate() error {
|
||||
if this.Domain == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Domain", fmt.Errorf(`70001`))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var _regex_SendMsgRequest_TelNum = regexp.MustCompile(`^1\d{10}$`)
|
||||
|
||||
func (this *SendMsgRequest) Validate() error {
|
||||
if this.Domain == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Domain", fmt.Errorf(`70001`))
|
||||
}
|
||||
if !_regex_SendMsgRequest_TelNum.MatchString(this.TelNum) {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("TelNum", fmt.Errorf(`70002`))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var _regex_SendCustomMsgRequest_TelNum = regexp.MustCompile(`^1\d{10}$`)
|
||||
|
||||
func (this *SendCustomMsgRequest) Validate() error {
|
||||
if this.Domain == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Domain", fmt.Errorf(`70001`))
|
||||
}
|
||||
if !_regex_SendCustomMsgRequest_TelNum.MatchString(this.TelNum) {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("TelNum", fmt.Errorf(`70002`))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var _regex_CheckMsgRequest_TelNum = regexp.MustCompile(`^1\d{10}$`)
|
||||
|
||||
func (this *CheckMsgRequest) Validate() error {
|
||||
if this.Domain == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Domain", fmt.Errorf(`70001`))
|
||||
}
|
||||
if !_regex_CheckMsgRequest_TelNum.MatchString(this.TelNum) {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("TelNum", fmt.Errorf(`70002`))
|
||||
}
|
||||
if this.Code == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Code", fmt.Errorf(`70003`))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *SendMsgStatusResponse) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *RemoveRequest) Validate() error {
|
||||
if this.Domain == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Domain", fmt.Errorf(`70001`))
|
||||
}
|
||||
if !(this.ID > 0) {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("ID", fmt.Errorf(`70004`))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *RemoveResponse) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *UpdateRequest) Validate() error {
|
||||
if this.Domain == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Domain", fmt.Errorf(`70001`))
|
||||
}
|
||||
if this.Extend != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Extend); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Extend", err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *UpdateResponse) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *PrivacyInfoRequest) Validate() error {
|
||||
if this.Domain == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Domain", fmt.Errorf(`70001`))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *ListRequest) Validate() error {
|
||||
if this.Domain == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Domain", fmt.Errorf(`70001`))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *ListResponse) Validate() error {
|
||||
for _, item := range this.Data {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *InfoRequest) Validate() error {
|
||||
if this.Domain == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Domain", fmt.Errorf(`70001`))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *InfoResponse) Validate() error {
|
||||
if this.Info != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Info); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Info", err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *DecryptJwtResponse) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *DecryptJwtRequest) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *CheckPwdRequest) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *AuthenticationRequest) Validate() error {
|
||||
if !(len(this.IDNum) == 18) {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("IDNum", fmt.Errorf(`70006`))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *RequestStatus) Validate() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
var _regex_RegistRequest_TelNum = regexp.MustCompile(`^1\d{10}$`)
|
||||
|
||||
func (this *RegistRequest) Validate() error {
|
||||
if this.Domain == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Domain", fmt.Errorf(`70001`))
|
||||
}
|
||||
if this.NickName == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("NickName", fmt.Errorf(`70005`))
|
||||
}
|
||||
if !(len(this.NickName) < 20) {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("NickName", fmt.Errorf(`70005`))
|
||||
}
|
||||
if !_regex_RegistRequest_TelNum.MatchString(this.TelNum) {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("TelNum", fmt.Errorf(`70002`))
|
||||
}
|
||||
if !(len(this.Password) > 5) {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Password", fmt.Errorf(`70007`))
|
||||
}
|
||||
if this.Extend != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Extend); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Extend", err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var _regex_LoginRequest_TelNum = regexp.MustCompile(`^1\d{10}$`)
|
||||
|
||||
func (this *LoginRequest) Validate() error {
|
||||
if this.Domain == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Domain", fmt.Errorf(`70001`))
|
||||
}
|
||||
if !_regex_LoginRequest_TelNum.MatchString(this.TelNum) {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("TelNum", fmt.Errorf(`70002`))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *TokenInfo) Validate() error {
|
||||
if this.AccountInfo != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.AccountInfo); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("AccountInfo", err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *Extend) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *Department) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *AccountInfo) Validate() error {
|
||||
if this.Extend != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Extend); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Extend", err)
|
||||
}
|
||||
}
|
||||
for _, item := range this.Departments {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Departments", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
1182
pb/account/account_triple.pb.go
Normal file
1182
pb/account/account_triple.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
6984
pb/artist/artist.pb.go
Normal file
6984
pb/artist/artist.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
592
pb/artist/artist.proto
Normal file
592
pb/artist/artist.proto
Normal file
@ -0,0 +1,592 @@
|
||||
syntax = "proto3";
|
||||
package artist;
|
||||
option go_package = "./;artist";
|
||||
|
||||
//import "validate.proto";
|
||||
|
||||
import "google/protobuf/descriptor.proto";
|
||||
//import "google/protobuf/wrappers.proto";
|
||||
//import "pb/artist/validate.proto";
|
||||
import "pb/artist/validator.proto";
|
||||
|
||||
// protoc --proto_path=. --go_out=./pb/artist --go-triple_out=./pb/artist ./pb/artist/artist.proto
|
||||
service Artist {
|
||||
rpc ArtistList (ArtistListRequest) returns (ArtistListResponse) {} //画家列表
|
||||
rpc CreateProfile (ProfileRequest) returns (ProfileResponse) {} //创建画家基础信息
|
||||
rpc UpdateProfile (ProfileRequest) returns (ProfileResponse) {} //更新画家基础信息
|
||||
rpc UpdateMedia (MediaRequest) returns (MediaResponse) {} //创建图片资料
|
||||
rpc UpdateIndex (IndexRequest) returns (IndexResponse) {} //更新画家指数
|
||||
rpc UpdateHonor (HonorRequest) returns (HonorResponse) {} //创建画家资料
|
||||
rpc UploadMedia (UploadMediaRequest) returns (UploadMediaResponse) {} //图像资料上传
|
||||
rpc ArtistDetail (DetailRequest) returns (DetailResponse) {} //画家信息详情
|
||||
rpc DelArtist (DelRequest) returns (DelResponse) {} //删除
|
||||
rpc HonorDel (HonorDelRequest) returns (HonorDelResponse) {} //删除
|
||||
rpc CreateArtistBatch (CreateArtistBatchRequest) returns (CreateArtistBatchResponse) {} //批量同步画家
|
||||
rpc ArtistIdName (ArtIdNameRequest) returns (ArtIdNameResponse){} // 画家名字ID列表1
|
||||
rpc ArtistInfo (ArtistInfoRequest) returns (ArtistInfoResponse){} // 画家信息
|
||||
rpc ArtistData (ArtistDataRequest) returns (ArtistDataResponse){} // 批量查询画家信息
|
||||
rpc InvitationAdd (InvitationAddRequest) returns (InvitationAddResponse){} // 添加邀请函
|
||||
rpc InvitationUpdate (InvitationUpdateRequest) returns (InvitationUpdateResponse){} // 添加、更新邀请函
|
||||
rpc InvitationDel (InvitationDelRequest) returns (InvitationDelResponse){} // 删除邀请函
|
||||
rpc InvitationList (InvitationListRequest) returns (InvitationListResponse){} // 邀请列表
|
||||
rpc InvitationInfo (InvitationInfoRequest) returns (InvitationInfoResponse){} // 邀请信息
|
||||
rpc ContractAdd (ContractAddRequest) returns (ContractAddResponse) {} //新增合同
|
||||
rpc ContractUpdate (ContractAddRequest) returns (ContractUpdateResponse) {} //更新合同
|
||||
rpc ContractList (ContractListRequest) returns (ContractListResponse){} // 合同列表
|
||||
rpc ArtistChainUpdate (ArtistChainUpdateRequest) returns (ArtistChainUpdateResponse){} // 画家链上数据
|
||||
rpc ExportArtist (ExportArtistRequest) returns (ExportArtistResponse){} // 导出画家
|
||||
rpc ExportFieldList (ExportFieldListRequest) returns (ExportFieldListResponse) {} //导出字段列表
|
||||
rpc GetInfoByUuids (GetInfoByUuidsRequest) returns (GetInfoByUuidsResponse) {} //批量查询画家信息
|
||||
rpc GetCardIdWithImg (GetCardIdWithImgReq) returns (GetCardIdWithImgResp) {} //根据身份证照片获取身份ID
|
||||
rpc IdcardConvertArtistId (IdcardConvertArtistIdRequest) returns (IdcardConvertArtistIdResponse) {} //使用身份证编号换取艺术家id Created By JJxu
|
||||
rpc CheckCaaCertNum(CheckCaaCertNumRequest)returns(CheckCaaCertNumResponse){} //校验中美协编号
|
||||
}
|
||||
|
||||
// ProfileListRequest
|
||||
message ArtistListRequest {
|
||||
string Keyword = 1 [json_name = "keyword"];
|
||||
int32 Page = 2 [json_name = "page"];
|
||||
int32 PageSize = 3 [json_name = "page_size"];
|
||||
repeated string uids =4 [json_name = "uids"];
|
||||
}
|
||||
// ProfileListRequest
|
||||
|
||||
// ProfileListResponse
|
||||
message ArtistListResponse {
|
||||
int32 Count = 1 [json_name = "count"];
|
||||
int32 Page = 2 [json_name = "page"];
|
||||
repeated ProfileRequest Data = 3 [json_name = "data"];
|
||||
string Msg = 4 [json_name = "message"];
|
||||
}
|
||||
// ProfileListResponse
|
||||
|
||||
|
||||
// CreateProfile
|
||||
message ProfileRequest{
|
||||
// string Uid = 1 [json_name = "uid",(validator.field) = {string_not_empty: true}];
|
||||
string Uid = 1 [json_name = "uid"];
|
||||
string Name = 2 [json_name = "name",(validator.field) = {string_not_empty: true,human_error:"画家名字不能为空"}];
|
||||
string PenName = 3 [json_name = "pen_name"];
|
||||
int32 Gender = 4 [json_name = "gender"];
|
||||
int32 Age = 5 [json_name = "age"];
|
||||
string NativePlace = 6 [json_name = "native_place"]; //籍贯
|
||||
string Phone = 7 [json_name = "phone"]; //
|
||||
string Email = 8 [json_name = "email"]; //
|
||||
string CardId = 9 [json_name = "card_id"]; //
|
||||
string BankName = 10 [json_name = "bank_name"]; //
|
||||
string BankNum = 11 [json_name = "bank_num"]; //
|
||||
int32 Seqnum = 12 [json_name = "seqnum"];
|
||||
string Tnum = 13 [json_name = "tnum"];
|
||||
int32 Num = 14 [json_name = "num"]; //画家编号
|
||||
string CaaCertNum = 15 [json_name = "caa_cert_num"]; //中美协编号
|
||||
string Agent = 16 [json_name = "agent"];
|
||||
string Teacher = 17 [json_name = "teacher"]; //师傅
|
||||
string Student = 18 [json_name = "student"]; //徒弟
|
||||
string Address = 19 [json_name = "address"];
|
||||
string StyleFaction = 20 [json_name = "style_faction"]; //风格派系
|
||||
string School = 21 [json_name = "school"]; //毕业学校
|
||||
string Position = 22 [json_name = "position"]; //职务
|
||||
string CoopPlatform = 23 [json_name = "coop_platform"]; //职务
|
||||
int32 Belong = 24 [json_name = "belong"]; //归属
|
||||
int32 Id = 25 [json_name = "id"];
|
||||
string RecentPhotoOne = 26 [json_name = "recent_photo_one"];
|
||||
// string Exhibition = 27 [json_name = "exhibition"]; //指数-展览
|
||||
// string Collectible = 28 [json_name = "collectible"]; //指数-收藏性
|
||||
// string Education = 29 [json_name = "education"]; //指数-资历(教育)
|
||||
// string Influence = 30 [json_name = "influence"]; //指数-影响力(人气)
|
||||
// string Professionalism = 31 [json_name = "professionalism"]; //指数-专业度
|
||||
string Resume = 27 [json_name = "resume"];
|
||||
string Indexs = 28 [json_name = "index"];
|
||||
string ChainHash = 29 [json_name = "chain_hash"];
|
||||
string StageName = 30 [json_name = "stage_name"];
|
||||
string CaaJoinTime = 31 [json_name = "caa_join_time"];
|
||||
int32 JoinShow = 32 [json_name = "join_show",(validator.field) = {int_gt: 0,human_error:"请选择是否参加画展"}];
|
||||
// double lataaaaa = 27 [json_name = "lataaaaa",(validator.field) = {uuid_ver: 4, string_not_empty: true}];
|
||||
// string Lataaaaa = 27 [(validate.rules).string = {min_len:1}];
|
||||
|
||||
|
||||
// string Home = 24 [(validate.rules).string.required = true];
|
||||
|
||||
// message Location {
|
||||
// double lat = 1 [(validate.rules).double = { gte: -90, lte: 90 }];
|
||||
// double lng = 2 [(validate.rules).double = { gte: -180, lte: 180 }];
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
message ProfileResponse{
|
||||
message Data {
|
||||
string Uid = 1 [json_name = "uid"];
|
||||
}
|
||||
string Msg = 1 [json_name = "msg"];
|
||||
Data DataInfo = 2[json_name = "data_info"];
|
||||
}
|
||||
// CreateProfile
|
||||
|
||||
|
||||
// CreateMedia
|
||||
message MediaRequest {
|
||||
string Uid = 1 [json_name = "uid",(validator.field) = {string_not_empty: true,human_error:"画家Id不能为空"}];
|
||||
string RecentPhotoOne = 2 [json_name = "recent_photo_one"];
|
||||
string RecentPhotoTwo = 3 [json_name = "recent_photo_two"];
|
||||
string CardFace = 4 [json_name = "card_face"];
|
||||
string CardNational = 5 [json_name = "card_national"];
|
||||
string SignImg = 6 [json_name = "sign_img"];
|
||||
message VideosMap{
|
||||
string CoverUrl = 1 [json_name = "cover_url"];
|
||||
string OriUrl = 2 [json_name = "ori_url"];
|
||||
}
|
||||
repeated VideosMap InterviewVideos = 7 [json_name = "interview_videos"];
|
||||
repeated VideosMap ThirdPartyVideos = 8 [json_name = "third_party_videos"];
|
||||
string CaaImg = 9 [json_name = "caa_img"];
|
||||
}
|
||||
|
||||
// IndexRequest 画家指数
|
||||
message IndexRequest{
|
||||
string Uid = 1 [json_name = "uid",(validator.field) = {string_not_empty: true,human_error:"画家Id不能为空"}];
|
||||
float Exhibition = 2 [json_name = "exhibition"];
|
||||
float Collectible = 3 [json_name = "collectible"];
|
||||
float Education = 4 [json_name = "education"];
|
||||
float Influence = 5 [json_name = "influence"];
|
||||
float Professionalism = 6 [json_name = "professionalism"];
|
||||
}
|
||||
|
||||
message IndexResponse{
|
||||
string Msg = 1 [json_name = "msg"];
|
||||
message Data{
|
||||
string Uid = 1 [json_name = "uid"];
|
||||
}
|
||||
Data DataInfo = 2 [json_name = "data_info"];
|
||||
}
|
||||
// IndexRequest 画家指数
|
||||
|
||||
message MediaResponse{
|
||||
string Msg = 1 [json_name = "msg"];
|
||||
message Data{
|
||||
string Uid = 1 [json_name = "uid"];
|
||||
}
|
||||
Data DataInfo = 2 [json_name = "data_info"];
|
||||
}
|
||||
// CreateMedia
|
||||
|
||||
|
||||
// UpdateHonor
|
||||
message HonorRequest {
|
||||
string Uid = 1 [json_name = "uuid",(validator.field) = {string_not_empty: true,human_error:"画家Id不能为空"}];
|
||||
int32 HonorType = 2 [json_name = "honor_type"];
|
||||
// string HonorAddDate = 3 [json_name = "honor_add_date"];
|
||||
// string HonorBeginDate = 4 [json_name = "honor_begin_date"];
|
||||
// string HonorEndDate = 5 [json_name = "honor_end_date"];
|
||||
// string HonorDisplayName = 6 [json_name = "honor_display_name"];
|
||||
// string HonorArtName = 7 [json_name = "honor_art_name"];
|
||||
// string HonorImg = 8 [json_name = "honor_img"];
|
||||
string HonorDetail = 3 [json_name = "honor_detail"];
|
||||
int32 Id = 4 [json_name = "id"];
|
||||
}
|
||||
|
||||
message HonorResponse{
|
||||
string Msg = 1 [json_name = "msg"];
|
||||
message HonorResData{
|
||||
int32 Id = 1 [json_name = "id"];
|
||||
}
|
||||
HonorResData DataInfo = 2 [json_name = "data"];
|
||||
}
|
||||
// UpdateHonor
|
||||
|
||||
// UploadMediaRequest
|
||||
message UploadMediaRequest{
|
||||
string FileType = 1 [json_name = "file_type"];
|
||||
string FileBuffer = 2 [json_name = "file_buffer"];
|
||||
}
|
||||
|
||||
message UploadMediaResponse{
|
||||
string Msg = 1 [json_name = "msg"];
|
||||
string Data = 2 [json_name = "data"];
|
||||
}
|
||||
// UploadMediaRequest
|
||||
|
||||
// DetailRequest
|
||||
message DetailRequest{
|
||||
string Uid = 1 [json_name = "uid",(validator.field) = {string_not_empty: true,human_error:"画家Id不能为空"}];
|
||||
}
|
||||
//DetailRequest
|
||||
// DetailResponse
|
||||
message DetailResponse{
|
||||
ProfileRequest ProfileInfo = 1 [json_name = "profile_info"];
|
||||
MediaRequest MediaInfo = 2 [json_name = "media_info"];
|
||||
repeated HonorRequest HonorInfo = 3 [json_name = "honor_info"];
|
||||
string Msg = 4;
|
||||
}
|
||||
//DetailResponse
|
||||
|
||||
// DelRequest
|
||||
message DelRequest{
|
||||
string Uid = 1 [json_name = "uid",(validator.field) = {string_not_empty: true,human_error:"画家Id不能为空"}];
|
||||
}
|
||||
// DelRequest
|
||||
|
||||
// DelResponse
|
||||
message DelResponse{
|
||||
string Msg = 1 [json_name = "msg"];
|
||||
}
|
||||
// DelResponse
|
||||
|
||||
|
||||
// HonorDel
|
||||
message HonorDelRequest{
|
||||
repeated int32 Ids = 1 [json_name = "ids"];
|
||||
}
|
||||
|
||||
message HonorDelResponse{
|
||||
string Msg = 1 [json_name = "msg"];
|
||||
}
|
||||
// HonorDel
|
||||
|
||||
message ArtistInfo {
|
||||
string Uid = 1 [json_name = "uid"];
|
||||
string Name = 2 [json_name = "name"];
|
||||
string PenName = 3 [json_name = "pen_name"];
|
||||
int32 Gender = 4 [json_name = "gender"];
|
||||
int32 Age = 5 [json_name = "age"];
|
||||
string NativePlace = 6 [json_name = "native_place"]; //籍贯
|
||||
string Phone = 7 [json_name = "phone"]; //
|
||||
string Email = 8 [json_name = "email"]; //
|
||||
string CardId = 9 [json_name = "card_id"]; //
|
||||
string BankName = 10 [json_name = "bank_name"]; //
|
||||
string BankNum = 11 [json_name = "bank_num"]; //
|
||||
int32 Seqnum = 12 [json_name = "seqnum"];
|
||||
string Tnum = 13 [json_name = "tnum"];
|
||||
int32 Num = 14 [json_name = "num"]; //画家编号
|
||||
string CaaCertNum = 15 [json_name = "caa_cert_num"]; //中美协编号
|
||||
string Agent = 16 [json_name = "agent"];
|
||||
string Teacher = 17 [json_name = "teacher"]; //师傅
|
||||
string Student = 18 [json_name = "student"]; //徒弟
|
||||
string Address = 19 [json_name = "address"];
|
||||
string StyleFaction = 20 [json_name = "style_faction"]; //风格派系
|
||||
string School = 21 [json_name = "school"]; //毕业学校
|
||||
string Position = 22 [json_name = "position"]; //职务
|
||||
string CoopPlatform = 23 [json_name = "coop_platform"]; //职务
|
||||
int32 Belong = 24 [json_name = "belong"]; //归属
|
||||
int32 Id = 25 [json_name = "id"];
|
||||
string RecentPhotoOne = 26 [json_name = "recent_photo_one"];
|
||||
}
|
||||
|
||||
message CreateArtistBatchRequest{
|
||||
repeated ArtistInfo ArtistInfoBatch = 1 [json_name = "artist_info_batch"] ;
|
||||
}
|
||||
|
||||
message CreateArtistBatchResponse{
|
||||
string Msg = 1 [json_name = "msg"];
|
||||
}
|
||||
|
||||
|
||||
// ArtIdNameRequest
|
||||
message ArtIdNameRequest {}
|
||||
// ArtIdNameResponse
|
||||
|
||||
message ArtIdNameResponse{
|
||||
message IdKbName{
|
||||
string Uuid = 1 [json_name = "uuid"];
|
||||
string Name = 2 [json_name = "name"];
|
||||
}
|
||||
repeated IdKbName Items = 3[json_name = "items"];
|
||||
string Msg = 4 [json_name = "msg"];
|
||||
}
|
||||
|
||||
// ArtistInfo
|
||||
message ArtistInfoRequest{
|
||||
string Uid = 1 [json_name = "uid",(validator.field) = {string_not_empty: true,human_error:"画家Id不能为空"}];
|
||||
}
|
||||
|
||||
message ArtistInfoResponse{
|
||||
message ArtistChainField {
|
||||
int32 ArtistId = 1 [json_name = "artist_name"];
|
||||
string Wtchainhash = 2 [json_name = "wtchainhash"];
|
||||
string Baiduchainhash = 3 [json_name = "baiduchainhash"];
|
||||
string Changchainhash = 4 [json_name = "changchainhash"];
|
||||
string Changchaincerturl = 5 [json_name = "changchaincerturl"];
|
||||
string Baiduchaincerturl = 6 [json_name = "baiduchaincerturl"];
|
||||
string Changchaincertossurl = 7 [json_name = "changchaincertossurl"];
|
||||
string Baiduchaincertossurl = 8 [json_name = "baiduchaincertossurl"];
|
||||
string Status = 9 [json_name = "status"];
|
||||
int32 Id = 10 [json_name = "id"];
|
||||
string ChainHash = 11 [json_name = "chain_hash"];
|
||||
}
|
||||
ProfileRequest ProfileInfo = 1 [json_name = "profile_info"];
|
||||
MediaRequest MediaRequest = 2 [json_name = "media"];
|
||||
ArtistChainField ArtistChainInfo = 3 [json_name = "artist_chain_info"];
|
||||
string Msg = 4 [json_name = "msg"];
|
||||
}
|
||||
// ArtistInfo
|
||||
|
||||
// ArtistData
|
||||
message ArtistDataRequest{
|
||||
repeated string Uids = 1 [json_name = "uid",(validator.field) = {string_not_empty: true,human_error:"画家Id不能为空"}];
|
||||
}
|
||||
|
||||
message ArtistDataResponse{
|
||||
message info{
|
||||
ProfileRequest ProfileInfo = 1 [json_name = "profile_info"];
|
||||
MediaRequest MediaRequest = 2 [json_name = "media"];
|
||||
}
|
||||
repeated info Data = 1;
|
||||
string Msg = 2 [json_name = "msg"];
|
||||
}
|
||||
// ArtistData
|
||||
|
||||
|
||||
// InvitationAdd
|
||||
message InvitationAddRequest{
|
||||
repeated string ArtistUuids = 1 [json_name = "artist_uuid",(validator.field) = {string_not_empty: true,human_error:"请选择画家"}];
|
||||
string Address = 2 [json_name = "address",(validator.field) = {string_not_empty: true,human_error:"地址不能为空"}];
|
||||
string InvitationDesc = 3 [json_name = "invitation_desc",(validator.field) = {string_not_empty: true,human_error:"邀请函主题不能为空"}];
|
||||
string ShowDesc = 4 [json_name = "show_desc",(validator.field) = {string_not_empty: true,human_error:"画展主题不能为空"}];
|
||||
string ShowTime = 5 [json_name = "show_time",(validator.field) = {string_not_empty: true,human_error:"时间不能为空"}];
|
||||
}
|
||||
|
||||
message InvitationAddResponse{
|
||||
string Msg = 1 [json_name = "msg"];
|
||||
}
|
||||
// InvitationAdd
|
||||
|
||||
// UpdateInvitation
|
||||
message InvitationUpdateRequest{
|
||||
string Uuid = 1 [json_name = "uuid",(validator.field) = {string_not_empty: true,human_error:"标识错误"}];
|
||||
string ArtistUuid = 2 [json_name = "artist_uuid",(validator.field) = {string_not_empty: true,human_error:"请选择画家"}];
|
||||
string Address = 3 [json_name = "address",(validator.field) = {string_not_empty: true,human_error:"地址不能为空"}];
|
||||
string InvitationDesc = 4 [json_name = "invitation_desc",(validator.field) = {string_not_empty: true,human_error:"邀请函主题不能为空"}];
|
||||
string ShowDesc = 5 [json_name = "show_desc",(validator.field) = {string_not_empty: true,human_error:"画展主题不能为空"}];
|
||||
string ShowTime = 6 [json_name = "show_time",(validator.field) = {string_not_empty: true,human_error:"时间不能为空"}];
|
||||
string ArtistName = 7 [json_name = "artist_name"];
|
||||
}
|
||||
|
||||
message InvitationUpdateResponse{
|
||||
string Msg = 1 [json_name = "msg"];
|
||||
}
|
||||
// UpdateInvitation
|
||||
|
||||
// InvitationDel
|
||||
message InvitationDelRequest{
|
||||
string Uuid = 1 [json_name = "uuid"];
|
||||
}
|
||||
|
||||
message InvitationDelResponse{
|
||||
string Msg = 1 [json_name = "msg"];
|
||||
}
|
||||
// InvitationDel
|
||||
|
||||
// InvitationList
|
||||
message InvitationListRequest{
|
||||
string ArtistUuid = 1 [json_name = "artist_uuid",(validator.field) = {string_not_empty: true,human_error:"请选择画家"}];
|
||||
}
|
||||
|
||||
message InvitationListResponse{
|
||||
repeated InvitationUpdateRequest Data = 1 [json_name = "data"];
|
||||
string Msg = 2 [json_name = "msg"];
|
||||
}
|
||||
// InvitationList
|
||||
|
||||
// InvitationInfo
|
||||
message InvitationInfoRequest{
|
||||
string Uuid = 1 [json_name = "uuid",(validator.field) = {string_not_empty: true,human_error:"请选择数据"}];
|
||||
}
|
||||
|
||||
message InvitationInfoResponse{
|
||||
InvitationUpdateRequest Info = 1 [json_name = "info"];
|
||||
string Msg = 2 [json_name = "msg"];
|
||||
}
|
||||
// InvitationInfo
|
||||
|
||||
|
||||
|
||||
// ContractAdd
|
||||
message ContractAddRequest {
|
||||
string Uid = 1 [json_name = "uid"];
|
||||
int32 Id = 2 [json_name = "id"];
|
||||
string CtOnlineSaleListImg = 3 [json_name = "ct_online_sale_list_img"];
|
||||
string CtOnlineCopySaleImg = 4 [json_name = "ct_online_copy_sale_img"];
|
||||
string CtOnlineCopyListImg = 5 [json_name = "ct_online_copy_list_img"];
|
||||
string CtOnlineSaleImg = 6 [json_name = "ct_online_sale_img"];
|
||||
string CtOnlineSaleTime = 7 [json_name = "ct_online_sale_time"];
|
||||
string CtOnlineCopyTime = 8 [json_name = "ct_online_copy_time"];
|
||||
string CtOfflineSaleImg = 9 [json_name = "ct_offline_sale_img"];
|
||||
string CtOfflineSaleListImg = 10 [json_name = "ct_offline_sale_list_img"];
|
||||
string CtOfflineCopySaleImg = 11 [json_name = "ct_offline_copy_sale_img"];
|
||||
string CtOfflineCopyListImg = 12 [json_name = "ct_offline_copy_list_img"];
|
||||
string CtOfflineSaleTime = 13 [json_name = "ct_offline_sale_time"];
|
||||
string CtOfflineCopyTime = 14 [json_name = "ct_offline_copy_time"];
|
||||
}
|
||||
|
||||
message ContractAddResponse{
|
||||
string Msg = 1 [json_name = "msg"];
|
||||
}
|
||||
// ContractAdd
|
||||
|
||||
// ContractUpdate
|
||||
message ContractUpdateResponse{
|
||||
string Msg = 1 [json_name = "msg"];
|
||||
}
|
||||
// ContractUpdate
|
||||
|
||||
|
||||
// ContractList 画家合同列表
|
||||
message ContractListRequest{
|
||||
string Uid = 1 [json_name = "uid",(validator.field) = {string_not_empty: true,human_error:"请选择画家"}];
|
||||
int32 Page = 2 [json_name = "page"];
|
||||
int32 PageSize = 3 [json_name = "page_size"];
|
||||
}
|
||||
|
||||
message ContractListResponse{
|
||||
string Msg = 1 [json_name = "msg"];
|
||||
int32 Count = 2 [json_name = "count"];
|
||||
int32 Page = 3 [json_name = "page"];
|
||||
repeated ContractAddRequest Data = 4 [json_name = "data"];
|
||||
}
|
||||
// ContractList 画家合同列表
|
||||
|
||||
// ArtistChainUpdate
|
||||
message ArtistChainUpdateRequest{
|
||||
string ArtistUuid = 1 [json_name = "artist_uuid",(validator.field) = {string_not_empty: true,human_error:"请选择画家"}]; // 画家uuid 必传
|
||||
string WtHash = 2 [json_name = "wt_hash"];
|
||||
string CxHash = 3 [json_name = "cx_hash"];
|
||||
string BaiduHash = 4 [json_name = "baidu_hash"];
|
||||
string BaiduChainHash = 5 [json_name = "baiduchainhash"];
|
||||
string BaiduChainCertUrl = 6 [json_name = "baiduchaincerturl"];
|
||||
string BaiduChainCertOssUrl = 7 [json_name = "baiduchaincertossurl"];
|
||||
string ChangChainHash = 8 [json_name = "changchainhash"];
|
||||
string ChangChainCertUrl = 9 [json_name = "changchaincerturl"];
|
||||
string ChangChainCertOssUrl = 10 [json_name = "changchaincertossurl"];
|
||||
string MnemonicPhrase = 11 [json_name = "mnemonic_phrase"]; // 助记词
|
||||
string PublicKey = 12 [json_name = "public_key"]; // 公钥
|
||||
string ChainHash = 13 [json_name = "chain_hash"]; // 地址
|
||||
}
|
||||
|
||||
message ArtistChainUpdateResponse{
|
||||
string Msg = 1 [json_name = "msg"];
|
||||
}
|
||||
// ArtistChainUpdate
|
||||
|
||||
// ExportArtist
|
||||
message ExportArtistRequest{
|
||||
string Keyword = 1 [json_name = "keyword"];
|
||||
int32 Page = 2 [json_name = "page"];
|
||||
int32 PageSize = 3 [json_name = "page_size"];
|
||||
string ColumnId = 4 [json_name = "column_id",(validator.field) = {string_not_empty: true,human_error:"请选择字段"}];
|
||||
string ColumnName = 5 [json_name = "column_name"];
|
||||
repeated string ArtistUuids = 6 [json_name = "artist_uuids"];
|
||||
}
|
||||
|
||||
message ExportArtistResponse{
|
||||
message Info {
|
||||
string Uid = 1 [json_name = "uid"];
|
||||
string Name = 2 [json_name = "name"];
|
||||
string PenName = 3 [json_name = "pen_name"];
|
||||
int32 Gender = 4 [json_name = "gender"];
|
||||
int32 Age = 5 [json_name = "age"];
|
||||
string NativePlace = 6 [json_name = "native_place"]; //籍贯
|
||||
string Phone = 7 [json_name = "phone"]; //
|
||||
string Email = 8 [json_name = "email"]; //
|
||||
string CardId = 9 [json_name = "card_id"]; //
|
||||
string BankName = 10 [json_name = "bank_name"]; //
|
||||
string BankNum = 11 [json_name = "bank_num"]; //
|
||||
int32 Seqnum = 12 [json_name = "seqnum"];
|
||||
string Tnum = 13 [json_name = "tnum"];
|
||||
int32 Num = 14 [json_name = "num"]; //画家编号
|
||||
string CaaCertNum = 15 [json_name = "caa_cert_num"]; //中美协编号
|
||||
string Agent = 16 [json_name = "agent"];
|
||||
string Teacher = 17 [json_name = "teacher"]; //师傅
|
||||
string Student = 18 [json_name = "student"]; //徒弟
|
||||
string Address = 19 [json_name = "address"];
|
||||
string StyleFaction = 20 [json_name = "style_faction"]; //风格派系
|
||||
string School = 21 [json_name = "school"]; //毕业学校
|
||||
string Position = 22 [json_name = "position"]; //职务
|
||||
string CoopPlatform = 23 [json_name = "coop_platform"]; //职务
|
||||
int32 Belong = 24 [json_name = "belong"]; //归属
|
||||
string Resume = 25 [json_name = "resume"];
|
||||
string Indexs = 26 [json_name = "index"];
|
||||
// string ChainHash = 27 [json_name = "chain_hash"];
|
||||
string RecentPhotoOne = 28 [json_name = "recent_photo_one"];
|
||||
string RecentPhotoTwo = 29 [json_name = "recent_photo_two"];
|
||||
string CardFace = 30 [json_name = "card_face"];
|
||||
string CardNational = 31 [json_name = "card_national"];
|
||||
string SignImg = 32 [json_name = "sign_img"];
|
||||
string ArtistUuid = 33 [json_name = "artist_uuid"]; // 画家uuid 必传
|
||||
string WtHash = 34 [json_name = "wt_hash"];
|
||||
string CxHash = 35 [json_name = "cx_hash"];
|
||||
string BaiduHash = 36 [json_name = "baidu_hash"];
|
||||
string BaiduChainHash = 37 [json_name = "baiduchainhash"];
|
||||
string BaiduChainCertUrl = 38 [json_name = "baiduchaincerturl"];
|
||||
string BaiduChainCertOssUrl = 39 [json_name = "baiduchaincertossurl"];
|
||||
string ChangChainHash = 40 [json_name = "changchainhash"];
|
||||
string ChangChainCertUrl = 41 [json_name = "changchaincerturl"];
|
||||
string ChangChainCertOssUrl = 42 [json_name = "changchaincertossurl"];
|
||||
string MnemonicPhrase = 43 [json_name = "mnemonic_phrase"]; // 助记词
|
||||
string PublicKey = 44 [json_name = "public_key"]; // 公钥
|
||||
string ChainHash = 45 [json_name = "chain_hash"]; // 地址
|
||||
}
|
||||
repeated Info Data = 1 [json_name = "data"];
|
||||
string StructName = 2 [json_name = "struct_name"];
|
||||
string ColumnDesc = 3 [json_name = "column_desc"];
|
||||
string Msg = 4 [json_name = "msg"];
|
||||
}
|
||||
// ExportArtist
|
||||
|
||||
// ExportFieldList
|
||||
message ExportFieldListRequest{
|
||||
int32 ExportType = 1 [json_name = "export_type",(validator.field) = {int_gt: 0,human_error:"导出类型必须大于0"}];
|
||||
}
|
||||
message ExportFieldListResponse{
|
||||
message Info {
|
||||
int32 Id = 1 [json_name = "id"];
|
||||
string ColumnDesc = 2 [json_name = "column_desc"];
|
||||
}
|
||||
repeated Info Data = 1[json_name = "data"];
|
||||
string Msg = 2 [json_name = "msg"];
|
||||
}
|
||||
// ExportFieldList
|
||||
|
||||
// GetInfoByUuidsRequest
|
||||
message GetInfoByUuidsRequest{
|
||||
repeated string ArtistUuids = 1 [json_name = "artist_uuids"];
|
||||
}
|
||||
message GetInfoByUuidsResponse{
|
||||
message Info{
|
||||
string Uid = 1 [json_name = "uid"];
|
||||
int32 Seqnum = 2 [json_name = "seqnum"];
|
||||
string Tnum = 3 [json_name = "tnum"];
|
||||
int32 Num = 4 [json_name = "num"];
|
||||
}
|
||||
repeated Info Data = 1 [json_name = "data"];
|
||||
string Msg = 2 [json_name = "msg"];
|
||||
}
|
||||
// GetInfoByUuidsRequest
|
||||
|
||||
message GetCardIdWithImgReq{
|
||||
string CardFace = 1 [json_name = "card_face",(validator.field) = {string_not_empty: true,human_error:"身份证照片不能为空"}];
|
||||
}
|
||||
message GetCardIdWithImgResp{
|
||||
string Path = 1;
|
||||
string Name = 2;
|
||||
string IdCard = 3;
|
||||
int32 Age = 4;
|
||||
string Birthday = 5;
|
||||
string Sex = 6;
|
||||
string Msg = 7;
|
||||
}
|
||||
|
||||
|
||||
message IdcardConvertArtistIdRequest{
|
||||
string idcard = 1;
|
||||
}
|
||||
message IdcardConvertArtistIdResponse{
|
||||
int64 id = 1;
|
||||
string uid =2;
|
||||
}
|
||||
|
||||
message CheckCaaCertNumRequest{
|
||||
string caaCertNum = 1;
|
||||
string realName =2;
|
||||
}
|
||||
|
||||
message CheckCaaCertNumResponse{
|
||||
}
|
482
pb/artist/artist.validator.pb.go
Normal file
482
pb/artist/artist.validator.pb.go
Normal file
@ -0,0 +1,482 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: pb/artist.proto
|
||||
|
||||
package artist
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
math "math"
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
_ "google.golang.org/protobuf/types/descriptorpb"
|
||||
_ "github.com/mwitkow/go-proto-validators"
|
||||
github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
func (this *ArtistListRequest) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *ArtistListResponse) Validate() error {
|
||||
for _, item := range this.Data {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *ProfileRequest) Validate() error {
|
||||
if this.Name == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Name", fmt.Errorf(`画家名字不能为空`))
|
||||
}
|
||||
if !(this.JoinShow > 0) {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("JoinShow", fmt.Errorf(`请选择是否参加画展`))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *ProfileResponse) Validate() error {
|
||||
if this.DataInfo != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.DataInfo); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("DataInfo", err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *ProfileResponse_Data) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *MediaRequest) Validate() error {
|
||||
if this.Uid == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Uid", fmt.Errorf(`画家Id不能为空`))
|
||||
}
|
||||
for _, item := range this.InterviewVideos {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("InterviewVideos", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
for _, item := range this.ThirdPartyVideos {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("ThirdPartyVideos", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *MediaRequest_VideosMap) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *IndexRequest) Validate() error {
|
||||
if this.Uid == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Uid", fmt.Errorf(`画家Id不能为空`))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *IndexResponse) Validate() error {
|
||||
if this.DataInfo != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.DataInfo); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("DataInfo", err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *IndexResponse_Data) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *MediaResponse) Validate() error {
|
||||
if this.DataInfo != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.DataInfo); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("DataInfo", err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *MediaResponse_Data) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *HonorRequest) Validate() error {
|
||||
if this.Uid == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Uid", fmt.Errorf(`画家Id不能为空`))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *HonorResponse) Validate() error {
|
||||
if this.DataInfo != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.DataInfo); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("DataInfo", err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *HonorResponse_HonorResData) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *UploadMediaRequest) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *UploadMediaResponse) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *DetailRequest) Validate() error {
|
||||
if this.Uid == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Uid", fmt.Errorf(`画家Id不能为空`))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *DetailResponse) Validate() error {
|
||||
if this.ProfileInfo != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.ProfileInfo); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("ProfileInfo", err)
|
||||
}
|
||||
}
|
||||
if this.MediaInfo != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.MediaInfo); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("MediaInfo", err)
|
||||
}
|
||||
}
|
||||
for _, item := range this.HonorInfo {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("HonorInfo", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *DelRequest) Validate() error {
|
||||
if this.Uid == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Uid", fmt.Errorf(`画家Id不能为空`))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *DelResponse) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *HonorDelRequest) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *HonorDelResponse) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *ArtistInfo) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *CreateArtistBatchRequest) Validate() error {
|
||||
for _, item := range this.ArtistInfoBatch {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("ArtistInfoBatch", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *CreateArtistBatchResponse) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *ArtIdNameRequest) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *ArtIdNameResponse) Validate() error {
|
||||
for _, item := range this.Items {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Items", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *ArtIdNameResponse_IdKbName) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *ArtistInfoRequest) Validate() error {
|
||||
if this.Uid == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Uid", fmt.Errorf(`画家Id不能为空`))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *ArtistInfoResponse) Validate() error {
|
||||
if this.ProfileInfo != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.ProfileInfo); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("ProfileInfo", err)
|
||||
}
|
||||
}
|
||||
if this.MediaRequest != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.MediaRequest); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("MediaRequest", err)
|
||||
}
|
||||
}
|
||||
if this.ArtistChainInfo != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.ArtistChainInfo); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("ArtistChainInfo", err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *ArtistInfoResponse_ArtistChainField) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *ArtistDataRequest) Validate() error {
|
||||
for _, item := range this.Uids {
|
||||
if item == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Uids", fmt.Errorf(`画家Id不能为空`))
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *ArtistDataResponse) Validate() error {
|
||||
for _, item := range this.Data {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *ArtistDataResponseInfo) Validate() error {
|
||||
if this.ProfileInfo != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.ProfileInfo); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("ProfileInfo", err)
|
||||
}
|
||||
}
|
||||
if this.MediaRequest != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.MediaRequest); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("MediaRequest", err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *InvitationAddRequest) Validate() error {
|
||||
for _, item := range this.ArtistUuids {
|
||||
if item == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("ArtistUuids", fmt.Errorf(`请选择画家`))
|
||||
}
|
||||
}
|
||||
if this.Address == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Address", fmt.Errorf(`地址不能为空`))
|
||||
}
|
||||
if this.InvitationDesc == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("InvitationDesc", fmt.Errorf(`邀请函主题不能为空`))
|
||||
}
|
||||
if this.ShowDesc == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("ShowDesc", fmt.Errorf(`画展主题不能为空`))
|
||||
}
|
||||
if this.ShowTime == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("ShowTime", fmt.Errorf(`时间不能为空`))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *InvitationAddResponse) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *InvitationUpdateRequest) Validate() error {
|
||||
if this.Uuid == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Uuid", fmt.Errorf(`标识错误`))
|
||||
}
|
||||
if this.ArtistUuid == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("ArtistUuid", fmt.Errorf(`请选择画家`))
|
||||
}
|
||||
if this.Address == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Address", fmt.Errorf(`地址不能为空`))
|
||||
}
|
||||
if this.InvitationDesc == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("InvitationDesc", fmt.Errorf(`邀请函主题不能为空`))
|
||||
}
|
||||
if this.ShowDesc == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("ShowDesc", fmt.Errorf(`画展主题不能为空`))
|
||||
}
|
||||
if this.ShowTime == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("ShowTime", fmt.Errorf(`时间不能为空`))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *InvitationUpdateResponse) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *InvitationDelRequest) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *InvitationDelResponse) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *InvitationListRequest) Validate() error {
|
||||
if this.ArtistUuid == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("ArtistUuid", fmt.Errorf(`请选择画家`))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *InvitationListResponse) Validate() error {
|
||||
for _, item := range this.Data {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *InvitationInfoRequest) Validate() error {
|
||||
if this.Uuid == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Uuid", fmt.Errorf(`请选择数据`))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *InvitationInfoResponse) Validate() error {
|
||||
if this.Info != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Info); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Info", err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *ContractAddRequest) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *ContractAddResponse) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *ContractUpdateResponse) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *ContractListRequest) Validate() error {
|
||||
if this.Uid == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Uid", fmt.Errorf(`请选择画家`))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *ContractListResponse) Validate() error {
|
||||
for _, item := range this.Data {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *ArtistChainUpdateRequest) Validate() error {
|
||||
if this.ArtistUuid == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("ArtistUuid", fmt.Errorf(`请选择画家`))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *ArtistChainUpdateResponse) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *ExportArtistRequest) Validate() error {
|
||||
if this.ColumnId == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("ColumnId", fmt.Errorf(`请选择字段`))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *ExportArtistResponse) Validate() error {
|
||||
for _, item := range this.Data {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *ExportArtistResponse_Info) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *ExportFieldListRequest) Validate() error {
|
||||
if !(this.ExportType > 0) {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("ExportType", fmt.Errorf(`导出类型必须大于0`))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *ExportFieldListResponse) Validate() error {
|
||||
for _, item := range this.Data {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *ExportFieldListResponse_Info) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *GetInfoByUuidsRequest) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *GetInfoByUuidsResponse) Validate() error {
|
||||
for _, item := range this.Data {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *GetInfoByUuidsResponse_Info) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *GetCardIdWithImgReq) Validate() error {
|
||||
if this.CardFace == "" {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("CardFace", fmt.Errorf(`身份证照片不能为空`))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *GetCardIdWithImgResp) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *ArtistDetailDataReq) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *ArtistDetailDataResp) Validate() error {
|
||||
for _, item := range this.Data {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *ArtistDetailDataResp_Info) Validate() error {
|
||||
if this.ProfileInfo != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.ProfileInfo); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("ProfileInfo", err)
|
||||
}
|
||||
}
|
||||
if this.MediaInfo != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.MediaInfo); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("MediaInfo", err)
|
||||
}
|
||||
}
|
||||
for _, item := range this.HonorInfo {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("HonorInfo", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *IdcardConvertArtistIdRequest) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *IdcardConvertArtistIdResponse) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *CheckCaaCertNumRequest) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *CheckCaaCertNumResponse) Validate() error {
|
||||
return nil
|
||||
}
|
1452
pb/artist/artist_triple.pb.go
Normal file
1452
pb/artist/artist_triple.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user