service/api/proto/zone/proto/zone_vo_api.go

48 lines
1.4 KiB
Go

package proto
import (
streamerproto "service/api/proto/streamer/proto"
"service/bizcommon/util"
"service/dbstruct"
)
type ApiZoneVO struct {
*dbstruct.Zone
StreamerExt *streamerproto.ApiListExtVO `json:"streamer_ext"`
IsUnreadZoneMomentExist int64 `json:"is_unread_zone_moment_exist"`
VisitorRole int64 `json:"visitor_role"`
Previews *dbstruct.MediaComponent `json:"previews"`
Expenditure int64 `json:"expenditure"`
IsIronfanshipUnlocked int64 `json:"is_ironfanship_unlocked"`
IsSuperfanshipUnlocked int64 `json:"is_superfanship_unlocked"`
}
func (vo *ApiZoneVO) GetMid() int64 {
if vo != nil && vo.Zone != nil {
return util.DerefInt64(vo.Zone.Mid)
}
return 0
}
func (vo *ApiZoneVO) CopyZone(zone *dbstruct.Zone) {
if zone != nil {
vo.Zone = zone
}
}
func (vo *ApiZoneVO) CopyStreamerExt(streamerExt streamerproto.StreamerExtVO) {
if streamerExt != nil {
if apiStreamerExt, ok := streamerExt.(*streamerproto.ApiListExtVO); ok {
vo.StreamerExt = apiStreamerExt
}
}
}
func (vo *ApiZoneVO) SetIsIronfanshipUnlocked(is_ironfanship_unlocked int64) {
vo.IsIronfanshipUnlocked = is_ironfanship_unlocked
}
func (vo *ApiZoneVO) SetIsSuperfanshipUnlocked(is_superfanship_unlocked int64) {
vo.IsSuperfanshipUnlocked = is_superfanship_unlocked
}