备份
This commit is contained in:
parent
51425ada2f
commit
263bba1515
@ -16,7 +16,8 @@ import (
|
||||
// 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.ArtistInfoUserProvider{})
|
||||
config.SetProviderService(&controller.ArtistInfoArtworkProvider{})
|
||||
//config.SetProviderService(&controller.ContractProvider{})
|
||||
//config.SetProviderService(&controller.ArtWorkProvider{})
|
||||
//config.SetProviderService(&controller.SupplyProvider{})
|
||||
|
43
cmd/internal/controller/artistServer_artwork.go
Normal file
43
cmd/internal/controller/artistServer_artwork.go
Normal file
@ -0,0 +1,43 @@
|
||||
// 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"
|
||||
)
|
||||
|
||||
var _ artistInfoArtwork.ArtistInfoArtworkServer = new(ArtistInfoArtworkProvider)
|
||||
|
||||
type ArtistInfoArtworkProvider struct {
|
||||
artistInfoArtwork.UnimplementedArtistInfoArtworkServer
|
||||
artistInfoLogic *logic.ArtistInfoArtworkLogic
|
||||
}
|
||||
|
||||
func (a ArtistInfoArtworkProvider) CreateArtworkLockRecord(ctx context.Context, req *artistInfoArtwork.CreateArtworkLockRecordReq) (*artistInfoArtwork.CommonNoParams, error) {
|
||||
if req.ArtworkUid == "" || req.ArtistUid == "" {
|
||||
return nil, errors.New("参数错误")
|
||||
}
|
||||
return a.artistInfoLogic.CreateArtworkLockRecord(req)
|
||||
}
|
||||
|
||||
func (ArtistInfoArtworkProvider) ArtworkLockAction(ctx context.Context, request *artistInfoArtwork.ArtworkLockActionRequest) (*artistInfoArtwork.CommonNoParams, error) {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (ArtistInfoArtworkProvider) GetArtworkRecordUids(ctx context.Context, request *artistInfoArtwork.GetArtworkLockRecordsRequest) (*artistInfoArtwork.ArtworkUidList, error) {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (ArtistInfoArtworkProvider) DeleteArtworkRecord(context.Context, *artistInfoArtwork.ArtworkUidList) (*artistInfoArtwork.CommonNoParams, error) {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
@ -4,30 +4,30 @@ import (
|
||||
"context"
|
||||
"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"
|
||||
"github.com/fonchain/fonchain-artistinfo/pb/artistinfo"
|
||||
)
|
||||
|
||||
var _ artistinfo.ArtistInfoServer = new(ArtistInfoProvider)
|
||||
var _ artistInfoUser.ArtistInfoUserServer = new(ArtistInfoUserProvider)
|
||||
|
||||
type ArtistInfoProvider struct {
|
||||
artistinfo.UnimplementedArtistInfoServer
|
||||
artistInfoLogic *logic.ArtistInfo
|
||||
type ArtistInfoUserProvider struct {
|
||||
artistInfoUser.UnimplementedArtistInfoUserServer
|
||||
artistInfoLogic *logic.ArtistInfoUser
|
||||
}
|
||||
|
||||
func (a *ArtistInfoProvider) RegisterUser(ctx context.Context, req *artistinfo.RegisterUserRequest) (rep *artistinfo.RegisterUserRespond, err error) {
|
||||
func (a *ArtistInfoUserProvider) RegisterUser(ctx context.Context, req *artistInfoUser.RegisterUserRequest) (rep *artistInfoUser.RegisterUserRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
// backup := &artistInfo.GetUserInfoRespond{}
|
||||
// backup := &artistinfoUser.GetUserInfoRespond{}
|
||||
if rep, err = a.artistInfoLogic.RegisterUser(req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func (a *ArtistInfoProvider) UpdateIdCard(ctx context.Context, in *artistinfo.UpdateIdCardRequest) (rep *artistinfo.CommonNoParams, err error) {
|
||||
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 {
|
||||
@ -61,78 +61,78 @@ func (a *ArtistInfoProvider) UpdateIdCard(ctx context.Context, in *artistinfo.Up
|
||||
return
|
||||
}
|
||||
|
||||
func (a *ArtistInfoProvider) GetUser(ctx context.Context, req *artistinfo.GetUserRequest) (rep *artistinfo.GetUserRespond, err error) {
|
||||
func (a *ArtistInfoUserProvider) GetUser(ctx context.Context, req *artistInfoUser.GetUserRequest) (rep *artistInfoUser.GetUserRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
// backup := &artistInfo.GetUserInfoRespond{}
|
||||
// backup := &artistinfoUser.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) {
|
||||
func (a *ArtistInfoUserProvider) GetUserById(ctx context.Context, req *artistInfoUser.GetUserByIdRequest) (rep *artistInfoUser.GetUserByIdRespond, err error) {
|
||||
return a.artistInfoLogic.GetUserById(req)
|
||||
}
|
||||
|
||||
//func (a *ArtistInfoProvider) UpdateRealName(ctx context.Context, req *artistinfo.UpdateRealNameRequest) (rep *artistinfo.UpdateRealNameRespond, err error) {
|
||||
//func (a *ArtistInfoUserProvider ) UpdateRealName(ctx context.Context, req *artistinfoUser.UpdateRealNameRequest) (rep *artistinfoUser.UpdateRealNameRespond, err error) {
|
||||
// fmt.Println("第一处")
|
||||
// // backup := &artistInfo.GetUserInfoRespond{}
|
||||
// // backup := &artistinfoUser.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) {
|
||||
func (a *ArtistInfoUserProvider) FinishVerify(ctx context.Context, req *artistInfoUser.FinishVerifyRequest) (rep *artistInfoUser.FinishVerifyRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
// backup := &artistInfo.GetUserInfoRespond{}
|
||||
// backup := &artistinfoUser.GetUserInfoRespond{}
|
||||
if rep, err = a.artistInfoLogic.FinishVerify(req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rep, nil
|
||||
}
|
||||
func (a *ArtistInfoProvider) UserLock(ctx context.Context, req *artistinfo.UserLockRequest) (rep *artistinfo.UserLockRespond, err error) {
|
||||
func (a *ArtistInfoUserProvider) UserLock(ctx context.Context, req *artistInfoUser.UserLockRequest) (rep *artistInfoUser.UserLockRespond, err error) {
|
||||
return a.artistInfoLogic.UserLock(req)
|
||||
}
|
||||
func (a *ArtistInfoProvider) CheckUserLock(ctx context.Context, req *artistinfo.CheckUserLockRequest) (rep *artistinfo.CheckUserLockRespond, err error) {
|
||||
func (a *ArtistInfoUserProvider) CheckUserLock(ctx context.Context, req *artistInfoUser.CheckUserLockRequest) (rep *artistInfoUser.CheckUserLockRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
// backup := &artistInfo.GetUserInfoRespond{}
|
||||
// backup := &artistinfoUser.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) {
|
||||
func (a *ArtistInfoUserProvider) ArtistSupplyList(ctx context.Context, req *artistInfoUser.ArtistSupplyListRequest) (rep *artistInfoUser.ArtistSupplyListRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
// backup := &artistInfo.GetUserInfoRespond{}
|
||||
// backup := &artistinfoUser.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) {
|
||||
func (a *ArtistInfoUserProvider) CheckInvitedCode(ctx context.Context, req *artistInfoUser.CheckInvitedCodeRequest) (rep *artistInfoUser.GetUserRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
// backup := &artistInfo.CheckInvitedCodeInfoRespond{}
|
||||
// backup := &artistinfoUser.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) {
|
||||
func (a *ArtistInfoUserProvider) UnFinishList(ctx context.Context, req *artistInfoUser.UnFinishListRequest) (rep *artistInfoUser.UnFinishListRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
// backup := &artistInfo.UnFinishListInfoRespond{}
|
||||
// backup := &artistinfoUser.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) {
|
||||
func (a *ArtistInfoUserProvider) GetUserMsg(ctx context.Context, req *artistInfoUser.GetUserMsgRequest) (rep *artistInfoUser.GetUserMsgRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
// backup := &artistInfo.GetUserMsgInfoRespond{}
|
||||
// backup := &artistinfoUser.GetUserMsgInfoRespond{}
|
||||
if rep, err = a.artistInfoLogic.GetUserMsg(req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -140,7 +140,7 @@ func (a *ArtistInfoProvider) GetUserMsg(ctx context.Context, req *artistinfo.Get
|
||||
}
|
||||
|
||||
// 绑定邀请人和受邀请人的账号,并加入到次数统计
|
||||
func (a *ArtistInfoProvider) BindInviteInvitedAccount(ctx context.Context, in *artistinfo.BindInviteInvitedAccountRequest) (res *artistinfo.BindInviteInvitedAccountRespond, err error) {
|
||||
func (a *ArtistInfoUserProvider) BindInviteInvitedAccount(ctx context.Context, in *artistInfoUser.BindInviteInvitedAccountRequest) (res *artistInfoUser.BindInviteInvitedAccountRespond, err error) {
|
||||
if in.UserId == 0 || in.InvitedUserId == 0 {
|
||||
return nil, err
|
||||
}
|
||||
@ -189,29 +189,29 @@ func (a *ArtistInfoProvider) BindInviteInvitedAccount(ctx context.Context, in *a
|
||||
return nil, err
|
||||
}
|
||||
|
||||
func (a *ArtistInfoProvider) BindArtistId(ctx context.Context, in *artistinfo.BindArtistIdRequest) (*artistinfo.BindArtistIdResp, error) {
|
||||
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 &artistinfo.BindArtistIdResp{Error: err.Error()}, err
|
||||
return &artistInfoUser.BindArtistIdResp{Error: err.Error()}, err
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (a *ArtistInfoProvider) FindUser(ctx context.Context, in *artistinfo.FindUserRequest) (*artistinfo.UserInfo, error) {
|
||||
func (a *ArtistInfoUserProvider) FindUser(ctx context.Context, in *artistInfoUser.FindUserRequest) (*artistInfoUser.UserInfo, error) {
|
||||
return a.artistInfoLogic.FindUser(in)
|
||||
}
|
||||
|
||||
func (a *ArtistInfoProvider) UpdateUserData(ctx context.Context, in *artistinfo.UserInfo) (*artistinfo.CommonNoParams, error) {
|
||||
func (a *ArtistInfoUserProvider) UpdateUserData(ctx context.Context, in *artistInfoUser.UserInfo) (*artistInfoUser.CommonNoParams, error) {
|
||||
return a.artistInfoLogic.UpdateUserData(in)
|
||||
}
|
||||
|
||||
func (a *ArtistInfoProvider) PreSaveArtistInfo(ctx context.Context, in *artistinfo.PreSaveArtistInfoData) (res *artistinfo.CommonNoParams, er error) {
|
||||
func (a *ArtistInfoUserProvider) PreSaveArtistInfo(ctx context.Context, in *artistInfoUser.PreSaveArtistInfoData) (res *artistInfoUser.CommonNoParams, er error) {
|
||||
return a.artistInfoLogic.PreSaveArtistInfo(in)
|
||||
}
|
||||
func (a *ArtistInfoProvider) GetPreSaveArtistInfo(ctx context.Context, in *artistinfo.GetPreSaveArtistInfoRequest) (res *artistinfo.PreSaveArtistInfoData, err error) {
|
||||
func (a *ArtistInfoUserProvider) GetPreSaveArtistInfo(ctx context.Context, in *artistInfoUser.GetPreSaveArtistInfoRequest) (res *artistInfoUser.PreSaveArtistInfoData, err error) {
|
||||
return a.artistInfoLogic.GetPreSaveArtistInfo(in)
|
||||
}
|
@ -10,14 +10,14 @@ import (
|
||||
"github.com/fonchain/fonchain-artistinfo/cmd/model"
|
||||
"github.com/fonchain/fonchain-artistinfo/pb/account"
|
||||
"github.com/fonchain/fonchain-artistinfo/pb/artist"
|
||||
"github.com/fonchain/fonchain-artistinfo/pb/artistinfo"
|
||||
"github.com/fonchain/fonchain-artistinfo/pb/artistInfoUser"
|
||||
db "github.com/fonchain/fonchain-artistinfo/pkg/db"
|
||||
"github.com/fonchain/fonchain-artistinfo/pkg/m"
|
||||
"github.com/fonchain/fonchain-artistinfo/pkg/service"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
func RegisterUser(req *artistinfo.RegisterUserRequest) (rep *artistinfo.RegisterUserRespond, err error) {
|
||||
func RegisterUser(req *artistInfoUser.RegisterUserRequest) (rep *artistInfoUser.RegisterUserRespond, err error) {
|
||||
|
||||
var user = model.User{
|
||||
MgmtAccId: req.MgmtAccId,
|
||||
@ -35,7 +35,7 @@ func RegisterUser(req *artistinfo.RegisterUserRequest) (rep *artistinfo.Register
|
||||
return
|
||||
}
|
||||
|
||||
func CreateUserInfo(req *artistinfo.CreateUserInfoRequest) (rep *artistinfo.CreateUserInfoRespond, err error) {
|
||||
func CreateUserInfo(req *artistInfoUser.CreateUserInfoRequest) (rep *artistInfoUser.CreateUserInfoRespond, err error) {
|
||||
var user model.User
|
||||
//找到用户
|
||||
fmt.Println("req.Id:", req.Id)
|
||||
@ -176,8 +176,8 @@ func CheckInvitedCodes(invitedCode string) (uint, error) {
|
||||
}
|
||||
return uint(user.ID), nil
|
||||
}
|
||||
func GetUser(req *artistinfo.GetUserRequest) (rep *artistinfo.GetUserRespond, err error) {
|
||||
rep = &artistinfo.GetUserRespond{}
|
||||
func GetUser(req *artistInfoUser.GetUserRequest) (rep *artistInfoUser.GetUserRespond, err error) {
|
||||
rep = &artistInfoUser.GetUserRespond{}
|
||||
// service := &artist.UserUpdateInfoService{}
|
||||
var user model.User
|
||||
if err = db.DB.Where("tel_num = ?", req.TelNum).First(&user).Error; err != nil {
|
||||
@ -202,8 +202,8 @@ func GetUser(req *artistinfo.GetUserRequest) (rep *artistinfo.GetUserRespond, er
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func GetUserById(req *artistinfo.GetUserByIdRequest) (rep *artistinfo.GetUserByIdRespond, err error) {
|
||||
rep = &artistinfo.GetUserByIdRespond{}
|
||||
func GetUserById(req *artistInfoUser.GetUserByIdRequest) (rep *artistInfoUser.GetUserByIdRespond, err error) {
|
||||
rep = &artistInfoUser.GetUserByIdRespond{}
|
||||
fmt.Println("id:", req.Id)
|
||||
fmt.Println("123")
|
||||
zap.L().Info("!!!!")
|
||||
@ -233,7 +233,7 @@ func GetUserById(req *artistinfo.GetUserByIdRequest) (rep *artistinfo.GetUserByI
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func FinishVerify(req *artistinfo.FinishVerifyRequest) (rep *artistinfo.FinishVerifyRespond, err error) {
|
||||
func FinishVerify(req *artistInfoUser.FinishVerifyRequest) (rep *artistInfoUser.FinishVerifyRespond, err error) {
|
||||
var user model.User
|
||||
user.ID = req.Id
|
||||
if err = db.DB.Model(&user).Update("isfdd", 2).Error; err != nil {
|
||||
@ -244,8 +244,8 @@ func FinishVerify(req *artistinfo.FinishVerifyRequest) (rep *artistinfo.FinishVe
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func ArtistSupplyList(req *artistinfo.ArtistSupplyListRequest) (rep *artistinfo.ArtistSupplyListRespond, err error) {
|
||||
var artistList = make([]artistinfo.ArtistArtworkSupplyListResponseData, 0)
|
||||
func ArtistSupplyList(req *artistInfoUser.ArtistSupplyListRequest) (rep *artistInfoUser.ArtistSupplyListRespond, err error) {
|
||||
var artistList = make([]artistInfoUser.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 := ` `
|
||||
@ -273,7 +273,7 @@ func ArtistSupplyList(req *artistinfo.ArtistSupplyListRequest) (rep *artistinfo.
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func UserLock(req *artistinfo.UserLockRequest) (rep *artistinfo.UserLockRespond, err error) {
|
||||
func UserLock(req *artistInfoUser.UserLockRequest) (rep *artistInfoUser.UserLockRespond, err error) {
|
||||
var tx = db.DB.Model(model.User{})
|
||||
switch {
|
||||
case req.Id != 0:
|
||||
@ -327,8 +327,8 @@ func UserLock(req *artistinfo.UserLockRequest) (rep *artistinfo.UserLockRespond,
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func CheckInvitedCode(req *artistinfo.CheckInvitedCodeRequest) (rep *artistinfo.GetUserRespond, err error) {
|
||||
rep = &artistinfo.GetUserRespond{}
|
||||
func CheckInvitedCode(req *artistInfoUser.CheckInvitedCodeRequest) (rep *artistInfoUser.GetUserRespond, err error) {
|
||||
rep = &artistInfoUser.GetUserRespond{}
|
||||
// service := &artist.UserUpdateInfoService{}
|
||||
var user model.User
|
||||
if err = db.DB.First(&user, "invited_code = ?", req.InvitedCode).Error; err != nil {
|
||||
@ -351,8 +351,8 @@ func CheckInvitedCode(req *artistinfo.CheckInvitedCodeRequest) (rep *artistinfo.
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func UnFinishList(req *artistinfo.UnFinishListRequest) (rep *artistinfo.UnFinishListRespond, err error) {
|
||||
rep = &artistinfo.UnFinishListRespond{}
|
||||
func UnFinishList(req *artistInfoUser.UnFinishListRequest) (rep *artistInfoUser.UnFinishListRespond, err error) {
|
||||
rep = &artistInfoUser.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))
|
||||
@ -411,7 +411,7 @@ func UnFinishList(req *artistinfo.UnFinishListRequest) (rep *artistinfo.UnFinish
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func GetUserMsg(req *artistinfo.GetUserMsgRequest) (rep *artistinfo.GetUserMsgRespond, err error) {
|
||||
func GetUserMsg(req *artistInfoUser.GetUserMsgRequest) (rep *artistInfoUser.GetUserMsgRespond, err error) {
|
||||
var user model.User
|
||||
|
||||
err = db.DB.Where("id = ?", req.Id).First(&user).Error
|
||||
@ -427,7 +427,7 @@ func GetUserMsg(req *artistinfo.GetUserMsgRequest) (rep *artistinfo.GetUserMsgRe
|
||||
return nil, err
|
||||
}
|
||||
fmt.Println(string(userByte))
|
||||
var re = new(artistinfo.GetUserMsgRespond)
|
||||
var re = new(artistInfoUser.GetUserMsgRespond)
|
||||
err = json.Unmarshal(userByte, re)
|
||||
if err != nil {
|
||||
zap.L().Error("1get user info err", zap.Error(err))
|
||||
@ -438,8 +438,8 @@ func GetUserMsg(req *artistinfo.GetUserMsgRequest) (rep *artistinfo.GetUserMsgRe
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func FindUser(req *artistinfo.FindUserRequest) (rep *artistinfo.UserInfo, err error) {
|
||||
rep = &artistinfo.UserInfo{}
|
||||
func FindUser(req *artistInfoUser.FindUserRequest) (rep *artistInfoUser.UserInfo, err error) {
|
||||
rep = &artistInfoUser.UserInfo{}
|
||||
var data = model.User{}
|
||||
var tx = db.DB.Model(model.User{}).Preload("RealNameInfo").Preload("InvitedBy.UserInfo.RealNameInfo")
|
||||
if req.MgmtAccId != 0 {
|
||||
@ -468,7 +468,7 @@ func FindUser(req *artistinfo.FindUserRequest) (rep *artistinfo.UserInfo, err er
|
||||
if data.InvitedBy != nil && data.InvitedBy.UserInfo != nil && data.InvitedBy.UserInfo.RealNameInfo != nil {
|
||||
invitedName = data.InvitedBy.UserInfo.RealNameInfo.Name
|
||||
}
|
||||
rep = &artistinfo.UserInfo{
|
||||
rep = &artistInfoUser.UserInfo{
|
||||
Id: data.ID,
|
||||
DeletedAt: int64(data.DeletedAt),
|
||||
UpdatedAt: data.UpdatedAt.Unix(),
|
||||
@ -481,7 +481,7 @@ func FindUser(req *artistinfo.FindUserRequest) (rep *artistinfo.UserInfo, err er
|
||||
InvitedName: invitedName, //邀请人没有实名则为空字符串
|
||||
IsRealName: data.IsRealName,
|
||||
RealNameId: data.RealNameId,
|
||||
RealName: &artistinfo.RealNameInfo{
|
||||
RealName: &artistInfoUser.RealNameInfo{
|
||||
Name: data.RealNameInfo.Name,
|
||||
IdNum: data.RealNameInfo.IdNum,
|
||||
IdCardFront: data.RealNameInfo.IdCardFront,
|
||||
@ -509,7 +509,7 @@ func FindUser(req *artistinfo.FindUserRequest) (rep *artistinfo.UserInfo, err er
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func UpdateUserData(req *artistinfo.UserInfo) (rep *artistinfo.CommonNoParams, err error) {
|
||||
func UpdateUserData(req *artistInfoUser.UserInfo) (rep *artistInfoUser.CommonNoParams, err error) {
|
||||
var (
|
||||
preUpdateData model.User
|
||||
tx = db.DB.Begin().Preload("RealNameInfo")
|
||||
@ -665,7 +665,7 @@ func UpdateUserData(req *artistinfo.UserInfo) (rep *artistinfo.CommonNoParams, e
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func PreSaveArtistInfo(in *artistinfo.PreSaveArtistInfoData) (rep *artistinfo.CommonNoParams, err error) {
|
||||
func PreSaveArtistInfo(in *artistInfoUser.PreSaveArtistInfoData) (rep *artistInfoUser.CommonNoParams, err error) {
|
||||
var data = model.TempArtistInfo{}
|
||||
err = db.DB.Where("mgmt_acc_id = ?", in.MgmtAccId).Find(&data).Error
|
||||
if err != nil {
|
||||
@ -695,10 +695,10 @@ func PreSaveArtistInfo(in *artistinfo.PreSaveArtistInfoData) (rep *artistinfo.Co
|
||||
return
|
||||
}
|
||||
|
||||
func GetPreSaveArtistInfo(in *artistinfo.GetPreSaveArtistInfoRequest) (res *artistinfo.PreSaveArtistInfoData, err error) {
|
||||
func GetPreSaveArtistInfo(in *artistInfoUser.GetPreSaveArtistInfoRequest) (res *artistInfoUser.PreSaveArtistInfoData, err error) {
|
||||
var data = model.TempArtistInfo{}
|
||||
err = db.DB.Where("mgmt_acc_id = ?", in.MgmtAccId).Find(&data).Error
|
||||
res = &artistinfo.PreSaveArtistInfoData{
|
||||
res = &artistInfoUser.PreSaveArtistInfoData{
|
||||
MgmtAccId: data.MgmtAccId,
|
||||
Name: data.Name,
|
||||
CardId: data.CardId,
|
||||
@ -715,3 +715,20 @@ func GetPreSaveArtistInfo(in *artistinfo.GetPreSaveArtistInfoRequest) (res *arti
|
||||
}
|
||||
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
|
||||
}
|
113
cmd/internal/dao/artistinfo_artwork.go
Normal file
113
cmd/internal/dao/artistinfo_artwork.go
Normal file
@ -0,0 +1,113 @@
|
||||
// Package dao -----------------------------
|
||||
// @file : artwork.go
|
||||
// @author : JJXu
|
||||
// @contact : wavingbear@163.com
|
||||
// @time : 2023/2/24 18:23
|
||||
// -------------------------------------------
|
||||
package dao
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/fonchain/fonchain-artistinfo/cmd/model"
|
||||
"github.com/fonchain/fonchain-artistinfo/pb/artistInfoArtwork"
|
||||
db "github.com/fonchain/fonchain-artistinfo/pkg/db"
|
||||
"github.com/fonchain/fonchain-artistinfo/pkg/util/stime"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
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,
|
||||
}
|
||||
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("画作数据未找到")
|
||||
}
|
||||
}
|
||||
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 = ?", artworkUid[0]).Delete(&model.ArtworkLockRecord{}).Error
|
||||
} else {
|
||||
return db.DB.Where("artwork_uid in ?", artworkUid).Delete(&model.ArtworkLockRecord{}).Error
|
||||
}
|
||||
}
|
||||
|
||||
func BatchLockArtworks(artistUid string) error {
|
||||
var artworkUids []string
|
||||
db.DB.Model(model.ArtworkLockRecord{}).
|
||||
Where("is_lock = false AND lock_time=''").Where(" artist_uid = ?", artistUid).
|
||||
Pluck("artwork_uid", &artworkUids)
|
||||
if artworkUids == nil {
|
||||
return nil
|
||||
}
|
||||
var updateMap = map[string]any{
|
||||
"is_lock": true,
|
||||
"lock_time": stime.StrNowDate(),
|
||||
}
|
||||
return db.DB.Model(model.ArtworkLockRecord{}).Where("artwork_uid in ?", artworkUids).Updates(&updateMap).Error
|
||||
}
|
||||
|
||||
func BatchUnlockArtworks(artistUid string) error {
|
||||
var artworkUids []string
|
||||
db.DB.Model(model.ArtworkLockRecord{}).
|
||||
Where(fmt.Sprintf("lock_time = (select max(lock_time) form artwork_lock_record WHERE artist_uid = %s)", artistUid)).
|
||||
Where("is_lock = true").
|
||||
Pluck("artwork_uid", &artworkUids)
|
||||
if artworkUids == nil {
|
||||
return nil
|
||||
}
|
||||
return db.DB.Model(model.ArtworkLockRecord{}).Where("artwork_uid in ?", artworkUids).Update("is_lock", false).Error
|
||||
}
|
||||
|
||||
func GetArtworkLockRecords(req *artistInfoArtwork.GetArtworkLockRecordsRequest) (resp *artistInfoArtwork.ArtworkLockList, err error) {
|
||||
|
||||
var (
|
||||
datas = model.ArtworkLockRecord{}
|
||||
tx = db.DB.Model(model.ArtworkLockRecord{}).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", req.ArtistUid)
|
||||
case artistInfoArtwork.ArtworkQueryMode_ArtistCanSee: //画家能看到的画作(暂存和锁定)
|
||||
tx = tx.Where("status < 3")
|
||||
case artistInfoArtwork.ArtworkQueryMode_AllUnlockArtwork: //所有已解锁的画作(历史画作)
|
||||
tx = tx.Where("status = 3")
|
||||
//case artistInfoArtwork.ArtworkQueryMode_AllHistoryArtwork: //所有历史画作
|
||||
// tx = tx.Where("status > 1")
|
||||
}
|
||||
err = tx.Find(&datas).Error
|
||||
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
|
||||
}
|
@ -1,100 +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)
|
||||
FindUser(req *artistinfo.FindUserRequest) (rep *artistinfo.UserInfo, err error)
|
||||
UpdateUserData(req *artistinfo.UserInfo) (rep *artistinfo.CommonNoParams, 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) (userInfo *artistinfo.GetUserByIdRespond, err error) {
|
||||
userInfo, 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
|
||||
}
|
||||
|
||||
func (a *ArtistInfo) FindUser(req *artistinfo.FindUserRequest) (rep *artistinfo.UserInfo, err error) {
|
||||
return dao.FindUser(req)
|
||||
}
|
||||
|
||||
func (a *ArtistInfo) UpdateUserData(req *artistinfo.UserInfo) (rep *artistinfo.CommonNoParams, err error) {
|
||||
rep, err = dao.UpdateUserData(req)
|
||||
return
|
||||
}
|
||||
func (a *ArtistInfo) PreSaveArtistInfo(in *artistinfo.PreSaveArtistInfoData) (rep *artistinfo.CommonNoParams, err error) {
|
||||
rep, err = dao.PreSaveArtistInfo(in)
|
||||
return
|
||||
}
|
||||
func (a *ArtistInfo) GetPreSaveArtistInfo(in *artistinfo.GetPreSaveArtistInfoRequest) (res *artistinfo.PreSaveArtistInfoData, err error) {
|
||||
res, err = dao.GetPreSaveArtistInfo(in)
|
||||
return
|
||||
}
|
100
cmd/internal/logic/artistInfo_user.go
Normal file
100
cmd/internal/logic/artistInfo_user.go
Normal file
@ -0,0 +1,100 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/fonchain/fonchain-artistinfo/cmd/internal/dao"
|
||||
"github.com/fonchain/fonchain-artistinfo/pb/artistInfoUser"
|
||||
)
|
||||
|
||||
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) 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
|
||||
}
|
58
cmd/internal/logic/artistinfo_artwork.go
Normal file
58
cmd/internal/logic/artistinfo_artwork.go
Normal file
@ -0,0 +1,58 @@
|
||||
// Package logic -----------------------------
|
||||
// @file : artistinfo_artwork.go
|
||||
// @author : JJXu
|
||||
// @contact : wavingbear@163.com
|
||||
// @time : 2023/2/24 22:26
|
||||
// -------------------------------------------
|
||||
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/artistInfoArtwork"
|
||||
)
|
||||
|
||||
type IArtistInfoArtwork interface {
|
||||
CreateArtworkLockRecord(req *artistInfoArtwork.CreateArtworkLockRecordReq) (res *artistInfoArtwork.CommonNoParams, err error)
|
||||
ArtworkLockAction(req *artistInfoArtwork.ArtworkLockActionRequest) (res *artistInfoArtwork.CommonNoParams, err error)
|
||||
GetArtworkLockRecords(req *artistInfoArtwork.GetArtworkLockRecordsRequest) (res *artistInfoArtwork.ArtworkLockList, err error)
|
||||
DeleteArtworkRecord(req *artistInfoArtwork.ArtworkUidList) (res *artistInfoArtwork.CommonNoParams, err error)
|
||||
}
|
||||
|
||||
var _ IArtistInfoArtwork = new(ArtistInfoArtworkLogic)
|
||||
|
||||
type ArtistInfoArtworkLogic struct{}
|
||||
|
||||
func (ArtistInfoArtworkLogic) CreateArtworkLockRecord(req *artistInfoArtwork.CreateArtworkLockRecordReq) (res *artistInfoArtwork.CommonNoParams, 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.CommonNoParams, err error) {
|
||||
switch req.Lock {
|
||||
case 2:
|
||||
err = dao.BatchLockArtworks(req.ArtistUid)
|
||||
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 (ArtistInfoArtworkLogic) DeleteArtworkRecord(req *artistInfoArtwork.ArtworkUidList) (res *artistInfoArtwork.CommonNoParams, err error) {
|
||||
err = dao.DeletedArtworkLockRecord(req.ArtworkUids...)
|
||||
return
|
||||
}
|
@ -3,8 +3,7 @@ package controller
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/fonchain/fonchain-artistinfo/cmd/internal/logic"
|
||||
"github.com/fonchain/fonchain-artistinfo/cmd/internal/old/logic"
|
||||
"github.com/fonchain/fonchain-artistinfo/pb/artwork"
|
||||
)
|
||||
|
||||
@ -60,6 +59,7 @@ func (a *ArtWorkProvider) UploadArtwork(ctx context.Context, req *artwork.Upload
|
||||
}
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func (a *ArtWorkProvider) ApproveArtwork(ctx context.Context, req *artwork.ApproveArtworkRequest) (rep *artwork.ApproveArtworkRespond, err error) {
|
||||
fmt.Println("第一处")
|
||||
if rep, err = a.artWorkLogic.ApproveArtwork(req); err != nil {
|
@ -45,24 +45,6 @@ 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
|
||||
artwork.ID = int32(data.ID)
|
@ -1,7 +1,13 @@
|
||||
// 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/cmd/internal/old/dao"
|
||||
"github.com/fonchain/fonchain-artistinfo/pb/artwork"
|
||||
)
|
||||
|
15
cmd/model/artworkLockRecord.go
Normal file
15
cmd/model/artworkLockRecord.go
Normal file
@ -0,0 +1,15 @@
|
||||
package model
|
||||
|
||||
type ArtworkLockRecord struct {
|
||||
Model
|
||||
ArtistUid string `json:"artistUid" gorm:"column:artist_uid;comment:画家uid"`
|
||||
ArtworkUid string `json:"artworkUid" gorm:"column:artwork_uid;comment:画作uid"`
|
||||
Status int64 `json:"status" gorm:"column:status;default:1;comment:1=准备/暂存 2=锁定 3=解锁"`
|
||||
LockTime string `json:"lockTime" gorm:"column:lock_time;锁定时间"`
|
||||
|
||||
UserInfo User `gorm:"foreignKey:ArtistUid;reference:MgmtArtistUid"`
|
||||
}
|
||||
|
||||
func (a ArtworkLockRecord) TableName() string {
|
||||
return "artwork_lock_record"
|
||||
}
|
17
go.mod
17
go.mod
@ -18,6 +18,7 @@ require (
|
||||
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
|
||||
@ -29,7 +30,7 @@ require (
|
||||
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646
|
||||
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
|
||||
@ -63,7 +64,7 @@ require (
|
||||
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.9.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
|
||||
@ -125,7 +126,7 @@ require (
|
||||
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.8.2 // 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
|
||||
@ -145,17 +146,17 @@ require (
|
||||
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.0.0-20220412020605-290c469a71a5 // indirect
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
|
||||
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad // indirect
|
||||
golang.org/x/text v0.3.7 // 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.0-20210107192922-496545a6307b // 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
|
||||
|
36
go.sum
36
go.sum
@ -239,6 +239,8 @@ 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=
|
||||
@ -269,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=
|
||||
@ -822,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=
|
||||
@ -857,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=
|
||||
@ -1090,8 +1093,8 @@ golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qx
|
||||
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-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=
|
||||
@ -1114,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=
|
||||
@ -1195,10 +1199,10 @@ golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBc
|
||||
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-20220114195835-da31bd327af9/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.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=
|
||||
@ -1209,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=
|
||||
@ -1289,7 +1293,7 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
|
||||
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-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=
|
||||
@ -1418,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=
|
||||
@ -1460,8 +1465,9 @@ 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=
|
||||
|
702
pb/artistInfoArtwork/artistinfoArtwork.pb.go
Normal file
702
pb/artistInfoArtwork/artistinfoArtwork.pb.go
Normal file
@ -0,0 +1,702 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.1
|
||||
// protoc v4.22.0--rc2
|
||||
// source: pb/artistinfoArtwork.proto
|
||||
|
||||
package artistInfoArtwork
|
||||
|
||||
import (
|
||||
_ "github.com/envoyproxy/protoc-gen-validate/validate"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// Symbols defined in public import of google/protobuf/timestamp.proto.
|
||||
|
||||
type Timestamp = timestamppb.Timestamp
|
||||
|
||||
type ArtworkQueryMode int32
|
||||
|
||||
const (
|
||||
ArtworkQueryMode_NowPreSaveArtwork ArtworkQueryMode = 0 //当前暂存的画作
|
||||
ArtworkQueryMode_NowLockedArtwork ArtworkQueryMode = 1 //当前已锁定的画作
|
||||
ArtworkQueryMode_ArtistCanSee ArtworkQueryMode = 2 //画家能看到的画作
|
||||
ArtworkQueryMode_AllUnlockArtwork ArtworkQueryMode = 3 //所有已解锁的画作(历史画作)
|
||||
)
|
||||
|
||||
// Enum value maps for ArtworkQueryMode.
|
||||
var (
|
||||
ArtworkQueryMode_name = map[int32]string{
|
||||
0: "NowPreSaveArtwork",
|
||||
1: "NowLockedArtwork",
|
||||
2: "ArtistCanSee",
|
||||
3: "AllUnlockArtwork",
|
||||
}
|
||||
ArtworkQueryMode_value = map[string]int32{
|
||||
"NowPreSaveArtwork": 0,
|
||||
"NowLockedArtwork": 1,
|
||||
"ArtistCanSee": 2,
|
||||
"AllUnlockArtwork": 3,
|
||||
}
|
||||
)
|
||||
|
||||
func (x ArtworkQueryMode) Enum() *ArtworkQueryMode {
|
||||
p := new(ArtworkQueryMode)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x ArtworkQueryMode) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (ArtworkQueryMode) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_pb_artistinfoArtwork_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (ArtworkQueryMode) Type() protoreflect.EnumType {
|
||||
return &file_pb_artistinfoArtwork_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x ArtworkQueryMode) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ArtworkQueryMode.Descriptor instead.
|
||||
func (ArtworkQueryMode) EnumDescriptor() ([]byte, []int) {
|
||||
return file_pb_artistinfoArtwork_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
type CommonNoParams struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
}
|
||||
|
||||
func (x *CommonNoParams) Reset() {
|
||||
*x = CommonNoParams{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_pb_artistinfoArtwork_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *CommonNoParams) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CommonNoParams) ProtoMessage() {}
|
||||
|
||||
func (x *CommonNoParams) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_pb_artistinfoArtwork_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use CommonNoParams.ProtoReflect.Descriptor instead.
|
||||
func (*CommonNoParams) Descriptor() ([]byte, []int) {
|
||||
return file_pb_artistinfoArtwork_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
type CreateArtworkLockRecordReq struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
ArtistUid string `protobuf:"bytes,1,opt,name=artistUid,proto3" json:"artistUid,omitempty"` //画家uid
|
||||
ArtworkUid string `protobuf:"bytes,2,opt,name=artworkUid,proto3" json:"artworkUid,omitempty"` //画作uid
|
||||
Status int64 `protobuf:"varint,3,opt,name=status,proto3" json:"status,omitempty"` //画作锁定状态,按业务逻辑不用传
|
||||
LockTime string `protobuf:"bytes,4,opt,name=lockTime,proto3" json:"lockTime,omitempty"`
|
||||
}
|
||||
|
||||
func (x *CreateArtworkLockRecordReq) Reset() {
|
||||
*x = CreateArtworkLockRecordReq{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_pb_artistinfoArtwork_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *CreateArtworkLockRecordReq) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CreateArtworkLockRecordReq) ProtoMessage() {}
|
||||
|
||||
func (x *CreateArtworkLockRecordReq) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_pb_artistinfoArtwork_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use CreateArtworkLockRecordReq.ProtoReflect.Descriptor instead.
|
||||
func (*CreateArtworkLockRecordReq) Descriptor() ([]byte, []int) {
|
||||
return file_pb_artistinfoArtwork_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *CreateArtworkLockRecordReq) GetArtistUid() string {
|
||||
if x != nil {
|
||||
return x.ArtistUid
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *CreateArtworkLockRecordReq) GetArtworkUid() string {
|
||||
if x != nil {
|
||||
return x.ArtworkUid
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *CreateArtworkLockRecordReq) GetStatus() int64 {
|
||||
if x != nil {
|
||||
return x.Status
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *CreateArtworkLockRecordReq) GetLockTime() string {
|
||||
if x != nil {
|
||||
return x.LockTime
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type ArtworkLockActionRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
ArtistUid string `protobuf:"bytes,1,opt,name=artistUid,proto3" json:"artistUid,omitempty"` //画家uid
|
||||
Lock int32 `protobuf:"varint,2,opt,name=lock,proto3" json:"lock,omitempty"` //2=锁定 3=解锁
|
||||
}
|
||||
|
||||
func (x *ArtworkLockActionRequest) Reset() {
|
||||
*x = ArtworkLockActionRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_pb_artistinfoArtwork_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ArtworkLockActionRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ArtworkLockActionRequest) ProtoMessage() {}
|
||||
|
||||
func (x *ArtworkLockActionRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_pb_artistinfoArtwork_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ArtworkLockActionRequest.ProtoReflect.Descriptor instead.
|
||||
func (*ArtworkLockActionRequest) Descriptor() ([]byte, []int) {
|
||||
return file_pb_artistinfoArtwork_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *ArtworkLockActionRequest) GetArtistUid() string {
|
||||
if x != nil {
|
||||
return x.ArtistUid
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ArtworkLockActionRequest) GetLock() int32 {
|
||||
if x != nil {
|
||||
return x.Lock
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type GetArtworkLockRecordsRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
ArtistUid string `protobuf:"bytes,1,opt,name=artistUid,proto3" json:"artistUid,omitempty"` //画家uid
|
||||
QueryType ArtworkQueryMode `protobuf:"varint,2,opt,name=queryType,proto3,enum=artistinfo.ArtworkQueryMode" json:"queryType,omitempty"` //查询模式
|
||||
}
|
||||
|
||||
func (x *GetArtworkLockRecordsRequest) Reset() {
|
||||
*x = GetArtworkLockRecordsRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_pb_artistinfoArtwork_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *GetArtworkLockRecordsRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetArtworkLockRecordsRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetArtworkLockRecordsRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_pb_artistinfoArtwork_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GetArtworkLockRecordsRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetArtworkLockRecordsRequest) Descriptor() ([]byte, []int) {
|
||||
return file_pb_artistinfoArtwork_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *GetArtworkLockRecordsRequest) GetArtistUid() string {
|
||||
if x != nil {
|
||||
return x.ArtistUid
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *GetArtworkLockRecordsRequest) GetQueryType() ArtworkQueryMode {
|
||||
if x != nil {
|
||||
return x.QueryType
|
||||
}
|
||||
return ArtworkQueryMode_NowPreSaveArtwork
|
||||
}
|
||||
|
||||
type ArtistLockInfo struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
ArtistUid string `protobuf:"bytes,1,opt,name=artistUid,proto3" json:"artistUid,omitempty"`
|
||||
ArtworkUid string `protobuf:"bytes,2,opt,name=artworkUid,proto3" json:"artworkUid,omitempty"`
|
||||
Status int64 `protobuf:"varint,3,opt,name=status,proto3" json:"status,omitempty"`
|
||||
LockTime string `protobuf:"bytes,4,opt,name=lockTime,proto3" json:"lockTime,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ArtistLockInfo) Reset() {
|
||||
*x = ArtistLockInfo{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_pb_artistinfoArtwork_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ArtistLockInfo) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ArtistLockInfo) ProtoMessage() {}
|
||||
|
||||
func (x *ArtistLockInfo) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_pb_artistinfoArtwork_proto_msgTypes[4]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ArtistLockInfo.ProtoReflect.Descriptor instead.
|
||||
func (*ArtistLockInfo) Descriptor() ([]byte, []int) {
|
||||
return file_pb_artistinfoArtwork_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *ArtistLockInfo) GetArtistUid() string {
|
||||
if x != nil {
|
||||
return x.ArtistUid
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ArtistLockInfo) GetArtworkUid() string {
|
||||
if x != nil {
|
||||
return x.ArtworkUid
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ArtistLockInfo) GetStatus() int64 {
|
||||
if x != nil {
|
||||
return x.Status
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ArtistLockInfo) GetLockTime() string {
|
||||
if x != nil {
|
||||
return x.LockTime
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type ArtworkLockList struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Data []*ArtistLockInfo `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` //画作uid列表
|
||||
}
|
||||
|
||||
func (x *ArtworkLockList) Reset() {
|
||||
*x = ArtworkLockList{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_pb_artistinfoArtwork_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ArtworkLockList) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ArtworkLockList) ProtoMessage() {}
|
||||
|
||||
func (x *ArtworkLockList) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_pb_artistinfoArtwork_proto_msgTypes[5]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ArtworkLockList.ProtoReflect.Descriptor instead.
|
||||
func (*ArtworkLockList) Descriptor() ([]byte, []int) {
|
||||
return file_pb_artistinfoArtwork_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *ArtworkLockList) GetData() []*ArtistLockInfo {
|
||||
if x != nil {
|
||||
return x.Data
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ArtworkUidList struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
ArtworkUids []string `protobuf:"bytes,1,rep,name=artworkUids,proto3" json:"artworkUids,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ArtworkUidList) Reset() {
|
||||
*x = ArtworkUidList{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_pb_artistinfoArtwork_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ArtworkUidList) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ArtworkUidList) ProtoMessage() {}
|
||||
|
||||
func (x *ArtworkUidList) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_pb_artistinfoArtwork_proto_msgTypes[6]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ArtworkUidList.ProtoReflect.Descriptor instead.
|
||||
func (*ArtworkUidList) Descriptor() ([]byte, []int) {
|
||||
return file_pb_artistinfoArtwork_proto_rawDescGZIP(), []int{6}
|
||||
}
|
||||
|
||||
func (x *ArtworkUidList) GetArtworkUids() []string {
|
||||
if x != nil {
|
||||
return x.ArtworkUids
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_pb_artistinfoArtwork_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_pb_artistinfoArtwork_proto_rawDesc = []byte{
|
||||
0x0a, 0x1a, 0x70, 0x62, 0x2f, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x66, 0x6f, 0x41,
|
||||
0x72, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x61, 0x72,
|
||||
0x74, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x66, 0x6f, 0x1a, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61,
|
||||
0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
|
||||
0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74,
|
||||
0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x10, 0x0a, 0x0e, 0x43, 0x6f, 0x6d,
|
||||
0x6d, 0x6f, 0x6e, 0x4e, 0x6f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0xa6, 0x01, 0x0a, 0x1a,
|
||||
0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x72, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x4c, 0x6f, 0x63,
|
||||
0x6b, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x28, 0x0a, 0x09, 0x61, 0x72,
|
||||
0x74, 0x69, 0x73, 0x74, 0x55, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xba,
|
||||
0xe9, 0xc0, 0x03, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x09, 0x61, 0x72, 0x74, 0x69, 0x73,
|
||||
0x74, 0x55, 0x69, 0x64, 0x12, 0x2a, 0x0a, 0x0a, 0x61, 0x72, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x55,
|
||||
0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xba, 0xe9, 0xc0, 0x03, 0x05, 0x8a,
|
||||
0x01, 0x02, 0x10, 0x01, 0x52, 0x0a, 0x61, 0x72, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x55, 0x69, 0x64,
|
||||
0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03,
|
||||
0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x6b,
|
||||
0x54, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x6b,
|
||||
0x54, 0x69, 0x6d, 0x65, 0x22, 0x4c, 0x0a, 0x18, 0x41, 0x72, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x4c,
|
||||
0x6f, 0x63, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||
0x12, 0x1c, 0x0a, 0x09, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x55, 0x69, 0x64, 0x18, 0x01, 0x20,
|
||||
0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x55, 0x69, 0x64, 0x12, 0x12,
|
||||
0x0a, 0x04, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6c, 0x6f,
|
||||
0x63, 0x6b, 0x22, 0x84, 0x01, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x41, 0x72, 0x74, 0x77, 0x6f, 0x72,
|
||||
0x6b, 0x4c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75,
|
||||
0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x09, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x55, 0x69, 0x64,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xba, 0xe9, 0xc0, 0x03, 0x05, 0x8a, 0x01, 0x02,
|
||||
0x10, 0x01, 0x52, 0x09, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x55, 0x69, 0x64, 0x12, 0x3a, 0x0a,
|
||||
0x09, 0x71, 0x75, 0x65, 0x72, 0x79, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e,
|
||||
0x32, 0x1c, 0x2e, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x66, 0x6f, 0x2e, 0x41, 0x72,
|
||||
0x74, 0x77, 0x6f, 0x72, 0x6b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x09,
|
||||
0x71, 0x75, 0x65, 0x72, 0x79, 0x54, 0x79, 0x70, 0x65, 0x22, 0x82, 0x01, 0x0a, 0x0e, 0x41, 0x72,
|
||||
0x74, 0x69, 0x73, 0x74, 0x4c, 0x6f, 0x63, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1c, 0x0a, 0x09,
|
||||
0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x55, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||
0x09, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x55, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x72,
|
||||
0x74, 0x77, 0x6f, 0x72, 0x6b, 0x55, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a,
|
||||
0x61, 0x72, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x55, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74,
|
||||
0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74,
|
||||
0x75, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x04,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x41,
|
||||
0x0a, 0x0f, 0x41, 0x72, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x4c, 0x6f, 0x63, 0x6b, 0x4c, 0x69, 0x73,
|
||||
0x74, 0x12, 0x2e, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32,
|
||||
0x1a, 0x2e, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x66, 0x6f, 0x2e, 0x41, 0x72, 0x74,
|
||||
0x69, 0x73, 0x74, 0x4c, 0x6f, 0x63, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x64, 0x61, 0x74,
|
||||
0x61, 0x22, 0x32, 0x0a, 0x0e, 0x41, 0x72, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x55, 0x69, 0x64, 0x4c,
|
||||
0x69, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x72, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x55, 0x69,
|
||||
0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x72, 0x74, 0x77, 0x6f, 0x72,
|
||||
0x6b, 0x55, 0x69, 0x64, 0x73, 0x2a, 0x67, 0x0a, 0x10, 0x41, 0x72, 0x74, 0x77, 0x6f, 0x72, 0x6b,
|
||||
0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x15, 0x0a, 0x11, 0x4e, 0x6f, 0x77,
|
||||
0x50, 0x72, 0x65, 0x53, 0x61, 0x76, 0x65, 0x41, 0x72, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x10, 0x00,
|
||||
0x12, 0x14, 0x0a, 0x10, 0x4e, 0x6f, 0x77, 0x4c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x41, 0x72, 0x74,
|
||||
0x77, 0x6f, 0x72, 0x6b, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x41, 0x72, 0x74, 0x69, 0x73, 0x74,
|
||||
0x43, 0x61, 0x6e, 0x53, 0x65, 0x65, 0x10, 0x02, 0x12, 0x14, 0x0a, 0x10, 0x41, 0x6c, 0x6c, 0x55,
|
||||
0x6e, 0x6c, 0x6f, 0x63, 0x6b, 0x41, 0x72, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x10, 0x03, 0x32, 0x80,
|
||||
0x03, 0x0a, 0x11, 0x41, 0x72, 0x74, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x41, 0x72, 0x74,
|
||||
0x77, 0x6f, 0x72, 0x6b, 0x12, 0x5f, 0x0a, 0x17, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x72,
|
||||
0x74, 0x77, 0x6f, 0x72, 0x6b, 0x4c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12,
|
||||
0x26, 0x2e, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x66, 0x6f, 0x2e, 0x43, 0x72, 0x65,
|
||||
0x61, 0x74, 0x65, 0x41, 0x72, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x4c, 0x6f, 0x63, 0x6b, 0x52, 0x65,
|
||||
0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74,
|
||||
0x69, 0x6e, 0x66, 0x6f, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4e, 0x6f, 0x50, 0x61, 0x72,
|
||||
0x61, 0x6d, 0x73, 0x22, 0x00, 0x12, 0x57, 0x0a, 0x11, 0x41, 0x72, 0x74, 0x77, 0x6f, 0x72, 0x6b,
|
||||
0x4c, 0x6f, 0x63, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x61, 0x72, 0x74,
|
||||
0x69, 0x73, 0x74, 0x69, 0x6e, 0x66, 0x6f, 0x2e, 0x41, 0x72, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x4c,
|
||||
0x6f, 0x63, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||
0x1a, 0x1a, 0x2e, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x66, 0x6f, 0x2e, 0x43, 0x6f,
|
||||
0x6d, 0x6d, 0x6f, 0x6e, 0x4e, 0x6f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x00, 0x12, 0x60,
|
||||
0x0a, 0x15, 0x47, 0x65, 0x74, 0x41, 0x72, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x4c, 0x6f, 0x63, 0x6b,
|
||||
0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x12, 0x28, 0x2e, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74,
|
||||
0x69, 0x6e, 0x66, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x72, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x4c,
|
||||
0x6f, 0x63, 0x6b, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
|
||||
0x74, 0x1a, 0x1b, 0x2e, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x66, 0x6f, 0x2e, 0x41,
|
||||
0x72, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x4c, 0x6f, 0x63, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x00,
|
||||
0x12, 0x4f, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x72, 0x74, 0x77, 0x6f, 0x72,
|
||||
0x6b, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x1a, 0x2e, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74,
|
||||
0x69, 0x6e, 0x66, 0x6f, 0x2e, 0x41, 0x72, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x55, 0x69, 0x64, 0x4c,
|
||||
0x69, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x66, 0x6f,
|
||||
0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4e, 0x6f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22,
|
||||
0x00, 0x42, 0x16, 0x5a, 0x14, 0x2e, 0x2f, 0x3b, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x49, 0x6e,
|
||||
0x66, 0x6f, 0x41, 0x72, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x50, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_pb_artistinfoArtwork_proto_rawDescOnce sync.Once
|
||||
file_pb_artistinfoArtwork_proto_rawDescData = file_pb_artistinfoArtwork_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_pb_artistinfoArtwork_proto_rawDescGZIP() []byte {
|
||||
file_pb_artistinfoArtwork_proto_rawDescOnce.Do(func() {
|
||||
file_pb_artistinfoArtwork_proto_rawDescData = protoimpl.X.CompressGZIP(file_pb_artistinfoArtwork_proto_rawDescData)
|
||||
})
|
||||
return file_pb_artistinfoArtwork_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_pb_artistinfoArtwork_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_pb_artistinfoArtwork_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
|
||||
var file_pb_artistinfoArtwork_proto_goTypes = []interface{}{
|
||||
(ArtworkQueryMode)(0), // 0: artistinfo.ArtworkQueryMode
|
||||
(*CommonNoParams)(nil), // 1: artistinfo.CommonNoParams
|
||||
(*CreateArtworkLockRecordReq)(nil), // 2: artistinfo.CreateArtworkLockRecordReq
|
||||
(*ArtworkLockActionRequest)(nil), // 3: artistinfo.ArtworkLockActionRequest
|
||||
(*GetArtworkLockRecordsRequest)(nil), // 4: artistinfo.GetArtworkLockRecordsRequest
|
||||
(*ArtistLockInfo)(nil), // 5: artistinfo.ArtistLockInfo
|
||||
(*ArtworkLockList)(nil), // 6: artistinfo.ArtworkLockList
|
||||
(*ArtworkUidList)(nil), // 7: artistinfo.ArtworkUidList
|
||||
}
|
||||
var file_pb_artistinfoArtwork_proto_depIdxs = []int32{
|
||||
0, // 0: artistinfo.GetArtworkLockRecordsRequest.queryType:type_name -> artistinfo.ArtworkQueryMode
|
||||
5, // 1: artistinfo.ArtworkLockList.data:type_name -> artistinfo.ArtistLockInfo
|
||||
2, // 2: artistinfo.ArtistInfoArtwork.CreateArtworkLockRecord:input_type -> artistinfo.CreateArtworkLockRecordReq
|
||||
3, // 3: artistinfo.ArtistInfoArtwork.ArtworkLockAction:input_type -> artistinfo.ArtworkLockActionRequest
|
||||
4, // 4: artistinfo.ArtistInfoArtwork.GetArtworkLockRecords:input_type -> artistinfo.GetArtworkLockRecordsRequest
|
||||
7, // 5: artistinfo.ArtistInfoArtwork.DeleteArtworkRecord:input_type -> artistinfo.ArtworkUidList
|
||||
1, // 6: artistinfo.ArtistInfoArtwork.CreateArtworkLockRecord:output_type -> artistinfo.CommonNoParams
|
||||
1, // 7: artistinfo.ArtistInfoArtwork.ArtworkLockAction:output_type -> artistinfo.CommonNoParams
|
||||
6, // 8: artistinfo.ArtistInfoArtwork.GetArtworkLockRecords:output_type -> artistinfo.ArtworkLockList
|
||||
1, // 9: artistinfo.ArtistInfoArtwork.DeleteArtworkRecord:output_type -> artistinfo.CommonNoParams
|
||||
6, // [6:10] is the sub-list for method output_type
|
||||
2, // [2:6] is the sub-list for method input_type
|
||||
2, // [2:2] is the sub-list for extension type_name
|
||||
2, // [2:2] is the sub-list for extension extendee
|
||||
0, // [0:2] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_pb_artistinfoArtwork_proto_init() }
|
||||
func file_pb_artistinfoArtwork_proto_init() {
|
||||
if File_pb_artistinfoArtwork_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_pb_artistinfoArtwork_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*CommonNoParams); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_pb_artistinfoArtwork_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*CreateArtworkLockRecordReq); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_pb_artistinfoArtwork_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ArtworkLockActionRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_pb_artistinfoArtwork_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*GetArtworkLockRecordsRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_pb_artistinfoArtwork_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ArtistLockInfo); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_pb_artistinfoArtwork_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ArtworkLockList); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_pb_artistinfoArtwork_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ArtworkUidList); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_pb_artistinfoArtwork_proto_rawDesc,
|
||||
NumEnums: 1,
|
||||
NumMessages: 7,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_pb_artistinfoArtwork_proto_goTypes,
|
||||
DependencyIndexes: file_pb_artistinfoArtwork_proto_depIdxs,
|
||||
EnumInfos: file_pb_artistinfoArtwork_proto_enumTypes,
|
||||
MessageInfos: file_pb_artistinfoArtwork_proto_msgTypes,
|
||||
}.Build()
|
||||
File_pb_artistinfoArtwork_proto = out.File
|
||||
file_pb_artistinfoArtwork_proto_rawDesc = nil
|
||||
file_pb_artistinfoArtwork_proto_goTypes = nil
|
||||
file_pb_artistinfoArtwork_proto_depIdxs = nil
|
||||
}
|
801
pb/artistInfoArtwork/artistinfoArtwork.pb.validate.go
Normal file
801
pb/artistInfoArtwork/artistinfoArtwork.pb.validate.go
Normal file
@ -0,0 +1,801 @@
|
||||
// Code generated by protoc-gen-validate. DO NOT EDIT.
|
||||
// source: pb/artistinfoArtwork.proto
|
||||
|
||||
package artistInfoArtwork
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/mail"
|
||||
"net/url"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
)
|
||||
|
||||
// ensure the imports are used
|
||||
var (
|
||||
_ = bytes.MinRead
|
||||
_ = errors.New("")
|
||||
_ = fmt.Print
|
||||
_ = utf8.UTFMax
|
||||
_ = (*regexp.Regexp)(nil)
|
||||
_ = (*strings.Reader)(nil)
|
||||
_ = net.IPv4len
|
||||
_ = time.Duration(0)
|
||||
_ = (*url.URL)(nil)
|
||||
_ = (*mail.Address)(nil)
|
||||
_ = anypb.Any{}
|
||||
_ = sort.Sort
|
||||
)
|
||||
|
||||
// Validate checks the field values on CommonNoParams with the rules defined in
|
||||
// the proto definition for this message. If any rules are violated, the first
|
||||
// error encountered is returned, or nil if there are no violations.
|
||||
func (m *CommonNoParams) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on CommonNoParams with the rules defined
|
||||
// in the proto definition for this message. If any rules are violated, the
|
||||
// result is a list of violation errors wrapped in CommonNoParamsMultiError,
|
||||
// or nil if none found.
|
||||
func (m *CommonNoParams) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *CommonNoParams) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
if len(errors) > 0 {
|
||||
return CommonNoParamsMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// CommonNoParamsMultiError is an error wrapping multiple validation errors
|
||||
// returned by CommonNoParams.ValidateAll() if the designated constraints
|
||||
// aren't met.
|
||||
type CommonNoParamsMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m CommonNoParamsMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m CommonNoParamsMultiError) AllErrors() []error { return m }
|
||||
|
||||
// CommonNoParamsValidationError is the validation error returned by
|
||||
// CommonNoParams.Validate if the designated constraints aren't met.
|
||||
type CommonNoParamsValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e CommonNoParamsValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e CommonNoParamsValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e CommonNoParamsValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e CommonNoParamsValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e CommonNoParamsValidationError) ErrorName() string { return "CommonNoParamsValidationError" }
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e CommonNoParamsValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sCommonNoParams.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = CommonNoParamsValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = CommonNoParamsValidationError{}
|
||||
|
||||
// Validate checks the field values on CreateArtworkLockRecordReq with the
|
||||
// rules defined in the proto definition for this message. If any rules are
|
||||
// violated, the first error encountered is returned, or nil if there are no violations.
|
||||
func (m *CreateArtworkLockRecordReq) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on CreateArtworkLockRecordReq with the
|
||||
// rules defined in the proto definition for this message. If any rules are
|
||||
// violated, the result is a list of violation errors wrapped in
|
||||
// CreateArtworkLockRecordReqMultiError, or nil if none found.
|
||||
func (m *CreateArtworkLockRecordReq) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *CreateArtworkLockRecordReq) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
// no validation rules for ArtistUid
|
||||
|
||||
// no validation rules for ArtworkUid
|
||||
|
||||
// no validation rules for Status
|
||||
|
||||
// no validation rules for LockTime
|
||||
|
||||
if len(errors) > 0 {
|
||||
return CreateArtworkLockRecordReqMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// CreateArtworkLockRecordReqMultiError is an error wrapping multiple
|
||||
// validation errors returned by CreateArtworkLockRecordReq.ValidateAll() if
|
||||
// the designated constraints aren't met.
|
||||
type CreateArtworkLockRecordReqMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m CreateArtworkLockRecordReqMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m CreateArtworkLockRecordReqMultiError) AllErrors() []error { return m }
|
||||
|
||||
// CreateArtworkLockRecordReqValidationError is the validation error returned
|
||||
// by CreateArtworkLockRecordReq.Validate if the designated constraints aren't met.
|
||||
type CreateArtworkLockRecordReqValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e CreateArtworkLockRecordReqValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e CreateArtworkLockRecordReqValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e CreateArtworkLockRecordReqValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e CreateArtworkLockRecordReqValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e CreateArtworkLockRecordReqValidationError) ErrorName() string {
|
||||
return "CreateArtworkLockRecordReqValidationError"
|
||||
}
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e CreateArtworkLockRecordReqValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sCreateArtworkLockRecordReq.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = CreateArtworkLockRecordReqValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = CreateArtworkLockRecordReqValidationError{}
|
||||
|
||||
// Validate checks the field values on ArtworkLockActionRequest with the rules
|
||||
// defined in the proto definition for this message. If any rules are
|
||||
// violated, the first error encountered is returned, or nil if there are no violations.
|
||||
func (m *ArtworkLockActionRequest) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on ArtworkLockActionRequest with the
|
||||
// rules defined in the proto definition for this message. If any rules are
|
||||
// violated, the result is a list of violation errors wrapped in
|
||||
// ArtworkLockActionRequestMultiError, or nil if none found.
|
||||
func (m *ArtworkLockActionRequest) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *ArtworkLockActionRequest) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
// no validation rules for ArtistUid
|
||||
|
||||
// no validation rules for Lock
|
||||
|
||||
if len(errors) > 0 {
|
||||
return ArtworkLockActionRequestMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ArtworkLockActionRequestMultiError is an error wrapping multiple validation
|
||||
// errors returned by ArtworkLockActionRequest.ValidateAll() if the designated
|
||||
// constraints aren't met.
|
||||
type ArtworkLockActionRequestMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m ArtworkLockActionRequestMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m ArtworkLockActionRequestMultiError) AllErrors() []error { return m }
|
||||
|
||||
// ArtworkLockActionRequestValidationError is the validation error returned by
|
||||
// ArtworkLockActionRequest.Validate if the designated constraints aren't met.
|
||||
type ArtworkLockActionRequestValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e ArtworkLockActionRequestValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e ArtworkLockActionRequestValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e ArtworkLockActionRequestValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e ArtworkLockActionRequestValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e ArtworkLockActionRequestValidationError) ErrorName() string {
|
||||
return "ArtworkLockActionRequestValidationError"
|
||||
}
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e ArtworkLockActionRequestValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sArtworkLockActionRequest.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = ArtworkLockActionRequestValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = ArtworkLockActionRequestValidationError{}
|
||||
|
||||
// Validate checks the field values on GetArtworkLockRecordsRequest with the
|
||||
// rules defined in the proto definition for this message. If any rules are
|
||||
// violated, the first error encountered is returned, or nil if there are no violations.
|
||||
func (m *GetArtworkLockRecordsRequest) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on GetArtworkLockRecordsRequest with the
|
||||
// rules defined in the proto definition for this message. If any rules are
|
||||
// violated, the result is a list of violation errors wrapped in
|
||||
// GetArtworkLockRecordsRequestMultiError, or nil if none found.
|
||||
func (m *GetArtworkLockRecordsRequest) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *GetArtworkLockRecordsRequest) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
// no validation rules for ArtistUid
|
||||
|
||||
// no validation rules for QueryType
|
||||
|
||||
if len(errors) > 0 {
|
||||
return GetArtworkLockRecordsRequestMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetArtworkLockRecordsRequestMultiError is an error wrapping multiple
|
||||
// validation errors returned by GetArtworkLockRecordsRequest.ValidateAll() if
|
||||
// the designated constraints aren't met.
|
||||
type GetArtworkLockRecordsRequestMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m GetArtworkLockRecordsRequestMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m GetArtworkLockRecordsRequestMultiError) AllErrors() []error { return m }
|
||||
|
||||
// GetArtworkLockRecordsRequestValidationError is the validation error returned
|
||||
// by GetArtworkLockRecordsRequest.Validate if the designated constraints
|
||||
// aren't met.
|
||||
type GetArtworkLockRecordsRequestValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e GetArtworkLockRecordsRequestValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e GetArtworkLockRecordsRequestValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e GetArtworkLockRecordsRequestValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e GetArtworkLockRecordsRequestValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e GetArtworkLockRecordsRequestValidationError) ErrorName() string {
|
||||
return "GetArtworkLockRecordsRequestValidationError"
|
||||
}
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e GetArtworkLockRecordsRequestValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sGetArtworkLockRecordsRequest.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = GetArtworkLockRecordsRequestValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = GetArtworkLockRecordsRequestValidationError{}
|
||||
|
||||
// Validate checks the field values on ArtistLockInfo with the rules defined in
|
||||
// the proto definition for this message. If any rules are violated, the first
|
||||
// error encountered is returned, or nil if there are no violations.
|
||||
func (m *ArtistLockInfo) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on ArtistLockInfo with the rules defined
|
||||
// in the proto definition for this message. If any rules are violated, the
|
||||
// result is a list of violation errors wrapped in ArtistLockInfoMultiError,
|
||||
// or nil if none found.
|
||||
func (m *ArtistLockInfo) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *ArtistLockInfo) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
// no validation rules for ArtistUid
|
||||
|
||||
// no validation rules for ArtworkUid
|
||||
|
||||
// no validation rules for Status
|
||||
|
||||
// no validation rules for LockTime
|
||||
|
||||
if len(errors) > 0 {
|
||||
return ArtistLockInfoMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ArtistLockInfoMultiError is an error wrapping multiple validation errors
|
||||
// returned by ArtistLockInfo.ValidateAll() if the designated constraints
|
||||
// aren't met.
|
||||
type ArtistLockInfoMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m ArtistLockInfoMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m ArtistLockInfoMultiError) AllErrors() []error { return m }
|
||||
|
||||
// ArtistLockInfoValidationError is the validation error returned by
|
||||
// ArtistLockInfo.Validate if the designated constraints aren't met.
|
||||
type ArtistLockInfoValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e ArtistLockInfoValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e ArtistLockInfoValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e ArtistLockInfoValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e ArtistLockInfoValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e ArtistLockInfoValidationError) ErrorName() string { return "ArtistLockInfoValidationError" }
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e ArtistLockInfoValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sArtistLockInfo.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = ArtistLockInfoValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = ArtistLockInfoValidationError{}
|
||||
|
||||
// Validate checks the field values on ArtworkLockList with the rules defined
|
||||
// in the proto definition for this message. If any rules are violated, the
|
||||
// first error encountered is returned, or nil if there are no violations.
|
||||
func (m *ArtworkLockList) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on ArtworkLockList with the rules
|
||||
// defined in the proto definition for this message. If any rules are
|
||||
// violated, the result is a list of violation errors wrapped in
|
||||
// ArtworkLockListMultiError, or nil if none found.
|
||||
func (m *ArtworkLockList) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *ArtworkLockList) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
for idx, item := range m.GetData() {
|
||||
_, _ = idx, item
|
||||
|
||||
if all {
|
||||
switch v := interface{}(item).(type) {
|
||||
case interface{ ValidateAll() error }:
|
||||
if err := v.ValidateAll(); err != nil {
|
||||
errors = append(errors, ArtworkLockListValidationError{
|
||||
field: fmt.Sprintf("Data[%v]", idx),
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
case interface{ Validate() error }:
|
||||
if err := v.Validate(); err != nil {
|
||||
errors = append(errors, ArtworkLockListValidationError{
|
||||
field: fmt.Sprintf("Data[%v]", idx),
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
})
|
||||
}
|
||||
}
|
||||
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
|
||||
if err := v.Validate(); err != nil {
|
||||
return ArtworkLockListValidationError{
|
||||
field: fmt.Sprintf("Data[%v]", idx),
|
||||
reason: "embedded message failed validation",
|
||||
cause: err,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if len(errors) > 0 {
|
||||
return ArtworkLockListMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ArtworkLockListMultiError is an error wrapping multiple validation errors
|
||||
// returned by ArtworkLockList.ValidateAll() if the designated constraints
|
||||
// aren't met.
|
||||
type ArtworkLockListMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m ArtworkLockListMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m ArtworkLockListMultiError) AllErrors() []error { return m }
|
||||
|
||||
// ArtworkLockListValidationError is the validation error returned by
|
||||
// ArtworkLockList.Validate if the designated constraints aren't met.
|
||||
type ArtworkLockListValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e ArtworkLockListValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e ArtworkLockListValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e ArtworkLockListValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e ArtworkLockListValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e ArtworkLockListValidationError) ErrorName() string { return "ArtworkLockListValidationError" }
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e ArtworkLockListValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sArtworkLockList.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = ArtworkLockListValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = ArtworkLockListValidationError{}
|
||||
|
||||
// Validate checks the field values on ArtworkUidList with the rules defined in
|
||||
// the proto definition for this message. If any rules are violated, the first
|
||||
// error encountered is returned, or nil if there are no violations.
|
||||
func (m *ArtworkUidList) Validate() error {
|
||||
return m.validate(false)
|
||||
}
|
||||
|
||||
// ValidateAll checks the field values on ArtworkUidList with the rules defined
|
||||
// in the proto definition for this message. If any rules are violated, the
|
||||
// result is a list of violation errors wrapped in ArtworkUidListMultiError,
|
||||
// or nil if none found.
|
||||
func (m *ArtworkUidList) ValidateAll() error {
|
||||
return m.validate(true)
|
||||
}
|
||||
|
||||
func (m *ArtworkUidList) validate(all bool) error {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var errors []error
|
||||
|
||||
if len(errors) > 0 {
|
||||
return ArtworkUidListMultiError(errors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ArtworkUidListMultiError is an error wrapping multiple validation errors
|
||||
// returned by ArtworkUidList.ValidateAll() if the designated constraints
|
||||
// aren't met.
|
||||
type ArtworkUidListMultiError []error
|
||||
|
||||
// Error returns a concatenation of all the error messages it wraps.
|
||||
func (m ArtworkUidListMultiError) Error() string {
|
||||
var msgs []string
|
||||
for _, err := range m {
|
||||
msgs = append(msgs, err.Error())
|
||||
}
|
||||
return strings.Join(msgs, "; ")
|
||||
}
|
||||
|
||||
// AllErrors returns a list of validation violation errors.
|
||||
func (m ArtworkUidListMultiError) AllErrors() []error { return m }
|
||||
|
||||
// ArtworkUidListValidationError is the validation error returned by
|
||||
// ArtworkUidList.Validate if the designated constraints aren't met.
|
||||
type ArtworkUidListValidationError struct {
|
||||
field string
|
||||
reason string
|
||||
cause error
|
||||
key bool
|
||||
}
|
||||
|
||||
// Field function returns field value.
|
||||
func (e ArtworkUidListValidationError) Field() string { return e.field }
|
||||
|
||||
// Reason function returns reason value.
|
||||
func (e ArtworkUidListValidationError) Reason() string { return e.reason }
|
||||
|
||||
// Cause function returns cause value.
|
||||
func (e ArtworkUidListValidationError) Cause() error { return e.cause }
|
||||
|
||||
// Key function returns key value.
|
||||
func (e ArtworkUidListValidationError) Key() bool { return e.key }
|
||||
|
||||
// ErrorName returns error name.
|
||||
func (e ArtworkUidListValidationError) ErrorName() string { return "ArtworkUidListValidationError" }
|
||||
|
||||
// Error satisfies the builtin error interface
|
||||
func (e ArtworkUidListValidationError) Error() string {
|
||||
cause := ""
|
||||
if e.cause != nil {
|
||||
cause = fmt.Sprintf(" | caused by: %v", e.cause)
|
||||
}
|
||||
|
||||
key := ""
|
||||
if e.key {
|
||||
key = "key for "
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"invalid %sArtworkUidList.%s: %s%s",
|
||||
key,
|
||||
e.field,
|
||||
e.reason,
|
||||
cause)
|
||||
}
|
||||
|
||||
var _ error = ArtworkUidListValidationError{}
|
||||
|
||||
var _ interface {
|
||||
Field() string
|
||||
Reason() string
|
||||
Key() bool
|
||||
Cause() error
|
||||
ErrorName() string
|
||||
} = ArtworkUidListValidationError{}
|
284
pb/artistInfoArtwork/artistinfoArtwork_triple.pb.go
Normal file
284
pb/artistInfoArtwork/artistinfoArtwork_triple.pb.go
Normal file
@ -0,0 +1,284 @@
|
||||
// Code generated by protoc-gen-go-triple. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-triple v1.0.8
|
||||
// - protoc v4.22.0--rc2
|
||||
// source: pb/artistinfoArtwork.proto
|
||||
|
||||
package artistInfoArtwork
|
||||
|
||||
import (
|
||||
context "context"
|
||||
protocol "dubbo.apache.org/dubbo-go/v3/protocol"
|
||||
dubbo3 "dubbo.apache.org/dubbo-go/v3/protocol/dubbo3"
|
||||
invocation "dubbo.apache.org/dubbo-go/v3/protocol/invocation"
|
||||
grpc_go "github.com/dubbogo/grpc-go"
|
||||
codes "github.com/dubbogo/grpc-go/codes"
|
||||
metadata "github.com/dubbogo/grpc-go/metadata"
|
||||
status "github.com/dubbogo/grpc-go/status"
|
||||
common "github.com/dubbogo/triple/pkg/common"
|
||||
constant "github.com/dubbogo/triple/pkg/common/constant"
|
||||
triple "github.com/dubbogo/triple/pkg/triple"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
const _ = grpc_go.SupportPackageIsVersion7
|
||||
|
||||
// ArtistInfoArtworkClient is the client API for ArtistInfoArtwork service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type ArtistInfoArtworkClient interface {
|
||||
// 画作相关
|
||||
CreateArtworkLockRecord(ctx context.Context, in *CreateArtworkLockRecordReq, opts ...grpc_go.CallOption) (*CommonNoParams, common.ErrorWithAttachment)
|
||||
ArtworkLockAction(ctx context.Context, in *ArtworkLockActionRequest, opts ...grpc_go.CallOption) (*CommonNoParams, common.ErrorWithAttachment)
|
||||
GetArtworkLockRecords(ctx context.Context, in *GetArtworkLockRecordsRequest, opts ...grpc_go.CallOption) (*ArtworkLockList, common.ErrorWithAttachment)
|
||||
DeleteArtworkRecord(ctx context.Context, in *ArtworkUidList, opts ...grpc_go.CallOption) (*CommonNoParams, common.ErrorWithAttachment)
|
||||
}
|
||||
|
||||
type artistInfoArtworkClient struct {
|
||||
cc *triple.TripleConn
|
||||
}
|
||||
|
||||
type ArtistInfoArtworkClientImpl struct {
|
||||
CreateArtworkLockRecord func(ctx context.Context, in *CreateArtworkLockRecordReq) (*CommonNoParams, error)
|
||||
ArtworkLockAction func(ctx context.Context, in *ArtworkLockActionRequest) (*CommonNoParams, error)
|
||||
GetArtworkLockRecords func(ctx context.Context, in *GetArtworkLockRecordsRequest) (*ArtworkLockList, error)
|
||||
DeleteArtworkRecord func(ctx context.Context, in *ArtworkUidList) (*CommonNoParams, error)
|
||||
}
|
||||
|
||||
func (c *ArtistInfoArtworkClientImpl) GetDubboStub(cc *triple.TripleConn) ArtistInfoArtworkClient {
|
||||
return NewArtistInfoArtworkClient(cc)
|
||||
}
|
||||
|
||||
func (c *ArtistInfoArtworkClientImpl) XXX_InterfaceName() string {
|
||||
return "artistinfo.ArtistInfoArtwork"
|
||||
}
|
||||
|
||||
func NewArtistInfoArtworkClient(cc *triple.TripleConn) ArtistInfoArtworkClient {
|
||||
return &artistInfoArtworkClient{cc}
|
||||
}
|
||||
|
||||
func (c *artistInfoArtworkClient) CreateArtworkLockRecord(ctx context.Context, in *CreateArtworkLockRecordReq, opts ...grpc_go.CallOption) (*CommonNoParams, common.ErrorWithAttachment) {
|
||||
out := new(CommonNoParams)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/CreateArtworkLockRecord", in, out)
|
||||
}
|
||||
|
||||
func (c *artistInfoArtworkClient) ArtworkLockAction(ctx context.Context, in *ArtworkLockActionRequest, opts ...grpc_go.CallOption) (*CommonNoParams, common.ErrorWithAttachment) {
|
||||
out := new(CommonNoParams)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ArtworkLockAction", in, out)
|
||||
}
|
||||
|
||||
func (c *artistInfoArtworkClient) GetArtworkLockRecords(ctx context.Context, in *GetArtworkLockRecordsRequest, opts ...grpc_go.CallOption) (*ArtworkLockList, common.ErrorWithAttachment) {
|
||||
out := new(ArtworkLockList)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetArtworkLockRecords", in, out)
|
||||
}
|
||||
|
||||
func (c *artistInfoArtworkClient) DeleteArtworkRecord(ctx context.Context, in *ArtworkUidList, opts ...grpc_go.CallOption) (*CommonNoParams, common.ErrorWithAttachment) {
|
||||
out := new(CommonNoParams)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/DeleteArtworkRecord", in, out)
|
||||
}
|
||||
|
||||
// ArtistInfoArtworkServer is the server API for ArtistInfoArtwork service.
|
||||
// All implementations must embed UnimplementedArtistInfoArtworkServer
|
||||
// for forward compatibility
|
||||
type ArtistInfoArtworkServer interface {
|
||||
// 画作相关
|
||||
CreateArtworkLockRecord(context.Context, *CreateArtworkLockRecordReq) (*CommonNoParams, error)
|
||||
ArtworkLockAction(context.Context, *ArtworkLockActionRequest) (*CommonNoParams, error)
|
||||
GetArtworkLockRecords(context.Context, *GetArtworkLockRecordsRequest) (*ArtworkLockList, error)
|
||||
DeleteArtworkRecord(context.Context, *ArtworkUidList) (*CommonNoParams, error)
|
||||
mustEmbedUnimplementedArtistInfoArtworkServer()
|
||||
}
|
||||
|
||||
// UnimplementedArtistInfoArtworkServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedArtistInfoArtworkServer struct {
|
||||
proxyImpl protocol.Invoker
|
||||
}
|
||||
|
||||
func (UnimplementedArtistInfoArtworkServer) CreateArtworkLockRecord(context.Context, *CreateArtworkLockRecordReq) (*CommonNoParams, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CreateArtworkLockRecord not implemented")
|
||||
}
|
||||
func (UnimplementedArtistInfoArtworkServer) ArtworkLockAction(context.Context, *ArtworkLockActionRequest) (*CommonNoParams, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ArtworkLockAction not implemented")
|
||||
}
|
||||
func (UnimplementedArtistInfoArtworkServer) GetArtworkLockRecords(context.Context, *GetArtworkLockRecordsRequest) (*ArtworkLockList, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetArtworkLockRecords not implemented")
|
||||
}
|
||||
func (UnimplementedArtistInfoArtworkServer) DeleteArtworkRecord(context.Context, *ArtworkUidList) (*CommonNoParams, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DeleteArtworkRecord not implemented")
|
||||
}
|
||||
func (s *UnimplementedArtistInfoArtworkServer) XXX_SetProxyImpl(impl protocol.Invoker) {
|
||||
s.proxyImpl = impl
|
||||
}
|
||||
|
||||
func (s *UnimplementedArtistInfoArtworkServer) XXX_GetProxyImpl() protocol.Invoker {
|
||||
return s.proxyImpl
|
||||
}
|
||||
|
||||
func (s *UnimplementedArtistInfoArtworkServer) XXX_ServiceDesc() *grpc_go.ServiceDesc {
|
||||
return &ArtistInfoArtwork_ServiceDesc
|
||||
}
|
||||
func (s *UnimplementedArtistInfoArtworkServer) XXX_InterfaceName() string {
|
||||
return "artistinfo.ArtistInfoArtwork"
|
||||
}
|
||||
|
||||
func (UnimplementedArtistInfoArtworkServer) mustEmbedUnimplementedArtistInfoArtworkServer() {}
|
||||
|
||||
// UnsafeArtistInfoArtworkServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to ArtistInfoArtworkServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeArtistInfoArtworkServer interface {
|
||||
mustEmbedUnimplementedArtistInfoArtworkServer()
|
||||
}
|
||||
|
||||
func RegisterArtistInfoArtworkServer(s grpc_go.ServiceRegistrar, srv ArtistInfoArtworkServer) {
|
||||
s.RegisterService(&ArtistInfoArtwork_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _ArtistInfoArtwork_CreateArtworkLockRecord_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CreateArtworkLockRecordReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
base := srv.(dubbo3.Dubbo3GrpcService)
|
||||
args := []interface{}{}
|
||||
args = append(args, in)
|
||||
md, _ := metadata.FromIncomingContext(ctx)
|
||||
invAttachment := make(map[string]interface{}, len(md))
|
||||
for k, v := range md {
|
||||
invAttachment[k] = v
|
||||
}
|
||||
invo := invocation.NewRPCInvocation("CreateArtworkLockRecord", args, invAttachment)
|
||||
if interceptor == nil {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
info := &grpc_go.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtistInfoArtwork_ArtworkLockAction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ArtworkLockActionRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
base := srv.(dubbo3.Dubbo3GrpcService)
|
||||
args := []interface{}{}
|
||||
args = append(args, in)
|
||||
md, _ := metadata.FromIncomingContext(ctx)
|
||||
invAttachment := make(map[string]interface{}, len(md))
|
||||
for k, v := range md {
|
||||
invAttachment[k] = v
|
||||
}
|
||||
invo := invocation.NewRPCInvocation("ArtworkLockAction", args, invAttachment)
|
||||
if interceptor == nil {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
info := &grpc_go.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtistInfoArtwork_GetArtworkLockRecords_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetArtworkLockRecordsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
base := srv.(dubbo3.Dubbo3GrpcService)
|
||||
args := []interface{}{}
|
||||
args = append(args, in)
|
||||
md, _ := metadata.FromIncomingContext(ctx)
|
||||
invAttachment := make(map[string]interface{}, len(md))
|
||||
for k, v := range md {
|
||||
invAttachment[k] = v
|
||||
}
|
||||
invo := invocation.NewRPCInvocation("GetArtworkLockRecords", args, invAttachment)
|
||||
if interceptor == nil {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
info := &grpc_go.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtistInfoArtwork_DeleteArtworkRecord_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ArtworkUidList)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
base := srv.(dubbo3.Dubbo3GrpcService)
|
||||
args := []interface{}{}
|
||||
args = append(args, in)
|
||||
md, _ := metadata.FromIncomingContext(ctx)
|
||||
invAttachment := make(map[string]interface{}, len(md))
|
||||
for k, v := range md {
|
||||
invAttachment[k] = v
|
||||
}
|
||||
invo := invocation.NewRPCInvocation("DeleteArtworkRecord", args, invAttachment)
|
||||
if interceptor == nil {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
info := &grpc_go.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// ArtistInfoArtwork_ServiceDesc is the grpc_go.ServiceDesc for ArtistInfoArtwork service.
|
||||
// It's only intended for direct use with grpc_go.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var ArtistInfoArtwork_ServiceDesc = grpc_go.ServiceDesc{
|
||||
ServiceName: "artistinfo.ArtistInfoArtwork",
|
||||
HandlerType: (*ArtistInfoArtworkServer)(nil),
|
||||
Methods: []grpc_go.MethodDesc{
|
||||
{
|
||||
MethodName: "CreateArtworkLockRecord",
|
||||
Handler: _ArtistInfoArtwork_CreateArtworkLockRecord_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ArtworkLockAction",
|
||||
Handler: _ArtistInfoArtwork_ArtworkLockAction_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetArtworkLockRecords",
|
||||
Handler: _ArtistInfoArtwork_GetArtworkLockRecords_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DeleteArtworkRecord",
|
||||
Handler: _ArtistInfoArtwork_DeleteArtworkRecord_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc_go.StreamDesc{},
|
||||
Metadata: "pb/artistinfoArtwork.proto",
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -2,9 +2,9 @@
|
||||
// versions:
|
||||
// - protoc-gen-go-triple v1.0.8
|
||||
// - protoc v4.22.0--rc2
|
||||
// source: pb/artistinfo/artistinfo.proto
|
||||
// source: pb/artistinfoUser.proto
|
||||
|
||||
package artistinfo
|
||||
package artistInfoUser
|
||||
|
||||
import (
|
||||
context "context"
|
||||
@ -24,10 +24,10 @@ import (
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
const _ = grpc_go.SupportPackageIsVersion7
|
||||
|
||||
// ArtistInfoClient is the client API for ArtistInfo service.
|
||||
// ArtistInfoUserClient is the client API for ArtistInfoUser service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type ArtistInfoClient interface {
|
||||
type ArtistInfoUserClient interface {
|
||||
RegisterUser(ctx context.Context, in *RegisterUserRequest, opts ...grpc_go.CallOption) (*RegisterUserRespond, common.ErrorWithAttachment)
|
||||
UpdateIdCard(ctx context.Context, in *UpdateIdCardRequest, opts ...grpc_go.CallOption) (*CommonNoParams, common.ErrorWithAttachment)
|
||||
// rpc UploadPic (UploadPicRequest) returns (UploadPicRespond) {} //上传身份证反面
|
||||
@ -53,11 +53,11 @@ type ArtistInfoClient interface {
|
||||
GetPreSaveArtistInfo(ctx context.Context, in *GetPreSaveArtistInfoRequest, opts ...grpc_go.CallOption) (*PreSaveArtistInfoData, common.ErrorWithAttachment)
|
||||
}
|
||||
|
||||
type artistInfoClient struct {
|
||||
type artistInfoUserClient struct {
|
||||
cc *triple.TripleConn
|
||||
}
|
||||
|
||||
type ArtistInfoClientImpl struct {
|
||||
type ArtistInfoUserClientImpl struct {
|
||||
RegisterUser func(ctx context.Context, in *RegisterUserRequest) (*RegisterUserRespond, error)
|
||||
UpdateIdCard func(ctx context.Context, in *UpdateIdCardRequest) (*CommonNoParams, error)
|
||||
GetUser func(ctx context.Context, in *GetUserRequest) (*GetUserRespond, error)
|
||||
@ -81,148 +81,148 @@ type ArtistInfoClientImpl struct {
|
||||
GetPreSaveArtistInfo func(ctx context.Context, in *GetPreSaveArtistInfoRequest) (*PreSaveArtistInfoData, error)
|
||||
}
|
||||
|
||||
func (c *ArtistInfoClientImpl) GetDubboStub(cc *triple.TripleConn) ArtistInfoClient {
|
||||
return NewArtistInfoClient(cc)
|
||||
func (c *ArtistInfoUserClientImpl) GetDubboStub(cc *triple.TripleConn) ArtistInfoUserClient {
|
||||
return NewArtistInfoUserClient(cc)
|
||||
}
|
||||
|
||||
func (c *ArtistInfoClientImpl) XXX_InterfaceName() string {
|
||||
return "artistinfo.ArtistInfo"
|
||||
func (c *ArtistInfoUserClientImpl) XXX_InterfaceName() string {
|
||||
return "artistinfo.ArtistInfoUser"
|
||||
}
|
||||
|
||||
func NewArtistInfoClient(cc *triple.TripleConn) ArtistInfoClient {
|
||||
return &artistInfoClient{cc}
|
||||
func NewArtistInfoUserClient(cc *triple.TripleConn) ArtistInfoUserClient {
|
||||
return &artistInfoUserClient{cc}
|
||||
}
|
||||
|
||||
func (c *artistInfoClient) RegisterUser(ctx context.Context, in *RegisterUserRequest, opts ...grpc_go.CallOption) (*RegisterUserRespond, common.ErrorWithAttachment) {
|
||||
func (c *artistInfoUserClient) RegisterUser(ctx context.Context, in *RegisterUserRequest, opts ...grpc_go.CallOption) (*RegisterUserRespond, common.ErrorWithAttachment) {
|
||||
out := new(RegisterUserRespond)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/RegisterUser", in, out)
|
||||
}
|
||||
|
||||
func (c *artistInfoClient) UpdateIdCard(ctx context.Context, in *UpdateIdCardRequest, opts ...grpc_go.CallOption) (*CommonNoParams, common.ErrorWithAttachment) {
|
||||
func (c *artistInfoUserClient) UpdateIdCard(ctx context.Context, in *UpdateIdCardRequest, opts ...grpc_go.CallOption) (*CommonNoParams, common.ErrorWithAttachment) {
|
||||
out := new(CommonNoParams)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateIdCard", in, out)
|
||||
}
|
||||
|
||||
func (c *artistInfoClient) GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc_go.CallOption) (*GetUserRespond, common.ErrorWithAttachment) {
|
||||
func (c *artistInfoUserClient) GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc_go.CallOption) (*GetUserRespond, common.ErrorWithAttachment) {
|
||||
out := new(GetUserRespond)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetUser", in, out)
|
||||
}
|
||||
|
||||
func (c *artistInfoClient) GetUserById(ctx context.Context, in *GetUserByIdRequest, opts ...grpc_go.CallOption) (*GetUserByIdRespond, common.ErrorWithAttachment) {
|
||||
func (c *artistInfoUserClient) GetUserById(ctx context.Context, in *GetUserByIdRequest, opts ...grpc_go.CallOption) (*GetUserByIdRespond, common.ErrorWithAttachment) {
|
||||
out := new(GetUserByIdRespond)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetUserById", in, out)
|
||||
}
|
||||
|
||||
func (c *artistInfoClient) CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc_go.CallOption) (*CreateUserRespond, common.ErrorWithAttachment) {
|
||||
func (c *artistInfoUserClient) CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc_go.CallOption) (*CreateUserRespond, common.ErrorWithAttachment) {
|
||||
out := new(CreateUserRespond)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/CreateUser", in, out)
|
||||
}
|
||||
|
||||
func (c *artistInfoClient) CreateUserInfo(ctx context.Context, in *CreateUserInfoRequest, opts ...grpc_go.CallOption) (*CreateUserInfoRespond, common.ErrorWithAttachment) {
|
||||
func (c *artistInfoUserClient) CreateUserInfo(ctx context.Context, in *CreateUserInfoRequest, opts ...grpc_go.CallOption) (*CreateUserInfoRespond, common.ErrorWithAttachment) {
|
||||
out := new(CreateUserInfoRespond)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/CreateUserInfo", in, out)
|
||||
}
|
||||
|
||||
func (c *artistInfoClient) FinishVerify(ctx context.Context, in *FinishVerifyRequest, opts ...grpc_go.CallOption) (*FinishVerifyRespond, common.ErrorWithAttachment) {
|
||||
func (c *artistInfoUserClient) FinishVerify(ctx context.Context, in *FinishVerifyRequest, opts ...grpc_go.CallOption) (*FinishVerifyRespond, common.ErrorWithAttachment) {
|
||||
out := new(FinishVerifyRespond)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/FinishVerify", in, out)
|
||||
}
|
||||
|
||||
func (c *artistInfoClient) CheckUserLock(ctx context.Context, in *CheckUserLockRequest, opts ...grpc_go.CallOption) (*CheckUserLockRespond, common.ErrorWithAttachment) {
|
||||
func (c *artistInfoUserClient) CheckUserLock(ctx context.Context, in *CheckUserLockRequest, opts ...grpc_go.CallOption) (*CheckUserLockRespond, common.ErrorWithAttachment) {
|
||||
out := new(CheckUserLockRespond)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/CheckUserLock", in, out)
|
||||
}
|
||||
|
||||
func (c *artistInfoClient) ArtistSupplyList(ctx context.Context, in *ArtistSupplyListRequest, opts ...grpc_go.CallOption) (*ArtistSupplyListRespond, common.ErrorWithAttachment) {
|
||||
func (c *artistInfoUserClient) ArtistSupplyList(ctx context.Context, in *ArtistSupplyListRequest, opts ...grpc_go.CallOption) (*ArtistSupplyListRespond, common.ErrorWithAttachment) {
|
||||
out := new(ArtistSupplyListRespond)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ArtistSupplyList", in, out)
|
||||
}
|
||||
|
||||
func (c *artistInfoClient) UserLock(ctx context.Context, in *UserLockRequest, opts ...grpc_go.CallOption) (*UserLockRespond, common.ErrorWithAttachment) {
|
||||
func (c *artistInfoUserClient) UserLock(ctx context.Context, in *UserLockRequest, opts ...grpc_go.CallOption) (*UserLockRespond, common.ErrorWithAttachment) {
|
||||
out := new(UserLockRespond)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UserLock", in, out)
|
||||
}
|
||||
|
||||
func (c *artistInfoClient) CheckInvitedCode(ctx context.Context, in *CheckInvitedCodeRequest, opts ...grpc_go.CallOption) (*GetUserRespond, common.ErrorWithAttachment) {
|
||||
func (c *artistInfoUserClient) CheckInvitedCode(ctx context.Context, in *CheckInvitedCodeRequest, opts ...grpc_go.CallOption) (*GetUserRespond, common.ErrorWithAttachment) {
|
||||
out := new(GetUserRespond)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/CheckInvitedCode", in, out)
|
||||
}
|
||||
|
||||
func (c *artistInfoClient) UnFinishList(ctx context.Context, in *UnFinishListRequest, opts ...grpc_go.CallOption) (*UnFinishListRespond, common.ErrorWithAttachment) {
|
||||
func (c *artistInfoUserClient) UnFinishList(ctx context.Context, in *UnFinishListRequest, opts ...grpc_go.CallOption) (*UnFinishListRespond, common.ErrorWithAttachment) {
|
||||
out := new(UnFinishListRespond)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UnFinishList", in, out)
|
||||
}
|
||||
|
||||
func (c *artistInfoClient) GetUserMsg(ctx context.Context, in *GetUserMsgRequest, opts ...grpc_go.CallOption) (*GetUserMsgRespond, common.ErrorWithAttachment) {
|
||||
func (c *artistInfoUserClient) GetUserMsg(ctx context.Context, in *GetUserMsgRequest, opts ...grpc_go.CallOption) (*GetUserMsgRespond, common.ErrorWithAttachment) {
|
||||
out := new(GetUserMsgRespond)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetUserMsg", in, out)
|
||||
}
|
||||
|
||||
func (c *artistInfoClient) UpdateMsg(ctx context.Context, in *UpdateMsgRequest, opts ...grpc_go.CallOption) (*UpdateMsgRespond, common.ErrorWithAttachment) {
|
||||
func (c *artistInfoUserClient) UpdateMsg(ctx context.Context, in *UpdateMsgRequest, opts ...grpc_go.CallOption) (*UpdateMsgRespond, common.ErrorWithAttachment) {
|
||||
out := new(UpdateMsgRespond)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateMsg", in, out)
|
||||
}
|
||||
|
||||
func (c *artistInfoClient) BindInviteInvitedAccount(ctx context.Context, in *BindInviteInvitedAccountRequest, opts ...grpc_go.CallOption) (*BindInviteInvitedAccountRespond, common.ErrorWithAttachment) {
|
||||
func (c *artistInfoUserClient) BindInviteInvitedAccount(ctx context.Context, in *BindInviteInvitedAccountRequest, opts ...grpc_go.CallOption) (*BindInviteInvitedAccountRespond, common.ErrorWithAttachment) {
|
||||
out := new(BindInviteInvitedAccountRespond)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/BindInviteInvitedAccount", in, out)
|
||||
}
|
||||
|
||||
func (c *artistInfoClient) BindArtistId(ctx context.Context, in *BindArtistIdRequest, opts ...grpc_go.CallOption) (*BindArtistIdResp, common.ErrorWithAttachment) {
|
||||
func (c *artistInfoUserClient) BindArtistId(ctx context.Context, in *BindArtistIdRequest, opts ...grpc_go.CallOption) (*BindArtistIdResp, common.ErrorWithAttachment) {
|
||||
out := new(BindArtistIdResp)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/BindArtistId", in, out)
|
||||
}
|
||||
|
||||
func (c *artistInfoClient) FindUsers(ctx context.Context, in *FindUserRequest, opts ...grpc_go.CallOption) (*FindUserResponse, common.ErrorWithAttachment) {
|
||||
func (c *artistInfoUserClient) FindUsers(ctx context.Context, in *FindUserRequest, opts ...grpc_go.CallOption) (*FindUserResponse, common.ErrorWithAttachment) {
|
||||
out := new(FindUserResponse)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/FindUsers", in, out)
|
||||
}
|
||||
|
||||
func (c *artistInfoClient) FindUser(ctx context.Context, in *FindUserRequest, opts ...grpc_go.CallOption) (*UserInfo, common.ErrorWithAttachment) {
|
||||
func (c *artistInfoUserClient) FindUser(ctx context.Context, in *FindUserRequest, opts ...grpc_go.CallOption) (*UserInfo, common.ErrorWithAttachment) {
|
||||
out := new(UserInfo)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/FindUser", in, out)
|
||||
}
|
||||
|
||||
func (c *artistInfoClient) UpdateUserData(ctx context.Context, in *UserInfo, opts ...grpc_go.CallOption) (*CommonNoParams, common.ErrorWithAttachment) {
|
||||
func (c *artistInfoUserClient) UpdateUserData(ctx context.Context, in *UserInfo, opts ...grpc_go.CallOption) (*CommonNoParams, common.ErrorWithAttachment) {
|
||||
out := new(CommonNoParams)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateUserData", in, out)
|
||||
}
|
||||
|
||||
func (c *artistInfoClient) PreSaveArtistInfo(ctx context.Context, in *PreSaveArtistInfoData, opts ...grpc_go.CallOption) (*CommonNoParams, common.ErrorWithAttachment) {
|
||||
func (c *artistInfoUserClient) PreSaveArtistInfo(ctx context.Context, in *PreSaveArtistInfoData, opts ...grpc_go.CallOption) (*CommonNoParams, common.ErrorWithAttachment) {
|
||||
out := new(CommonNoParams)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/PreSaveArtistInfo", in, out)
|
||||
}
|
||||
|
||||
func (c *artistInfoClient) GetPreSaveArtistInfo(ctx context.Context, in *GetPreSaveArtistInfoRequest, opts ...grpc_go.CallOption) (*PreSaveArtistInfoData, common.ErrorWithAttachment) {
|
||||
func (c *artistInfoUserClient) GetPreSaveArtistInfo(ctx context.Context, in *GetPreSaveArtistInfoRequest, opts ...grpc_go.CallOption) (*PreSaveArtistInfoData, common.ErrorWithAttachment) {
|
||||
out := new(PreSaveArtistInfoData)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetPreSaveArtistInfo", in, out)
|
||||
}
|
||||
|
||||
// ArtistInfoServer is the server API for ArtistInfo service.
|
||||
// All implementations must embed UnimplementedArtistInfoServer
|
||||
// ArtistInfoUserServer is the server API for ArtistInfoUser service.
|
||||
// All implementations must embed UnimplementedArtistInfoUserServer
|
||||
// for forward compatibility
|
||||
type ArtistInfoServer interface {
|
||||
type ArtistInfoUserServer interface {
|
||||
RegisterUser(context.Context, *RegisterUserRequest) (*RegisterUserRespond, error)
|
||||
UpdateIdCard(context.Context, *UpdateIdCardRequest) (*CommonNoParams, error)
|
||||
// rpc UploadPic (UploadPicRequest) returns (UploadPicRespond) {} //上传身份证反面
|
||||
@ -246,106 +246,106 @@ type ArtistInfoServer interface {
|
||||
UpdateUserData(context.Context, *UserInfo) (*CommonNoParams, error)
|
||||
PreSaveArtistInfo(context.Context, *PreSaveArtistInfoData) (*CommonNoParams, error)
|
||||
GetPreSaveArtistInfo(context.Context, *GetPreSaveArtistInfoRequest) (*PreSaveArtistInfoData, error)
|
||||
mustEmbedUnimplementedArtistInfoServer()
|
||||
mustEmbedUnimplementedArtistInfoUserServer()
|
||||
}
|
||||
|
||||
// UnimplementedArtistInfoServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedArtistInfoServer struct {
|
||||
// UnimplementedArtistInfoUserServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedArtistInfoUserServer struct {
|
||||
proxyImpl protocol.Invoker
|
||||
}
|
||||
|
||||
func (UnimplementedArtistInfoServer) RegisterUser(context.Context, *RegisterUserRequest) (*RegisterUserRespond, error) {
|
||||
func (UnimplementedArtistInfoUserServer) RegisterUser(context.Context, *RegisterUserRequest) (*RegisterUserRespond, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method RegisterUser not implemented")
|
||||
}
|
||||
func (UnimplementedArtistInfoServer) UpdateIdCard(context.Context, *UpdateIdCardRequest) (*CommonNoParams, error) {
|
||||
func (UnimplementedArtistInfoUserServer) UpdateIdCard(context.Context, *UpdateIdCardRequest) (*CommonNoParams, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateIdCard not implemented")
|
||||
}
|
||||
func (UnimplementedArtistInfoServer) GetUser(context.Context, *GetUserRequest) (*GetUserRespond, error) {
|
||||
func (UnimplementedArtistInfoUserServer) GetUser(context.Context, *GetUserRequest) (*GetUserRespond, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetUser not implemented")
|
||||
}
|
||||
func (UnimplementedArtistInfoServer) GetUserById(context.Context, *GetUserByIdRequest) (*GetUserByIdRespond, error) {
|
||||
func (UnimplementedArtistInfoUserServer) GetUserById(context.Context, *GetUserByIdRequest) (*GetUserByIdRespond, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetUserById not implemented")
|
||||
}
|
||||
func (UnimplementedArtistInfoServer) CreateUser(context.Context, *CreateUserRequest) (*CreateUserRespond, error) {
|
||||
func (UnimplementedArtistInfoUserServer) CreateUser(context.Context, *CreateUserRequest) (*CreateUserRespond, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CreateUser not implemented")
|
||||
}
|
||||
func (UnimplementedArtistInfoServer) CreateUserInfo(context.Context, *CreateUserInfoRequest) (*CreateUserInfoRespond, error) {
|
||||
func (UnimplementedArtistInfoUserServer) CreateUserInfo(context.Context, *CreateUserInfoRequest) (*CreateUserInfoRespond, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CreateUserInfo not implemented")
|
||||
}
|
||||
func (UnimplementedArtistInfoServer) FinishVerify(context.Context, *FinishVerifyRequest) (*FinishVerifyRespond, error) {
|
||||
func (UnimplementedArtistInfoUserServer) FinishVerify(context.Context, *FinishVerifyRequest) (*FinishVerifyRespond, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method FinishVerify not implemented")
|
||||
}
|
||||
func (UnimplementedArtistInfoServer) CheckUserLock(context.Context, *CheckUserLockRequest) (*CheckUserLockRespond, error) {
|
||||
func (UnimplementedArtistInfoUserServer) CheckUserLock(context.Context, *CheckUserLockRequest) (*CheckUserLockRespond, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CheckUserLock not implemented")
|
||||
}
|
||||
func (UnimplementedArtistInfoServer) ArtistSupplyList(context.Context, *ArtistSupplyListRequest) (*ArtistSupplyListRespond, error) {
|
||||
func (UnimplementedArtistInfoUserServer) ArtistSupplyList(context.Context, *ArtistSupplyListRequest) (*ArtistSupplyListRespond, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ArtistSupplyList not implemented")
|
||||
}
|
||||
func (UnimplementedArtistInfoServer) UserLock(context.Context, *UserLockRequest) (*UserLockRespond, error) {
|
||||
func (UnimplementedArtistInfoUserServer) UserLock(context.Context, *UserLockRequest) (*UserLockRespond, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UserLock not implemented")
|
||||
}
|
||||
func (UnimplementedArtistInfoServer) CheckInvitedCode(context.Context, *CheckInvitedCodeRequest) (*GetUserRespond, error) {
|
||||
func (UnimplementedArtistInfoUserServer) CheckInvitedCode(context.Context, *CheckInvitedCodeRequest) (*GetUserRespond, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CheckInvitedCode not implemented")
|
||||
}
|
||||
func (UnimplementedArtistInfoServer) UnFinishList(context.Context, *UnFinishListRequest) (*UnFinishListRespond, error) {
|
||||
func (UnimplementedArtistInfoUserServer) UnFinishList(context.Context, *UnFinishListRequest) (*UnFinishListRespond, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UnFinishList not implemented")
|
||||
}
|
||||
func (UnimplementedArtistInfoServer) GetUserMsg(context.Context, *GetUserMsgRequest) (*GetUserMsgRespond, error) {
|
||||
func (UnimplementedArtistInfoUserServer) GetUserMsg(context.Context, *GetUserMsgRequest) (*GetUserMsgRespond, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetUserMsg not implemented")
|
||||
}
|
||||
func (UnimplementedArtistInfoServer) UpdateMsg(context.Context, *UpdateMsgRequest) (*UpdateMsgRespond, error) {
|
||||
func (UnimplementedArtistInfoUserServer) UpdateMsg(context.Context, *UpdateMsgRequest) (*UpdateMsgRespond, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateMsg not implemented")
|
||||
}
|
||||
func (UnimplementedArtistInfoServer) BindInviteInvitedAccount(context.Context, *BindInviteInvitedAccountRequest) (*BindInviteInvitedAccountRespond, error) {
|
||||
func (UnimplementedArtistInfoUserServer) BindInviteInvitedAccount(context.Context, *BindInviteInvitedAccountRequest) (*BindInviteInvitedAccountRespond, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method BindInviteInvitedAccount not implemented")
|
||||
}
|
||||
func (UnimplementedArtistInfoServer) BindArtistId(context.Context, *BindArtistIdRequest) (*BindArtistIdResp, error) {
|
||||
func (UnimplementedArtistInfoUserServer) BindArtistId(context.Context, *BindArtistIdRequest) (*BindArtistIdResp, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method BindArtistId not implemented")
|
||||
}
|
||||
func (UnimplementedArtistInfoServer) FindUsers(context.Context, *FindUserRequest) (*FindUserResponse, error) {
|
||||
func (UnimplementedArtistInfoUserServer) FindUsers(context.Context, *FindUserRequest) (*FindUserResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method FindUsers not implemented")
|
||||
}
|
||||
func (UnimplementedArtistInfoServer) FindUser(context.Context, *FindUserRequest) (*UserInfo, error) {
|
||||
func (UnimplementedArtistInfoUserServer) FindUser(context.Context, *FindUserRequest) (*UserInfo, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method FindUser not implemented")
|
||||
}
|
||||
func (UnimplementedArtistInfoServer) UpdateUserData(context.Context, *UserInfo) (*CommonNoParams, error) {
|
||||
func (UnimplementedArtistInfoUserServer) UpdateUserData(context.Context, *UserInfo) (*CommonNoParams, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateUserData not implemented")
|
||||
}
|
||||
func (UnimplementedArtistInfoServer) PreSaveArtistInfo(context.Context, *PreSaveArtistInfoData) (*CommonNoParams, error) {
|
||||
func (UnimplementedArtistInfoUserServer) PreSaveArtistInfo(context.Context, *PreSaveArtistInfoData) (*CommonNoParams, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method PreSaveArtistInfo not implemented")
|
||||
}
|
||||
func (UnimplementedArtistInfoServer) GetPreSaveArtistInfo(context.Context, *GetPreSaveArtistInfoRequest) (*PreSaveArtistInfoData, error) {
|
||||
func (UnimplementedArtistInfoUserServer) GetPreSaveArtistInfo(context.Context, *GetPreSaveArtistInfoRequest) (*PreSaveArtistInfoData, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetPreSaveArtistInfo not implemented")
|
||||
}
|
||||
func (s *UnimplementedArtistInfoServer) XXX_SetProxyImpl(impl protocol.Invoker) {
|
||||
func (s *UnimplementedArtistInfoUserServer) XXX_SetProxyImpl(impl protocol.Invoker) {
|
||||
s.proxyImpl = impl
|
||||
}
|
||||
|
||||
func (s *UnimplementedArtistInfoServer) XXX_GetProxyImpl() protocol.Invoker {
|
||||
func (s *UnimplementedArtistInfoUserServer) XXX_GetProxyImpl() protocol.Invoker {
|
||||
return s.proxyImpl
|
||||
}
|
||||
|
||||
func (s *UnimplementedArtistInfoServer) XXX_ServiceDesc() *grpc_go.ServiceDesc {
|
||||
return &ArtistInfo_ServiceDesc
|
||||
func (s *UnimplementedArtistInfoUserServer) XXX_ServiceDesc() *grpc_go.ServiceDesc {
|
||||
return &ArtistInfoUser_ServiceDesc
|
||||
}
|
||||
func (s *UnimplementedArtistInfoServer) XXX_InterfaceName() string {
|
||||
return "artistinfo.ArtistInfo"
|
||||
func (s *UnimplementedArtistInfoUserServer) XXX_InterfaceName() string {
|
||||
return "artistinfo.ArtistInfoUser"
|
||||
}
|
||||
|
||||
func (UnimplementedArtistInfoServer) mustEmbedUnimplementedArtistInfoServer() {}
|
||||
func (UnimplementedArtistInfoUserServer) mustEmbedUnimplementedArtistInfoUserServer() {}
|
||||
|
||||
// UnsafeArtistInfoServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to ArtistInfoServer will
|
||||
// UnsafeArtistInfoUserServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to ArtistInfoUserServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeArtistInfoServer interface {
|
||||
mustEmbedUnimplementedArtistInfoServer()
|
||||
type UnsafeArtistInfoUserServer interface {
|
||||
mustEmbedUnimplementedArtistInfoUserServer()
|
||||
}
|
||||
|
||||
func RegisterArtistInfoServer(s grpc_go.ServiceRegistrar, srv ArtistInfoServer) {
|
||||
s.RegisterService(&ArtistInfo_ServiceDesc, srv)
|
||||
func RegisterArtistInfoUserServer(s grpc_go.ServiceRegistrar, srv ArtistInfoUserServer) {
|
||||
s.RegisterService(&ArtistInfoUser_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _ArtistInfo_RegisterUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _ArtistInfoUser_RegisterUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RegisterUserRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
@ -374,7 +374,7 @@ func _ArtistInfo_RegisterUser_Handler(srv interface{}, ctx context.Context, dec
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtistInfo_UpdateIdCard_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _ArtistInfoUser_UpdateIdCard_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UpdateIdCardRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
@ -403,7 +403,7 @@ func _ArtistInfo_UpdateIdCard_Handler(srv interface{}, ctx context.Context, dec
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtistInfo_GetUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _ArtistInfoUser_GetUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetUserRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
@ -432,7 +432,7 @@ func _ArtistInfo_GetUser_Handler(srv interface{}, ctx context.Context, dec func(
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtistInfo_GetUserById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _ArtistInfoUser_GetUserById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetUserByIdRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
@ -461,7 +461,7 @@ func _ArtistInfo_GetUserById_Handler(srv interface{}, ctx context.Context, dec f
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtistInfo_CreateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _ArtistInfoUser_CreateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CreateUserRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
@ -490,7 +490,7 @@ func _ArtistInfo_CreateUser_Handler(srv interface{}, ctx context.Context, dec fu
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtistInfo_CreateUserInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _ArtistInfoUser_CreateUserInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CreateUserInfoRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
@ -519,7 +519,7 @@ func _ArtistInfo_CreateUserInfo_Handler(srv interface{}, ctx context.Context, de
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtistInfo_FinishVerify_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _ArtistInfoUser_FinishVerify_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(FinishVerifyRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
@ -548,7 +548,7 @@ func _ArtistInfo_FinishVerify_Handler(srv interface{}, ctx context.Context, dec
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtistInfo_CheckUserLock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _ArtistInfoUser_CheckUserLock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CheckUserLockRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
@ -577,7 +577,7 @@ func _ArtistInfo_CheckUserLock_Handler(srv interface{}, ctx context.Context, dec
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtistInfo_ArtistSupplyList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _ArtistInfoUser_ArtistSupplyList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ArtistSupplyListRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
@ -606,7 +606,7 @@ func _ArtistInfo_ArtistSupplyList_Handler(srv interface{}, ctx context.Context,
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtistInfo_UserLock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _ArtistInfoUser_UserLock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UserLockRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
@ -635,7 +635,7 @@ func _ArtistInfo_UserLock_Handler(srv interface{}, ctx context.Context, dec func
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtistInfo_CheckInvitedCode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _ArtistInfoUser_CheckInvitedCode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CheckInvitedCodeRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
@ -664,7 +664,7 @@ func _ArtistInfo_CheckInvitedCode_Handler(srv interface{}, ctx context.Context,
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtistInfo_UnFinishList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _ArtistInfoUser_UnFinishList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UnFinishListRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
@ -693,7 +693,7 @@ func _ArtistInfo_UnFinishList_Handler(srv interface{}, ctx context.Context, dec
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtistInfo_GetUserMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _ArtistInfoUser_GetUserMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetUserMsgRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
@ -722,7 +722,7 @@ func _ArtistInfo_GetUserMsg_Handler(srv interface{}, ctx context.Context, dec fu
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtistInfo_UpdateMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _ArtistInfoUser_UpdateMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UpdateMsgRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
@ -751,7 +751,7 @@ func _ArtistInfo_UpdateMsg_Handler(srv interface{}, ctx context.Context, dec fun
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtistInfo_BindInviteInvitedAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _ArtistInfoUser_BindInviteInvitedAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(BindInviteInvitedAccountRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
@ -780,7 +780,7 @@ func _ArtistInfo_BindInviteInvitedAccount_Handler(srv interface{}, ctx context.C
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtistInfo_BindArtistId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _ArtistInfoUser_BindArtistId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(BindArtistIdRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
@ -809,7 +809,7 @@ func _ArtistInfo_BindArtistId_Handler(srv interface{}, ctx context.Context, dec
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtistInfo_FindUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _ArtistInfoUser_FindUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(FindUserRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
@ -838,7 +838,7 @@ func _ArtistInfo_FindUsers_Handler(srv interface{}, ctx context.Context, dec fun
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtistInfo_FindUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _ArtistInfoUser_FindUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(FindUserRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
@ -867,7 +867,7 @@ func _ArtistInfo_FindUser_Handler(srv interface{}, ctx context.Context, dec func
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtistInfo_UpdateUserData_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _ArtistInfoUser_UpdateUserData_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UserInfo)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
@ -896,7 +896,7 @@ func _ArtistInfo_UpdateUserData_Handler(srv interface{}, ctx context.Context, de
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtistInfo_PreSaveArtistInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _ArtistInfoUser_PreSaveArtistInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(PreSaveArtistInfoData)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
@ -925,7 +925,7 @@ func _ArtistInfo_PreSaveArtistInfo_Handler(srv interface{}, ctx context.Context,
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtistInfo_GetPreSaveArtistInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _ArtistInfoUser_GetPreSaveArtistInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetPreSaveArtistInfoRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
@ -954,98 +954,98 @@ func _ArtistInfo_GetPreSaveArtistInfo_Handler(srv interface{}, ctx context.Conte
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// ArtistInfo_ServiceDesc is the grpc_go.ServiceDesc for ArtistInfo service.
|
||||
// ArtistInfoUser_ServiceDesc is the grpc_go.ServiceDesc for ArtistInfoUser service.
|
||||
// It's only intended for direct use with grpc_go.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var ArtistInfo_ServiceDesc = grpc_go.ServiceDesc{
|
||||
ServiceName: "artistinfo.ArtistInfo",
|
||||
HandlerType: (*ArtistInfoServer)(nil),
|
||||
var ArtistInfoUser_ServiceDesc = grpc_go.ServiceDesc{
|
||||
ServiceName: "artistinfo.ArtistInfoUser",
|
||||
HandlerType: (*ArtistInfoUserServer)(nil),
|
||||
Methods: []grpc_go.MethodDesc{
|
||||
{
|
||||
MethodName: "RegisterUser",
|
||||
Handler: _ArtistInfo_RegisterUser_Handler,
|
||||
Handler: _ArtistInfoUser_RegisterUser_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateIdCard",
|
||||
Handler: _ArtistInfo_UpdateIdCard_Handler,
|
||||
Handler: _ArtistInfoUser_UpdateIdCard_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetUser",
|
||||
Handler: _ArtistInfo_GetUser_Handler,
|
||||
Handler: _ArtistInfoUser_GetUser_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetUserById",
|
||||
Handler: _ArtistInfo_GetUserById_Handler,
|
||||
Handler: _ArtistInfoUser_GetUserById_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CreateUser",
|
||||
Handler: _ArtistInfo_CreateUser_Handler,
|
||||
Handler: _ArtistInfoUser_CreateUser_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CreateUserInfo",
|
||||
Handler: _ArtistInfo_CreateUserInfo_Handler,
|
||||
Handler: _ArtistInfoUser_CreateUserInfo_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "FinishVerify",
|
||||
Handler: _ArtistInfo_FinishVerify_Handler,
|
||||
Handler: _ArtistInfoUser_FinishVerify_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CheckUserLock",
|
||||
Handler: _ArtistInfo_CheckUserLock_Handler,
|
||||
Handler: _ArtistInfoUser_CheckUserLock_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ArtistSupplyList",
|
||||
Handler: _ArtistInfo_ArtistSupplyList_Handler,
|
||||
Handler: _ArtistInfoUser_ArtistSupplyList_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UserLock",
|
||||
Handler: _ArtistInfo_UserLock_Handler,
|
||||
Handler: _ArtistInfoUser_UserLock_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CheckInvitedCode",
|
||||
Handler: _ArtistInfo_CheckInvitedCode_Handler,
|
||||
Handler: _ArtistInfoUser_CheckInvitedCode_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UnFinishList",
|
||||
Handler: _ArtistInfo_UnFinishList_Handler,
|
||||
Handler: _ArtistInfoUser_UnFinishList_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetUserMsg",
|
||||
Handler: _ArtistInfo_GetUserMsg_Handler,
|
||||
Handler: _ArtistInfoUser_GetUserMsg_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateMsg",
|
||||
Handler: _ArtistInfo_UpdateMsg_Handler,
|
||||
Handler: _ArtistInfoUser_UpdateMsg_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "BindInviteInvitedAccount",
|
||||
Handler: _ArtistInfo_BindInviteInvitedAccount_Handler,
|
||||
Handler: _ArtistInfoUser_BindInviteInvitedAccount_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "BindArtistId",
|
||||
Handler: _ArtistInfo_BindArtistId_Handler,
|
||||
Handler: _ArtistInfoUser_BindArtistId_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "FindUsers",
|
||||
Handler: _ArtistInfo_FindUsers_Handler,
|
||||
Handler: _ArtistInfoUser_FindUsers_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "FindUser",
|
||||
Handler: _ArtistInfo_FindUser_Handler,
|
||||
Handler: _ArtistInfoUser_FindUser_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateUserData",
|
||||
Handler: _ArtistInfo_UpdateUserData_Handler,
|
||||
Handler: _ArtistInfoUser_UpdateUserData_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "PreSaveArtistInfo",
|
||||
Handler: _ArtistInfo_PreSaveArtistInfo_Handler,
|
||||
Handler: _ArtistInfoUser_PreSaveArtistInfo_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetPreSaveArtistInfo",
|
||||
Handler: _ArtistInfo_GetPreSaveArtistInfo_Handler,
|
||||
Handler: _ArtistInfoUser_GetPreSaveArtistInfo_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc_go.StreamDesc{},
|
||||
Metadata: "pb/artistinfo/artistinfo.proto",
|
||||
Metadata: "pb/artistinfoUser.proto",
|
||||
}
|
53
pb/artistinfoArtwork.proto
Normal file
53
pb/artistinfoArtwork.proto
Normal file
@ -0,0 +1,53 @@
|
||||
syntax = "proto3";
|
||||
package artistinfo;
|
||||
option go_package = "./;artistInfoArtwork";
|
||||
|
||||
import "validate.proto";
|
||||
import public "google/protobuf/timestamp.proto";
|
||||
// protoc -I . -I ./pb --proto_path=. --go_out=./pb/artistInfoArtwork --go-triple_out=./pb/artistInfoArtwork --validate_out="lang=go:./pb/artistInfoArtwork" ./pb/artistinfoArtwork.proto
|
||||
service ArtistInfoArtwork {
|
||||
//画作相关
|
||||
rpc CreateArtworkLockRecord(CreateArtworkLockRecordReq)returns(CommonNoParams){} //创建画作锁状态记录
|
||||
rpc ArtworkLockAction(ArtworkLockActionRequest)returns(CommonNoParams){} //修改状态锁
|
||||
rpc GetArtworkLockRecords(GetArtworkLockRecordsRequest)returns(ArtworkLockList){} //获取画作uid列表
|
||||
rpc DeleteArtworkRecord(ArtworkUidList)returns(CommonNoParams){} //删除画作锁记录
|
||||
}
|
||||
|
||||
message CommonNoParams{}
|
||||
|
||||
message CreateArtworkLockRecordReq{
|
||||
string artistUid=1 [(validate.rules).message.required = true];//画家uid
|
||||
string artworkUid=2 [(validate.rules).message.required = true];//画作uid
|
||||
int64 status=3;//画作锁定状态,按业务逻辑不用传
|
||||
string lockTime=4;
|
||||
}
|
||||
|
||||
message ArtworkLockActionRequest{
|
||||
string artistUid =1 ;//画家uid
|
||||
int32 lock =2; //2=锁定 3=解锁
|
||||
}
|
||||
enum ArtworkQueryMode {
|
||||
NowPreSaveArtwork = 0; //当前暂存的画作
|
||||
NowLockedArtwork = 1; //当前已锁定的画作
|
||||
ArtistCanSee = 2; //画家能看到的画作
|
||||
AllUnlockArtwork = 3; //所有已解锁的画作(历史画作)
|
||||
}
|
||||
message GetArtworkLockRecordsRequest{
|
||||
string artistUid =1 [(validate.rules).message.required = true];//画家uid
|
||||
ArtworkQueryMode queryType =2 ; //查询模式
|
||||
}
|
||||
|
||||
message ArtistLockInfo{
|
||||
string artistUid=1;
|
||||
string artworkUid=2;
|
||||
int64 status=3;
|
||||
string lockTime=4;
|
||||
}
|
||||
|
||||
message ArtworkLockList{
|
||||
repeated ArtistLockInfo data =1; //画作uid列表
|
||||
}
|
||||
|
||||
message ArtworkUidList{
|
||||
repeated string artworkUids =1 ;
|
||||
}
|
@ -1,9 +1,9 @@
|
||||
syntax = "proto3";
|
||||
package artistinfo;
|
||||
option go_package = "./;artistinfo";
|
||||
option go_package = "./;artistInfoUser";
|
||||
import public "google/protobuf/timestamp.proto";
|
||||
// protoc --proto_path=. --go_out=./pb/artistinfo --go-triple_out=./pb/artistinfo ./pb/artistinfo/artistinfo.proto
|
||||
service ArtistInfo {
|
||||
// protoc --proto_path=. --go_out=./pb/artistinfoUser --go-triple_out=./pb/artistinfoUser ./pb/artistinfoUser.proto
|
||||
service ArtistInfoUser {
|
||||
rpc RegisterUser (RegisterUserRequest) returns (RegisterUserRespond){}
|
||||
rpc UpdateIdCard (UpdateIdCardRequest) returns (CommonNoParams) {} //更新身份证信息
|
||||
// rpc UploadPic (UploadPicRequest) returns (UploadPicRespond) {} //上传身份证反面
|
||||
@ -28,7 +28,6 @@ service ArtistInfo {
|
||||
rpc PreSaveArtistInfo(PreSaveArtistInfoData)returns(CommonNoParams){}//暂存艺术家信息
|
||||
rpc GetPreSaveArtistInfo(GetPreSaveArtistInfoRequest)returns(PreSaveArtistInfoData){}//获取暂存的艺术家信息
|
||||
}
|
||||
|
||||
message CommonNoParams{
|
||||
}
|
||||
message UpdateMsgRequest {
|
||||
@ -429,11 +428,11 @@ message UserInfo{
|
||||
}
|
||||
|
||||
message PreSaveArtistInfoData{
|
||||
int64 mgmtAccId = 1;
|
||||
int64 mgmtAccId = 1;
|
||||
string name = 2;
|
||||
string cardId = 3;
|
||||
int32 gender = 4;
|
||||
int32 age = 5;
|
||||
int32 gender = 4;
|
||||
int32 age = 5;
|
||||
string nativePlace = 6;
|
||||
string penName = 7;
|
||||
string phone = 8;
|
||||
@ -447,3 +446,10 @@ message PreSaveArtistInfoData{
|
||||
message GetPreSaveArtistInfoRequest{
|
||||
int64 mgmtAccId = 1;
|
||||
}
|
||||
|
||||
message CreateArtworkLockRecordReq{
|
||||
string artistUid =1;
|
||||
string artworkUid =2;
|
||||
bool isLock =3;
|
||||
string lockTime =4;
|
||||
}
|
768
pb/validate.proto
Normal file
768
pb/validate.proto
Normal file
@ -0,0 +1,768 @@
|
||||
syntax = "proto2";
|
||||
package validate;
|
||||
|
||||
option go_package = "github.com/envoyproxy/protoc-gen-validate/validate";
|
||||
option java_package = "io.envoyproxy.pgv.validate";
|
||||
|
||||
import "google/protobuf/descriptor.proto";
|
||||
import "google/protobuf/duration.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
// Validation rules applied at the message level
|
||||
extend google.protobuf.MessageOptions {
|
||||
// Disabled nullifies any validation rules for this message, including any
|
||||
// message fields associated with it that do support validation.
|
||||
optional bool disabled = 919191;
|
||||
}
|
||||
|
||||
// Validation rules applied at the oneof level
|
||||
extend google.protobuf.OneofOptions {
|
||||
// Required ensures that exactly one the field options in a oneof is set;
|
||||
// validation fails if no fields in the oneof are set.
|
||||
optional bool required = 919191;
|
||||
}
|
||||
|
||||
// Validation rules applied at the field level
|
||||
extend google.protobuf.FieldOptions {
|
||||
// Rules specify the validations to be performed on this field. By default,
|
||||
// no validation is performed against a field.
|
||||
optional FieldRules rules = 919191;
|
||||
}
|
||||
|
||||
// FieldRules encapsulates the rules for each type of field. Depending on the
|
||||
// field, the correct set should be used to ensure proper validations.
|
||||
message FieldRules {
|
||||
oneof type {
|
||||
// Scalar Field Types
|
||||
FloatRules float = 1;
|
||||
DoubleRules double = 2;
|
||||
Int32Rules int32 = 3;
|
||||
Int64Rules int64 = 4;
|
||||
UInt32Rules uint32 = 5;
|
||||
UInt64Rules uint64 = 6;
|
||||
SInt32Rules sint32 = 7;
|
||||
SInt64Rules sint64 = 8;
|
||||
Fixed32Rules fixed32 = 9;
|
||||
Fixed64Rules fixed64 = 10;
|
||||
SFixed32Rules sfixed32 = 11;
|
||||
SFixed64Rules sfixed64 = 12;
|
||||
BoolRules bool = 13;
|
||||
StringRules string = 14;
|
||||
BytesRules bytes = 15;
|
||||
|
||||
// Complex Field Types
|
||||
EnumRules enum = 16;
|
||||
MessageRules message = 17;
|
||||
RepeatedRules repeated = 18;
|
||||
MapRules map = 19;
|
||||
|
||||
// Well-Known Field Types
|
||||
AnyRules any = 20;
|
||||
DurationRules duration = 21;
|
||||
TimestampRules timestamp = 22;
|
||||
}
|
||||
}
|
||||
|
||||
// FloatRules describes the constraints applied to `float` values
|
||||
message FloatRules {
|
||||
// Const specifies that this field must be exactly the specified value
|
||||
optional float const = 1;
|
||||
|
||||
// Lt specifies that this field must be less than the specified value,
|
||||
// exclusive
|
||||
optional float lt = 2;
|
||||
|
||||
// Lte specifies that this field must be less than or equal to the
|
||||
// specified value, inclusive
|
||||
optional float lte = 3;
|
||||
|
||||
// Gt specifies that this field must be greater than the specified value,
|
||||
// exclusive. If the value of Gt is larger than a specified Lt or Lte, the
|
||||
// range is reversed.
|
||||
optional float gt = 4;
|
||||
|
||||
// Gte specifies that this field must be greater than or equal to the
|
||||
// specified value, inclusive. If the value of Gte is larger than a
|
||||
// specified Lt or Lte, the range is reversed.
|
||||
optional float gte = 5;
|
||||
|
||||
// In specifies that this field must be equal to one of the specified
|
||||
// values
|
||||
repeated float in = 6;
|
||||
|
||||
// NotIn specifies that this field cannot be equal to one of the specified
|
||||
// values
|
||||
repeated float not_in = 7;
|
||||
}
|
||||
|
||||
// DoubleRules describes the constraints applied to `double` values
|
||||
message DoubleRules {
|
||||
// Const specifies that this field must be exactly the specified value
|
||||
optional double const = 1;
|
||||
|
||||
// Lt specifies that this field must be less than the specified value,
|
||||
// exclusive
|
||||
optional double lt = 2;
|
||||
|
||||
// Lte specifies that this field must be less than or equal to the
|
||||
// specified value, inclusive
|
||||
optional double lte = 3;
|
||||
|
||||
// Gt specifies that this field must be greater than the specified value,
|
||||
// exclusive. If the value of Gt is larger than a specified Lt or Lte, the
|
||||
// range is reversed.
|
||||
optional double gt = 4;
|
||||
|
||||
// Gte specifies that this field must be greater than or equal to the
|
||||
// specified value, inclusive. If the value of Gte is larger than a
|
||||
// specified Lt or Lte, the range is reversed.
|
||||
optional double gte = 5;
|
||||
|
||||
// In specifies that this field must be equal to one of the specified
|
||||
// values
|
||||
repeated double in = 6;
|
||||
|
||||
// NotIn specifies that this field cannot be equal to one of the specified
|
||||
// values
|
||||
repeated double not_in = 7;
|
||||
}
|
||||
|
||||
// Int32Rules describes the constraints applied to `int32` values
|
||||
message Int32Rules {
|
||||
// Const specifies that this field must be exactly the specified value
|
||||
optional int32 const = 1;
|
||||
|
||||
// Lt specifies that this field must be less than the specified value,
|
||||
// exclusive
|
||||
optional int32 lt = 2;
|
||||
|
||||
// Lte specifies that this field must be less than or equal to the
|
||||
// specified value, inclusive
|
||||
optional int32 lte = 3;
|
||||
|
||||
// Gt specifies that this field must be greater than the specified value,
|
||||
// exclusive. If the value of Gt is larger than a specified Lt or Lte, the
|
||||
// range is reversed.
|
||||
optional int32 gt = 4;
|
||||
|
||||
// Gte specifies that this field must be greater than or equal to the
|
||||
// specified value, inclusive. If the value of Gte is larger than a
|
||||
// specified Lt or Lte, the range is reversed.
|
||||
optional int32 gte = 5;
|
||||
|
||||
// In specifies that this field must be equal to one of the specified
|
||||
// values
|
||||
repeated int32 in = 6;
|
||||
|
||||
// NotIn specifies that this field cannot be equal to one of the specified
|
||||
// values
|
||||
repeated int32 not_in = 7;
|
||||
}
|
||||
|
||||
// Int64Rules describes the constraints applied to `int64` values
|
||||
message Int64Rules {
|
||||
// Const specifies that this field must be exactly the specified value
|
||||
optional int64 const = 1;
|
||||
|
||||
// Lt specifies that this field must be less than the specified value,
|
||||
// exclusive
|
||||
optional int64 lt = 2;
|
||||
|
||||
// Lte specifies that this field must be less than or equal to the
|
||||
// specified value, inclusive
|
||||
optional int64 lte = 3;
|
||||
|
||||
// Gt specifies that this field must be greater than the specified value,
|
||||
// exclusive. If the value of Gt is larger than a specified Lt or Lte, the
|
||||
// range is reversed.
|
||||
optional int64 gt = 4;
|
||||
|
||||
// Gte specifies that this field must be greater than or equal to the
|
||||
// specified value, inclusive. If the value of Gte is larger than a
|
||||
// specified Lt or Lte, the range is reversed.
|
||||
optional int64 gte = 5;
|
||||
|
||||
// In specifies that this field must be equal to one of the specified
|
||||
// values
|
||||
repeated int64 in = 6;
|
||||
|
||||
// NotIn specifies that this field cannot be equal to one of the specified
|
||||
// values
|
||||
repeated int64 not_in = 7;
|
||||
}
|
||||
|
||||
// UInt32Rules describes the constraints applied to `uint32` values
|
||||
message UInt32Rules {
|
||||
// Const specifies that this field must be exactly the specified value
|
||||
optional uint32 const = 1;
|
||||
|
||||
// Lt specifies that this field must be less than the specified value,
|
||||
// exclusive
|
||||
optional uint32 lt = 2;
|
||||
|
||||
// Lte specifies that this field must be less than or equal to the
|
||||
// specified value, inclusive
|
||||
optional uint32 lte = 3;
|
||||
|
||||
// Gt specifies that this field must be greater than the specified value,
|
||||
// exclusive. If the value of Gt is larger than a specified Lt or Lte, the
|
||||
// range is reversed.
|
||||
optional uint32 gt = 4;
|
||||
|
||||
// Gte specifies that this field must be greater than or equal to the
|
||||
// specified value, inclusive. If the value of Gte is larger than a
|
||||
// specified Lt or Lte, the range is reversed.
|
||||
optional uint32 gte = 5;
|
||||
|
||||
// In specifies that this field must be equal to one of the specified
|
||||
// values
|
||||
repeated uint32 in = 6;
|
||||
|
||||
// NotIn specifies that this field cannot be equal to one of the specified
|
||||
// values
|
||||
repeated uint32 not_in = 7;
|
||||
}
|
||||
|
||||
// UInt64Rules describes the constraints applied to `uint64` values
|
||||
message UInt64Rules {
|
||||
// Const specifies that this field must be exactly the specified value
|
||||
optional uint64 const = 1;
|
||||
|
||||
// Lt specifies that this field must be less than the specified value,
|
||||
// exclusive
|
||||
optional uint64 lt = 2;
|
||||
|
||||
// Lte specifies that this field must be less than or equal to the
|
||||
// specified value, inclusive
|
||||
optional uint64 lte = 3;
|
||||
|
||||
// Gt specifies that this field must be greater than the specified value,
|
||||
// exclusive. If the value of Gt is larger than a specified Lt or Lte, the
|
||||
// range is reversed.
|
||||
optional uint64 gt = 4;
|
||||
|
||||
// Gte specifies that this field must be greater than or equal to the
|
||||
// specified value, inclusive. If the value of Gte is larger than a
|
||||
// specified Lt or Lte, the range is reversed.
|
||||
optional uint64 gte = 5;
|
||||
|
||||
// In specifies that this field must be equal to one of the specified
|
||||
// values
|
||||
repeated uint64 in = 6;
|
||||
|
||||
// NotIn specifies that this field cannot be equal to one of the specified
|
||||
// values
|
||||
repeated uint64 not_in = 7;
|
||||
}
|
||||
|
||||
// SInt32Rules describes the constraints applied to `sint32` values
|
||||
message SInt32Rules {
|
||||
// Const specifies that this field must be exactly the specified value
|
||||
optional sint32 const = 1;
|
||||
|
||||
// Lt specifies that this field must be less than the specified value,
|
||||
// exclusive
|
||||
optional sint32 lt = 2;
|
||||
|
||||
// Lte specifies that this field must be less than or equal to the
|
||||
// specified value, inclusive
|
||||
optional sint32 lte = 3;
|
||||
|
||||
// Gt specifies that this field must be greater than the specified value,
|
||||
// exclusive. If the value of Gt is larger than a specified Lt or Lte, the
|
||||
// range is reversed.
|
||||
optional sint32 gt = 4;
|
||||
|
||||
// Gte specifies that this field must be greater than or equal to the
|
||||
// specified value, inclusive. If the value of Gte is larger than a
|
||||
// specified Lt or Lte, the range is reversed.
|
||||
optional sint32 gte = 5;
|
||||
|
||||
// In specifies that this field must be equal to one of the specified
|
||||
// values
|
||||
repeated sint32 in = 6;
|
||||
|
||||
// NotIn specifies that this field cannot be equal to one of the specified
|
||||
// values
|
||||
repeated sint32 not_in = 7;
|
||||
}
|
||||
|
||||
// SInt64Rules describes the constraints applied to `sint64` values
|
||||
message SInt64Rules {
|
||||
// Const specifies that this field must be exactly the specified value
|
||||
optional sint64 const = 1;
|
||||
|
||||
// Lt specifies that this field must be less than the specified value,
|
||||
// exclusive
|
||||
optional sint64 lt = 2;
|
||||
|
||||
// Lte specifies that this field must be less than or equal to the
|
||||
// specified value, inclusive
|
||||
optional sint64 lte = 3;
|
||||
|
||||
// Gt specifies that this field must be greater than the specified value,
|
||||
// exclusive. If the value of Gt is larger than a specified Lt or Lte, the
|
||||
// range is reversed.
|
||||
optional sint64 gt = 4;
|
||||
|
||||
// Gte specifies that this field must be greater than or equal to the
|
||||
// specified value, inclusive. If the value of Gte is larger than a
|
||||
// specified Lt or Lte, the range is reversed.
|
||||
optional sint64 gte = 5;
|
||||
|
||||
// In specifies that this field must be equal to one of the specified
|
||||
// values
|
||||
repeated sint64 in = 6;
|
||||
|
||||
// NotIn specifies that this field cannot be equal to one of the specified
|
||||
// values
|
||||
repeated sint64 not_in = 7;
|
||||
}
|
||||
|
||||
// Fixed32Rules describes the constraints applied to `fixed32` values
|
||||
message Fixed32Rules {
|
||||
// Const specifies that this field must be exactly the specified value
|
||||
optional fixed32 const = 1;
|
||||
|
||||
// Lt specifies that this field must be less than the specified value,
|
||||
// exclusive
|
||||
optional fixed32 lt = 2;
|
||||
|
||||
// Lte specifies that this field must be less than or equal to the
|
||||
// specified value, inclusive
|
||||
optional fixed32 lte = 3;
|
||||
|
||||
// Gt specifies that this field must be greater than the specified value,
|
||||
// exclusive. If the value of Gt is larger than a specified Lt or Lte, the
|
||||
// range is reversed.
|
||||
optional fixed32 gt = 4;
|
||||
|
||||
// Gte specifies that this field must be greater than or equal to the
|
||||
// specified value, inclusive. If the value of Gte is larger than a
|
||||
// specified Lt or Lte, the range is reversed.
|
||||
optional fixed32 gte = 5;
|
||||
|
||||
// In specifies that this field must be equal to one of the specified
|
||||
// values
|
||||
repeated fixed32 in = 6;
|
||||
|
||||
// NotIn specifies that this field cannot be equal to one of the specified
|
||||
// values
|
||||
repeated fixed32 not_in = 7;
|
||||
}
|
||||
|
||||
// Fixed64Rules describes the constraints applied to `fixed64` values
|
||||
message Fixed64Rules {
|
||||
// Const specifies that this field must be exactly the specified value
|
||||
optional fixed64 const = 1;
|
||||
|
||||
// Lt specifies that this field must be less than the specified value,
|
||||
// exclusive
|
||||
optional fixed64 lt = 2;
|
||||
|
||||
// Lte specifies that this field must be less than or equal to the
|
||||
// specified value, inclusive
|
||||
optional fixed64 lte = 3;
|
||||
|
||||
// Gt specifies that this field must be greater than the specified value,
|
||||
// exclusive. If the value of Gt is larger than a specified Lt or Lte, the
|
||||
// range is reversed.
|
||||
optional fixed64 gt = 4;
|
||||
|
||||
// Gte specifies that this field must be greater than or equal to the
|
||||
// specified value, inclusive. If the value of Gte is larger than a
|
||||
// specified Lt or Lte, the range is reversed.
|
||||
optional fixed64 gte = 5;
|
||||
|
||||
// In specifies that this field must be equal to one of the specified
|
||||
// values
|
||||
repeated fixed64 in = 6;
|
||||
|
||||
// NotIn specifies that this field cannot be equal to one of the specified
|
||||
// values
|
||||
repeated fixed64 not_in = 7;
|
||||
}
|
||||
|
||||
// SFixed32Rules describes the constraints applied to `sfixed32` values
|
||||
message SFixed32Rules {
|
||||
// Const specifies that this field must be exactly the specified value
|
||||
optional sfixed32 const = 1;
|
||||
|
||||
// Lt specifies that this field must be less than the specified value,
|
||||
// exclusive
|
||||
optional sfixed32 lt = 2;
|
||||
|
||||
// Lte specifies that this field must be less than or equal to the
|
||||
// specified value, inclusive
|
||||
optional sfixed32 lte = 3;
|
||||
|
||||
// Gt specifies that this field must be greater than the specified value,
|
||||
// exclusive. If the value of Gt is larger than a specified Lt or Lte, the
|
||||
// range is reversed.
|
||||
optional sfixed32 gt = 4;
|
||||
|
||||
// Gte specifies that this field must be greater than or equal to the
|
||||
// specified value, inclusive. If the value of Gte is larger than a
|
||||
// specified Lt or Lte, the range is reversed.
|
||||
optional sfixed32 gte = 5;
|
||||
|
||||
// In specifies that this field must be equal to one of the specified
|
||||
// values
|
||||
repeated sfixed32 in = 6;
|
||||
|
||||
// NotIn specifies that this field cannot be equal to one of the specified
|
||||
// values
|
||||
repeated sfixed32 not_in = 7;
|
||||
}
|
||||
|
||||
// SFixed64Rules describes the constraints applied to `sfixed64` values
|
||||
message SFixed64Rules {
|
||||
// Const specifies that this field must be exactly the specified value
|
||||
optional sfixed64 const = 1;
|
||||
|
||||
// Lt specifies that this field must be less than the specified value,
|
||||
// exclusive
|
||||
optional sfixed64 lt = 2;
|
||||
|
||||
// Lte specifies that this field must be less than or equal to the
|
||||
// specified value, inclusive
|
||||
optional sfixed64 lte = 3;
|
||||
|
||||
// Gt specifies that this field must be greater than the specified value,
|
||||
// exclusive. If the value of Gt is larger than a specified Lt or Lte, the
|
||||
// range is reversed.
|
||||
optional sfixed64 gt = 4;
|
||||
|
||||
// Gte specifies that this field must be greater than or equal to the
|
||||
// specified value, inclusive. If the value of Gte is larger than a
|
||||
// specified Lt or Lte, the range is reversed.
|
||||
optional sfixed64 gte = 5;
|
||||
|
||||
// In specifies that this field must be equal to one of the specified
|
||||
// values
|
||||
repeated sfixed64 in = 6;
|
||||
|
||||
// NotIn specifies that this field cannot be equal to one of the specified
|
||||
// values
|
||||
repeated sfixed64 not_in = 7;
|
||||
}
|
||||
|
||||
// BoolRules describes the constraints applied to `bool` values
|
||||
message BoolRules {
|
||||
// Const specifies that this field must be exactly the specified value
|
||||
optional bool const = 1;
|
||||
}
|
||||
|
||||
// StringRules describe the constraints applied to `string` values
|
||||
message StringRules {
|
||||
// Const specifies that this field must be exactly the specified value
|
||||
optional string const = 1;
|
||||
|
||||
// Len specifies that this field must be the specified number of
|
||||
// characters (Unicode code points). Note that the number of
|
||||
// characters may differ from the number of bytes in the string.
|
||||
optional uint64 len = 19;
|
||||
|
||||
// MinLen specifies that this field must be the specified number of
|
||||
// characters (Unicode code points) at a minimum. Note that the number of
|
||||
// characters may differ from the number of bytes in the string.
|
||||
optional uint64 min_len = 2;
|
||||
|
||||
// MaxLen specifies that this field must be the specified number of
|
||||
// characters (Unicode code points) at a maximum. Note that the number of
|
||||
// characters may differ from the number of bytes in the string.
|
||||
optional uint64 max_len = 3;
|
||||
|
||||
// LenBytes specifies that this field must be the specified number of bytes
|
||||
// at a minimum
|
||||
optional uint64 len_bytes = 20;
|
||||
|
||||
// MinBytes specifies that this field must be the specified number of bytes
|
||||
// at a minimum
|
||||
optional uint64 min_bytes = 4;
|
||||
|
||||
// MaxBytes specifies that this field must be the specified number of bytes
|
||||
// at a maximum
|
||||
optional uint64 max_bytes = 5;
|
||||
|
||||
// Pattern specifes that this field must match against the specified
|
||||
// regular expression (RE2 syntax). The included expression should elide
|
||||
// any delimiters.
|
||||
optional string pattern = 6;
|
||||
|
||||
// Prefix specifies that this field must have the specified substring at
|
||||
// the beginning of the string.
|
||||
optional string prefix = 7;
|
||||
|
||||
// Suffix specifies that this field must have the specified substring at
|
||||
// the end of the string.
|
||||
optional string suffix = 8;
|
||||
|
||||
// Contains specifies that this field must have the specified substring
|
||||
// anywhere in the string.
|
||||
optional string contains = 9;
|
||||
|
||||
// In specifies that this field must be equal to one of the specified
|
||||
// values
|
||||
repeated string in = 10;
|
||||
|
||||
// NotIn specifies that this field cannot be equal to one of the specified
|
||||
// values
|
||||
repeated string not_in = 11;
|
||||
|
||||
// WellKnown rules provide advanced constraints against common string
|
||||
// patterns
|
||||
oneof well_known {
|
||||
// Email specifies that the field must be a valid email address as
|
||||
// defined by RFC 5322
|
||||
bool email = 12;
|
||||
|
||||
// Hostname specifies that the field must be a valid hostname as
|
||||
// defined by RFC 1034. This constraint does not support
|
||||
// internationalized domain names (IDNs).
|
||||
bool hostname = 13;
|
||||
|
||||
// Ip specifies that the field must be a valid IP (v4 or v6) address.
|
||||
// Valid IPv6 addresses should not include surrounding square brackets.
|
||||
bool ip = 14;
|
||||
|
||||
// Ipv4 specifies that the field must be a valid IPv4 address.
|
||||
bool ipv4 = 15;
|
||||
|
||||
// Ipv6 specifies that the field must be a valid IPv6 address. Valid
|
||||
// IPv6 addresses should not include surrounding square brackets.
|
||||
bool ipv6 = 16;
|
||||
|
||||
// Uri specifies that the field must be a valid, absolute URI as defined
|
||||
// by RFC 3986
|
||||
bool uri = 17;
|
||||
|
||||
// UriRef specifies that the field must be a valid URI as defined by RFC
|
||||
// 3986 and may be relative or absolute.
|
||||
bool uri_ref = 18;
|
||||
|
||||
// Address specifies that the field must be either a valid hostname as
|
||||
// defined by RFC 1034 (which does not support internationalized domain
|
||||
// names or IDNs), or it can be a valid IP (v4 or v6).
|
||||
bool address = 21;
|
||||
}
|
||||
}
|
||||
|
||||
// BytesRules describe the constraints applied to `bytes` values
|
||||
message BytesRules {
|
||||
// Const specifies that this field must be exactly the specified value
|
||||
optional bytes const = 1;
|
||||
|
||||
// Len specifies that this field must be the specified number of bytes
|
||||
optional uint64 len = 13;
|
||||
|
||||
// MinLen specifies that this field must be the specified number of bytes
|
||||
// at a minimum
|
||||
optional uint64 min_len = 2;
|
||||
|
||||
// MaxLen specifies that this field must be the specified number of bytes
|
||||
// at a maximum
|
||||
optional uint64 max_len = 3;
|
||||
|
||||
// Pattern specifes that this field must match against the specified
|
||||
// regular expression (RE2 syntax). The included expression should elide
|
||||
// any delimiters.
|
||||
optional string pattern = 4;
|
||||
|
||||
// Prefix specifies that this field must have the specified bytes at the
|
||||
// beginning of the string.
|
||||
optional bytes prefix = 5;
|
||||
|
||||
// Suffix specifies that this field must have the specified bytes at the
|
||||
// end of the string.
|
||||
optional bytes suffix = 6;
|
||||
|
||||
// Contains specifies that this field must have the specified bytes
|
||||
// anywhere in the string.
|
||||
optional bytes contains = 7;
|
||||
|
||||
// In specifies that this field must be equal to one of the specified
|
||||
// values
|
||||
repeated bytes in = 8;
|
||||
|
||||
// NotIn specifies that this field cannot be equal to one of the specified
|
||||
// values
|
||||
repeated bytes not_in = 9;
|
||||
|
||||
// WellKnown rules provide advanced constraints against common byte
|
||||
// patterns
|
||||
oneof well_known {
|
||||
// Ip specifies that the field must be a valid IP (v4 or v6) address in
|
||||
// byte format
|
||||
bool ip = 10;
|
||||
|
||||
// Ipv4 specifies that the field must be a valid IPv4 address in byte
|
||||
// format
|
||||
bool ipv4 = 11;
|
||||
|
||||
// Ipv6 specifies that the field must be a valid IPv6 address in byte
|
||||
// format
|
||||
bool ipv6 = 12;
|
||||
}
|
||||
}
|
||||
|
||||
// EnumRules describe the constraints applied to enum values
|
||||
message EnumRules {
|
||||
// Const specifies that this field must be exactly the specified value
|
||||
optional int32 const = 1;
|
||||
|
||||
// DefinedOnly specifies that this field must be only one of the defined
|
||||
// values for this enum, failing on any undefined value.
|
||||
optional bool defined_only = 2;
|
||||
|
||||
// In specifies that this field must be equal to one of the specified
|
||||
// values
|
||||
repeated int32 in = 3;
|
||||
|
||||
// NotIn specifies that this field cannot be equal to one of the specified
|
||||
// values
|
||||
repeated int32 not_in = 4;
|
||||
}
|
||||
|
||||
// MessageRules describe the constraints applied to embedded message values.
|
||||
// For message-type fields, validation is performed recursively.
|
||||
message MessageRules {
|
||||
// Skip specifies that the validation rules of this field should not be
|
||||
// evaluated
|
||||
optional bool skip = 1;
|
||||
|
||||
// Required specifies that this field must be set
|
||||
optional bool required = 2;
|
||||
}
|
||||
|
||||
// RepeatedRules describe the constraints applied to `repeated` values
|
||||
message RepeatedRules {
|
||||
// MinItems specifies that this field must have the specified number of
|
||||
// items at a minimum
|
||||
optional uint64 min_items = 1;
|
||||
|
||||
// MaxItems specifies that this field must have the specified number of
|
||||
// items at a maximum
|
||||
optional uint64 max_items = 2;
|
||||
|
||||
// Unique specifies that all elements in this field must be unique. This
|
||||
// contraint is only applicable to scalar and enum types (messages are not
|
||||
// supported).
|
||||
optional bool unique = 3;
|
||||
|
||||
// Items specifies the contraints to be applied to each item in the field.
|
||||
// Repeated message fields will still execute validation against each item
|
||||
// unless skip is specified here.
|
||||
optional FieldRules items = 4;
|
||||
}
|
||||
|
||||
// MapRules describe the constraints applied to `map` values
|
||||
message MapRules {
|
||||
// MinPairs specifies that this field must have the specified number of
|
||||
// KVs at a minimum
|
||||
optional uint64 min_pairs = 1;
|
||||
|
||||
// MaxPairs specifies that this field must have the specified number of
|
||||
// KVs at a maximum
|
||||
optional uint64 max_pairs = 2;
|
||||
|
||||
// NoSparse specifies values in this field cannot be unset. This only
|
||||
// applies to map's with message value types.
|
||||
optional bool no_sparse = 3;
|
||||
|
||||
// Keys specifies the constraints to be applied to each key in the field.
|
||||
optional FieldRules keys = 4;
|
||||
|
||||
// Values specifies the constraints to be applied to the value of each key
|
||||
// in the field. Message values will still have their validations evaluated
|
||||
// unless skip is specified here.
|
||||
optional FieldRules values = 5;
|
||||
}
|
||||
|
||||
// AnyRules describe constraints applied exclusively to the
|
||||
// `google.protobuf.Any` well-known type
|
||||
message AnyRules {
|
||||
// Required specifies that this field must be set
|
||||
optional bool required = 1;
|
||||
|
||||
// In specifies that this field's `type_url` must be equal to one of the
|
||||
// specified values.
|
||||
repeated string in = 2;
|
||||
|
||||
// NotIn specifies that this field's `type_url` must not be equal to any of
|
||||
// the specified values.
|
||||
repeated string not_in = 3;
|
||||
}
|
||||
|
||||
// DurationRules describe the constraints applied exclusively to the
|
||||
// `google.protobuf.Duration` well-known type
|
||||
message DurationRules {
|
||||
// Required specifies that this field must be set
|
||||
optional bool required = 1;
|
||||
|
||||
// Const specifies that this field must be exactly the specified value
|
||||
optional google.protobuf.Duration const = 2;
|
||||
|
||||
// Lt specifies that this field must be less than the specified value,
|
||||
// exclusive
|
||||
optional google.protobuf.Duration lt = 3;
|
||||
|
||||
// Lt specifies that this field must be less than the specified value,
|
||||
// inclusive
|
||||
optional google.protobuf.Duration lte = 4;
|
||||
|
||||
// Gt specifies that this field must be greater than the specified value,
|
||||
// exclusive
|
||||
optional google.protobuf.Duration gt = 5;
|
||||
|
||||
// Gte specifies that this field must be greater than the specified value,
|
||||
// inclusive
|
||||
optional google.protobuf.Duration gte = 6;
|
||||
|
||||
// In specifies that this field must be equal to one of the specified
|
||||
// values
|
||||
repeated google.protobuf.Duration in = 7;
|
||||
|
||||
// NotIn specifies that this field cannot be equal to one of the specified
|
||||
// values
|
||||
repeated google.protobuf.Duration not_in = 8;
|
||||
}
|
||||
|
||||
// TimestampRules describe the constraints applied exclusively to the
|
||||
// `google.protobuf.Timestamp` well-known type
|
||||
message TimestampRules {
|
||||
// Required specifies that this field must be set
|
||||
optional bool required = 1;
|
||||
|
||||
// Const specifies that this field must be exactly the specified value
|
||||
optional google.protobuf.Timestamp const = 2;
|
||||
|
||||
// Lt specifies that this field must be less than the specified value,
|
||||
// exclusive
|
||||
optional google.protobuf.Timestamp lt = 3;
|
||||
|
||||
// Lte specifies that this field must be less than the specified value,
|
||||
// inclusive
|
||||
optional google.protobuf.Timestamp lte = 4;
|
||||
|
||||
// Gt specifies that this field must be greater than the specified value,
|
||||
// exclusive
|
||||
optional google.protobuf.Timestamp gt = 5;
|
||||
|
||||
// Gte specifies that this field must be greater than the specified value,
|
||||
// inclusive
|
||||
optional google.protobuf.Timestamp gte = 6;
|
||||
|
||||
// LtNow specifies that this must be less than the current time. LtNow
|
||||
// can only be used with the Within rule.
|
||||
optional bool lt_now = 7;
|
||||
|
||||
// GtNow specifies that this must be greater than the current time. GtNow
|
||||
// can only be used with the Within rule.
|
||||
optional bool gt_now = 8;
|
||||
|
||||
// Within specifies that this field must be within this duration of the
|
||||
// current time. This constraint can be used alone or with the LtNow and
|
||||
// GtNow rules.
|
||||
optional google.protobuf.Duration within = 9;
|
||||
}
|
88
pkg/util/stime/common.go
Normal file
88
pkg/util/stime/common.go
Normal file
@ -0,0 +1,88 @@
|
||||
// Package stime -----------------------------
|
||||
// @file : common.go
|
||||
// @author : JJXu
|
||||
// @contact : wavingbear@163.com
|
||||
// @time : 2022/10/21 00:19:04
|
||||
// -------------------------------------------
|
||||
package stime
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
var Loc loc
|
||||
|
||||
type loc time.Location
|
||||
|
||||
func (l loc) Shanghai() *time.Location {
|
||||
var shanghai, err = time.LoadLocation("Asia/Shanghai")
|
||||
if err != nil {
|
||||
shanghai = time.FixedZone("CST", 8*3600)
|
||||
}
|
||||
return shanghai
|
||||
}
|
||||
|
||||
const (
|
||||
//常规时间格式(日期带横杠)
|
||||
Format_Normal_YMDhms = "2006-01-02 15:04:05"
|
||||
Format_Normal_YMD = "2006-01-02"
|
||||
Format_Normal_hms = "15:04:05"
|
||||
Format_Normal_hm = "15:04"
|
||||
Format_Normal_YM = "2006-01"
|
||||
//带斜杠的时间格式
|
||||
Format_Slash_YMDhms = "2006/01/02 15:04:05"
|
||||
Format_Slash_YMD = "2006/01/02"
|
||||
//无间隔符
|
||||
Format_NoSpacer_YMDhms = "20060102150405"
|
||||
Format_NoSpacer_YMD = "20060102"
|
||||
Format_ChinaChar_YMD = "2006年01月02日"
|
||||
)
|
||||
|
||||
var MonthStrMap = map[string]string{
|
||||
"January": "01",
|
||||
"February": "02",
|
||||
"March": "03",
|
||||
"April": "04",
|
||||
"May": "05",
|
||||
"June": "06",
|
||||
"July": "07",
|
||||
"August": "08",
|
||||
"September": "09",
|
||||
"October": "10",
|
||||
"November": "11",
|
||||
"December": "12",
|
||||
}
|
||||
var MonthIntMap = map[string]int{
|
||||
"January": 1,
|
||||
"February": 2,
|
||||
"March": 3,
|
||||
"April": 4,
|
||||
"May": 5,
|
||||
"June": 6,
|
||||
"July": 7,
|
||||
"August": 8,
|
||||
"September": 9,
|
||||
"October": 10,
|
||||
"November": 11,
|
||||
"December": 12,
|
||||
}
|
||||
|
||||
var WeekIntMap = map[string]int{
|
||||
"Monday": 1,
|
||||
"Tuesday": 2,
|
||||
"Wednesday": 3,
|
||||
"Thursday": 4,
|
||||
"Friday": 5,
|
||||
"Saturday": 6,
|
||||
"Sunday": 7,
|
||||
}
|
||||
|
||||
var WeekStrMap = map[string]string{
|
||||
"Monday": "一",
|
||||
"Tuesday": "二",
|
||||
"Wednesday": "三",
|
||||
"Thursday": "四",
|
||||
"Friday": "五",
|
||||
"Saturday": "六",
|
||||
"Sunday": "日",
|
||||
}
|
128
pkg/util/stime/getTime.go
Normal file
128
pkg/util/stime/getTime.go
Normal file
@ -0,0 +1,128 @@
|
||||
/*
|
||||
* @FileName: getTime.go
|
||||
* @Author: JJXu
|
||||
* @CreateTime: 2022/3/1 下午6:35
|
||||
* @Description:
|
||||
*/
|
||||
|
||||
package stime
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
)
|
||||
|
||||
func StrNowDate() string {
|
||||
return TimeToString(time.Now(), Format_Normal_YMD)
|
||||
}
|
||||
|
||||
func StrNowYearMonth() string {
|
||||
return TimeToString(time.Now(), Format_Normal_YM)
|
||||
}
|
||||
|
||||
//ThisMorming 今天凌晨
|
||||
func ThisMorming(format string) (strTime string) {
|
||||
thisTime := time.Now()
|
||||
year := thisTime.Year()
|
||||
month := MonthStrMap[thisTime.Month().String()]
|
||||
day := fmt.Sprintf("%02d", thisTime.Day())
|
||||
strTime = fmt.Sprintf("%v-%v-%v 00:00:00", year, month, day)
|
||||
if format != Format_Normal_YMDhms {
|
||||
t1, _ := time.ParseInLocation(Format_Normal_YMDhms, strTime, Loc.Shanghai())
|
||||
strTime = t1.Format(format)
|
||||
}
|
||||
return strTime
|
||||
}
|
||||
|
||||
//ThisMorningUnix 获取当日凌晨的时间戳
|
||||
func ThisMorningToUnix() int64 {
|
||||
thist := time.Now()
|
||||
zero_tm := time.Date(thist.Year(), thist.Month(), thist.Day(), 0, 0, 0, 0, thist.Location()).Unix()
|
||||
return zero_tm
|
||||
}
|
||||
|
||||
//TomorrowMorning 第二天凌晨
|
||||
func TomorrowMorning(baseTime time.Time) *time.Time {
|
||||
year := baseTime.Year()
|
||||
month := MonthStrMap[baseTime.Month().String()]
|
||||
day := fmt.Sprintf("%02d", baseTime.Day()+1)
|
||||
strTime := fmt.Sprintf("%v-%v-%v 00:00:00", year, month, day)
|
||||
res, _ := StringToTime(strTime)
|
||||
return res
|
||||
}
|
||||
|
||||
//ThisTimeUnix 获取当前时间的时间戳
|
||||
func CurrentimeToUnix() int64 {
|
||||
return time.Now().Unix()
|
||||
}
|
||||
|
||||
//Currentime 获取当前时间
|
||||
func Currentime(format string) (strTime string) {
|
||||
strTime = time.Now().Format(format)
|
||||
return
|
||||
}
|
||||
|
||||
//HoursAgo 若干小时之前的时间
|
||||
func HoursAgo(hours time.Duration, format string) (lastTimeStr string) {
|
||||
lastStamp := time.Now().Unix() - int64((time.Hour * hours).Seconds())
|
||||
lastTime := time.Unix(lastStamp, 0).In(Loc.Shanghai())
|
||||
lastTimeStr = lastTime.Format(format)
|
||||
return
|
||||
}
|
||||
|
||||
//TimeToString 时间转字符串
|
||||
func TimeToString(t time.Time, format string) string {
|
||||
return t.Format(format)
|
||||
}
|
||||
|
||||
//计算指定月份的天数
|
||||
func YearMonthToDayNumber(year int, month int) int {
|
||||
// 有31天的月份
|
||||
day31 := map[int]bool{
|
||||
1: true,
|
||||
3: true,
|
||||
5: true,
|
||||
7: true,
|
||||
8: true,
|
||||
10: true,
|
||||
12: true,
|
||||
}
|
||||
if day31[month] == true {
|
||||
return 31
|
||||
}
|
||||
// 有30天的月份
|
||||
day30 := map[int]bool{
|
||||
4: true,
|
||||
6: true,
|
||||
9: true,
|
||||
11: true,
|
||||
}
|
||||
if day30[month] == true {
|
||||
return 30
|
||||
}
|
||||
// 计算是平年还是闰年
|
||||
if (year%4 == 0 && year%100 != 0) || year%400 == 0 {
|
||||
// 得出2月的天数
|
||||
return 29
|
||||
}
|
||||
// 得出2月的天数
|
||||
return 28
|
||||
}
|
||||
|
||||
// 求时间差(返回一个数字,该数字单位由传过来的unit决定。若unit为60,则单位是分钟。)
|
||||
func GetDiffTime(start_time string, end_time string, unit int64) int64 {
|
||||
// 转成时间戳
|
||||
if len(start_time) == 10 {
|
||||
start_time = fmt.Sprintf("%v 00:00:00", start_time)
|
||||
}
|
||||
if len(end_time) == 10 {
|
||||
end_time = fmt.Sprintf("%v 00:00:00", end_time)
|
||||
}
|
||||
startUnix, _ := time.ParseInLocation("2006-01-02 15:04:05", start_time, Loc.Shanghai())
|
||||
endUnix, _ := time.ParseInLocation("2006-01-02 15:04:05", end_time, Loc.Shanghai())
|
||||
startTime := startUnix.Unix()
|
||||
endTime := endUnix.Unix()
|
||||
// 求相差天数
|
||||
date := (endTime - startTime) / unit
|
||||
return date
|
||||
}
|
101
pkg/util/stime/getTimeExt.go
Normal file
101
pkg/util/stime/getTimeExt.go
Normal file
@ -0,0 +1,101 @@
|
||||
package stime
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
"time"
|
||||
)
|
||||
|
||||
// 根据指定时间获取后面的若干天工作日列表
|
||||
// param baseOn 指定基准时间
|
||||
// param daysNum 获取工作日的数量
|
||||
func GetWorkDayList(baseOn *time.Time, daysNum int) []time.Time {
|
||||
var timeList []time.Time
|
||||
var basCount = 1
|
||||
var workDay time.Time
|
||||
for {
|
||||
if len(timeList) == daysNum {
|
||||
break
|
||||
}
|
||||
workDay = baseOn.AddDate(0, 0, basCount)
|
||||
switch workDay.Weekday() {
|
||||
case time.Saturday:
|
||||
basCount += 2
|
||||
continue
|
||||
case time.Sunday:
|
||||
basCount++
|
||||
continue
|
||||
default:
|
||||
timeList = append(timeList, workDay)
|
||||
basCount++
|
||||
}
|
||||
}
|
||||
return timeList
|
||||
}
|
||||
|
||||
// 根据指定时间获取后面的若干天工作日列表
|
||||
// param baseOn 指定基准时间
|
||||
// param daysNum 获取工作日的数量
|
||||
func GetWorkDayStrList(baseOn *time.Time, daysNum int) []string {
|
||||
var timeList []string
|
||||
var basCount = 1
|
||||
var workDay time.Time
|
||||
for {
|
||||
if len(timeList) == daysNum {
|
||||
break
|
||||
}
|
||||
workDay = baseOn.AddDate(0, 0, basCount)
|
||||
switch workDay.Weekday() {
|
||||
case time.Saturday:
|
||||
basCount += 2
|
||||
continue
|
||||
case time.Sunday:
|
||||
basCount++
|
||||
continue
|
||||
default:
|
||||
timeList = append(timeList, TimeToString(workDay, Format_Normal_YMD))
|
||||
basCount++
|
||||
}
|
||||
}
|
||||
return timeList
|
||||
}
|
||||
|
||||
// 获取时间差文字描述
|
||||
func GetTimeDifferenceDesc(now *time.Time, before *time.Time) string {
|
||||
if before == nil {
|
||||
return ""
|
||||
}
|
||||
if now.After(*before) {
|
||||
subTimestamp := now.Unix() - before.Unix()
|
||||
day := subTimestamp / (3600 * 24)
|
||||
hour := (subTimestamp - day*3600*24) / 3600
|
||||
minute := (subTimestamp - day*3600*24 - hour*3600) / 60
|
||||
second := subTimestamp - day*3600*24 - hour*3600 - minute*60
|
||||
|
||||
switch {
|
||||
case day > 0:
|
||||
if hour > 0 {
|
||||
return fmt.Sprintf("%d天%d小时", day, hour)
|
||||
} else {
|
||||
return fmt.Sprintf("%d天", day)
|
||||
}
|
||||
case hour > 0:
|
||||
if minute < 10 {
|
||||
return fmt.Sprintf("%d小时", hour)
|
||||
} else {
|
||||
return fmt.Sprintf("%d小时%d", hour, minute)
|
||||
}
|
||||
case hour == 0 && minute > 0:
|
||||
return fmt.Sprintf("%d分钟", minute)
|
||||
case hour == 0 && minute == 0:
|
||||
return fmt.Sprintf("%d秒", second)
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// TimeStampToBytes 时间戳转字节
|
||||
func TimeStampToBytes(stamp int64) []byte {
|
||||
timeStr := strconv.FormatInt(stamp, 2)
|
||||
return []byte(timeStr)
|
||||
}
|
12
pkg/util/stime/getTimeExt_test.go
Normal file
12
pkg/util/stime/getTimeExt_test.go
Normal file
@ -0,0 +1,12 @@
|
||||
package stime
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestGetWorkDayStrList(t *testing.T) {
|
||||
now := time.Now()
|
||||
result := GetWorkDayStrList(&now, 5)
|
||||
t.Log(result)
|
||||
}
|
71
pkg/util/stime/timeTranslate.go
Normal file
71
pkg/util/stime/timeTranslate.go
Normal file
@ -0,0 +1,71 @@
|
||||
/*
|
||||
* @Author: immortal
|
||||
* @Date: 2022-03-11 20:55:38
|
||||
* @LastEditors: immortal
|
||||
* @LastEditTime: 2022-03-12 14:26:42
|
||||
* @Description:
|
||||
* @FilePath: \monitor_env\utils\simpletime\timeTranslate.go
|
||||
*/
|
||||
/**
|
||||
* @Author Puzzle
|
||||
* @Date 2021/11/18 1:36 下午
|
||||
**/
|
||||
|
||||
package stime
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
)
|
||||
|
||||
func GetTimestampMillisecond() int64 {
|
||||
now := time.Now()
|
||||
return now.UnixNano() / 1e6
|
||||
}
|
||||
|
||||
func StringToTime(strTime string) (*time.Time, error) {
|
||||
const TIME_LAYOUT = "2006-01-02 15:04:05" //此时间不可更改
|
||||
timeobj, err := time.ParseInLocation(TIME_LAYOUT, strTime, Loc.Shanghai())
|
||||
return &timeobj, err
|
||||
}
|
||||
|
||||
func StringToTimeWithFormat(strTime string, timeFormat string) (*time.Time, error) {
|
||||
timeobj, err := time.ParseInLocation(timeFormat, strTime, Loc.Shanghai())
|
||||
return &timeobj, err
|
||||
}
|
||||
|
||||
// 去除精确时间后面的小数点
|
||||
func NowTimeToTime(layout string) *time.Time {
|
||||
otime := time.Now().Format(layout) //"2006-01-02 15:04:05" and so on
|
||||
tt, _ := StringToTime(otime)
|
||||
return tt
|
||||
}
|
||||
|
||||
// 时间之间的转换
|
||||
func TimeStampToString(value interface{}, after_type string) {
|
||||
switch value.(type) {
|
||||
case string:
|
||||
fmt.Println(value.(string))
|
||||
case int64:
|
||||
fmt.Println(value.(int64))
|
||||
case int32:
|
||||
fmt.Println(value.(int32))
|
||||
}
|
||||
}
|
||||
|
||||
func GetAge(birthday time.Time) int {
|
||||
if birthday.IsZero() {
|
||||
return 0
|
||||
}
|
||||
now := time.Now()
|
||||
year, month, day := now.Date()
|
||||
if year == 0 || month == 0 || day == 0 {
|
||||
return 0
|
||||
}
|
||||
age := year - birthday.Year() - 1
|
||||
//判断年龄
|
||||
if birthday.Month() < month || birthday.Month() == month && birthday.Day() <= day {
|
||||
age++
|
||||
}
|
||||
return age
|
||||
}
|
26
pkg/util/stime/timeTranslate_test.go
Normal file
26
pkg/util/stime/timeTranslate_test.go
Normal file
@ -0,0 +1,26 @@
|
||||
/*
|
||||
* @FileName: time_test.go
|
||||
* @Author: JJXu
|
||||
* @CreateTime: 2022/2/25 下午2:37
|
||||
* @Description:
|
||||
*/
|
||||
|
||||
package stime
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestTime(t *testing.T) {
|
||||
result := NowTimeToTime(Format_Normal_YMDhms)
|
||||
fmt.Println(result)
|
||||
}
|
||||
func TestGetAge(t *testing.T) {
|
||||
age := GetAge(time.Date(1991, 3, 6, 0, 0, 0, 0, Loc.Shanghai()))
|
||||
fmt.Println(age)
|
||||
if age != 31 {
|
||||
t.Errorf("want 31 but get %v", age)
|
||||
}
|
||||
}
|
52
pkg/util/stime/week.go
Normal file
52
pkg/util/stime/week.go
Normal file
@ -0,0 +1,52 @@
|
||||
/**
|
||||
* @Author Puzzle
|
||||
* @Date 2022/5/20 12:54 下午
|
||||
**/
|
||||
|
||||
package stime
|
||||
|
||||
import "time"
|
||||
|
||||
func NowWeekDay() string {
|
||||
var weekday = [7]string{"七", "一", "二", "三", "四", "五", "六"}
|
||||
week := int(time.Now().Weekday())
|
||||
return weekday[week]
|
||||
}
|
||||
|
||||
// 获取按年算的周数
|
||||
func GetYearWeek(t *time.Time) int {
|
||||
yearDay := t.YearDay()
|
||||
yearFirstDay := t.AddDate(0, 0, -yearDay+1)
|
||||
firstDayInWeek := int(yearFirstDay.Weekday())
|
||||
|
||||
//今年第一周有几天
|
||||
firstWeekDays := 1
|
||||
if firstDayInWeek != 0 {
|
||||
firstWeekDays = 7 - firstDayInWeek + 1
|
||||
}
|
||||
var week int
|
||||
if yearDay <= firstWeekDays {
|
||||
week = 1
|
||||
} else {
|
||||
week = (yearDay-firstWeekDays)/7 + 2
|
||||
}
|
||||
return week
|
||||
}
|
||||
|
||||
// GetWeekDate 获取基准时间范围最最近的某个星期时间
|
||||
//
|
||||
// param baseOn: 基准时间
|
||||
// param weekNum: 中国星期数 1~7
|
||||
// return *time.Time
|
||||
func GetWeekDate(baseOn time.Time, weekNum int) *time.Time {
|
||||
if baseOn.IsZero() || (weekNum <= 0 || weekNum > 7) {
|
||||
return nil
|
||||
}
|
||||
baseDate := time.Date(baseOn.Year(), baseOn.Month(), baseOn.Day(), 0, 0, 0, 0, Loc.Shanghai())
|
||||
var (
|
||||
w = int(baseOn.Weekday())
|
||||
weekDate time.Time
|
||||
)
|
||||
weekDate = baseDate.AddDate(0, 0, weekNum-w)
|
||||
return &weekDate
|
||||
}
|
20
pkg/util/stime/week_test.go
Normal file
20
pkg/util/stime/week_test.go
Normal file
@ -0,0 +1,20 @@
|
||||
// Package simpletime -----------------------------
|
||||
// @file : week_test.go
|
||||
// @author : JJXu
|
||||
// @contact : wavingbear@163.com
|
||||
// @time : 2022/8/31 14:57
|
||||
// -------------------------------------------
|
||||
package stime
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestGetYearWeek(t *testing.T) {
|
||||
now := time.Now()
|
||||
t.Log(GetYearWeek(&now))
|
||||
var w = int(now.Weekday())
|
||||
t.Log(now.AddDate(0, 0, -w+1).Weekday())
|
||||
t.Log(now.AddDate(0, 0, 7-w).Weekday())
|
||||
}
|
Loading…
Reference in New Issue
Block a user