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 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 AddUser(u *User) (int64, 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 CheckUname(user User) error
- func CloseProjGant(id 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 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 DeleteRole(Id int64) (int64, error)
- func DeleteUserRole(uid, rid 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 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 SaveRole(role Role) (rid int64, err error)
- func SaveUser(user User) (uid 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 UpdateCarCalendar(cid int64, title, content, color string, allday, public bool, ...) error
- func UpdateDatabase() (err1, err2, err3, err4, err5, err6, err7 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) (err error)
- func UpdatePostMerit(id int64, fieldname, value string) error
- func UpdateProduct(cid int64, code, title, label, principal 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 UpdateRole(role Role) (err error)
- func UpdateUser(cid int64, fieldname, value string) error
- func UpdateUserlastlogintime(username string) error
- func ValidateUser(user User) error
- 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 Article
- type Attachment
- type CarCalendar
- type CatalogLink
- type Commentwiki
- type FileNode
- type MeetCalendar
- type MeritBasic
- type OnlyAttachment
- type OnlyChanges
- type OnlyHistory
- type OnlyOffice
- 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 int64, limit, offset 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 SearchProjProduct(pid 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 GetProjectTitle(title string) (cate 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 Role
- 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 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 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 AddWikiMany ¶
一对多模式
func AddWikiReply ¶
func CheckUname ¶
func DelUserById ¶
func DeleteRole ¶
func DeleteUserRole ¶
func DeleteWikiReply ¶
func GetProductsCount ¶
取得侧栏id下成果总数
func Getuserlist ¶
get user list
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 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 ValidateUser ¶
Types ¶
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)
取所有——要修改为支持时间段的,比如某个月份
type AdminCarousel ¶
type AdminCarousel struct { Id int64 `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 Article ¶
type Article struct { Id int64 `form:"-"` Subtext string `orm:"sie(20)"` Content string `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
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 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 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 FileNode ¶
type FileNode struct { Id int64 `json:"id"` Title string `json:"text"` Code string `json:"code"` //分级目录代码 Grade int FileNodes []*FileNode `json:"nodes"` }
树状目录数据
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)
取所有——要修改为支持时间段的,比如某个月份
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 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 int64, limit, offset int64, searchText string) (products []*Product, err error)
根据侧栏id分页查出所有成果——按编号排序
func GetProjProducts ¶
根据项目顶级id查出所有成果 直接把所有成果都查出来。getallproduct
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 GetProjectTitle ¶
根据名字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 ¶
func GetRelevancy ¶
根据成果id取得关联文件 根据成果编号,取得关联文件编号
type Role ¶
type Role struct { Id int64 `PK` 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" ` }
角色表
type User ¶
type User struct { Id int64 `PK` 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 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