Documentation
¶
Index ¶
- Constants
- Variables
- func AddArticle(m *Article) (id int64, err error)
- func AddSingle(m *Single) (id int64, err error)
- func AddSystem(m *System) (id int64, err error)
- func AddVideo(m *Video) (id int64, err error)
- func CategoryHasChildById(id int) bool
- func CreateOneAdminRole(cateId int, title, description, permission string) error
- func CreateOneAdminUser(account, pwd string, role int) error
- func CreateOneCarousel(cateId int, title, url, path, description string) error
- func CreateOneCategory(modelid int, catename, description string, parentId int) error
- func CreateOneGallery(cateId, modelId int, title, description string) error
- func CreateOneModel(id int, title, description, dbname string) error
- func CreateOnePicture(cateId, downloadCount int, title, publishTime, path, description string) (int, error)
- func CreateOneTag(cateId int, title, description string) (int, error)
- func DeleteArticle(id int) (err error)
- func DeleteModel(id int) error
- func DeleteOneAdminRole(id int) error
- func DeleteOneAdminUser(id int) error
- func DeleteOneCarousel(id int) error
- func DeleteOneCategory(id int) error
- func DeleteOneGallery(id int) error
- func DeleteOnePicture(id int) error
- func DeleteOneTag(id int) error
- func DeleteSingle(id int) (err error)
- func DeleteSystem(id int) (err error)
- func DeleteVideo(id int) (err error)
- func GetAdminRoles(catId int, keyword string, pagesize, offset int) []orm.Params
- func GetAdminRolesNum(catId int, keyword string) int
- func GetAdminUserNumByRole(role int) int64
- func GetAllArticle(query map[string]string, fields []string, sortby []string, order []string, ...) (ml []interface{}, err error)
- func GetAllSingle(query map[string]string, fields []string, sortby []string, order []string, ...) (ml []interface{}, err error)
- func GetAllSystem(query map[string]string, fields []string, sortby []string, order []string, ...) (ml []interface{}, err error)
- func GetAllVideo(query map[string]string, fields []string, sortby []string, order []string, ...) (ml []interface{}, err error)
- func GetCarousels(catId int, keyword string, pagesize, offset int) []orm.Params
- func GetCarouselsNum(catId int, keyword string) int
- func GetGallerys(catId int, keyword string, pagesize, offset int) []orm.Params
- func GetGallerysNum(catId int, keyword string) int
- func GetPictures(catId int, keyword string, pagesize, offset int) []orm.Params
- func GetPicturesNum(catId int, keyword string) int
- func GetPicturesNumByTagName(cateId int, keyTag string)
- func GetSubCategorysById(parentid int, isrecursion bool) []interface{}
- func GetTags(catId int, keyword string, pagesize, offset int) []orm.Params
- func GetTagsNum(catId int, keyword string) int
- func InitSystemAdmin()
- func InitSystemModel()
- func MustCreateOneAdminRole(id, cateId int, title, description, permission string) error
- func MustCreateOneCategory(id, modelid int, catename, description string, parentId int) error
- func ResetAdminUserPwd(id int) error
- func SearchAdminRoles(cateId int, keyword string, pagesize, offset int) []orm.Params
- func SearchAdminRolesNum(keyword string) int
- func UpdateAdminRole(id, cateId int, title, description, permission string) error
- func UpdateAdminRoleSort(id, sort int) error
- func UpdateAdminUserInfo(userid, role int, name, oldpwd, newpwd string) error
- func UpdateAdminUserSort(id, sort int) error
- func UpdateArticleById(m *Article) (err error)
- func UpdateCache()
- func UpdateCarousel(id, cateId int, title, url, path, description string) error
- func UpdateCarouselSort(id, sort int) error
- func UpdateCategory(id, modelId, parentId int, title, description string) error
- func UpdateCategorySort(id, sort int) error
- func UpdateGallery(id, cateId, modelId int, title, description string) error
- func UpdateGallerySort(id, sort int) error
- func UpdateModel(id, cateId int, title, description, tableName string) error
- func UpdateModelSort(id, sort int) error
- func UpdatePicture(id, cateId int, title, description string) error
- func UpdatePictureSort(id, sort int) error
- func UpdateSingleById(m *Single) (err error)
- func UpdateSystemById(m *System) (err error)
- func UpdateTag(id, cateId int, title, description string) error
- func UpdateTagSort(id, sort int) error
- func UpdateVideoById(m *Video) (err error)
- type AdminRole
- type AdminUser
- type Article
- type Carousel
- type Category
- type Gallery
- type Model
- type Picture
- type Single
- type System
- type Tag
- type Url
- type Video
Constants ¶
const ( NoError = iota ParamsMissError //1 ParamsTypeError LoginError LoginAccountError LoginPwdError AccountExistError OldPwdError PwdWeakError CookieError NoPermissonError //10 FileExtError EmailFormatError EmailNoneExistError AccountUnuseError IDCardNumberError PhoneNumberError EmailExistError NetworkPlatformInfoExistError JSONUnMarsalError AccountExistAndPleaseRefreshPageError //20 InfoNotExistError CanNotDelCateError PwdRepeatError CaptchaError VideoFormatError DataBaseGetError )
const SystemError = -1
SystemError 系统内部错误
Variables ¶
var ErrCode = map[string]int{ "系统内部错误": SystemError, "无错误": NoError, "参数不完整": ParamsMissError, "参数类型错误": ParamsTypeError, "账号或者密码错误": LoginError, "账号错误": LoginAccountError, "密码错误": LoginPwdError, "用户名已经存在": AccountExistError, "旧密码输入错误": OldPwdError, "密码强度太弱,请输入6位以上数字和字母的组合": PwdWeakError, "登录过期,请重新登录": CookieError, "用户权限不够": NoPermissonError, "文件格式不正确": FileExtError, "邮箱格式不正确": EmailFormatError, "邮箱不存在": EmailNoneExistError, "账号已经被冻结": AccountUnuseError, "身份证号码格式不正确": IDCardNumberError, "手机号码格式不正确": PhoneNumberError, "邮箱已经存在": EmailExistError, "网络平台信息已经存在": NetworkPlatformInfoExistError, "JSON解析错误": JSONUnMarsalError, "账号已经存在,请刷新页面重试": AccountExistAndPleaseRefreshPageError, "信息不存在": InfoNotExistError, "该栏目不允许删除": CanNotDelCateError, "新密码不能和旧密码一致": PwdRepeatError, "验证码错误": CaptchaError, "视频文件格式错误,目前只支持mp4,flv,mov,rmvb,avi格式文件": VideoFormatError, "数据库获取异常": DataBaseGetError, }
var ErrInfo = map[int]string{ SystemError: "系统内部错误", NoError: "无错误", ParamsMissError: "参数不完整", ParamsTypeError: "参数类型错误", LoginError: "账号或者密码错误", LoginAccountError: "账号错误", LoginPwdError: "密码错误", AccountExistError: "用户名已经存在", OldPwdError: "旧密码输入错误", PwdWeakError: "密码强度太弱,请输入6位以上数字和字母的组合", CookieError: "登录过期,请重新登录", NoPermissonError: "用户权限不够", FileExtError: "文件格式不正确", EmailFormatError: "邮箱格式不正确", EmailNoneExistError: "邮箱不存在", AccountUnuseError: "账号已经被冻结", IDCardNumberError: "身份证号码格式不正确", PhoneNumberError: "手机号码格式不正确", EmailExistError: "邮箱已经存在", NetworkPlatformInfoExistError: "网络平台信息已经存在", JSONUnMarsalError: "JSON解析错误", AccountExistAndPleaseRefreshPageError: "账号已经存在,请刷新页面重试", InfoNotExistError: "信息不存在", CanNotDelCateError: "该栏目不允许删除", PwdRepeatError: "新密码不能和旧密码一致", CaptchaError: "验证码错误", VideoFormatError: "视频文件格式错误,目前只支持mp4,flv,mov,rmvb,avi格式文件", DataBaseGetError: "数据库获取异常", }
Functions ¶
func AddArticle ¶
AddArticle insert a new Article into database and returns last inserted Id on success.
func AddSingle ¶
AddSingle insert a new Single into database and returns last inserted Id on success.
func AddSystem ¶
AddSystem insert a new System into database and returns last inserted Id on success.
func CategoryHasChildById ¶
CategoryHasChildById 判断某个栏目是否含有子栏目 @params id @return bool
func CreateOneAdminRole ¶
CreateOneAdminRole 新建一篇角色 @params catId title thumb source description content @return error
func CreateOneAdminUser ¶
CreateOneAdminUser 新建一个管理员用户 @params account pwd role permission @return error
func CreateOneCarousel ¶
CreateOneCarousel 新建一篇轮换图 @params catId title thumb source description content @return error
func CreateOneCategory ¶
CreateOneCategory 创建一个栏目 @params role modelid catname pid data @return error
func CreateOneGallery ¶
CreateOneGallery 新建一篇相册 @params catId title thumb source description content @return error
func CreateOneModel ¶
CreateOneModel 创建一个新的model @params cateId name dbname @return error
func CreateOnePicture ¶
func CreateOnePicture(cateId, downloadCount int, title, publishTime, path, description string) (int, error)
CreateOnePicture 新建一篇图片 @params catId title thumb source description content @return error
func CreateOneTag ¶
CreateOneTag 新建一篇标签 @params catId title thumb source description content @return error
func DeleteArticle ¶
DeleteArticle deletes Article by Id and returns error if the record to be deleted doesn't exist
func DeleteOneAdminRole ¶
DeleteOneAdminRole 删除一个角色 @params id @return error
func DeleteOneAdminUser ¶
DeleteOneAdminUser 删除管理员 @params id @return error
func DeleteOneCarousel ¶
DeleteOneCarousel 删除一个轮换图 @params id @return error
func DeleteOneCategory ¶
DeleteOneCategory 删除一个栏目 @params id @return error
func DeleteOneGallery ¶
DeleteOneGallery 删除一个相册 @params id @return error
func DeleteOnePicture ¶
DeleteOnePicture 删除一个图片 @params id @return error
func DeleteSingle ¶
DeleteSingle deletes Single by Id and returns error if the record to be deleted doesn't exist
func DeleteSystem ¶
DeleteSystem deletes System by Id and returns error if the record to be deleted doesn't exist
func DeleteVideo ¶
DeleteVideo deletes Video by Id and returns error if the record to be deleted doesn't exist
func GetAdminRoles ¶
GetAdminRoles 获取角色 @params catId keyword(搜索title的关键词) pagesize offset @return []orm.Params
func GetAdminRolesNum ¶
GetAdminRolesNum 获取角色的数量 @params cateId keyword(搜索title的关键词) @return int
func GetAdminUserNumByRole ¶
GetAdminUserNumByRole 通过类型获取用户的数量 @params role @return int64
func GetAllArticle ¶
func GetAllArticle(query map[string]string, fields []string, sortby []string, order []string, offset int64, limit int64) (ml []interface{}, err error)
GetAllArticle retrieves all Article matches certain condition. Returns empty list if no records exist
func GetAllSingle ¶
func GetAllSingle(query map[string]string, fields []string, sortby []string, order []string, offset int64, limit int64) (ml []interface{}, err error)
GetAllSingle retrieves all Single matches certain condition. Returns empty list if no records exist
func GetAllSystem ¶
func GetAllSystem(query map[string]string, fields []string, sortby []string, order []string, offset int64, limit int64) (ml []interface{}, err error)
GetAllSystem retrieves all System matches certain condition. Returns empty list if no records exist
func GetAllVideo ¶
func GetAllVideo(query map[string]string, fields []string, sortby []string, order []string, offset int64, limit int64) (ml []interface{}, err error)
GetAllVideo retrieves all Video matches certain condition. Returns empty list if no records exist
func GetCarousels ¶
GetCarousels 获取轮换图 @params catId keyword(搜索title的关键词) pagesize offset @return []orm.Params
func GetCarouselsNum ¶
GetCarouselsNum 获取轮换图的数量 @params cateId keyword(搜索title的关键词) @return int
func GetGallerys ¶
GetGallerys 获取相册 @params catId keyword(搜索title的关键词) pagesize offset @return []orm.Params
func GetGallerysNum ¶
GetGallerysNum 获取相册的数量 @params cateId keyword(搜索title的关键词) @return int
func GetPictures ¶
GetPictures 获取图片 @params catId keyword(搜索title的关键词) pagesize offset @return []orm.Params
func GetPicturesNum ¶
GetPicturesNum 获取图片的数量 @params cateId keyword(搜索title的关键词) @return int
func GetPicturesNumByTagName ¶
func GetSubCategorysById ¶
GetSubCategorysById 递归的获取一个栏目id的子栏目 @params parentid isrecursion(是否递归获取) @return []interface{}
func GetTagsNum ¶
GetTagsNum 获取标签的数量 @params cateId keyword(搜索title的关键词) @return int
func InitSystemAdmin ¶
func InitSystemAdmin()
func InitSystemModel ¶
func InitSystemModel()
func MustCreateOneAdminRole ¶
MustCreateOneAdminRole 新建角色 @params catId title thumb source description content @return error
func MustCreateOneCategory ¶
MustCreateOneCategory 创建一个栏目 @params id role modelid catname pid data @return error
func ResetAdminUserPwd ¶
ResetAdminUserPwd 重置管理员密码 @params id @return error
func SearchAdminRoles ¶
SearchAdminRoles 搜索角色 @params keyword pagesize offset @return []orm.Params
func SearchAdminRolesNum ¶
SearchAdminRolesNum 搜索角色数目 @params keyword @return int
func UpdateAdminRole ¶
UpdateAdminRole 更新角色 @params id title description @return error
func UpdateAdminRoleSort ¶
UpdateAdminRoleSort 更新角色排序 @params id sort @return error
func UpdateAdminUserInfo ¶
UpdateAdminUserInfo 更新用户信息 @params userid name oldpwd newpwd @return error
func UpdateAdminUserSort ¶
UpdateAdminUserSort 更新用户排序 @params id sort @return error
func UpdateArticleById ¶
UpdateArticle updates Article by Id and returns error if the record to be updated doesn't exist
func UpdateCarousel ¶
UpdateCarousel 更新轮换图 @params id title description @return error
func UpdateCarouselSort ¶
UpdateCarouselSort 更新轮换图排序 @params id sort @return error
func UpdateCategory ¶
UpdateCategory 更新栏目信息 @params id name @return error
func UpdateCategorySort ¶
UpdateCategorySort 更新栏目排序 @params id sort @return error
func UpdateGallery ¶
UpdateGallery 更新相册 @params id title description @return error
func UpdateGallerySort ¶
UpdateGallerySort 更新相册排序 @params id sort @return error
func UpdateModel ¶
UpdateModel 更新模型信息 @params id cateId title description tableName @return error
func UpdateModelSort ¶
UpdateModelSort 更新栏目排序 @params id sort @return error
func UpdatePicture ¶
UpdatePicture 更新图片 @params id title description @return error
func UpdatePictureSort ¶
UpdatePictureSort 更新图片排序 @params id sort @return error
func UpdateSingleById ¶
UpdateSingle updates Single by Id and returns error if the record to be updated doesn't exist
func UpdateSystemById ¶
UpdateSystem updates System by Id and returns error if the record to be updated doesn't exist
func UpdateTagSort ¶
UpdateTagSort 更新标签排序 @params id sort @return error
func UpdateVideoById ¶
UpdateVideo updates Video by Id and returns error if the record to be updated doesn't exist
Types ¶
type AdminRole ¶
type AdminRole struct {
//主键
Id int `orm:"column(Id);pk"`
//栏目Id
CateId int `orm:"column(CateId)"`
//名字
Title string `orm:"column(Title)"`
//描述
Description string `orm:"column(Description); null"`
//排序值
Sort int `orm:"column(Sort);default(0)"`
//操作权限
OperationPermission string `orm:"column(OperationPermission)"`
}
角色表
func GetOneAdminRoleById ¶
GetOneAdminRoleById 获取一个角色 @params Id @return *AdminRole
type AdminUser ¶
type AdminUser struct {
//主键
Id int `orm:"column(Id);pk"`
//栏目Id
CateId int `orm:"column(CateId)"`
//排序值
Sort int `orm:"column(Sort);default(0)"`
//账号
Account string `orm:"column(Account)"`
//密码
Password string `orm:"column(Password)"`
//最后登陆IP
LatestLoginIP string `orm:"column(LatestLoginIP)"`
//Email
Email string `orm:"column(Email)"`
//真实姓名
RealName string `orm:"column(RealName)"`
//最后登陆时间
LastLoginTime string `orm:"column(LastTime)"`
//最新登陆时间
LatestLoginTime string `orm:"column(LatestTime)"`
//用户角色
Role int `orm:"column(Role)"`
}
管理员表
func AdminUserLogin ¶
AdminUserLogin 管理员登录 @params account password @return error
func GetAdminUserByRole ¶
GetAdminuserByRole 通过类型获取用户 @params role @return []Adminuser
func GetOneAdminUserByAccount ¶
GetOneAdminUserByAccount 通过账号获取一个管理员用户 @params account @return *AdminUser
func GetOneAdminUserById ¶
GetOneAdminUserById 通过id获取一个管理员用户 @params id @return *AdminUser
type Article ¶
type Article struct {
//主键
Id int `orm:"column(Id);pk"`
//栏目Id
CateId int `orm:"column(CateId)"`
//名字
Title string `orm:"column(Title)"`
//描述
Description string `orm:"column(Description);null"`
//创建时间
CreateTime string `orm:"column(CreateTime)"`
//更新时间
UpdateTime string `orm:"column(UpdateTime)"`
//排序值
Sort int `orm:"column(Sort)"`
//状态 - 当值为-1时表示数据已删除
Status int `orm:"column(Status);default(0)"`
//内容
Content string `orm:"column(Content);type(BLOB)"`
}
文章表
func GetArticleById ¶
GetArticleById retrieves Article by Id. Returns error if Id doesn't exist
type Carousel ¶
type Carousel struct {
//主键
Id int `orm:"column(Id);pk"`
//栏目Id
CateId int `orm:"column(CateId)"`
//名字
Title string `orm:"column(Title)"`
//描述
Description string `orm:"column(Description);null"`
//创建时间
CreateTime string `orm:"column(CreateTime)"`
//更新时间
UpdateTime string `orm:"column(UpdateTime)"`
//排序值
Sort int `orm:"column(Sort);default(0)"`
//链接地址
Url string `orm:"column(Url)"`
//图片
Path string `orm:"column(Path)"`
}
轮换图表
func GetOneCarouselById ¶
GetOneCarouselById 获取一个轮换图 @params Id @return *Carousel
type Category ¶
type Category struct {
//主键
Id int `orm:"column(Id);pk"`
//名字
Title string `orm:"column(Title)"`
//描述
Description string `orm:"column(Description);null"`
//排序值
Sort int `orm:"column(Sort);default(0)"`
//模型Id
ModelId int `orm:"column(ModelId)"`
//状态 - 当值为-1时表示数据已删除
Status int `orm:"column(Status);default(0)"`
//父栏目Id
ParentId int `orm:"column(ParentId)"`
}
栏目表
func GetOneCategoryById ¶
GetOneCategoryById 通过id获取一个栏目信息 @params id @return *Category,error
type Gallery ¶
type Gallery struct {
//主键
Id int `orm:"column(Id);pk"`
//栏目Id
CateId int `orm:"column(CateId)"`
//名字
Title string `orm:"column(Title)"`
//描述
Description string `orm:"column(Description);null"`
//创建时间
CreateTime string `orm:"column(CreateTime)"`
//更新时间
UpdateTime string `orm:"column(UpdateTime)"`
//排序值
Sort int `orm:"column(Sort);default(0)"`
//缩略图
Thumb string `orm:"column(Thumb)"`
//点击量
Hit int64 `orm:"column(Hit);default(0)"`
//下载量
PicsDownload int64 `orm:"column(PicsDownload);default(0)"`
}
相册表
func GetOneGalleryById ¶
GetOneGalleryById 获取一个相册 @params Id @return *Gallery
type Model ¶
type Model struct {
//主键
Id int `orm:"column(Id);pk"`
//名字
Title string `orm:"column(Title)"`
//描述
Description string `orm:"column(Description);null"`
//排序值
Sort int `orm:"column(Sort);default(0)"`
//表名
DBTableName string `orm:"column(DBTableName)"`
}
模型表
func GetAllModelWithCache ¶
func GetAllModelWithCache() []Model
GetAllModelWithCache 通过缓存获取全部的模型信息 @params nil @return []Model
func GetOneModelById ¶
GetOneModelById 通过id获取一个模型信息 @params id @return *Model,error
func GetOneModelByIdWithCache ¶
GetOneModelByIdWithCache 通过id获取一个模型信息(从缓存取) @params id @return *Model,error
type Picture ¶
type Picture struct {
//主键
Id int `orm:"column(Id);pk"`
//栏目Id
CateId int `orm:"column(CateId)"`
//名字
Title string `orm:"column(Title)"`
//描述
Description string `orm:"column(Description);null"`
//创建时间
CreateTime string `orm:"column(CreateTime)"`
//更新时间
UpdateTime string `orm:"column(UpdateTime)"`
//发布时间
PublishTime string `orm:"column(PublishTime)"`
//路径
Path string `orm:"column(Path)"`
//排序值
Sort int `orm:"column(Sort);default(0)"`
//状态 - 当值为-1时表示数据已删除
Status int `orm:"column(Status);default(0)"`
//点击量
Hit int64 `orm:"column(Hit);default(0)"`
//下载量
Download int64 `orm:"column(Download);default(0)"`
}
图片表
func GetOnePictureById ¶
GetOnePictureById 获取一个图片 @params Id @return *Picture
type Single ¶
type Single struct {
//主键
Id int `orm:"column(Id);pk"`
//栏目Id
CateId int `orm:"column(CateId)"`
//名字
Title string `orm:"column(Title)"`
//描述
Description string `orm:"column(Description);null"`
//创建时间
CreateTime string `orm:"column(CreateTime)"`
//更新时间
UpdateTime string `orm:"column(UpdateTime)"`
//排序值
Sort int `orm:"column(Sort);default(0)"`
//状态 - 当值为-1时表示数据已删除
Status int `orm:"column(Status);default(0)"`
//内容
Content string `orm:"column(Content);type(BLOB)"`
}
单页面表
func GetSingleById ¶
GetSingleById retrieves Single by Id. Returns error if Id doesn't exist
type System ¶
type System struct {
//主键
Id int `orm:"column(Id);pk"`
//名字
Title string `orm:"column(Title)"`
//描述
Description string `orm:"column(Description);null"`
//创建时间
CreateTime string `orm:"column(CreateTime)"`
//更新时间
UpdateTime string `orm:"column(UpdateTime)"`
//排序值
Sort int `orm:"column(Sort);default(0)"`
//状态 - 当值为-1时表示数据已删除
Status int `orm:"column(Status);default(0)"`
}
系统信息表
func GetSystemById ¶
GetSystemById retrieves System by Id. Returns error if Id doesn't exist
type Tag ¶
type Tag struct {
//主键
Id int `orm:"column(Id);pk"`
//栏目Id
CateId int `orm:"column(CateId)"`
//名字
Title string `orm:"column(Title)"`
//描述
Description string `orm:"column(Description);null"`
//创建时间
CreateTime string `orm:"column(CreateTime)"`
//排序值
Sort int `orm:"column(Sort);default(0)"`
//点击量
Hit int64 `orm:"column(Hit);default(0)"`
//下载量
PicsDownload int64 `orm:"column(PicsDownload);default(0)"`
}
标签表
func GetOneTagById ¶
GetOneTagById 获取一个标签 @params Id @return *Tag
func GetOneTagByTitle ¶
GetOneTagByTitle 通过账号获取一个管理员用户 @params title @return *Tag
type Url ¶
type Url struct {
//主键
Id int `orm:"column(Id);pk"`
//名字
Title string `orm:"column(Title)"`
//描述
Description string `orm:"column(Description);null"`
//创建时间
CreateTime string `orm:"column(CreateTime)"`
//更新时间
UpdateTime string `orm:"column(UpdateTime)"`
//排序值
Sort int `orm:"column(Sort);default(0)"`
//状态 - 当值为-1时表示数据已删除
Status int `orm:"column(Status);default(0)"`
//链接地址
Url string `orm:"column(Url)"`
}
type Video ¶
type Video struct {
//主键
Id int `orm:"column(Id);pk"`
//栏目Id
CateId int `orm:"column(CateId)"`
//名字
Title string `orm:"column(Title)"`
//描述
Description string `orm:"column(Description);null"`
//创建时间
CreateTime string `orm:"column(CreateTime)"`
//更新时间
UpdateTime string `orm:"column(UpdateTime)"`
//排序值
Sort int `orm:"column(Sort);default(0)"`
//状态 - 当值为-1时表示数据已删除
Status int `orm:"column(Status);default(0)"`
//内容
Content string `orm:"column(Content);type(BLOB)"`
}
视频表
func GetVideoById ¶
GetVideoById retrieves Video by Id. Returns error if Id doesn't exist