MCPcopy Create free account
hub / github.com/TruthHun/DocHub / GetDescByDid

Method GetDescByDid

models/DocTextModel.go:51–60  ·  view source on GitHub ↗

根据文档表的文档id获取文档摘要,默认获取255个字符长度 @param did document_store的id @param length 需要获取的长度 @return desc 返回摘要内容

(did interface{}, length ...int)

Source from the content-addressed store, hash-verified

49//@param length 需要获取的长度
50//@return desc 返回摘要内容
51func (this *DocText) GetDescByDid(did interface{}, length ...int) (desc string) {
52 var dsid = 0
53 if docinfo, rows, _ := NewDocument().GetDocInfoById(did); rows > 0 {
54 dsid = docinfo[0].DsId
55 }
56 if dsinfo, rows, _ := NewDocument().GetDocStoreByDsId(dsid); rows > 0 {
57 return this.GetDescByMd5(dsinfo[0].Md5, length...)
58 }
59 return
60}

Callers

nothing calls this directly

Calls 4

GetDescByMd5Method · 0.95
NewDocumentFunction · 0.85
GetDocInfoByIdMethod · 0.80
GetDocStoreByDsIdMethod · 0.80

Tested by

no test coverage detected