45 lines
1.8 KiB
Go
45 lines
1.8 KiB
Go
|
// 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
|
||
|
}
|
||
|
|
||
|
// CreateArtworkLockRecord 创建画作锁定记录
|
||
|
func (a ArtistInfoArtworkProvider) CreateArtworkLockRecord(ctx context.Context, req *artistInfoArtwork.CreateArtworkLockRecordReq) (*artistInfoArtwork.ArtworkCommonNoParams, error) {
|
||
|
if req.ArtworkUid == "" || req.ArtistUid == "" {
|
||
|
return nil, errors.New("参数错误")
|
||
|
}
|
||
|
return a.artistInfoLogic.CreateArtworkLockRecord(req)
|
||
|
}
|
||
|
|
||
|
// ArtworkLockAction 修改画作锁状态
|
||
|
func (a ArtistInfoArtworkProvider) ArtworkLockAction(ctx context.Context, request *artistInfoArtwork.ArtworkLockActionRequest) (*artistInfoArtwork.ArtworkCommonNoParams, error) {
|
||
|
return a.artistInfoLogic.ArtworkLockAction(request)
|
||
|
}
|
||
|
|
||
|
// GetArtworkRecordUids 获取画作锁记录
|
||
|
func (a ArtistInfoArtworkProvider) GetArtworkLockRecords(ctx context.Context, request *artistInfoArtwork.GetArtworkLockRecordsRequest) (*artistInfoArtwork.ArtworkLockList, error) {
|
||
|
return a.artistInfoLogic.GetArtworkLockRecords(request)
|
||
|
}
|
||
|
|
||
|
// DeleteArtworkRecord 删除话u走锁记录
|
||
|
func (a ArtistInfoArtworkProvider) DeleteArtworkRecord(ctx context.Context, request *artistInfoArtwork.DeleteArtworkRecordRequest) (*artistInfoArtwork.ArtworkCommonNoParams, error) {
|
||
|
return a.artistInfoLogic.DeleteArtworkRecord(request)
|
||
|
}
|