Documentation ¶
Overview ¶
提交给merit的成果记录表
Index ¶
- func AddAdminCalendar(title, content, color string, allday, public bool, start, end time.Time) (id int64, err error)
- func AddAdminCarousel(title, url string) (id int64, err error)
- func AddAdminCategory(pid int64, title, code string, grade int) (id int64, err error)
- func AddAdminDepart(pid int64, title, code string) (id int64, err error)
- func AddAdminIpsegment(title, startip, endip string, iprole int) (id int64, err error)
- func AddAdminSynchIp(pid int64, username, synchip, port string) (id int64, err error)
- func AddArticle(subtext, content string, productid int64) (id int64, err error)
- func AddAttachment(filename string, filesize, downloads, productid int64) (id int64, err error)
- func AddCarCalendar(title, content, color, ip string, allday, public bool, start, end time.Time) (id int64, err error)
- func AddCatalogLink(cid int64, link string) (id int64, err error)
- func AddDiary(title, content, diarydate string, projectid, uid int64) (id int64, err error)
- func AddDoc(code, title, label, principal string, end time.Time, uid int64) (id int64, err error)
- func AddMeetCalendar(title, content, color, ip string, allday, public bool, start, end time.Time) (id int64, err error)
- func AddOnlyAttachment(filename string, filesize, downloads, productid int64) (id int64, err1, err2 error)
- func AddOnlyChanges(key, uid, uname, created string) (id int64, err1, err2 error)
- func AddOnlyHistory(onlyattachmentid, uid int64, serverversion string, version int, ...) (id int64, err1, err2 error)
- func AddPostMerit(catalog PostMerit) (cid int64, err error, news string)
- func AddProduct(code, title, label, principal string, uid, Projectid, TopProjectId int64) (id int64, err error)
- func AddProjCalendar(pid int64, title, content, color, imgurl string, ...) (id int64, err error)
- func AddProjGant(id1, parentid int64, status, code, name, depends, description string, ...) (id int64, err error)
- func AddProject(code, title, label, principal string, parentid int64, ...) (id int64, err error)
- func AddRelevancy(prodid int64, relevancy string) (id int64, err error)
- func AddTopicLike(tid int64, openid string) (id int64, err error)
- func AddTopicReply(tid int64, openid, content, avatar, username, created string) (id int64, err error)
- func AddUser(u *User) (int64, error)
- func AddUserAvator(userid int64, avatarurl string) (id int64, err error)
- func AddUserOpenID(userid int64, openid string) (id int64, err error)
- func AddUserRole(uid, rid int64) error
- func AddWikiMany(title, uname, content, attachment string) (id int64, err error)
- func AddWikiOne(title, content, uname string) (id int64, err error)
- func AddWikiReply(tid, nickname, content string) error
- func BbsBbs(UserId int64, Desc string, SelectDate time.Time) (id int64, err error)
- func CheckCheck(ActivityId, UserId int64, Lat, Lng float64, PhotoUrl string, ...) (id int64, err error)
- func CheckCreate(CreaterId int64, Caption, Desc, Location string, Lat, Lng float64, ...) (id int64, err error)
- func CheckUname(user User) error
- func CloseProjGant(id int64) error
- func Connect()
- func DelAdminCarouselById(Id int64) (int64, error)
- func DelUserById(Id int64) (int64, error)
- func DeletAttachment(aid string) error
- func DeletWiki(tid string) error
- func DeleteAdminCalendar(cid int64) error
- func DeleteAdminCategory(cid int64) error
- func DeleteAdminDepart(cid int64) error
- func DeleteAdminIpsegment(cid int64) error
- func DeleteAdminSynchIp(cid int64) error
- func DeleteArticle(id int64) error
- func DeleteAttachment(cid int64) error
- func DeleteCarCalendar(cid int64) error
- func DeleteDiary(id int64) error
- func DeleteDoc(cid int64) error
- func DeleteMeetCalendar(cid int64) error
- func DeleteOnlyAttachment(cid int64) error
- func DeletePostMerit(cid int64) error
- func DeleteProduct(cid int64) error
- func DeleteProjCalendar(cid int64) error
- func DeleteProjGant(id int64) error
- func DeleteProject(id int64) error
- func DeleteRelevancy(prodid int64) error
- func DeleteRole(Id int64) (int64, error)
- func DeleteStandard(id int64) error
- func DeleteTodo(todoid int64) error
- func DeleteTopicLike(openid string) error
- func DeleteTopicReply(id int64) error
- func DeleteUserRole(uid, rid int64) error
- func DeleteValid(id int64) error
- func DeleteWikiReply(rid string) error
- func DropAdminCalendar(cid int64, start, end time.Time) error
- func DropCarCalendar(cid int64, start, end time.Time) error
- func DropMeetCalendar(cid int64, start, end time.Time) error
- func DropProjCalendar(cid int64, start, end time.Time) error
- func GetAttachmentsCount(id int64) (cnt int64, err error)
- func GetProductsCount(id int64, searchText string) (count int64, err error)
- func GetProjectsCount(searchText string) (count int64, err error)
- func Getuserlist(page int64, page_size int64, sort string) (users []orm.Params, count int64)
- func InsertRole() error
- func InsertUser()
- func Insertprojtemplet(pid int64, parentidpath, parenttitlepath string, nodes []*FileNode)
- func ModifyCatalog(cid int64, fieldname, value string) error
- func ModifyCatalogLink(id, cid int64, fieldname, value string) error
- func ModifyDatabase() (err1 error)
- func ModifyWiki(tid, title, content string) error
- func Projhasson(id int64) bool
- func ResizeAdminCalendar(cid int64, end time.Time) error
- func ResizeCarCalendar(cid int64, end time.Time) error
- func ResizeMeetCalendar(cid int64, end time.Time) error
- func ResizeProjCalendar(cid int64, end time.Time) error
- func SaveLibrary(library Library) (lid int64, err error)
- func SaveRole(role Role) (rid int64, err error)
- func SaveStandard(standard Standard) (sid int64, err error)
- func SaveUser(user User) (uid int64, err error)
- func TodoCreate(name string, userid int64) (id int64, err error)
- func UpdateAdminCalendar(cid int64, title, content, color string, allday, public bool, ...) error
- func UpdateAdminCategory(cid int64, title, code string, grade int) error
- func UpdateAdminDepart(cid int64, title, code string) error
- func UpdateAdminIpsegment(cid int64, title, startip, endip string, iprole int) error
- func UpdateAdminSynchIp(cid int64, username, synchip, port string) error
- func UpdateArticle(id int64, subtext, content string) error
- func UpdateAttachment(cid int64, filename string, filesize, downloads int64) (err error)
- func UpdateAttachmentTime(cid int64) (err error)
- func UpdateCarCalendar(cid int64, title, content, color string, allday, public bool, ...) error
- func UpdateDatabase() (err1, err2, err3, err4, err5, err6, err7 error)
- func UpdateDiary(id int64, title, content string) error
- func UpdateDoc(cid int64, code, title, label, principal string, end time.Time) error
- func UpdateDocTime(cid int64) error
- func UpdateMeetCalendar(cid int64, title, content, color string, allday, public bool, ...) error
- func UpdateMeritBasic(cid int64, fieldname, value string) error
- func UpdateOnlyAttachment(cid int64, filename string) (err error)
- func UpdatePostMerit(id int64, fieldname, value string) error
- func UpdateProduct(cid int64, code, title, label, principal string) error
- func UpdateProductTime(cid int64) error
- func UpdateProductTtile(pid int64, title string) error
- func UpdateProjCalendar(cid int64, title, content, color, url string, allday, public, memorabilia bool, ...) error
- func UpdateProjGant(cid int64, code, title, label string) error
- func UpdateProject(cid int64, code, title, label, principal string) error
- func UpdateProjectTtile(pid int64, title string) error
- func UpdateRole(role Role) (err error)
- func UpdateStandard(id int64, number, title, route string) error
- func UpdateTodo(todoid int64) error
- func UpdateUser(cid int64, fieldname, value string) error
- func UpdateUserlastlogintime(username string) error
- func ValidateUser(user User) error
- type Activity
- type AdminCalendar
- type AdminCarousel
- type AdminCategory
- type AdminDepartment
- func GetAdminDepart(pid int64) (departs []*AdminDepartment, err error)
- func GetAdminDepartName(title string) (AdminDepartment, error)
- func GetAdminDepartTitle(title string) (categories []*AdminDepartment, err error)
- func GetAdminDepartbyId(id int64) (category AdminDepartment, err error)
- func GetAdminDepartbyidtitle(id int64, title string) (*AdminDepartment, error)
- type AdminIpsegment
- type AdminSynchIp
- type Apply
- type Article
- type Attachment
- type Bbs
- type CarCalendar
- type CatalogLink
- type Check
- type CheckUser
- type Checkin
- type Commenttopic
- type Commentwiki
- type Diary
- type DiaryUser
- type FileNode
- type Library
- type Like
- type MeetCalendar
- type MeritBasic
- type OnlyAttachment
- type OnlyChanges
- type OnlyHistory
- type OnlyOffice
- type OnlyOfficeAttatch
- type Pidstruct
- type PostMerit
- type Product
- func GetAllProducts() (products []*Product, err error)
- func GetProd(id int64) (prod Product, err error)
- func GetProducts(id int64) (products []*Product, err error)
- func GetProductsPage(id, limit, offset, uid int64, searchText string) (products []*Product, err error)
- func GetProjProducts(id int64, number int) (count int64, products []*Product, err error)
- func SearchProduct(key string) (prod []*Product, err error)
- func SearchProductPage(limit, offset int64, key string) (prod []*Product, err error)
- func SearchProjProduct(pid, limit, offset int64, key, searchtext string) (count int64, prod []*Product, err error)
- func SearchProjProductPage(pid, limit, offset int64, key string) (prod []*Product, err error)
- type ProjCalendar
- func GetAllProjCalendar(pid int64, public bool) (calendars []*ProjCalendar, err error)
- func GetProjCalendar(pid int64, start, end time.Time, public bool) (calendars []*ProjCalendar, err error)
- func GetProjCalendarbyid(id int64) (calendar ProjCalendar, err error)
- func ListPostsByOffsetAndLimit(pid int64, set, postsPerPage int, public bool) ([]*ProjCalendar, error)
- type ProjGant
- type Project
- func GetAllProjects() (proj []*Project, err error)
- func GetProj(id int64) (proj Project, err error)
- func GetProjSonbyId(id int64) (projects []*Project, err error)
- func GetProjbyParentidTitle(parentid int64, title string) (proj Project, err error)
- func GetProjbyParenttitlepath(parenttitlepath, title string) (proj Project, err error)
- func GetProjectCodeTitle(code, title string) (proj Project, err error)
- func GetProjects() (proj []*Project, err error)
- func GetProjectsPage(limit, offset int64, searchText string) (proj []*Project, err error)
- func GetProjectsbyPid(id int64) (projects []*Project, err error)
- func SearchProject(key string) (proj []*Project, err error)
- type Relevancy
- type RelevancyProduct
- type Role
- type Standard
- func GetAllStandards() ([]*Standard, error)
- func GetStandard(id int64) (standard Standard, err error)
- func SearchStandardsName(name string, isDesc bool) ([]*Standard, error)
- func SearchStandardsNamePage(limit, offset int64, name string, isDesc bool) ([]*Standard, error)
- func SearchStandardsNumber(number string, isDesc bool) ([]*Standard, error)
- func SearchStandardsNumberPage(limit, offset int64, number string, isDesc bool) ([]*Standard, error)
- type Todo
- type TodoUser
- type Todolog
- type User
- func GetAllusers(page int64, page_size int64, sort string) (users []*User, count int64)
- func GetUname(user User) ([]*User, error)
- func GetUserByIp(ip string) (user User, err error)
- func GetUserByNickname(nickname string) (user User)
- func GetUserByOpenID(openid string) (user User, err error)
- func GetUserByUserId(userid int64) (user User)
- func GetUserByUsername(username string) (user User, err error)
- func GetUsers() (users []*User, err error)
- func GetUsersbySec(department, secoffice string) (users []*User, count int, err error)
- func GetUsersbySecId(secofficeid string) (users []*User, count int, err error)
- func GetUsersbySecOnly(department string) (users []*User, count int, err error)
- type UserAvatar
- type UserAvatarUrl
- type UserOpenID
- type UserRole
- type Wiki
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddAdminCalendar ¶
func AddAdminCalendar(title, content, color string, allday, public bool, start, end time.Time) (id int64, err error)
********日历******** 添加
func AddAdminCategory ¶
添加
func AddAdminIpsegment ¶
添加ip地址段
func AddAdminSynchIp ¶
****项目同步ip**** 添加AdminSynchIp
func AddArticle ¶
添加文章作为成果的附件
func AddAttachment ¶
添加附件到成果id下 如果附件名称已经存在,则不再追加写入数据库 应该用ReadOrCreate尝试从数据库读取,不存在的话就创建一个
func AddCarCalendar ¶
func AddCarCalendar(title, content, color, ip string, allday, public bool, start, end time.Time) (id int64, err error)
********汽车日历******** 添加
func AddMeetCalendar ¶
func AddMeetCalendar(title, content, color, ip string, allday, public bool, start, end time.Time) (id int64, err error)
*******会议室日历 添加
func AddOnlyAttachment ¶
func AddOnlyAttachment(filename string, filesize, downloads, productid int64) (id int64, err1, err2 error)
添加附件到成果id下 如果附件名称已经存在,则不再追加写入数据库 应该用ReadOrCreate尝试从数据库读取,不存在的话就创建一个
func AddOnlyChanges ¶
添加历史版本
func AddOnlyHistory ¶
func AddOnlyHistory(onlyattachmentid, uid int64, serverversion string, version int, key, fileurl, changesurl string, expires, created time.Time) (id int64, err1, err2 error)
添加历史版本
func AddProduct ¶
func AddProduct(code, title, label, principal string, uid, Projectid, TopProjectId int64) (id int64, err error)
添加成果到项目侧栏某个id下 如果这个侧栏id下的这个成果编号已经存在,则返回id //应该用ReadOrCreate尝试从数据库读取,不存在的话就创建一个
func AddProjCalendar ¶
func AddProjCalendar(pid int64, title, content, color, imgurl string, allday, public, memorabilia bool, start, end time.Time) (id int64, err error)
************项目日历 ********日历******** 添加
func AddProjGant ¶
func AddProjGant(id1, parentid int64, status, code, name, depends, description string, level, duration, progress int, start, end time.Time, startismilestone, endismilestone, haschild bool) (id int64, err error)
添加项目进度
func AddProject ¶
func AddProject(code, title, label, principal string, parentid int64, parentidpath, parenttitlepath string, grade int) (id int64, err error)
添加项目
func AddTopicReply ¶
func AddUserAvator ¶
后台手工操作添加微信小程序openid和用户名
func AddUserOpenID ¶
后台手工操作添加微信小程序openid和用户名
func AddWikiMany ¶
一对多模式
func AddWikiReply ¶
func CheckCheck ¶
func CheckCheck(ActivityId, UserId int64, Lat, Lng float64, PhotoUrl string, SelectDate time.Time) (id int64, err error)
打卡记录写入数据库
func CheckCreate ¶
func CheckUname ¶
func DelAdminCarouselById ¶
func DelUserById ¶
func DeleteRole ¶
func DeleteStandard ¶
func DeleteTopicLike ¶
func DeleteTopicReply ¶
func DeleteUserRole ¶
func DeleteValid ¶
func DeleteWikiReply ¶
func GetProductsCount ¶
取得侧栏id下成果总数
func Getuserlist ¶
get user list
func InsertRole ¶
func InsertRole() error
func Insertprojtemplet ¶
递归将项目模板目录写入数据库
func ModifyCatalogLink ¶
修改links
func UpdateAdminCalendar ¶
func UpdateAdminCalendar(cid int64, title, content, color string, allday, public bool, start, end time.Time) error
修改
func UpdateAdminCategory ¶
修改
func UpdateAdminIpsegment ¶
修改Ip地址段
func UpdateAdminSynchIp ¶
修改
func UpdateAttachment ¶
修改_这个意义不大,对于附件的修改,一般是追加或删除
func UpdateAttachmentTime ¶
修改附件的日期和changesurl修改记录地址
func UpdateCarCalendar ¶
func UpdateCarCalendar(cid int64, title, content, color string, allday, public bool, start, end time.Time) error
修改
func UpdateDatabase ¶
func UpdateDatabase() (err1, err2, err3, err4, err5, err6, err7 error)
func UpdateMeetCalendar ¶
func UpdateMeetCalendar(cid int64, title, content, color string, allday, public bool, start, end time.Time) error
修改
func UpdateMeritBasic ¶
用户修改一个用户的某个字段
func UpdateOnlyAttachment ¶
修改附件的日期和changesurl修改记录地址
func UpdateProduct ¶
修改成果信息
func UpdateProjCalendar ¶
func UpdateProjCalendar(cid int64, title, content, color, url string, allday, public, memorabilia bool, start, end time.Time) error
修改
func UpdateProject ¶
修改——还没改,有问题,不能用
func UpdateRole ¶
func UpdateStandard ¶
func ValidateUser ¶
Types ¶
type Activity ¶
type Activity struct { Id int64 `json:"F_ID"` CreaterId int64 Caption string `json:"F_Caption"` Desc string Location string `json:"F_Location"` Lat float64 Lng float64 StartDate time.Time `json:"F_StartDate",orm:"auto_now_add;type(date)"` EndDate time.Time `json:"F_EndDate",orm:"auto_now_add;type(date)"` IfFace bool IfLocation bool IfPhoto bool }
type AdminCalendar ¶
type AdminCalendar struct { Id int64 `json:"id",form:"-"` Title string `json:"title",form:"title;text;title:",valid:"MinSize(1);MaxSize(100)"` //orm:"unique", Content string `json:"content",orm:"sie(20)"` Starttime time.Time `json:"start",orm:"type(datetime)"` Endtime time.Time `json:"end",orm:"null;type(datetime)"` Allday bool `json:"allDay",orm:"default(0)"` Color string `json:"color",orm:"null"` Public bool `default(true)` }
func GetAdminCalendar ¶
func GetAdminCalendar(start, end time.Time, public bool) (calendars []*AdminCalendar, err error)
取所有——要修改为支持时间段的,比如某个月份
func GetAdminCalendarbyid ¶
func GetAdminCalendarbyid(id int64) (calendar AdminCalendar, err error)
根据id查询事件
func SearchAdminCalendar ¶
func SearchAdminCalendar(title string, public bool) (calendars []*AdminCalendar, err error)
取所有——要修改为支持时间段的,比如某个月份 未测试!!!20181117修改filter为cond2
type AdminCarousel ¶
type AdminCarousel struct { Id int64 `json:"id",form:"-"` Title string `form:"title;text;title:",valid:"MinSize(1);MaxSize(20)"` //orm:"unique", Url string `orm:"null"` Created time.Time `orm:"auto_now_add;type(datetime)"` Updated time.Time `orm:"auto_now_add;type(datetime)"` }
首页轮播图片
func GetAdminCarousel ¶
func GetAdminCarousel() (carousels []*AdminCarousel, err error)
type AdminCategory ¶
type AdminCategory struct { Id int64 `form:"-"` ParentId int64 `orm:"null"` Title string `form:"title;text;title:",valid:"MinSize(1);MaxSize(20)"` //orm:"unique", Code string `orm:"null"` Grade int `orm:"null"` Created time.Time `orm:"auto_now_add;type(datetime)"` Updated time.Time `orm:"auto_now;type(datetime)"` }
func GetAdminCategory ¶
func GetAdminCategory(pid int64) (categories []*AdminCategory, err error)
根据父级id取得所有 如果父级id为空,则取所有一级category
func GetAdminCategoryTitle ¶
func GetAdminCategoryTitle(title string) (categories []*AdminCategory, err error)
根据类别名字title查询所有下级分级category
func GetAdminCategorybyId ¶
func GetAdminCategorybyId(id int64) (category []*AdminCategory, err error)
根据id查分级
type AdminDepartment ¶
type AdminDepartment struct { Id int64 `form:"-"` ParentId int64 `orm:"null"` Title string `form:"title;text;title:",valid:"MinSize(1);MaxSize(20)"` //orm:"unique", Code string `orm:"null"` Created time.Time `orm:"auto_now_add;type(datetime)"` Updated time.Time `orm:"auto_now_add;type(datetime)"` }
科室结构
func GetAdminDepart ¶
func GetAdminDepart(pid int64) (departs []*AdminDepartment, err error)
根据部门id取得所有科室 如果父级id为0,则取所有部门
func GetAdminDepartName ¶
func GetAdminDepartName(title string) (AdminDepartment, error)
根据父级id取得所有 如果父级id为空,则取所有一级category
func GetAdminCategory(pid int64) (categories []*AdminDepartment, err error) { o := orm.NewOrm() categories = make([]*AdminDepartment, 0) qs := o.QueryTable("AdminDepartment") _, err = qs.Filter("parentid", pid).All(&categories) if err != nil { return nil, err } return categories, err }
根据部门名字title返回自身
func GetAdminDepartTitle ¶
func GetAdminDepartTitle(title string) (categories []*AdminDepartment, err error)
根据部门名字title查询所有下级科室category
func GetAdminDepartbyId ¶
func GetAdminDepartbyId(id int64) (category AdminDepartment, err error)
根据id查科室
func GetAdminDepartbyidtitle ¶
func GetAdminDepartbyidtitle(id int64, title string) (*AdminDepartment, error)
由分院id和科室 名称取得科室
type AdminIpsegment ¶
type AdminIpsegment struct { Id int64 `form:"-"` Title string `form:"title;text;title:",valid:"MinSize(1);MaxSize(20)"` //orm:"unique", StartIp string //`orm:"not null"` EndIp string `orm:"null"` Iprole int `orm:"null"` Created time.Time `orm:"auto_now_add;type(datetime)"` Updated time.Time `orm:"auto_now;type(datetime)"` }
func GetAdminIpsegment ¶
func GetAdminIpsegment() (ipsegments []*AdminIpsegment, err error)
查询所有Ip地址段
type AdminSynchIp ¶
type AdminSynchIp struct { Id int64 `form:"-"` ParentId int64 `orm:"null"` UserName string `form:"title;text;title:",valid:"MinSize(1);MaxSize(20)"` //orm:"unique", SynchIp string //`orm:"not null"` Port string `orm:"default(80)"` Created time.Time `orm:"auto_now_add;type(datetime)"` Updated time.Time `orm:"auto_now;type(datetime)"` }
项目同步ip表
func GetAdminSynchIp ¶
func GetAdminSynchIp(pid int64) (synchips []*AdminSynchIp, err error)
根据父级id取得所有AdminSynchIp
type Apply ¶
type Apply struct { Id int64 ApplyerId int64 ActivityId int64 ApplyDate time.Time `orm:"auto_now_add;type(date)"` }
报名活动
type Article ¶
type Article struct { Id int64 `json:"id",form:"-"` Subtext string `orm:"sie(20)"` Content string `json:"html",orm:"sie(5000)"` ProductId int64 `orm:"null"` Views int64 `orm:"default(0)"` Created time.Time `orm:"auto_now_add;type(datetime)"` Updated time.Time `orm:"auto_now_add;type(datetime)"` }
func GetArticles ¶
取得所有项目
func GetArticles() (Artic []*Article, err error) { o := orm.NewOrm() qs := o.QueryTable("Article") //这个表名AchievementTopic需要用驼峰式, _, err = qs.Filter("parentid", 0).All(&Artic) if err != nil { return Artic, err } return Artic, err }
根据成果id取得所有文章——只返回id和prodid,因为返回content太慢了,没必要吧20171007
func GetWxArticles ¶
微信小程序,根据成果id取得所有文章——返回id和prodid,content……
type Attachment ¶
type Attachment struct { Id int64 FileName string FileSize int64 Downloads int64 ProductId int64 //*Topic `orm:"rel(fk)"` Created time.Time `orm:"auto_now_add;type(datetime)"` Updated time.Time `orm:"auto_now;type(datetime)"` }
附件,attachment 和 topic 是 ManyToOne 关系,也就是 ForeignKey 为 topic
func GetAttachmentTitle ¶
func GetAttachmentTitle(title string) (cate Attachment, err error)
根据名字title查询到附件
func GetAttachments ¶
func GetAttachments(id int64) (attachments []*Attachment, err error)
根据成果id取得所有附件
type Bbs ¶
type Bbs struct { Id int64 UserId int64 BbsDate time.Time `orm:"auto_now_add;type(date)"` Desc string SelectDate time.Time `orm:"auto_now_add;type(date)"` }
公告记录
type CarCalendar ¶
type CarCalendar struct { Id int64 `json:"id",form:"-"` Title string `json:"title",form:"title;text;title:",valid:"MinSize(1);MaxSize(100)"` //orm:"unique", Content string `json:"content",orm:"sie(20)"` Starttime time.Time `json:"start",orm:"type(datetime)"` Endtime time.Time `json:"end",orm:"type(datetime)"` Allday bool `json:"allDay",orm:"default(0)"` Color string `json:"color",orm:"null"` Public bool `default(true)` Ip string `json:"ip",orm:"null"` }
func GetCarCalendar ¶
func GetCarCalendar(start, end time.Time, public bool) (calendars []*CarCalendar, err error)
取所有——要修改为支持时间段的,比如某个月份
func GetCarCalendarbyid ¶
func GetCarCalendarbyid(id int64) (calendar CarCalendar, err error)
根据id查询事件
type CatalogLink ¶
type CatalogLink struct { Id int64 CatalogId int64 Url string `orm:"sie(500)"` Created time.Time `orm:"auto_now_add;type(datetime)"` Updated time.Time `orm:"auto_now_add;type(datetime)"` }
附件链接表
func GetCatalogLinks ¶
func GetCatalogLinks(cid int64) (links []*CatalogLink, err error)
根据成果id查出附件链接表
type Check ¶
type Check struct { Id int64 ActivityId int64 UserId int64 CheckDate time.Time `orm:"auto_now_add;type(date)"` PhotoUrl string Lat float64 Lng float64 SelectDate time.Time `orm:"auto_now_add;type(date)"` }
打卡记录
type CheckUser ¶
GetPkgInfosByIDs returns a list of package info by given IDs.
func GetPkgInfosByIDs(ids []int64) ([]*PkgInfo, error) { if len(ids) == 0 { return []*PkgInfo{}, nil } pkgInfos := make([]*PkgInfo, 0, len(ids)) return pkgInfos, x.Where("id > 0").In("id", base.Int64sToStrings(ids)).Find(&pkgInfos) }
type Checkin ¶
type Checkin struct { Id int64 ActivityId int64 UserId int64 CheckDate time.Time `orm:"auto_now_add;type(date)"` PhotoUrl string Lat float64 Lng float64 SelectDate time.Time `orm:"auto_now_add;type(date)"` }
打卡记录
type Commenttopic ¶
type Commenttopic struct { Id int64 Tid int64 OpenID string `orm:"size(30)"` Content string `orm:"size(100)"` Avatar string Username string `orm:"size(20)"` Created string `orm:"size(20)"` }
文章评论
func GetAllTopicReplies ¶
func GetAllTopicReplies(tid int64) (replies []*Commenttopic, err error)
type Commentwiki ¶
type Commentwiki struct { Id int64 Tid int64 Name string Content string `orm:"size(1000)"` Created time.Time }
wiki评论
func GetAllWikiReplies ¶
func GetAllWikiReplies(tid int64) (replies []*Commentwiki, err error)
type Diary ¶
type Diary struct { Id int64 `json:"id",form:"-"` Title string `orm:"sie(20)"` Diarydate string `orm:"sie(20)"` Content string `json:"html",orm:"sie(5000)"` ProjectId int64 `orm:"null"` UserId int64 `orm:"null"` Views int64 `orm:"default(0)"` Created time.Time `orm:"auto_now_add;type(datetime)"` Updated time.Time `orm:"auto_now_add;type(datetime)"` }
func GetWxDiaries ¶
微信小程序,根据projectid取得所有设代日志
type FileNode ¶
type FileNode struct { Id int64 `json:"id"` Title string `json:"text"` Code string `json:"code"` //分级目录代码 Grade int FileNodes []*FileNode `json:"nodes"` }
树状目录数据
type Library ¶
type Library struct { Id int64 Number string //规范的编号`orm:"unique"` Title string LiNumber string //完整编号,含年份 Category string //行业分类 Year string //编号里的年份 Execute string //执行时间 Content string `orm:"sie(5000)"` Created time.Time `orm:"auto_now_add;type(datetime)"` Updated time.Time `orm:"auto_now;type(datetime)"` }
func GetAllValids ¶
func SearchLiabraryNumber ¶
由分类SL和编号搜索有效版本库
type Like ¶
type Topic struct { Id int64 Uid int64 Title string Tnumber string //`orm:"unique"` Category string CategoryId int64 Content string `orm:"sie(5000)"` Attachment string Created time.Time `orm:"auto_now_add;type(datetime)"` Updated time.Time `orm:"auto_now;type(datetime)"` Views int64 Author string ReplyTime time.Time ReplyCount int64 ReplyLastUserName string // Attachments []*Attachment `orm:"reverse(many)"` // fk 的反向关系 }
文章点赞
func GetAllTopicLikes ¶
type MeetCalendar ¶
type MeetCalendar struct { Id int64 `json:"id",form:"-"` Title string `json:"title",form:"title;text;title:",valid:"MinSize(1);MaxSize(100)"` //orm:"unique", Content string `json:"content",orm:"sie(20)"` Starttime time.Time `json:"start",orm:"type(datetime)"` Endtime time.Time `json:"end",orm:"type(datetime)"` Allday bool `json:"allDay",orm:"default(0)"` Color string `json:"color",orm:"null"` Public bool `default(true)` Ip string `json:"ip",orm:"null"` }
func GetMeetCalendar ¶
func GetMeetCalendar(start, end time.Time, public bool) (calendars []*MeetCalendar, err error)
取所有——要修改为支持时间段的,比如某个月份
func GetMeetCalendarbyid ¶
func GetMeetCalendarbyid(id int64) (calendar MeetCalendar, err error)
根据id查询事件
func SearchMeetCalendar ¶
func SearchMeetCalendar(title string, public bool) (calendars []*MeetCalendar, err error)
取所有——要修改为支持时间段的,比如某个月份 未测试20181117修改filter为cond3
type MeritBasic ¶
type MeritBasic struct { Id int64 `PK` Username string `orm:"unique"` //这个拼音的简写 Nickname string //中文名,注意这里,很多都要查询中文名才行`orm:"unique;size(32)" form:"Nickname" valid:"Required;MaxSize(20);MinSize(2)"` Password string Repassword string `orm:"-" form:"Repassword" valid:"Required" form:"-"` Ip string //ip地址 Port string EcmsIp string //用户engineercms的ip地址 EcmsPort string //用户engineercms的端口 Createtime time.Time `orm:"type(datetime);auto_now_add" ` Updated time.Time `orm:"type(datetime);auto_now_add" ` }
用户表
func GetMeritBasic ¶
func GetMeritBasic() (meritbasic MeritBasic, err error)
查出merit基本信息 取到一个数据,不是数组,所以table无法显示
type OnlyAttachment ¶
type OnlyAttachment struct { Id int64 FileName string FileSize int64 Downloads int64 DocId int64 //*Topic `orm:"rel(fk)"` // Changesurl string `orm:"null"` //文件修改记录 Created time.Time `orm:"auto_now_add;type(datetime)"` Updated time.Time `orm:"auto_now;type(datetime)"` }
附件
func GetOnlyAttachbyId ¶
func GetOnlyAttachbyId(Id int64) (attach OnlyAttachment, err error)
根据附件id查询附件
func GetOnlyAttachments ¶
func GetOnlyAttachments(id int64) (attachments []*OnlyAttachment, err error)
根据成果id取得所有附件
type OnlyChanges ¶
type OnlyChanges struct { Id int64 HistoryKey string `orm:"sie(19)"` UserId string `orm:"sie(10)"` UserName string `orm:"sie(20)"` Created string `orm:"sie(19)"` }
修改情况
func GetOnlyChanges ¶
func GetOnlyChanges(key string) (onlychanges []*OnlyChanges, err error)
根据附件历史版本key获取历史版本修改信息
type OnlyHistory ¶
type OnlyHistory struct { Id int64 AttachId int64 UserId int64 ServerVersion string Version int FileUrl string ChangesUrl string //`orm:"null"` HistoryKey string `orm:"sie(19)"` Expires time.Time `orm:"type(datetime)"` Created time.Time `orm:"type(datetime)"` }
历史版本
func GetOnlyHistory ¶
func GetOnlyHistory(onlyattachmentid int64) (onlyhistories []*OnlyHistory, err error)
根据附件id获取历史版本信息
func GetOnlyHistoryVersion ¶
func GetOnlyHistoryVersion(onlyattachmentid int64) (onlyhistories []OnlyHistory, err error)
获取附件id历史版本号
type OnlyOffice ¶
type OnlyOffice struct { Id int64 `form:"-"` Code string `orm:"null"` Title string `orm:"null"` Label string `orm:"null"` End time.Time `orm:"null;type(datetime)"` Principal string `orm:"null"` // Ext string `orm:"null"` Uid int64 `orm:"null"` Created time.Time `orm:"auto_now_add;type(datetime)"` Updated time.Time `orm:"auto_now;type(datetime)"` }
type OnlyOfficeAttatch ¶
type OnlyOfficeAttatch struct { OnlyOffice `xorm:"extends"` OnlyAttachment `xorm:"extends"` User `xorm:"extends"` }
func GetDocList ¶
func GetDocList(offset, limit int) (docs []*OnlyOfficeAttatch, err error)
分页取得所有项目
type Pidstruct ¶
type Pidstruct struct { ParentId int64 ParentTitle string ParentIdPath string ParentTitlePath string }
func Insertproj ¶
func Insertproj(pid []Pidstruct, nodes []*AdminCategory, igrade, height int) (cid []Pidstruct)
递归将分级目录写入数据库
type PostMerit ¶
type PostMerit struct { Id int64 `json:"id"` ProjectNumber string //项目编号 ProjectName string //项目名称 DesignStage string //阶段 Section string //专业 Tnumber string //成果编号 Name string //成果名称 Category string //成果类型 Page string //成果计量单位 Count float64 //成果数量 Drawn string //编制、绘制 Designd string //设计 Checked string //校核 Examined string //审查 Verified string //核定 Approved string //批准 Complex float64 //难度系数 Drawnratio float64 //编制、绘制占比系数 Designdratio float64 //设计系数 Checkedratio float64 //校核系数 Examinedratio float64 //审查系数 Datestring string //保存字符型日期 Date time.Time `orm:"null;auto_now_add;type(datetime)"` Created time.Time `orm:"auto_now_add;type(datetime)"` Updated time.Time `orm:"auto_now_add;type(datetime)"` Author string //上传者 State int //1编写状态,未提交;2编写者提交, }
type Product ¶
type Product struct { Id int64 Code string `orm:"null"` //编号 //编号 //编号 Title string `form:"title;text;title:",valid:"MinSize(1);MaxSize(20)"` //orm:"unique", Label string `orm:"null"` //关键字 //标签 Uid int64 `orm:"null"` Principal string `orm:"null"` //提供人 //负责人id ProjectId int64 `orm:"null"` //侧栏id TopProjectId int64 `orm:"default(0)"` //项目id // Content string `orm:"sie(5000)"` //内容 Created time.Time `orm:"auto_now_add;type(datetime)"` Updated time.Time `orm:"auto_now;type(datetime)"` }
func GetProductsPage ¶
func GetProductsPage(id, limit, offset, uid int64, searchText string) (products []*Product, err error)
根据侧栏id分页查出所有成果——按编号排序
func GetProjProducts ¶
根据项目顶级id查出所有成果 这个不优雅,应该用循环子孙id,查询字段在id数组中,参考SearchProjProductPage 直接把所有成果都查出来。getallproduct
func SearchProductPage ¶
搜索本地成果,分页
type ProjCalendar ¶
type ProjCalendar struct { Id int64 `json:"id",form:"-"` ProjectId int64 `json:"projectid"` Title string `json:"title",form:"title;text;title:",valid:"MinSize(1);MaxSize(100)"` //orm:"unique", Content string `json:"content",orm:"sie(20)"` Starttime time.Time `json:"start",orm:"type(datetime)"` Endtime time.Time `json:"end",orm:"null;type(datetime)"` Allday bool `json:"allDay",orm:"default(true)"` Memorabilia bool `json:"memorabilia",orm:"default(false)"` //是否属于大事记 Image string `json:"image",orm:"null"` //图片链接地址 Color string `json:"color",orm:"null"` Public bool `default(true)` //是否公开 }
func GetAllProjCalendar ¶
func GetAllProjCalendar(pid int64, public bool) (calendars []*ProjCalendar, err error)
取出所有日历日程
func GetProjCalendar ¶
func GetProjCalendar(pid int64, start, end time.Time, public bool) (calendars []*ProjCalendar, err error)
取所有——要修改为支持时间段的,比如某个月份
func GetProjCalendarbyid ¶
func GetProjCalendarbyid(id int64) (calendar ProjCalendar, err error)
根据id查询事件
func ListPostsByOffsetAndLimit ¶
func ListPostsByOffsetAndLimit(pid int64, set, postsPerPage int, public bool) ([]*ProjCalendar, error)
取出分页的日历
type ProjGant ¶
type ProjGant struct { Id int64 `form:"-"` ParentId int64 `orm:"null"` Status string `orm:"null"` //STATUS_ACTIVE, STATUS_DONE, STATUS_FAILED, STATUS_SUSPENDED, STATUS_UNDEFINED Level int `orm:"null"` Code string `orm:"null"` //编号 Name string `orm:"null"` //项目名称 StartIsMilestone bool Start time.Time `orm:"type(datetime)"` EndIsMilestone bool End time.Time `orm:"null;type(datetime)"` Duration int `orm:"null"` Progress int `orm:"null"` Depends string `orm:"null"` HasChild bool `orm:"null"` Description string `orm:"null"` Show bool Created time.Time `orm:"null","auto_now_add;type(datetime)"` Updated time.Time `orm:"null","auto_now_add;type(datetime)"` }
func GetProjGantName ¶
根据编号code和名字name查询到项目进度
func GetProjGantParent ¶
根据名字name和parentid查询到项目进度
type Project ¶
type Project struct { Id int64 `form:"-"` Code string `orm:"null"` //编号 Title string `form:"title;text;title:",valid:"MinSize(1);MaxSize(20)"` //orm:"unique", Label string `orm:"null"` //标签 Principal string `orm:"null"` //负责人id ParentId int64 `orm:"null"` ParentIdPath string `orm:"null"` ParentTitlePath string `orm:"null"` Grade int `orm:"null"` Created time.Time `orm:"null","auto_now_add;type(datetime)"` Updated time.Time `orm:"null","auto_now_add;type(datetime)"` }
func GetProjbyParentidTitle ¶
根据parentid和title取得proj目录
func GetProjbyParenttitlepath ¶
根据parenttitlepath和title取得proj目录
func GetProjectCodeTitle ¶
根据名字title查询到项目目录
func GetProjectsPage ¶
分页取得项目列表
func GetProjectsbyPid ¶
根据id查出所有子孙,用ParentIdPath 逻辑错误:110-210-310包含了10???? 20180107完美解决这个问题。同ProdModel.go中GetProjProducts一致 通过Id为projid,查出本级 parentid是projid,查出二级 parentidpath包含projid-,查出三级,以及往下 还是不严谨,projid-前面还有数据呢?必须前后都有限定符号才行 差点按照无闻的视频,将parentidpath存成$id1#$id2#$id3# 存:parentidpath="$"+id1+"#" 查:__contains,"$"+id1+"#" 取:stings.replace(stings.replace(parentidpath,"#",","-1),"$",""-1) 输出:strings.split(上面的,",")
type Relevancy ¶
type Relevancy struct { Id int64 `form:"-"` ProductId int64 `orm:"null"` //编号 Relevancy string `orm:"null"` //标签 Created time.Time `orm:"null","auto_now_add;type(datetime)"` Updated time.Time `orm:"null","auto_now_add;type(datetime)"` }
func GetAllRelevancies ¶
type RelevancyProduct ¶
func GetRelevancy ¶
func GetRelevancy(prodid int64) ([]*RelevancyProduct, error)
根据成果id取得关联文件名称product code 根据关联文件名称product code,取得prod和proj
func GetRelevancybyName ¶
func GetRelevancybyName(relevancy string) ([]*RelevancyProduct, error)
根据关联名称取得关联的成果id及成果code
type Role ¶
type Role struct { Id int64 Rolename string `json:"name",orm:"unique"` //这个拼音的简写 Rolenumber string Status string `json:"role",orm:"default('0');size(2)"` //,form:"Status",valid:"Range('0','1','2','3','4')"` Createtime time.Time `orm:"type(datetime);auto_now_add" ` Updated time.Time `orm:"type(datetime);auto_now_add" ` }
角色表
func GetRoleByUsername ¶
func GetRolenameByUserId ¶
由用户id取得所拥有的角色rolename
type Standard ¶
type Standard struct { Id int64 Number string //`orm:"unique"` Title string Uid int64 Category string Content string `orm:"sie(5000)"` Route string // AttachmentId int64 // Attachments []*Attachment `orm:"reverse(many)"` // fk 的反向关系 Created time.Time `orm:"auto_now_add;type(datetime)"` Updated time.Time `orm:"auto_now;type(datetime)"` Views int64 }
func GetAllStandards ¶
func SearchStandardsName ¶
由名字模糊搜索
func SearchStandardsNamePage ¶
由名字模糊搜索
func SearchStandardsNumber ¶
由编号模糊搜索
type Todo ¶
type Todo struct { Id int64 `json:"todoid"` Name string `json:"todoname"` UserId int64 Completed bool `json:"completed"` Created time.Time `orm:"auto_now_add;type(date)"` Updated time.Time `orm:"auto_now_add;type(date)"` }
待办事件
type TodoUser ¶
func GetTodoUser ¶
type Todolog ¶
type Todolog struct { Id int64 TodoId int64 UserId int64 Action string //'Finish' : 'Restart' Created time.Time `orm:"auto_now_add;type(date)"` }
操作记录
type User ¶
type User struct { Id int64 Username string `json:"name",orm:"unique"` //这个拼音的简写 Nickname string //中文名,注意这里,很多都要查询中文名才行`orm:"unique;size(32)" form:"Nickname" valid:"Required;MaxSize(20);MinSize(2)"` Password string Repassword string `orm:"-" form:"Repassword" valid:"Required" form:"-"` Email string `orm:"size(32)" form:"Email" valid:"Email"` Department string //分院 Secoffice string //科室,这里应该用科室id,才能保证即时重名也不怕。否则,查看科室必须要上溯到分院才能避免科室名称重复问题 Remark string `orm:"null;size(200)" form:"Remark" valid:"MaxSize(200)"` Ip string //ip地址 Port string Status int `orm:"default(2)" form:"Status" valid:"Range(1,2)"` Lastlogintime time.Time `orm:"type(datetime);auto_now_add" form:"-"` Createtime time.Time `orm:"type(datetime);auto_now_add" ` Updated time.Time `orm:"type(datetime);auto_now_add" ` Role string `json:"role"` }
用户表
func GetAllusers ¶
func GetUserByUsername ¶
###*****这里特别注意,这个是用户名,是汉语拼音,不是Nickname!!!!
func GetUsersbySec ¶
根据分院和科室名称查所有用户,只有状态1的
func GetUsersbySecId ¶
根据科室id查所有用户
func GetUsersbySecOnly ¶
根据分院名称查所有用户——适用于没有科室的部门 查出所有人员,只有分院(部门)而没科室字段的人员,只有状态1的
func (*User) Valid ¶
func (u *User) Valid(v *validation.Validation)
type UserAvatar ¶
type UserAvatar struct { Id int64 Uid int64 AvatarUrl string Createtime time.Time `orm:"type(datetime);auto_now_add" ` }
用户和AvatorUrl对应表,一个用户对应多个AvatorUrl
type UserAvatarUrl ¶
type UserAvatarUrl struct { User `xorm:"extends"` UserAvatar `xorm:"extends"` }
func GetUserAvatorUrl ¶
func GetUserAvatorUrl(uid int64) ([]*UserAvatarUrl, error)
type UserOpenID ¶
用户和openid对应表,一个用户对应多个openid
type UserRole ¶
func GetRoleByUserId ¶
由用户id取得所拥有的角色id
type Wiki ¶
type Wiki struct { Id int64 Uid int64 Title string Content string `orm:"sie(5000)"` Attachment string Created time.Time `orm:"auto_now_add;type(datetime)"` Updated time.Time `orm:"auto_now;type(datetime)"` Views int64 Author string ReplyTime time.Time ReplyCount int64 ReplyLastUserName string }
func GetAllWikis ¶
缺少排序,由项目名称获取项目下所有成果,如果没有项目名称,则获取所有成果
func ListWikisByOffsetAndLimit ¶
取出分页的wiki
Source Files ¶
- AdminModel.go
- ArticModel.go
- AttachModel.go
- BbsModel.go
- CarMeetModel.go
- CheckinModel.go
- DiaryModel.go
- GantModel.go
- OnlyofficeModel.go
- PostMeritModel.go
- ProdModel.go
- ProjModel.go
- RelevancyModel.go
- ReplyModel.go
- RoleModel.go
- SearchModel.go
- StandardModel.go
- TodoModel.go
- UpdateDatabaseModel.go
- UserModel.go
- WikiMode.go