ws

package
v0.0.4-0...-d9ff495 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PageSize    = 20
	KvGeekAdmin = "GeekAdmin"
)
View Source
const (
	FavTypeTopic = 1
	FavTypeDown  = 2
)
View Source
const (
	KeyBindAddr = "BindAddr"

	EnvProd = "prod"
	EnvDev  = "dev"
)

--所有常量

Variables

View Source
var (
	Gpa       *gpa.Gpa
	TokenMap  = make(map[string][]string)
	MultiSite = 0

	ScoreMap = make(map[int64]*ScoreRule)
	WebGin   = gin.New()

	UaSeo = regexp.MustCompile(`baiduspider|twitterbot|facebookexternalhit|rogerbot|linkedinbot|embedly|quora link preview|showyoubot|outbrain|pinterest|slackbot|vkShare|W3C_Validator`)
	UaH5  = regexp.MustCompile(`(MIDP)|(WAP)|(UP.Browser)|(Smartphone)|(Obigo)|(Mobile)|(AU.Browser)|(wxd.Mms)|(WxdB.Browser)|(CLDC)|(UP.Link)|(KM.Browser)|(UCWEB)|(SEMC\-Browser)|(Mini)|(Symbian)|(Palm)|(Nokia)|(Panasonic)|(MOT\-)|(SonyEricsson)|(NEC\-)|(Alcatel)|(Ericsson)|(BENQ)|(BenQ)|(Amoisonic)|(Amoi\-)|(Capitel)|(PHILIPS)|(SAMSUNG)|(Lenovo)|(Mitsu)|(Motorola)|(SHARP)|(WAPPER)|(LG\-)|(LG/)|(EG900)|(CECT)|(Compal)|(kejian)|(Bird)|(BIRD)|(G900/V1.0)|(Arima)|(CTL)|(TDG)|(Daxian)|(DAXIAN)|(DBTEL)|(Eastcom)|(EASTCOM)|(PANTECH)|(Dopod)|(Haier)|(HAIER)|(KONKA)|(KEJIAN)|(LENOVO)|(Soutec)|(SOUTEC)|(SAGEM)|(SEC\-)|(SED\-)|(EMOL\-)|(INNO55)|(ZTE)|(iPhone)|(Android)|(Windows CE)|(Wget)|(Java)|(curl)|(Opera)/`)
)
View Source
var (
	NoteDao     = &DaoNote{}
	CategoryDao = &DaoCategory{}
)
View Source
var (
	ReplyDao = &DaoReply{}
	ThankDao = &DaoReplyThank{}
)
View Source
var (
	TopicDao         = &DaoTopic{}
	TopicCategoryDao = &DaoTopicCategory{}

	FollowDao = &DaoFollow{}
	AppendDao = &DaoTopicAppend{}
)
View Source
var (
	UserDao  = &DaoUser{}
	KvDao    = &DaoKeyVal{}
	ScoreLog = &DaoScoreLog{}
	MsgDao   = &DaoMsg{}
	TokenDao = &DaoToken{}
)
View Source
var (
	/**
	NE  : NOT EXIST
	Err : ERROR
	Dis :disable
	*/
	OK = st(0, "")
	//---0~9 全局系统错误
	StErrorParameter = st(1, "参数错误")
	StErrorToken     = st(2, "用户未登录,Token失效")
	StMax            = st(3, "已达最大记录数")
	StScoreLack      = st(4, "积分不够")
	StExist          = st(5, "已存在")
	StNotExist       = st(6, "不存在")
	StErrorDb        = st(7, "数据逻辑错误")
	StErrorCaptcha   = st(8, "认证码错误")
	StErrorUnknown   = st(9, "未知错误")

	StVerifyFail = st(12, "数据认证失败")

	//1~2 AppId 3~4 状态
	StUsernameExist    = st(1000, "用户名已存在")
	StUsernameNotExist = st(1001, "用户名不存在")
	StEmailExist       = st(1002, "邮箱已存在")
	StEmailNotExist    = st(1003, "邮箱不存在")
	StUserPassError    = st(1004, "密码错误")
	StUserPassErrorMax = st(1005, "密码错误")
	StUserDisable      = st(1006, "用户禁用")
)
View Source
var FavDao = &DaoFav{}
View Source
var (
	RefererDao = &DaoReferer{}
)
View Source
var ResourceDao = &DaoResource{}
View Source
var ResourceDownDao = &DaoResourceDown{}
View Source
var ResourceSummaryDao = &DaoResourceSummary{}
View Source
var (
	ZxDao = &DaoZx{}
)

Functions

func EnvParam

func EnvParam(key string) string

func EnvParamInt

func EnvParamInt(key string, defaultVal int) int

func EnvParamSet

func EnvParamSet(key, val string)

func GetUa

func GetUa(ctx *gin.Context) string

func InitWs

func InitWs()

func KeySave

func KeySave(siteId int64, k, v string) (int64, error)

func ParamInit

func ParamInit(paramArg ...string)

* 示例("dev","prod",` Key1=111 Key2=abc `)

func SiteId

func SiteId(c *gin.Context) int64

func WebAuth

func WebAuth(url string, fun func(wdb *Web))

func WebAuthAdmin

func WebAuthAdmin(url string, fun func(wdb *Web))

func WebPost

func WebPost(url string, fun func(wdb *Web))

Types

type DaoCategory

type DaoCategory struct {
	Add func(SiteId int64, Name string, ParentId, ItemCount, UserId int64) (int64, error) `INSERT INTO NoteCategory(SiteId,Name,ParentId,CreateAt,ModifyAt,ItemCount,UserId)VALUES (?,?,?,now(),now(),?, ?)`

	List        func(SiteId int64, userId int64) ([]map[string]string, error)    `select Id,Name,ParentId from NoteCategory where SiteId=? and UserId=?`
	ModifyName  func(Name string, SiteId int64, Id, UserId int64) (int64, error) `update NoteCategory set Name=? where SiteId=? and Id=? and UserId=?`
	Del         func(SiteId int64, Id, UserId int64) (int64, error)              `Delete from NoteCategory where SiteId=? and  Id=? and UserId=?`
	DelParentId func(SiteId int64, Id, UserId int64) (int64, error)              `Delete from NoteCategory where SiteId=? and  ParentId=? and UserId=?`
}

type DaoFav

type DaoFav struct {
	ListFavTopic func(SiteId int64, UserId, start int64) ([]map[string]string, error) `` /* 400-byte string literal not displayed */

	Count func(SiteId int64, UserId int64) (int64, bool, error) `select count(*) from Fav where SiteId=? and UserId=? `

	Exist func(SiteId int64, UserId int64, Id interface{}) (int64, bool, error) `select count(*) from Fav where SiteId=? and UserId=? and EntityId=?`

	Del func(SiteId int64, UserId int64, Id interface{}) (int64, error) `delete from Fav where SiteId=? and UserId=? and EntityId=?`

	Save func(SiteId int64, UserId, FavType int64, Id interface{}) (int64, error) `INSERT INTO Fav(SiteId,UserId,FavType,EntityId,CreateAt)VALUES(?,?,?,?,now())`
}

type DaoFollow

type DaoFollow struct {
	Exist    func(SiteId int64, Id int64, UserId interface{}) (int64, bool, error) `select count(*) from Follow where SiteId=? and FollowId=? and UserId=?`
	Follow   func(SiteId int64, FollowId, UserId int64) (int64, error)             `INSERT INTO Follow (SiteId,FollowId,UserId,CreateAt)VALUES(?,?,?,now())`
	UnFollow func(SiteId int64, FollowId, UserId int64) (int64, error)             `delete from Follow where SiteId=? and FollowId=? and UserId=?`
	Count    func(SiteId int64, UserId int64) (int64, bool, error)                 `select count(*) from Follow where SiteId=? and UserId=? `

	TopicList func(SiteId int64, UserId, start int64) ([]map[string]string, error) `` /* 393-byte string literal not displayed */

}

type DaoKeyVal

type DaoKeyVal struct {
	Add    func(SiteId int64, k string, v interface{}) (int64, error) `insert into KeyVal(SiteId,KeyName,Val)values(?,?,?)`
	Get    func(SiteId int64, key string) (string, bool, error)       `select Val from KeyVal where SiteId=? and KeyName=?`
	Update func(val, key string, SiteId int64) (int64, error)         `update KeyVal set Val=? where KeyName=? and SiteId=?`

	TopicCount func(SiteId, SiteId2 int64) (int64, error) `update KeyVal set Val=(SELECT sum(TopicCount) from GkUser where SiteId=? ) where SiteId=? and KeyName='TopicCount'`
	ReplyCount func(SiteId, SiteId2 int64) (int64, error) `update KeyVal set Val=(SELECT sum(ReplyCount) from GkUser where SiteId=? ) where SiteId=? and KeyName='ReplyCount'`
	UserCount  func(SiteId, SiteId2 int64) (int64, error) `update KeyVal set Val=(SELECT count(*) from GkUser where SiteId=? ) where SiteId=? and KeyName='UserCount'`

	CountInfo func(SiteId int64) ([][]string, error) `select KeyName,Val from KeyVal where SiteId=? and KeyName in ('UserCount','ReplyCount','TopicCount')`
}

type DaoMsg

type DaoMsg struct {
	Add func(SiteId int64, Title, Body, EntityId, MsgType string, FromUserId, userId, groupId int64) (int64, error) `INSERT INTO Msg(SiteId,Title,Body,EntityId,MsgType,FromUserId,UserId,Status,CreateAt,GroupId)VALUES(?,?,?,?,?,?,?,0,now(),?)`

	FindGroupId func(SiteId int64, UserId, Id int64) (int64, bool, error) `select GroupId from Msg where SiteId=? and userId=? and Id=?`

	Del func(SiteId int64, id, userId int64) (int64, error) `delete from Msg where SiteId=? and Id=? and UserId=?`

	Count       func(SiteId int64, id int64) (int64, bool, error)                   `select count(*) from Msg where SiteId=? and UserId=?`
	CountUnread func(SiteId int64, id int64) (int64, bool, error)                   `select count(*) from Msg where SiteId=? and UserId=? and Status=0`
	CountByType func(SiteId int64, userId int64, mType string) (int64, bool, error) `select count(*) from Msg where SiteId=? and UserId=? and MsgType=?`

	Read      func(SiteId int64, userId, id int64) (int64, error)      `update Msg set Status=1 where SiteId=? and UserId=? and Id=? and Status=0`
	ReadGroup func(SiteId int64, userId, groupId int64) (int64, error) `update Msg set Status=1 where SiteId=? and UserId=? and GroupId=? and Status=0`

	ListUnread func(SiteId int64, userId, start int64) ([]map[string]string, error)                     `` /* 213-byte string literal not displayed */
	ListByType func(SiteId int64, userId int64, mType string, start int64) ([]map[string]string, error) `` /* 214-byte string literal not displayed */

	List func(SiteId int64, userId, start int64) ([]map[string]string, error) `` /* 199-byte string literal not displayed */
}

type DaoNote

type DaoNote struct {
	Detail func(SiteId int64, Id, UserId int64) (map[string]string, bool, error) `select Title,Body from Notes where SiteId=? and Id=? and UserId=?`

	Add func(SiteId int64, NoteCategoryId, Title, Body, SourceType, Source string, UserId int64) (int64, error) `INSERT INTO Notes(SiteId,CategoryId,Title,Body,CreateAt,SourceType,Source,UserId)VALUES(?,?,?,?,now(),?,?,?)`

	List       func(SiteId int64, userId int64) ([]map[string]string, error) `select Id,Title,CategoryId from Notes where SiteId=? and UserId=?`
	UpdateCat  func(catId, CatId, UserId int64, SiteId int64) (int64, error) `update Notes set CategoryId=? where CategoryId=? and UserId=? and SiteId=?`
	UpdatePCat func(catId, CatId, UserId int64, SiteId int64) (int64, error) `update Notes set CategoryId=0 where CategoryId in(select Id from NoteCategory where ParentId=?) and UserId=?  and SiteId=?`
}

type DaoReferer

type DaoReferer struct {
	Add func(SiteId, TopicId int64, Referer string) (int64, error) `INSERT INTO TopicReferer(SiteId,TopicId,Referer,Click,CreateAt,ModifyAt,ClickAll)VALUES(?,?,?,1,now(),now(),1)`

	Check func(SiteId, TopicId int64, Referer string) (int64, bool, error) `select count(*) from TopicReferer where SiteId=? and TopicId=? and Referer=?`

	Up func(SiteId, TopicId int64, Referer string) (int64, error) `update TopicReferer set Click=Click+1 ,ClickAll=ClickAll+1 where SiteId=? and TopicId=? and Referer=?`
}

type DaoReply

type DaoReply struct {
	Get func(SiteId, replyId int64) (map[string]string, bool, error) `` /* 142-byte string literal not displayed */

	CountByUserId func(SiteId int64, id interface{}) (int64, bool, error) `select count(*) from TopicReply where SiteId=? and UserId=?`
	Count         func(SiteId int64, TopicId int64) (int64, bool, error)  `select count(*) from TopicReply where SiteId=? and TopicId=?`

	List func(SiteId int64, topicId interface{}) ([]map[string]string, error) `` /* 129-byte string literal not displayed */

	Insert func(SiteId int64, UserId int64, TopicId, Username, Reply interface{}) (int64, error) `INSERT INTO TopicReply(SiteId,UserId,TopicId,Username,Reply,CreateAt)VALUES(?,?,?,?,?, now())`
}

type DaoReplyThank

type DaoReplyThank struct {
	List func(SiteId, TopicId, UserId int64) ([]int64, error) `select ReplyId from ReplyThank where SiteId=? and TopicId=? and UserId=?`

	Exist func(SiteId, ReplyId int64) (int, bool, error) `select count(*) from ReplyThank where SiteId=? and ReplyId=?`

	Add func(SiteId, UserId, ReplyId int64, TopicId interface{}) (int64, error) `INSERT INTO ReplyThank(SiteId,UserId,ReplyId,TopicId,CreateAt) VALUES (?, ?,?,?,now())`
}

type DaoResource

type DaoResource struct {
	GetBySiteIdAndId func(SiteId, userId, Id int64) (map[string]string, bool, error) `` /* 134-byte string literal not displayed */

	FindBySiteIdAndId func(SiteId, Id int64) (Resource, bool, error)

	ListTitleNew func(SiteId, start int64) ([]map[string]string, error) `select ResName,Id,UserId from Resource where SiteId=? and Status=1 order by Id desc limit ?,20`

	Add func(SiteId, UserId, Size int64, FileName, ResPath, Username string) (int64, error) `INSERT INTO Resource(SiteId,UserId,Size,FileName,CreateAt,Status,ResPath,Username)VALUES(?,?,?,?,now(),0,?,?)`

	Up func(ResName, ResDesc string, ResScore, Id, userId int64) (int64, error) `update Resource set Status=1,ResName=?,ResDesc=?,ResScore=? where Id=? and UserId=?`

	List func(SiteId, UserId int64) ([]map[string]string, error) `select Id,fmt(CreateAt)CreateAt,ResDesc,ResName from Resource where SiteId=? and UserId=? and Status=1`
}

type DaoResourceDown

type DaoResourceDown struct {
	Add func(SiteId, UserId, ResourceId, Score, AuthorScore int64, Username string) (int64, error) `INSERT INTO ResourceDown(SiteId,UserId,ResourceId,Score,AuthorScore,CreateAt,Username)VALUES(?,?,?,?,?,now(),?) `

	FindByUserIdAndResourceId func(userId, ResourceId int64) (ResourceDown, bool, error)

	Exist func(siteId, userId, ResourceId int64) (int, bool, error) `select count(*) from ResourceDown where SiteId=? and UserId=? and ResourceId=?`
}

type DaoResourceSummary

type DaoResourceSummary struct {
	Get func(SiteId, UserId int64) (map[string]string, bool, error) `select * from ResourceSummary where SiteId=? and UserId=?`

	UpUploadItem func(UserId, SiteId, UserId2 int64) (int64, error) `update ResourceSummary set UploadItem=(select count(*) from Resource where UserId=? and Status=1) where SiteId=? and UserId=?`

	Add func(SiteId, UserId, UploadItem, DownItem, UpLimit int64) (int64, error) `INSERT INTO ResourceSummary (SiteId,UserId,UploadItem,DownItem,UpLimit) VALUES (?,?,?,?,?)`
}

type DaoScoreLog

type DaoScoreLog struct {
	Count func(SiteId int64, UserId int64) (int64, bool, error) `select count(*) from ScoreLog where SiteId=? and UserId=?`

	List func(SiteId int64, UserId, start int64) ([]map[string]string, error) `` /* 167-byte string literal not displayed */

	Add func(SiteId, Score int64, ScoreType, ScoreDesc, EntityId string, Fee, UserId int64) (int64, error) `insert into ScoreLog(SiteId ,Score,ScoreType, ScoreDesc, EntityId, CreateAt,Fee,UserId)VALUES(?,?,?,?,?,now(),?, ?)`
}

type DaoToken

type DaoToken struct {
	Del  func(SiteId, userId int64, ua string) (int64, error)        `delete from GkToken where SiteId=? and UserId=? and Ua=?`
	Add  func(SiteId, UserId int64, Ua, Token string) (int64, error) `insert into GkToken(SiteId,UserId,Ua,Token,CreateAt)VALUES(?,?,?,?,now())`
	Find func(SiteId, userId int64, ua string) (string, bool, error) `select Token from GkToken where SiteId=? and UserId=? and Ua=? `
}

type DaoTopic

type DaoTopic struct {
	FindBase func(SiteId, Id int64) (map[string]string, bool, error) `select Title,UserId,Id from Topic where SiteId=? and Id=?`

	UpCategory func(toId, catId, siteId int64) (int64, error) `update Topic set CategoryId=? where CategoryId=? and SiteId=?`

	Find          func(id interface{}) (map[string]string, bool, error)   `select Id,Title,UserId from Topic where Id=?`
	Count         func(SiteId int64) (int64, bool, error)                 `select count(*) from Topic where SiteId=?`
	CountByUserId func(SiteId int64, id interface{}) (int64, bool, error) `select count(*) from Topic where SiteId=? and UserId=?`

	UpdateReply func(ReplyUsername string, ReplyCount, ReplyUserId, Id int64) (int64, error) `update Topic set ReplyUsername=?,ReplyCount=?,ReplyUserId=?,ReplyTime=now() where Id=?`

	Add func(SiteId int64, Title, Body, UserId, CategoryId, Username, SourceType, Source interface{}) (int64, error) `INSERT INTO Topic(SiteId,Title,Body,UserId,CategoryId,CreateAt,Username,SourceType,Source)VALUES(?,?,?,?,?,now(),?,?,?)`

	ModifyShowTimes func(SiteId int64, Id, UserId interface{}) (int64, error) `update Topic set Today=Today+1,ShowTimes=ShowTimes+1 where SiteId=? and Id=? and UserId=?`

	FindById func(SiteId int64, Id, UserId interface{}) (map[string]string, bool, error) `` /* 373-byte string literal not displayed */

	List func(SiteId int64, start int64) ([]map[string]string, error) `` /* 318-byte string literal not displayed */

	Top1000 func(SiteId int64) ([]map[string]string, error) `` /* 148-byte string literal not displayed */

	ListBySub func(SiteId int64, id, start interface{}) ([]map[string]string, error) `` /* 333-byte string literal not displayed */

	ListByParent func(SiteId int64, parentId, start interface{}) ([]map[string]string, error) `` /* 374-byte string literal not displayed */

	ListByUserId func(SiteId int64, userId interface{}, start interface{}) ([]map[string]string, error) `` /* 311-byte string literal not displayed */

	HotToday func(SiteId int64) ([]map[string]string, error) `select Id,UserId,Title,Today from Topic where SiteId=? Order by Today desc limit 0,10`
	HotAll   func(SiteId int64) ([]map[string]string, error) `select Id,UserId,Title,ShowTimes from Topic where SiteId=? Order by ShowTimes desc limit 0,10`
}

type DaoTopicAppend

type DaoTopicAppend struct {
	List func(SiteId, TopicId int64) ([]map[string]string, error) `select Id,fmt(CreateAt)CreateAt,AppendText from TopicAppend where SiteId=? and TopicId=?`

	Count func(SiteId, TopicId int64) (int64, bool, error) `select count(*) from TopicAppend where SiteId=? and TopicId=?`

	Add func(SiteId, TopicId int64, AppendText string) (int64, error) `INSERT INTO  TopicAppend(SiteId,TopicId,AppendText,CreateAt)VALUES(?,?,?,now())`
}

type DaoTopicCategory

type DaoTopicCategory struct {
	List func(SiteId int64) ([]map[string]string, error) `select Id,Name,ParentId,ItemCount from Category where SiteId=?`

	Del func(SiteId, Id int64) (int64, error) `delete from Category where SiteId=? and Id=?`

	Add func(SiteId int64, Name, ParentId interface{}) (int64, error) `INSERT INTO  Category (SiteId,Name,ParentId,CreateAt,ModifyAt,ItemCount) VALUES (?,?, ?, now(), now(),0)`

	UpItemCount func(SiteId int64, id interface{}) (int64, error) `update Category set ItemCount=ItemCount+1 where SiteId=? and Id=?`

	UpName func(name string, Id, SiteId int64) (int64, error) `update Category set Name=? where Id=? and SiteId=? `
}

type DaoUser

type DaoUser struct {
	List func(siteId, s int64) ([]map[string]interface{}, error) `select Id,Username,DauCount,Dau,Score from GkUser where SiteId=? order by DauCount desc limit ?,20`

	Count func(siteId int64) (int64, bool, error) `select count(*) from GkUser where SiteId=? `

	Setting    func(editType, Info interface{}, privacy, UserId int64, SiteId int64) (int64, error) `update GkUser set EditType=?,Info=?,Privacy=? where Id=? and SiteId=?`
	SettingGet func(SiteId int64, UserId int64) (map[string]string, bool, error)                    `select Info,EditType,Privacy from GkUser where SiteId=? and Id=?`

	BaseInfo           func(SiteId int64, UserId interface{}) (map[string]string, bool, error) `` /* 144-byte string literal not displayed */
	BaseInfoByUsername func(SiteId int64, Username string) (map[string]string, bool, error)    `` /* 150-byte string literal not displayed */

	MemberInfo func(SiteId int64, username string) (map[string]string, bool, error) `` /* 135-byte string literal not displayed */

	SetPasswordError func(PasswordError interface{}, username string, SiteId int64) (int64, error) `update GkUser set PasswordError=?,LoginDate=now() where Username=? and SiteId=?  `

	UpPassword func(p string, userId, siteId int64) (int64, error) `update GkUser set Password=? where Id=? and SiteId=?`

	UpTopic  func(tc, UserId int64, SiteId int64) (int64, error)      `update GkUser set TopicCount=?,ModifyAt=now() where Id=? and SiteId=? `
	UpReply  func(rc, UserId int64, SiteId int64) (int64, error)      `update GkUser set ReplyCount=?,ModifyAt=now() where Id=? and SiteId=? `
	UpFav    func(rc, UserId int64, SiteId int64) (int64, error)      `update GkUser set FavCount=?,ModifyAt=now() where Id=? and SiteId=? `
	UpFollow func(rc, UserId int64, SiteId int64) (int64, error)      `update GkUser set FollowCount=?,ModifyAt=now() where Id=? and SiteId=? `
	UpMsg    func(UserId, UserId2 int64, SiteId int64) (int64, error) `update GkUser set MsgCount=(select count(*) from Msg where UserId=? and status=0) where Id=? and SiteId=? `

	LoginAward func(SiteId int64, userId int64) (map[string]string, bool, error) `select LoginAward,LoginDay from GkUser where SiteId=? and  Id=?`
	Score      func(SiteId int64, userId int64) (int64, bool, error)             `select Score from GkUser where SiteId=? and Id=?`

	UpScore func(sc, userId, siteId int64) (int64, error) `update GkUser set Score=? where Id=? and SiteId=?`

	LoginAwardDo func(SiteId int64, userId int64) (int64, error) `update GkUser set LoginAward=0,LoginDay=LoginDay+1 where SiteId=? and Id=? and LoginAward=1`

	Dau func(SiteId int64) ([]map[string]string, error) `select Dau,Id,Username,Info from GkUser where SiteId=? and Dau>0 order by Dau desc limit 0,10`

	DauOrder func(SiteId int64, userId interface{}) (int64, bool, error) `select count(*)+1 DauOrder from GkUser where SiteId=? and  Dau>(select Dau from GkUser where Id=?)`
	DauAdd   func(SiteId int64, userId int64) (int64, error)             `update GkUser set Dau=Dau+1 where SiteId=? and Id=?`

	CheckByEmail    func(SiteId int64, email string) (int64, bool, error)    `select count(*) from GkUser where SiteId=? and Email=?`
	CheckByUsername func(SiteId int64, Username string) (int64, bool, error) `select count(*) from GkUser where SiteId=? and Username=?`

	Add func(SiteId int64, Username, Password, Email, Mobile string) (int64, error) `` /* 142-byte string literal not displayed */
}

type DaoZx

type DaoZx struct {
	Add func(SiteId int64, PageKey, Ua, TestJson string) (int64, error) `INSERT INTO Zx(SiteId,PageKey,Ua,TestJson,CreateAt)VALUES(?,?,?,?,now())`

	UpJson func(TestJson, Ua, PageKey string, SiteId int64) (int64, error) `update Zx set TestJson=? where Ua=? and PageKey=? and SiteId=?`

	Pub func(Ua, PageKey string, SiteId int64) (int64, error) `update Zx set ZxJson=TestJson where Ua=? and PageKey=? and SiteId=?`

	GetTest func(SiteId int64, Ua, PageKey string) (string, bool, error) `select TestJson from Zx where SiteId=? and Ua=? and PageKey=?`
	Get     func(SiteId int64, Ua, PageKey string) (string, bool, error) `select ZxJson from Zx where SiteId=? and Ua=? and PageKey=?`
}

type MsgReq

type MsgReq struct {
	UserId          int64
	FromUserId      int64
	Title           string
	Body            string
	SiteId, GroupId int64
	EntityId        string
	MsgType         string
	FromUsername    string
}

type Resource

type Resource struct {
	SiteId, ResScore, UserId, Size                int64
	FileName, ResName, ResDesc, ResPath, Username string
	CreateAt                                      time.Time
	Status                                        int
}

type ResourceDown

type ResourceDown struct {
	Id                         int64 ``
	UserId, ResourceId, SiteId int64
	Score, AuthorScore         int64
	CreateAt                   time.Time
	Username                   string
}

type ST

type ST struct {
	Code int32
	Msg  string
}

type ScoreRule

type ScoreRule struct {
	Thank, LoginMax, LoginMin, Reply, GetReply, Topic, Register int64
}

func GetSoreRule

func GetSoreRule(siteId int64) *ScoreRule

func SetSoreRule

func SetSoreRule(siteId int64, rule string) *ScoreRule

type UpReq

type UpReq struct {
	UserId int64
	Type   string
	Val    int64
	// 积分变化值
	Fee       int64
	EntityId  string
	ScoreType string
	ScoreDesc string
	//
	SiteId int64
}

type Web

type Web struct {
	Out     map[string]interface{}
	Ua      string
	Context *gin.Context
	SiteId  int64
	//---
	Auth   bool
	UserId int64

	Username string
	// contains filtered or unexported fields
}

func Verify

func Verify(c *gin.Context) *Web

func VerifyAdmin

func VerifyAdmin(c *gin.Context) *Web

func VerifyMultiSiteAdmin

func VerifyMultiSiteAdmin(c *gin.Context) *Web

func (*Web) Int64

func (p *Web) Int64(n string) int64

func (*Web) Int64Default

func (p *Web) Int64Default(n string, def int64) int64

func (*Web) Result

func (p *Web) Result(result ...interface{})

func (*Web) ST

func (p *Web) ST(st *ST, result ...interface{})

func (*Web) ScoreLack

func (p *Web) ScoreLack() bool

func (*Web) Start

func (p *Web) Start() int64

func (*Web) StartPageSize

func (p *Web) StartPageSize(ps int64) int64

func (*Web) String

func (p *Web) String(n string) string

Jump to

Keyboard shortcuts

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