model

package
v0.0.0-...-a3f9433 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 15, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Copyright 2016 Wenhui Shen <www.webx.top>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 Wenhui Shen <www.webx.top>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 Wenhui Shen <www.webx.top>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 Wenhui Shen <www.webx.top>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 Wenhui Shen <www.webx.top>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 Wenhui Shen <www.webx.top>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 Wenhui Shen <www.webx.top>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 Wenhui Shen <www.webx.top>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 Wenhui Shen <www.webx.top>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 Wenhui Shen <www.webx.top>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 Wenhui Shen <www.webx.top>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EditorContent

func EditorContent(ctx *X.Context, etype string, editorContent string) (string, string)

Types

type Album

type Album struct {
	*M
}

func NewAlbum

func NewAlbum(ctx *X.Context) *Album

func (*Album) Add

func (a *Album) Add(m *D.Album) (affected int64, err error)

func (*Album) Delete

func (a *Album) Delete(id int) (affected int64, err error)

func (*Album) Edit

func (a *Album) Edit(id int, m *D.Album) (affected int64, err error)

func (*Album) Get

func (a *Album) Get(id int) (m *D.Album, has bool, err error)

func (*Album) List

func (a *Album) List(s *Select) (countFn func() int64, m []*D.Album, err error)

type Attathment

type Attathment struct {
	*M
}

func NewAttathment

func NewAttathment(ctx *X.Context) *Attathment

func (*Attathment) Add

func (a *Attathment) Add(m *D.Attathment) (affected int64, err error)

func (*Attathment) Delete

func (a *Attathment) Delete(id int) (affected int64, err error)

func (*Attathment) Edit

func (a *Attathment) Edit(id int, m *D.Attathment) (affected int64, err error)

func (*Attathment) Get

func (a *Attathment) Get(id int) (m *D.Attathment, has bool, err error)

func (*Attathment) List

func (a *Attathment) List(s *Select) (countFn func() int64, m []*D.Attathment, err error)

type Category

type Category struct {
	*M
}

func NewCategory

func NewCategory(ctx *X.Context) *Category

func (*Category) Add

func (a *Category) Add(m *D.Category) (affected int64, err error)

func (*Category) Delete

func (a *Category) Delete(id int) (affected int64, err error)

func (*Category) Dir

func (a *Category) Dir(pid int) (rs []D.Category)

func (*Category) Edit

func (a *Category) Edit(id int, m *D.Category) (affected int64, err error)

func (*Category) Get

func (a *Category) Get(id int) (m *D.Category, has bool, err error)

func (*Category) List

func (a *Category) List(s *Select) (countFn func() int64, m []*D.Category, err error)

type Comment

type Comment struct {
	*M
	C *Ocontent
}

func NewComment

func NewComment(ctx *X.Context) *Comment

func (*Comment) Add

func (a *Comment) Add(m *D.Comment) (affected int64, err error)

func (*Comment) Delete

func (a *Comment) Delete(id int64) (affected int64, err error)

func (*Comment) Edit

func (a *Comment) Edit(id int64, m *D.Comment) (affected int64, err error)

func (*Comment) EditorContent

func (a *Comment) EditorContent(m *D.Comment) (otherContent string)

func (*Comment) Get

func (a *Comment) Get(id int64) (m *D.Comment, has bool, err error)

func (*Comment) GetOtherContent

func (a *Comment) GetOtherContent(id int64) (m *D.Ocontent, has bool, err error)

func (*Comment) List

func (a *Comment) List(s *Select) (countFn func() int64, m []*D.Comment, err error)

func (*Comment) ListWithPost

func (a *Comment) ListWithPost(s *Select) (countFn func() int64, m []*CommentWithPost, err error)

type CommentWithPost

type CommentWithPost struct {
	Comment *D.Comment `xorm:"extends"`
	Post    *D.Post    `xorm:"extends" rel:"LEFT:Post.id=Comment.rc_id"`
}

type Config

type Config struct {
	*M
}

func NewConfig

func NewConfig(ctx *X.Context) *Config

func (*Config) Add

func (a *Config) Add(m *D.Config) (affected int64, err error)

func (*Config) Delete

func (a *Config) Delete(id int) (affected int64, err error)

func (*Config) Edit

func (a *Config) Edit(id int, m *D.Config) (affected int64, err error)

func (*Config) Get

func (a *Config) Get(id int) (m *D.Config, has bool, err error)

func (*Config) List

func (a *Config) List(s *Select) (countFn func() int64, m []*D.Config, err error)
type Link struct {
	*M
}
func NewLink(ctx *X.Context) *Link

func (*Link) Add

func (a *Link) Add(m *D.Link) (affected int64, err error)

func (*Link) Delete

func (a *Link) Delete(id int) (affected int64, err error)

func (*Link) Edit

func (a *Link) Edit(id int, m *D.Link) (affected int64, err error)

func (*Link) Get

func (a *Link) Get(id int) (m *D.Link, has bool, err error)

func (*Link) List

func (a *Link) List(s *Select) (countFn func() int64, m []*D.Link, err error)

type M

type M struct {
	*Model
}

func NewM

func NewM(ctx *X.Context) *M

type Ocontent

type Ocontent struct {
	*M
}

func NewOcontent

func NewOcontent(ctx *X.Context) *Ocontent

func (*Ocontent) Add

func (a *Ocontent) Add(m *D.Ocontent) (affected int64, err error)

func (*Ocontent) DelByMaster

func (a *Ocontent) DelByMaster(rid int64, rtype string) (affected int64, err error)

func (*Ocontent) Edit

func (a *Ocontent) Edit(id int64, m *D.Ocontent) (affected int64, err error)

func (*Ocontent) Get

func (a *Ocontent) Get(id int64) (m *D.Ocontent, has bool, err error)

func (*Ocontent) GetByMaster

func (a *Ocontent) GetByMaster(rid int64, rtype string) (m *D.Ocontent, has bool, err error)

type Post

type Post struct {
	*M
	C   *Ocontent
	Uid int
	// contains filtered or unexported fields
}

func NewPost

func NewPost(ctx *X.Context) *Post

func (*Post) Add

func (a *Post) Add(m *D.Post) (affected int64, err error)

func (*Post) Delete

func (a *Post) Delete(id int) (affected int64, err error)

func (*Post) Edit

func (a *Post) Edit(id int, m *D.Post) (affected int64, err error)

func (*Post) EditorContent

func (a *Post) EditorContent(m *D.Post) (otherContent string)

func (*Post) Get

func (a *Post) Get(id int) (m *D.Post, has bool, err error)

func (*Post) GetOtherContent

func (a *Post) GetOtherContent(id int) (m *D.Ocontent, has bool, err error)

func (*Post) List

func (a *Post) List(s *Select) (countFn func() int64, m []*D.Post, err error)

type Tag

type Tag struct {
	*M
}

func NewTag

func NewTag(ctx *X.Context) *Tag

func (*Tag) Add

func (a *Tag) Add(m *D.Tag) (affected int64, err error)

func (*Tag) AddNotExists

func (a *Tag) AddNotExists(uid int, rcType string, tags ...string) (m []*D.Tag, err error)

func (*Tag) DelExists

func (a *Tag) DelExists(rcType string, tags ...string) (err error)

func (*Tag) Delete

func (a *Tag) Delete(id int) (affected int64, err error)

func (*Tag) Edit

func (a *Tag) Edit(id int, m *D.Tag) (affected int64, err error)

func (*Tag) Get

func (a *Tag) Get(id int) (m *D.Tag, has bool, err error)

func (*Tag) List

func (a *Tag) List(s *Select) (countFn func() int64, m []*D.Tag, err error)

func (*Tag) UpdateTimes

func (a *Tag) UpdateTimes(id int, n int) (affected int64, err error)

type User

type User struct {
	*M
}

func NewUser

func NewUser(ctx *X.Context) *User

func (*User) Delete

func (a *User) Delete(id int) (affected int64, err error)

func (*User) Login

func (a *User) Login(uname string, passwd string) (u *D.User, err error)

func (*User) Register

func (a *User) Register(uname string, passwd string, active bool) (u *D.User, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL