Documentation
¶
Index ¶
- Variables
- func CloseDB()
- func Connect() error
- func CountIps(query interface{}, args []interface{}) uint
- func CountMessage(query interface{}, args ...interface{}) uint
- func CountVisitors() uint
- func CountVisitorsByKefuId(kefuId string) uint
- func CreateIpblack(ip string, kefuId string) uint
- func CreateMessage(kefu_id string, visitor_id string, content string, mes_type string)
- func CreateReplyContent(groupId string, userId string, content, itemName string)
- func CreateReplyGroup(groupName string, userId string)
- func CreateUser(name string, password string, avator string, nickname string) uint
- func CreateUserClient(kefu, clientId string) uint
- func CreateUserRole(userId uint, roleId uint)
- func CreateVisitor(name, avator, sourceIp, toId, visitorId, refer, city, clientIp, extra string)
- func CreateWelcome(userId string, content string) uint
- func DeleteIpblackByIp(ip string)
- func DeleteReplyContent(id string, userId string)
- func DeleteReplyGroup(id string, userId string)
- func DeleteRoleByUserId(userId interface{})
- func DeleteUserById(id string)
- func DeleteWelcome(userId interface{}, id string)
- func Execute(sql string) error
- func FindConfig(key string) string
- func FindUnreadMessageNumByVisitorId(visitor_id string) uint
- func InitConfig()
- func ReadMessageByVisitorId(visitor_id string)
- func SaveRole(id string, name string, method string, path string)
- func UpdateAbout(page string, title_cn string, title_en string, keywords_cn string, ...)
- func UpdateConfig(key string, value string)
- func UpdateReplyContent(id, userId, title, content string)
- func UpdateUser(id string, name string, password string, avator string, nickname string)
- func UpdateUserAvator(name string, avator string)
- func UpdateUserPass(name string, pass string)
- func UpdateVisitor(name, avator, visitorId string, status uint, clientIp string, sourceIp string, ...)
- func UpdateVisitorKefu(visitorId string, kefuId string)
- func UpdateVisitorStatus(visitorId string, status uint)
- func UpdateWelcome(userId string, id string, content string) uint
- type About
- type Config
- type EveryDayNum
- type Ipblack
- type Message
- type MessageKefu
- type Model
- type ReplyGroup
- type ReplyItem
- type Role
- type User
- type User_client
- type User_role
- type Visitor
- type Welcome
Constants ¶
This section is empty.
Variables ¶
View Source
var CustomConfigs []Config
View Source
var DB *gorm.DB
Functions ¶
func CreateIpblack ¶
func CreateMessage ¶
func CreateReplyContent ¶
func CreateReplyGroup ¶
func CreateUser ¶
func CreateUserClient ¶
func CreateUserRole ¶
func CreateVisitor ¶
func CreateVisitor(name, avator, sourceIp, toId, visitorId, refer, city, clientIp, extra string)
func CreateWelcome ¶
func DeleteIpblackByIp ¶
func DeleteIpblackByIp(ip string)
func DeleteReplyContent ¶
func DeleteReplyGroup ¶
func DeleteRoleByUserId ¶
func DeleteRoleByUserId(userId interface{})
func DeleteUserById ¶
func DeleteUserById(id string)
func DeleteWelcome ¶
func DeleteWelcome(userId interface{}, id string)
func FindConfig ¶
func FindUnreadMessageNumByVisitorId ¶
获取未读数
func InitConfig ¶
func InitConfig()
func UpdateAbout ¶
func UpdateConfig ¶
func UpdateReplyContent ¶
func UpdateReplyContent(id, userId, title, content string)
func UpdateUser ¶
func UpdateUserAvator ¶
func UpdateUserPass ¶
func UpdateVisitor ¶
func UpdateVisitorKefu ¶
func UpdateVisitorStatus ¶
Types ¶
type About ¶
type About struct {
ID uint `gorm:"primary_key" json:"id"`
TitleCn string `json:"title_cn"`
TitleEn string `json:"title_en"`
KeywordsCn string `json:"keywords_cn"`
KeywordsEn string `json:"keywords_en"`
DescCn string `json:"desc_cn"`
DescEn string `json:"desc_en"`
CssJs string `json:"css_js"`
HtmlCn string `json:"html_cn"`
HtmlEn string `json:"html_en"`
Page string `json:"page"`
}
func FindAboutByPage ¶
func FindAboutByPage(page interface{}) About
func FindAboutByPageLanguage ¶
func FindAbouts ¶
func FindAbouts() []About
type Config ¶
type Config struct {
ID uint `gorm:"primary_key" json:"id"`
ConfName string `json:"conf_name"`
ConfKey string `json:"conf_key"`
ConfValue string `json:"conf_value"`
}
func FindConfigs ¶
func FindConfigs() []Config
type EveryDayNum ¶
查询每天条数
func CountVisitorsEveryDay ¶
func CountVisitorsEveryDay(toId string) []EveryDayNum
type Ipblack ¶
type Ipblack struct {
ID uint `gorm:"primary_key" json:"id"`
IP string `json:"ip"`
KefuId string `json:"kefu_id"`
CreateAt time.Time `json:"create_at"`
}
func FindIpsByKefuId ¶
type Message ¶
type Message struct {
Model
KefuId string `json:"kefu_id"`
VisitorId string `json:"visitor_id"`
Content string `json:"content"`
MesType string `json:"mes_type"`
Status string `json:"status"`
}
func FindLastMessageByVisitorId ¶
查询最后一条消息
func FindMessageByVisitorId ¶
type MessageKefu ¶
type MessageKefu struct {
Model
KefuId string `json:"kefu_id"`
VisitorId string `json:"visitor_id"`
Content string `json:"content"`
MesType string `json:"mes_type"`
Status string `json:"status"`
VisitorName string `json:"visitor_name"`
VisitorAvator string `json:"visitor_avator"`
KefuName string `json:"kefu_name"`
KefuAvator string `json:"kefu_avator"`
CreateTime string `json:"create_time"`
}
func FindMessageByPage ¶
func FindMessageByPage(page uint, pagesize uint, query interface{}, args ...interface{}) []*MessageKefu
分页查询
func FindMessageByWhere ¶
func FindMessageByWhere(query interface{}, args ...interface{}) []MessageKefu
type ReplyGroup ¶
type ReplyGroup struct {
Id string `json:"group_id"`
GroupName string `json:"group_name"`
UserId string `json:"user_id"`
Items []*ReplyItem `json:"items";"`
}
func FindReplyBySearcch ¶
func FindReplyBySearcch(userId interface{}, search string) []*ReplyGroup
func FindReplyByUserId ¶
func FindReplyByUserId(userId interface{}) []*ReplyGroup
func FindReplyTitleByUserId ¶
func FindReplyTitleByUserId(userId interface{}) []*ReplyGroup
type ReplyItem ¶
type ReplyItem struct {
Id string `json:"item_id"`
Content string `json:"item_content"`
GroupId string `json:"group_id"`
ItemName string `json:"item_name"`
UserId string `json:"user_id"`
}
type Role ¶
type User ¶
type User struct {
Model
Name string `json:"name"`
Password string `json:"password"`
Nickname string `json:"nickname"`
Avator string `json:"avator"`
RoleName string `json:"role_name" sql:"-"`
RoleId string `json:"role_id" sql:"-"`
}
func FindUserById ¶
func FindUserById(id interface{}) User
func FindUserRole ¶
func FindUserRole(query interface{}, id interface{}) User
type User_client ¶
type User_client struct {
ID uint `gorm:"primary_key" json:"id"`
Kefu string `json:"kefu"`
Client_id string `json:"client_id"`
Created_at string `json:"created_at"`
}
func FindClients ¶
func FindClients(kefu string) []User_client
type User_role ¶
type User_role struct {
ID uint `gorm:"primary_key" json:"id"`
UserId string `json:"user_id"`
RoleId uint `json:"role_id"`
}
func FindRoleByUserId ¶
func FindRoleByUserId(userId interface{}) User_role
type Visitor ¶
type Visitor struct {
Model
Name string `json:"name"`
Avator string `json:"avator"`
SourceIp string `json:"source_ip"`
ToId string `json:"to_id"`
VisitorId string `json:"visitor_id"`
Status uint `json:"status"`
Refer string `json:"refer"`
City string `json:"city"`
ClientIp string `json:"client_ip"`
Extra string `json:"extra"`
}
func FindVisitorByVistorId ¶
func FindVisitors ¶
func FindVisitorsByKefuId ¶
func FindVisitorsOnline ¶
func FindVisitorsOnline() []Visitor
type Welcome ¶
type Welcome struct {
ID uint `gorm:"primary_key" json:"id"`
UserId string `json:"user_id"`
Keyword string `json:"keyword"`
Content string `json:"content"`
IsDefault uint `json:"is_default"`
Ctime time.Time `json:"ctime"`
}
func FindWelcomeByUserIdKey ¶
func FindWelcomeByUserIdKey(userId interface{}, keyword interface{}) Welcome
func FindWelcomesByKeyword ¶
func FindWelcomesByKeyword(userId interface{}, keyword interface{}) []Welcome
func FindWelcomesByUserId ¶
func FindWelcomesByUserId(userId interface{}) []Welcome
Click to show internal directories.
Click to hide internal directories.